Closed nakixii closed 1 year ago
Hi @nakixii , Thanks for reporting incompatibility issues. I did a quick check of the image, it seems the image has strange value in ramdisk table entry size. Is this image modified by some 3rd party tool? Or do you build it by yourself?
Hi @nakixii , Thanks for reporting incompatibility issues. I did a quick check of the image, it seems the image has strange value in ramdisk table entry size. Is this image modified by some 3rd party tool? Or do you build it by yourself?
It's an official image on Redmi K50 MIUI 13.1.22.9.19.DEV.
Hi @nakixii ,
Just tried with aosp unpack_bootimg.py
,
red➜ ~/big/a/system/tools/mkbootimg git:(c6bbbe1) ✗ ./unpack_bootimg.py --boot_img ~/work/boot/vendor_boot.img --out out
Traceback (most recent call last):
File "/home/yu/big/a/system/tools/mkbootimg/./unpack_bootimg.py", line 563, in <module>
main()
File "/home/yu/big/a/system/tools/mkbootimg/./unpack_bootimg.py", line 558, in main
info = unpack_bootimg(args.boot_img, args.out)
File "/home/yu/big/a/system/tools/mkbootimg/./unpack_bootimg.py", line 486, in unpack_bootimg
info = unpack_vendor_boot_image(image_file, output_dir)
File "/home/yu/big/a/system/tools/mkbootimg/./unpack_bootimg.py", line 426, in unpack_vendor_boot_image
ramdisk_name = cstr(unpack(
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 15: invalid start byte
Not sure if XiaoMi has changed the default "mkbootimg" tool.
Let's check the "vendor ramdisk total size" field of the image header: The binary hex is 0x121fb803, interpret it as little endian int, we get 0x03b81f12 = 62398226 bytes ~= 59.5 MB.
Also the dtb seems incorrect.
15:24:31.147 [main] INFO cfig.utils.DTC - parsing DTB: build/unzip_boot/dtb
FATAL ERROR: Blob has incorrect magic number
15:24:31.149 [main] ERROR cfig.utils.DTC - can not parse DTB: build/unzip_boot/dtb
The dtb problem seems to be caused by the offset. After skipping the first 32 (I'm not sure) bytes manually, dtc can convert it correctly.
That's good.
About "ramdisk", it can be manually extracted with
mkdir temp && cd temp && cpio -iv < ../build/unzip_boot/ramdisk.img
"dtb" can be manually extracted as you have successfully done.
anyway, it doesn't feel good to support such modified image formats ~~
OK.
vendor_boot download link: https://drive.google.com/file/d/1Ch1RFpDFYXtyJaHHBU6nRCXXLMniWP0w/view?usp=drivesdk