New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to pack my own ZImage (kernel) to a new boot.img #2
Comments
###For example,e330s:
make recovery.img:
|
在你编译完内核以后,在arch/arm/boot/下,没有生成*.dtb文件?
就可以生成dt.img
|
Yes i has the following dtb files: /usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot/ What is the param -p scripts/dtc/ ??? for ./dtbTool -s 2048 -o /usr/android/kernel/dt.img -p scripts/dtc /usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot DTB files My kernel: Pantech A880s |
@hkfriends 我用你给的boot.rar成功生成了dt.img,命令如下,我在dtbTool里加了调试代码,终于发现是你的命令参数里的路径(-p scripts/dtc)有问题,需要改成-p scripts/dtc/。
|
it is strange...i am still has error => Found 0 unique DTB(s)
I have 4 files in here: root@ubuntu:/usr/android/a880s# ls /usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot |
I also download E330S source code: root@ubuntu:/usr/android/a880s# ./dtbTool -v -s 2048 -o ./dt.img -p /usr/android/SHV-E330S_JB_Opensource/Kernel/scripts/dtc/ /usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot |
-p /usr/android/kernel/obj/KERNEL_OBJ/scripts/dtc/ 发送自HTC手机 ----- Reply message ----- it is strange...i am still has error => Found 0 unique DTB(s) root@ubuntu:/usr/android/a880s# ./dtbTool -v -s 2048 -o ./dt.img -p /usr/android/kernel/scripts/dtc/ /usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot DTB combiner: Input directory: '/usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot' Output file: './dt.img' Found file: msmsamarium-rumi.dtb ... skip, failed to scan for 'qcom,msm-id = <' tag Found file: msmsamarium-sim.dtb ... skip, failed to scan for 'qcom,msm-id = <' tag Found file: msm8974-v2-ef56s-pp10.dtb ... skip, failed to scan for 'qcom,msm-id = <' tag => Found 0 unique DTB(s) root@ubuntu:/usr/android/a880s#
I have 4 files in here: root@ubuntu:/usr/android/a880s# ls /usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot compressed msm8974-v2-ef56s-pp10.dtb msmsamarium-sim.dtb Image msmsamarium-rumi.dtb zImage root@ubuntu:/usr/android/a880s# ls /usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot compressed msm8974-v2-ef56s-pp10.dtb msmsamarium-sim.dtb Image msmsamarium-rumi.dtb zImage root@ubuntu:/usr/android/a880s# ls /usr/android/kernel/scripts/dtc/ checks.c dtc-lexer.lex.c_shipped flattree.c srcpos.c data.c dtc-parser.tab.c fstree.c srcpos.h dtc.c dtc-parser.tab.c_shipped libfdt treesource.c dtc.h dtc-parser.tab.h livetree.c util.c dtc-lexer.l dtc-parser.tab.h_shipped Makefile util.h dtc-lexer.lex.c dtc-parser.y Makefile.dtc version_gen.h root@ubuntu:/usr/android/a880s# — |
你把dtcTool放在内核的scripts目录下运行试试吧,scripts/dtbTool 发送自HTC手机 ----- Reply message ----- I also download E330S source code: but the same error: how to debug dtbTool ?? root@ubuntu:/usr/android/a880s# ./dtbTool -v -s 2048 -o ./dt.img -p /usr/android/SHV-E330S_JB_Opensource/Kernel/scripts/dtc/ /usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot DTB combiner: Input directory: '/usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot' Output file: './dt.img' Found file: msmsamarium-rumi.dtb ... skip, failed to scan for 'qcom,msm-id = <' tag Found file: msmsamarium-sim.dtb ... skip, failed to scan for 'qcom,msm-id = <' tag Found file: msm8974-v2-ef56s-pp10.dtb ... skip, failed to scan for 'qcom,msm-id = <' tag => Found 0 unique DTB(s) root@ubuntu:/usr/android/a880s# — |
你要确定dtc所在的目录是否正确,dtc文件是否存在,dtb目录是否正确,*.dtb是否存在。 在 2013-09-07 08:39:28,hkfriends notifications@github.com 写道: I also download E330S source code: root@ubuntu:/usr/android/a880s# ./dtbTool -v -s 2048 -o ./dt.img -p /usr/android/SHV-E330S_JB_Opensource/Kernel/scripts/dtc/ /usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot — |
@hkfriends 你的dtc没有编译出来。
|
ok thanks... same error root@ubuntu:/usr/android/a880s# ./dtbTool -v -s 2048 -o ./dt.img -p /usr/android/ /usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot |
I also install DTC 1.3 apt-get install device-tree-compiler
still has error |
@hkfriends 这条命令要保证 /xxxx/dtc/dtc存在 ![qq20130907235443](https://f.cloud.github.com/assets/555410/1101637/4e4082f8-17d6-11e3-8a5c-3d66fd5c5e41.jpg “github”) ![qq20130907235500](https://f.cloud.github.com/assets/555410/1101638/4e772092-17d6-11e3-8c4f-7170bd323071.jpg “github”) ![qq20130907235516](https://f.cloud.github.com/assets/555410/1101639/4e9aa09e-17d6-11e3-801d-9e03fe6e5fa9.jpg “github”) ![qq20130907235427](https://f.cloud.github.com/assets/555410/1101640/4ea20f28-17d6-11e3-8a0d-2e31ba2bd0e2.jpg “github”) |
Yes, 路径 is ok
Here is the proof:root@ubuntu:/usr/android/a880s# ls /usr/android/dtc -l root@ubuntu:/usr/android/a880s# ls -l /usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot root@ubuntu:/usr/android/a880s# ./dtbTool -v -s 2048 -o ./dt.img -p /usr/android/ /usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot |
@hkfriends |
/usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot/ |
good... it is working :) I tested either -p or without -p is ok (as I already installed DTC by apt-get install device-tree-compiler the output parameter must ended with "/" Many thanks^^ Ok , then how can i use this dt.img and with my own zImage + ramdisk ==>to make my boot.img? root@ubuntu:/usr/android/a880s# ./dtbTool -v -s 2048 -o ./dt.img -p /usr/android/dtc/ /usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot/ Generating master DTB... Generating master DTB... |
Ok , then how can i use this dt.img and with my own zImage + ramdisk ==>to make my boot.img? It seems your script "mkboot" has no such handling paramter: repack boot.img: |
###For example,e330s:
make recovery.img:
|
it is strange: ./mkbootimg_dtb --kernel /usr/android/kernel/obj/KERNEL_OBJ/arch/arm/boot/zImage --ramdisk ./tmp/ramdisk.gz --base 0x00000000 --offset 0x02000000 --tags-addr 0x01e00000 --dt ./dt.img --cmdline "console=null androidboot.hardware=qcom user_debug=31 maxcpus=2 msm_rtb.filter=0x3F" -o myboot.img H:\sdk>fastboot boot myboot.img |
@hkfriends |
Yes, the same as yours root@ubuntu:/usr/android/a880s# ./mkboot boot.img tmptest |
I upload my files http://pan.baidu.com/share/link?shareid=1765365218&uk=1597028979 This is the stock boot.img (good image from original) |
@hkfriends |
@hkfriends 官方用的是tp20.dts ,开源内核里编译用的是pp10,是不是这个原因呢。 |
官方的dt.img+new zImage+ramdisk打包 ==> OK but another problem... now my device is very slow....... not normal |
i think i need to build my own dt.img what is the diff of tp20.dts and pp10 |
@hkfriends 你把编译得到的 *.ko放在/system/lib/modules/下了吗? |
@hkfriends 或者在/system/build.prop中可以找到ro.product.board_ver=TP20 从build.prop得出A880正式机主板型号为TP20,而其它型号可能为工程机。 在内核源代码include\pantech\BOARD_REV.h中指定需要编译的主板型号 #define BOARD_VER TP10 (官方提供的源代码为TP10,可能用来测试工程机的,自己编译时应该改为TP20) |
理解 , 讓我再試一次. 以前编译 a850,860,870 沒有這樣的問題.. |
我这里运行dtbTool时发现这一句: |
@ziyouwa |
@xiaolu 谢谢!还是不明白为什么识别不正确,的确是常规文件 |
Hello @xiaolu! I compiled dt.img from my msm8226-g2mds.dtb file in /arch/arm/boot/. But after I repacked boot.img and replaced dt.img in it and flash my phone did not boot! If I repack boot.img with stock dt.img phone working. In what can be problem? And what is VERy strange - they have the same size in bytes!! |
I fix this problem using dtbToolCM with -2 parameter. |
Ok. |
@ziyouwa 我发现,在我的电脑分区文件系统为reiserfs时,d_type始终为0。那么,很可能是文件系统的问题。 |
@xiaolu I am tried for a long time with this tool.
|
Hi there
I can use your tools to unpack stock boot.img to zImage and ramdisk... then I can make change to ramdisk and then re-pack ok .... very good!!
unfortunately I have download kernel source and re-build (customize) my kernel and build new zImage
but I cannot pack my own (new) zImage and the ramdisk, I belive dt.img need to re-build....
can you tell me how to use your script to do that? it seems no paramter for me to pass dt.img path
大大, 簡單的是怎樣把我自己compile的kernel (zImage), 合拼ramdisk + dt.img 為boot.img ?
貌似dt.img 要compile過, 同時你的script不能指特定zImage 戓 dt.img
謝謝幫忙
The text was updated successfully, but these errors were encountered: