Packing Custom Android boot.img Error

2

I am receiving the following error every time I make a modified Nexus 6 kernel and use Peter Batard's mkbootimg tools (https://github.com/pbatard/bootimg-tools) to create a bootable image:

android@ubuntu:~/android-sdk-linux/platform-tools$ ./fastboot boot myboot3.img
downloading 'boot.img'...
OKAY [  1.219s]
booting...
FAILED (remote failure)
finished. total time: 1.282s

I have booted off of the stock and Franco bootable images which worked. However, unpacking those bootable images and replacing the kernel with my modified zImage from the msm source (I also tried Franco's Shamu kernel source as well) will result in that same error.

When unpacking the boot.img I receive the mkbootimg command line instructions:

mkbootimg --base 0 --pagesize 2048 --kernel_offset 0x00008000 --ramdisk_offset 0x0000000b --second_offset 0x00f00000 --tags_offset 0x0000000b --cmdline 'console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=shamu msm_rtb.filter=0x37 ehci-hcd.park=3 utags.blkdev=/dev/block/platform/msm_sdcc.1/by-name/utags utags.backup=/dev/block/platform/msm_sdcc.1/by-name/utagsBackup coherent_pool=8M' --kernel kernel --ramdisk ramdisk.cpio.gz -o /home/android/Desktop/shamu-lmy47z/boot.img

The only change to this I make is replacing kernel with the newly created zImage and changing the output name to something like myboot.img. I have been able to unpack the stock image and repack it without making any modifications and it has worked fine. Is it possible that one of the parameters in the mkbootimg command needs to be modified?

-- EDIT --

I ran unmkbootimg from this thread Error with repacking boot.img (Android). Which gave the following information:

 *** WARNING ****
This image is built using NON-standard mkbootimg!
OFF_KERNEL_ADDR is 0x000080F5
OFF_RAMDISK_ADDR is 0x00000100
OFF_SECOND_ADDR is 0x00F000F5
Please modify mkbootimg.c using the above values to build your image.
****************

This still resulted in a failed boot.img.

Here are the beginning of the respective files:

boot.img (from the factory build of the LMY47Z Nexus 6 system).

android@ubuntu:~/Desktop/shamu-lmy47z$ xxd -l 320 boot.img
0000000: 414e 4452 4f49 4421 cdc5 6d00 0080 0000  ANDROID!..m.....
0000010: dff2 0a00 0b00 0000 0000 0000 0000 f000  ................
0000020: 0b00 0000 0008 0000 0000 0000 0000 0000  ................
0000030: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000040: 636f 6e73 6f6c 653d 7474 7948 534c 302c  console=ttyHSL0,
0000050: 3131 3532 3030 2c6e 3820 616e 6472 6f69  115200,n8 androi
0000060: 6462 6f6f 742e 636f 6e73 6f6c 653d 7474  dboot.console=tt
0000070: 7948 534c 3020 616e 6472 6f69 6462 6f6f  yHSL0 androidboo
0000080: 742e 6861 7264 7761 7265 3d73 6861 6d75  t.hardware=shamu
0000090: 206d 736d 5f72 7462 2e66 696c 7465 723d   msm_rtb.filter=
00000a0: 3078 3337 2065 6863 692d 6863 642e 7061  0x37 ehci-hcd.pa
00000b0: 726b 3d33 2075 7461 6773 2e62 6c6b 6465  rk=3 utags.blkde
00000c0: 763d 2f64 6576 2f62 6c6f 636b 2f70 6c61  v=/dev/block/pla
00000d0: 7466 6f72 6d2f 6d73 6d5f 7364 6363 2e31  tform/msm_sdcc.1
00000e0: 2f62 792d 6e61 6d65 2f75 7461 6773 2075  /by-name/utags u
00000f0: 7461 6773 2e62 6163 6b75 703d 2f64 6576  tags.backup=/dev
0000100: 2f62 6c6f 636b 2f70 6c61 7466 6f72 6d2f  /block/platform/
0000110: 6d73 6d5f 7364 6363 2e31 2f62 792d 6e61  msm_sdcc.1/by-na
0000120: 6d65 2f75 7461 6773 4261 636b 7570 2063  me/utagsBackup c
0000130: 6f68 6572 656e 745f 706f 6f6c 3d38 4d00  oherent_pool=8M.

myboot.img (built w/ mkbootimg and zImage made from msm source)

android@ubuntu:~/Desktop/shamu-lmy47z$ xxd -l 320 myboot.img
0000000: 414e 4452 4f49 4421 4016 6a00 0080 0000  ANDROID!@.j.....
0000010: dff2 0a00 0b00 0000 0000 0000 0000 f000  ................
0000020: 0b00 0000 0010 0000 0000 0000 0000 0000  ................
0000030: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000040: 636f 6e73 6f6c 653d 7474 7948 534c 302c  console=ttyHSL0,
0000050: 3131 3532 3030 2c6e 3820 616e 6472 6f69  115200,n8 androi
0000060: 6462 6f6f 742e 636f 6e73 6f6c 653d 7474  dboot.console=tt
0000070: 7948 534c 3020 616e 6472 6f69 6462 6f6f  yHSL0 androidboo
0000080: 742e 6861 7264 7761 7265 3d73 6861 6d75  t.hardware=shamu
0000090: 206d 736d 5f72 7462 2e66 696c 7465 723d   msm_rtb.filter=
00000a0: 3078 3337 2065 6863 692d 6863 642e 7061  0x37 ehci-hcd.pa
00000b0: 726b 3d33 2075 7461 6773 2e62 6c6b 6465  rk=3 utags.blkde
00000c0: 763d 2f64 6576 2f62 6c6f 636b 2f70 6c61  v=/dev/block/pla
00000d0: 7466 6f72 6d2f 6d73 6d5f 7364 6363 2e31  tform/msm_sdcc.1
00000e0: 2f62 792d 6e61 6d65 2f75 7461 6773 2075  /by-name/utags u
00000f0: 7461 6773 2e62 6163 6b75 703d 2f64 6576  tags.backup=/dev
0000100: 2f62 6c6f 636b 2f70 6c61 7466 6f72 6d2f  /block/platform/
0000110: 6d73 6d5f 7364 6363 2e31 2f62 792d 6e61  msm_sdcc.1/by-na
0000120: 6d65 2f75 7461 6773 4261 636b 7570 2063  me/utagsBackup c
0000130: 6f68 6572 656e 745f 706f 6f6c 3d38 4d00  oherent_pool=8M.
android
linux
linux-kernel
android-kernel
asked on Stack Overflow Jul 13, 2015 by rourion • edited May 23, 2017 by Community

1 Answer

0

First of all I suggest using mkboot(look for it in github) for unpacking and packing boot images.

Very few actual devices use the vanilla mkbootimg, instead they customize it. Marvel and MTK are notorious for modifying the bootloader to load their ugly proprietary boot images.

I would also check if the DTS in the boot image comes as a separate part. If thats the case then you need to make sure you unpack and repack it. I dont think you are doing it now.

answered on Stack Overflow Jul 14, 2015 by skoperst

User contributions licensed under CC BY-SA 3.0