cfig / Android_boot_image_editor

Parsing and re-packing Android boot.img/vbmeta.img/payload.bin, supporting Android 15
Apache License 2.0
1.06k stars 234 forks source link

If you have time, fix the ramdisk without a kernel. Huawei ramdisk.img #122

Closed xxroot closed 1 year ago

xxroot commented 1 year ago

If you have time, fix the ramdisk without a kernel. Huawei ramdisk.img

'Caused by: java.io.FileNotFoundException: build/unzip_boot/kernel (没有那个文件或目录) at java.base/java.io.FileInputStream.open0(Native Method) at java.base/java.io.FileInputStream.open(FileInputStream.java:219) at java.base/java.io.FileInputStream.(FileInputStream.java:157) at cfig.bootimg.Common$Companion.hashFileAndSize(Common.kt:210) at cfig.bootimg.v2.BootV2.pack(BootV2.kt:397) at cfig.packable.BootImgParser.pack(BootImgParser.kt:86) ... 8 more ' ramdisk.zip

cfig commented 1 year ago

Never seen such ramdisk.img for /ramdisk partition. What's the Huawei device model ? I see "androidboot.hardware=qcom"

xxroot commented 1 year ago

honour 30 lite But this phone is MTK chip, I also don't understand why androidboot.hardware=qcom

xxroot commented 1 year ago

In my opinion, this problem is solved by adding a judgment when packing the kernel. If the kernel does not exist, skip the kernel packing

cfig commented 1 year ago

In my opinion, this problem is solved by adding a judgment when packing the kernel. If the kernel does not exist, skip the kernel packing

Yes, that's the idea. I quickly checked several Huawei & Honor phones, they all have "ramdisk" or "ramdisk_a/b" partitions.

xxroot commented 1 year ago

Later, all Huawei and Honor are ramdisk, which seems to be separated from kernel. kernel should be in boot

xxroot commented 1 year ago

Caused by: java.lang.IllegalStateException: This should not happen, please add comments at: https://github.com/cfig/Android_boot_image_editor/issues/122

cfig commented 1 year ago

Please rename the file to "ramdisk.img"

xxroot commented 1 year ago

哈哈,犯二了,我把名字改成了boot.img

cfig commented 1 year ago

Nice