Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,739,156 Members 46,462 Now Online
XDA Developers Android and Mobile Development Forum

[REF] Create boot.img for the One S

Tip us?
 
xkonni
Old
(Last edited by xkonni; 6th April 2012 at 10:59 AM.)
#1  
xkonni's Avatar
Senior Member - OP
Thanks Meter 714
Posts: 359
Join Date: Jan 2010
Location: berlin

 
DONATE TO ME
Default [REF] Create boot.img for the One S

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:
Select 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:
Select 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
The Following 17 Users Say Thank You to xkonni For This Useful Post: [ Click to Expand ]
 
shiftedx
Old
#2  
Senior Member
Thanks Meter 47
Posts: 282
Join Date: Apr 2010
Location: Fort Worth

 
DONATE TO ME
Quote:
Originally Posted by xkonni View Post
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:
Select 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:
Select 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
Old
#3  
xkonni's Avatar
Senior Member - OP
Thanks Meter 714
Posts: 359
Join Date: Jan 2010
Location: berlin

 
DONATE TO ME
Me too. Took quite some time to figure it out, though once you know it's rather easy.

Sent from my HTC One S
 
fulky
Old
#4  
fulky's Avatar
Member
Thanks Meter 2
Posts: 43
Join Date: Feb 2010
Location: Cuneo
someone could download your boot.ini? I have a problem with my htc one s
tnk
Device: HTC one S
 
xkonni
Old
#5  
xkonni's Avatar
Senior Member - OP
Thanks Meter 714
Posts: 359
Join Date: Jan 2010
Location: berlin

 
DONATE TO ME
Quote:
Originally Posted by fulky View Post
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
The Following User Says Thank You to xkonni For This Useful Post: [ Click to Expand ]
 
fulky
Old
#6  
fulky's Avatar
Member
Thanks Meter 2
Posts: 43
Join Date: Feb 2010
Location: Cuneo
Quote:
Originally Posted by xkonni View Post
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
you are my savior, it works.
thank you very much
Device: HTC one S
 
xkonni
Old
#7  
xkonni's Avatar
Senior Member - OP
Thanks Meter 714
Posts: 359
Join Date: Jan 2010
Location: berlin

 
DONATE TO ME
Quote:
Originally Posted by fulky View Post
you are my savior, it works.
thank you very much
ok... glad to help!
 
jammysunny
Old
#8  
Senior Member
Thanks Meter 10
Posts: 282
Join Date: Feb 2009
Location: 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
Old
#9  
xkonni's Avatar
Senior Member - OP
Thanks Meter 714
Posts: 359
Join Date: Jan 2010
Location: berlin

 
DONATE TO ME
its just a slightly modified stock boot.img with changed parameters in default.prop that allow adb shell as root. nothing fancy...
 
zylith
Old
#10  
zylith's Avatar
Senior Member
Thanks Meter 164
Posts: 189
Join Date: Aug 2009
Location: Collinsville
not doing this, would it cause a error in CWM as status 0? when I try to flash a rom.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Device Review: OnePlus One

Seemingly every day, there are a bunch of new devices being released. Some are budget devices and some are … more

Browse the Internet with the Innovative Atlas Web Browser

For the most part, Chrome, Firefox, and Dolphin Browser have no real rivals among … more

Choose from Over a Thousand Battery Styles with 3Minit Battery Mod

The battery style in stock Android looks pretty dull. It doesn’t … more

Organize Your Cloud Storage Files with Unclouded

Cloud storage services like Dropbox or Google Drive have grown in popularity dramatically … more