欢迎Hermes爱好者s署名转载本文,转载请遵循署名-非商业性使用-相同方式共享 2.5协议,注明出自http://www.thinkagain.cn。
You can copy, distribute this article, but dont forget to point a link to my site:http://www.thinkagain.cn.
English user please scrolls down for english explanation.
=====================================================
系列6. 定制常见错误及解决方法
本文将介绍在BuildOS过程常出现的一些错误提示及其解决方法。在制作OS过程中主要出现的错误有2种,一个是重复文件错误和rgu文件错误。
重复文件的解决方法最简单,直接将重复文件删除就是了。但建议你最好做个记录,那些文件是因为重复而被删除了。重复文件错误可以细分为2种:
1.1 OEM Package有重复文件
我们先谈谈第一种。如在系列4制作OEM Package Part2中,我曾介绍过制作GSFinder的OEM Package和只制作GSFinder快捷方式的OEM Package,如果在定制过程中,误将2个OEM Package都选中,如图1,
Fig.1 同时选中2个GSFinder OEM Package
点击绿色三角形开始制作OS后,就会出现图2的错误提示:”\temp\dump\GSFinder.lnk已存在”
Fig.2 错误提示:”GSFinder.lnk”已存在
同时BuildOS.exe的状态栏会显示是哪个过程出错,如图3,处理OEM\Link_GSFinder时候出错。
Fig.3 BuildOS的状态栏错误提示
打开浏览器,在My_ROM_Kitchen下搜索GSFinder.lnk,如图4。
Fig.4 在My_ROM_Kitchen目录下搜索GSFinder.lnk
图5是GSFinder.lnk的搜索结果,可以看到在GSFinder和Link_GSFinder下均有同名GSFinder.lnk文件。所以,2者不能同时被制作进ROM,2者删其一即可。
Fig.5 GSFinder.lnk的搜索结果
2. OEM Package的文件和系统自带文件重复
一些OEM Package可能有些文件和系统自带的程序重复。如HTC X-Button 1.5,一个HTC出的任务管理软件,里面就有很多文件和OEMAPPS下的文件重复。可以在文末下载它的OEM Package。将它复制到\My_ROM_Kitchen\OEM目录下。运行BuildOS,如图6。
Fig.6 选中HTC X-Button 1.5
BuildOS在处理OEMAPPS的时候,将会提示exitbutton.bmp文件重复错误。如图7。
Fig.7 错误提示:”exitbutton.bmp已存在”
用浏览器搜索exitbutton.bmp,发现在HTC X-Button 1.5和OEMAPPS目录下均有此文件。
Fig.8 exitbutton.bmp的搜索结果
不单单是exitbutton.bmp,X-Button1.5还有很多文件和系统自带的重复,可以见图9,左边是OEMAPPS下的系统自带文件,右边是X-Button的文件。红色方框内的文件都是重复文件。
Fig.9 X-Button1.5的重复文件
2. rgu文件错误
rgu文件错误通常比较麻烦,在出现错误提示后,必须到temp\log.txt,来查看是那个rgu文件出问题。rgu文件错误有如下几种。
运行BuildOS,在最后建立注册表示,会出现”Error building default.hv and user.hv!”(在创建default.hv和user.hv时出现错误)。如图10。
进入My_ROM_Kitchen\temp目录,打开log.txt,最后3行是错误提示,最后第3行提示在*.rgu(guid.rgu)的第1行出现错误。文件的第1行出现错误通常是未将rgu文件保存为unicode格式。解决方法就是用记事本将该文件打开,然后重新保存为unicode格式文件。
Fig.11 Log.txt内错误提示
如果rgu文件未以REGEDIT4作为第1行,那么也会出现错误,log文件中也会提示第1行出现错误。解决方法就是添加REGEDIT4到rgu开头,并将之单独作为1行。
2.3 rgu文件未以空行作为最后一行
rgu文件的最后一行如果不是空行的话,也会建立hv的时候,提示出现错误。打开log文件,如果提示出现错误的行号是最后一行的话,那么肯定是该文件未能以空行结束。解决方法,也就是增加一个空行就可以了。
2.4 rgu文件中目录提示符是单斜杠不是双斜杠
我们曾在系列4编辑rgu文件时提过,注册表项中的单斜杠必须全部用双斜杠来表示。如图12显示,第12行语句是@=”\Windows\regedit.exe,-143″,正确的应该是:”@=\\Windows\\regedit.exe,-143″。
Fig.13 rgu内第12行代码
Fig.14 log文件错误提示
为了简化rgu文件的测试,我编写了一个bat文件(test_hv_rgu.zip,在文末下载)来检查rgu是否存在错误。解压下载的test_hv_rgu.zip里面包括2个批处理文件,2个dll文件和一个rgucomp.exe。双击make_hv.bat来检查rgu文件是否能正确被转换成hv文件。运行界面如图15,请把拟测试的*.rgu文件重新命名为boot.rgu,并将它放到和批处理同一目录下。
按任意键开始转换,图16是因rgu文件非unicode格式而提示在第1行出现错误。
Fig.16 错误提示
如果过程没有错误,会提示<RGUComp> done! 如图17。
Fig.17 正常结束
用make_rgu.bat可以将hv文件转换为rgu文件。图18是该批处理的运行界面。将*.hv改名为user.hv。
按任意键开始转换,图19是转换结果,一般不会有错误。
Fig.19 hv转换为rgu
Fig.20 在目录下生成user.rgu
打开user.rgu,查看内容,如图21,前4行是RGUComp的信息,剩下的都是注册表表项。
下次,将发布我制作的基于Dopod官方WM6.0 ROM的ROM Kitchen
软件下载(Tool downloads)
1. HTC X-Button 1.5 OEM Package
htc_x_button_1.5.zip
zip- File
14. Aug 2007 (624Hits)2. test_hv_rgu.zip,用来测试rgu或hv文件
test_hv_rgu.zip
zip- File
06. Aug 2007 (1074Hits)
================English explanation===============
Lesson 6. Frequent errors and solutions in BuildOS
Today I would like to talk about some frequent erros and their solutions in build os process. The most 2 common errors in customizing OS process are duplicate files and rgu file errors.
1. Duplicate files
The solution to duplicate file error is very simple, just delete the duplicate file. I strongly suggest that you had betterl to log which files are delete for duplicate reason. The duplicate file errors can be categorized in 2 sorts.
1.1 Duplicate files in OEM packages
In Lesson 4 Make OEM Package Part2, I introduced 2 kinds OEM package of GSFinder. One includes all the application files, while the other one only includes shortcut. Because both OEM package of GSFinder have GSFinder.lnk, therefor if you select these 2 OEM packages in the same time when building OS like Fig.1. An error window will pop out to show “\temp\dump’GSFinder.lnk” already exists. See Fig.2. The status bar of BuildOS.exe will show in which process error occurs. Fig3 shows that error occurs when processing OEM\Link_GSFinder.
Open explorer, search the GSFinder.lnk in My_ROM_Kitchen, see Fig.4. Fig.5 is the search result. You can find there are duplicate GSFinder.lnk in GSFinder and Link_GSFinder folders. They can not make into ROM at the same time.
1.2 Duplicate file in OEM package and default system files
Some OEM Packages may have file that are duplicate with default system files. For example, HTC X-Button 1.5, a well use task manager application released by HTC. You can download its OEM package in above. It has several files that are duplicate with some default system files in OEMAPPS folder.
Extract download zip file, copy it into My_ROM_Kitchen\OEM, run BuildOS, see Fig.6. Shortly, error window will display to tell you that “temp\dump\exitbutton.bmp” already exists as shown in Fig.7. Using explorer to search exitbutton.bmp, you will find there both are exitbutton.bmp in HTC X-Button 1.5 and OEMAPPS folders. See Fig.8. Not only exitbutton.bmp, X-Buttons also has other duplicate files, see Fig.9, left side is the files in OEMAPPS, right side are the ones in HTC X-Button.
2. rgu file errors
When errors occur in creating registry process, the window says:”error building default.hv and user.hv!” see Fig.10, they are mostly rgu file errors. Please enter temp folder, open log.txt to check which rgu file has problems.
2.1 rgu file is not saved in unicode
If rgu file is not unicode format, the error will happen. The last 3 lines in log.txt are the error logs. see Fig.11. It says initial registry failed in *.rgu(guid.rgu) with a few lines in line1. The solution is open rgu by notepad, save it in unicode format.
2.2 rgu file does not start with REGEDIT4
The same error with 2.1 will be logged in log file, if rgu file does not start with REGEDIT4. The solution is simply adding REGEDIT4 into rgu as first line.
2.3 the end line of rgu file is not blank
Please make the last line of rgu blank.
2.4 there is “\” not “\\” in rgu
The “\” in registry entry must be written in”\\”. As shown in Fig.12, the line 12 :\Windows\regedit.exe,-143 is wrong, the correct one is “@=\\Windows\\regedit.exe,-143″. The log will says there is problem with line 12. See Fig.13.
I wrote a bat (included in test_hv_rgu.zip) to simplify the rgu testing, the download link is showed above. Test_hv_rgu.zip contains 2 bat files, 2 dll files and rgucomp.exe. Run make_hv.bat to check whether the rgu file is correctly transformed to hv. see Fig.15. please rename the *.rgu to boot.rgu, and put it in the same folder with bat file, then press any key to start transforamtion. The red line in fig.16 shows there is problem in line1, the reason may be rgu is not in unicode or the first line is not REGEDIT4. If there is no error, the screen will display “<RGUComp> done!” as shown in Fig.17.
Using make_rgu.bat will change hv to rgu. Fig.16 is the running window. Please rename *.hv to user.hv, press any key to start change. Fig.19 is the result, usually there is no errors. A user.rgu will be created in folder see Fig.20. Open it, the first 4 lines are the information of RGUComp.exe. Others are the registry entires.
This is the end of series, next I will release my ROM Kitchen for softbank which i mentioned in Lesson2.
转载文章请注明转载自:ThinkAgain - Let's Blog!



























2008.01.09 Wednesday 8:33 am
“2. OEM Package的文件和系统自带文件重复”
这种情况应该如何解决呢?
我曾经做过一个包含支持中日韩wince.nls的OEM Package,结果就出现这个问题。删除系统默认的wince.nls也不行。
2008.01.09 Wednesday 10:10 am
To Raymond.S,检查下log文件,查找下原因。wince.nls无需做成package,直接将它覆盖到系统自带的就可以了。