[REF] Create boot.img for the One S

Search This thread

xkonni

Senior Member
Jan 16, 2010
377
1,041
berlin
As mentioned before, there's something wrong with creating boot images for the HTC One S. They just don't boot.
I did some hexdumping, editing and finally found out what's really wrong.

When unpacking a boot.img you get the base_addr 80400000.

In cyanogenmod/system/core/mkbootimg/mkbootimg.c:146 you have the line
Code:
  hdr.ramdisk_addr = base + 0x01000000;

When using mkbootimg with the given base_addr of 80400000 this results in a ramdisk_addr of 81400000 whereas the correct address would be 81800000.

To create a boot.img you execute:
Code:
mkbootimg --kernel zImage --ramdisk ramdisk.gz --base 80400000 --ramdiskaddr 81800000 --cmdline console=ttyHSL0,115200,n8 -o boot.img

And it's important to specify --base BEFORE --ramdiskaddr as otherwise it gets overwritten.

Hope you can put this to good use ;)
 
Last edited:

shiftedx

Senior Member
Apr 26, 2010
295
51
Fort Worth
As mentioned before, there's something wrong with creating boot images for the HTC One S. They just don't boot.
I did some hexdumping, editing and finally found out what's really wrong.

When unpacking a boot.img you get the base_addr 80400000.

In cyanogenmod/system/core/mkbootimg/mkbootimg.c:146 you have the line
Code:
  hdr.ramdisk_addr = base + 0x01000000;

When using mkbootimg with the given base_addr of 80400000 this results in a ramdisk_addr of 81400000 whereas the correct address would be 81800000.

To create a boot.img you execute:
Code:
mkbootimg --kernel zImage --ramdisk ramdisk.gz --base 80400000 --ramdiskaddr 81800000 --cmdline console=ttyHSL0,115200,n8 -o boot.img

And it's important to specify --base BEFORE --ramdiskaddr as otherwise it gets overwritten.

Hope you can put this to good use ;)


Wow thank you! I was having such trouble with it I was about to post about this actually.
 

xkonni

Senior Member
Jan 16, 2010
377
1,041
berlin
Me too. Took quite some time to figure it out, though once you know it's rather easy.

Sent from my HTC One S
 

jammysunny

Senior Member
Feb 13, 2009
292
10
Karlsruhe
I got one problem.....I did a mistake with Rooting my S....Everytime when I tried to restart, it hangs...so I must always go to bootloader back, installing this superboot form Modaco...So I flashed RUUs, all three, but failed....
So, does this .img-file do what?
 

xkonni

Senior Member
Jan 16, 2010
377
1,041
berlin
its just a slightly modified stock boot.img with changed parameters in default.prop that allow adb shell as root. nothing fancy...
 

SpotTech

Senior Member
Mar 14, 2010
459
240
Liège
Google Pixel 5
where does this binary come from?
did you speficy --ramdiskaddr after --base?
did you hexedit the boot.img to check the ramdiskaddr? maybe something else is wrong with your kernel/ramdisk.

where does this binary come from? --> Google
did you speficy --ramdiskaddr after --base? --> yes
did you hexedit the boot.img to check the ramdiskaddr? --> how to?
 

xkonni

Senior Member
Jan 16, 2010
377
1,041
berlin
where does this binary come from? --> Google
a link to the binary might be helpful, i did not find an official one released by google.
if you downloaded it from some third party, maybe its based on outdated source code.
the one that compiles out of recent aosp/cm source code works fine.


did you hexedit the boot.img to check the ramdiskaddr? --> how to?

use any hexeditor for your OS. i'm using bviplus on archlinux, but it really doesn't matter.
hexedit the boot.img and see if address 0x16 contains 40 (wrong, results in ramdiskaddr 8140 0000) or 80 (correct, results in ramdiskaddr 8180 0000).

example of a boot.img with correct ramdiskaddr:
lqGyX.png


you could also upload it somewhere and let me have a look.
or join irc for further questions ;)

#cyanogenmod-ville on irc.freenode.org
 

klin1344

Senior Member
Nov 11, 2011
3,486
5,611
Thank you for this guide. It saved me a lot of time as I was trying to figure out why my compiled kernels wouldn't boot. I am used to samsungs, which have no boot.imgs so this is new to me.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 17
    As mentioned before, there's something wrong with creating boot images for the HTC One S. They just don't boot.
    I did some hexdumping, editing and finally found out what's really wrong.

    When unpacking a boot.img you get the base_addr 80400000.

    In cyanogenmod/system/core/mkbootimg/mkbootimg.c:146 you have the line
    Code:
      hdr.ramdisk_addr = base + 0x01000000;

    When using mkbootimg with the given base_addr of 80400000 this results in a ramdisk_addr of 81400000 whereas the correct address would be 81800000.

    To create a boot.img you execute:
    Code:
    mkbootimg --kernel zImage --ramdisk ramdisk.gz --base 80400000 --ramdiskaddr 81800000 --cmdline console=ttyHSL0,115200,n8 -o boot.img

    And it's important to specify --base BEFORE --ramdiskaddr as otherwise it gets overwritten.

    Hope you can put this to good use ;)
    1
    someone could download your boot.ini? I have a problem with my htc one s
    tnk

    i'm not entirely sure how that would help you, its basically the same those you can find in any rom around here. but there you go: boot.img - mediafire
    1
    Glad it helped :)

    Sent from my HTC One S