• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[Tutorial] How to flash a new boot.img via Fastboot

Did this tutorial help you?

  • Yes

    Votes: 486 94.4%
  • No (please post why not)

    Votes: 29 5.6%

  • Total voters
    515
Search This thread

fipsib

Senior Member
Jan 16, 2011
589
781
Munich
Hey Guys,

since I heard many questions lately concerning flashing a boot.img onto the One S I decided to give you a small tutorial! (which should also work on any other device with bootloadermode)
If you have fastboot already installed on your PC it's very quick & easy!

Pls be aware that this could damage your phone & I'm not responsible for this. so only do this if you really feel comfortable with it & you know about the risks!

First of all you need to have fastboot & adb installed, as well as the drivers for the One S. If you haven't, move on to the second post in this thread!

If you are on a Sense-based ROM make sure you haven't ticked the fast boot option in the settings!

Step 0,5
What is the boot.img?
-> basically it contains the kernel & the ramdisk. But let's hear what the pros have to say:
"The boot.img is a small(ish) file that contains 2 main parts, the kernel (the brain of the Android system) and the ramdisk (a core set of instructions and binaries that begins the boot process and controls base aspects of the system, such as mountpoints, memory management and startup services)" Source
Further information can be found here.


Do I need to flash the boot.img manually in fastboot?:

  • No, if you're using TWRP and are on a Hboot-version lower than 1.13
  • Yes, if you're using any other recovery (like CWM)
  • Yes, if you're using TWRP and your ville has the Hboot-version 1.13 or higher


1.Step
reboot your Phone into the bootloader.
This can either be done via
- powering off and keeping volume up & the power-button pressed
- the extended power-menu (If your ROM has it, just select "reboot" & then "bootloader")
- via adb, connect your phone with the pc, make sure it says "USB debugging connected", go to Android/platform-tools/ & then press shift while you perform a right click with the mouse, then choose "open prompt here", type
Code:
adb reboot-bootloader
& press enter. Your One S should then reboot into the bootloader

I personally prefer one of the last two methods, depending which way occurs faster to me at that specific moment.

2.Step
make sure it says "Fastboot USB" like in the following picture
loadera5adad4bJPG.jpg

(Source = Google)

3.Step
Test if it your device has been detected with the following command:
Code:
fastboot devices
if it gives you an answer other than a blank one or an error there you go

4.Step
copy the boot.img you want to flash into the folder C:\android\platform-tools\ & then execute the command
Code:
fastboot flash boot boot.img
(if your boot.img is named differently then adjust the last part of the command)
wait for it to succeed.
if it says okay two times & the prompt reappears everything should be fine

5.Step
reboot your device with
Code:
fastboot reboot

6.Step
If you want check
Code:
Settings -> About phone -> Kernel
if it matches the boot.img you just flashed

The whole process should look something like this in your CMD:

11062696ll.jpg

Here you go!
Quick & easy!

When I helped please press the thanks button!

If you have any suggestions to make it even easier of found a mistake, please tell me, it's already very late in Germany ;)

BE AWARE THAT I'M NOT RESPONSIBLE IF IT DOESN'T WORK OR BREAKS YOUR PHONE! THIS IS JUST THE WAY I UPDATE THE BOOT.IMG ON MY PHONE!
 
Last edited:

fipsib

Senior Member
Jan 16, 2011
589
781
Munich
Installing ADB and Fastboot

It's actually pretty easy!

1. Step
download the Android SDK from HERE

Alternatively you can also download the USB drivers & the runtimes for adb & fastboot as a standalone as provided by Inferi0r in the 4th post:
[Download carefully, didn't test them for viruses or (mal)function]

2. Step
Run the downloaded file & change the extracting-folder directly to C:\
(..this will take some time...)
You should then have a folder C:\Android

3. Step
If you haven't installed the One S' drivers yet, download HTC Sync (e.g. from here, or here) & install it, which will also install the drivers needed for adb & fastboot to work.
If you have them installed already, skip this one & proceed to step 4.

4. Step
- go to C:\Android again
- press
Code:
Win + R
on your keyboard to bring up the Run dialog
- type in
Code:
sysdm.cpl
and hit OK
- now, the System Properties panel should open. Click on the Advanced tab
- in the Advanced Tab click on Environment Variables
- at the Environment Variables window find where it says Path in the Section of System variables, click on it, and press the Edit button
- when the new window opens, type in
Code:
;C:\Android
at the very end and klick OK
- now close all the windows, that's all, you're done!

5. Step
- go to C:\Android\platform-tools\ again
- right-click with your mouse while pressing shift
- select "open prompt here" & then you're ready to go to.
- most common adb/fastboot commands:
- adb commands
- fastboot commands
- by entering
Code:
adb help
or
Code:
fastboot help



When I helped please press the thanks button!
 
Last edited:

zaxondis

Senior Member
Aug 11, 2010
425
69
New York City
Thanks!

Thanks for posting!

Anyone have any sweet boot images they want to share? I'll see what I can dig up for our screen size and post some myself soon.
 

MadJoe

Senior Member
Jul 18, 2007
839
146
Boston
Excellent post, thank you. You could also mention the easiest way to boot into bootloader: a root enabled app like Quick Boot, or even Titanium Backup has the option.

Sent from my H1S using XDA Premium.
 

qwerty warrior

Senior Member
Jan 21, 2011
677
93
oh finally thank you ive been trying to find how to do this

i wish HTC phones were easy as samsung phones
 

fipsib

Senior Member
Jan 16, 2011
589
781
Munich
So boot.img is basically a kernel?

basically it contains the kernel & the ramdisk. But there also are some other things:
"[boot.img is a] custom android format consisting of a 2k header, followed by a gzipped kernel, followed by a ramdisk, followed by a [optional] second stage loader" Source

"The boot.img is a small(ish) file that contains 2 main parts, the kernel (the brain of the Android system) and the ramdisk (a core set of instructions and binaries that begins the boot process and controls base aspects of the system, such as mountpoints, memory management and startup services)" Source

Further information can be found
HERE
& Here

[edit] added this to the OP
 
Last edited:

AlxMAX

Senior Member
Sep 30, 2007
541
133
Bucharest
... 3.Step
Test if it your device has been detected with the following command:
Code:
fastboot devices
if it gives you an answer other than a blank one or an error there you go

4.Step
copy the boot.img you want to flash into the folder C:\android\platform-tools\ & then execute the command
Code:
fastboot flash boot boot.img
You should consider adding an extra 3.5 step like this:
Code:
fastboot boot boot.img
This step is meant to test the kernel & ramdisk before flashing it. Of course, the phone might not be fully functional because the modules in /system/lib/modules might not be paired with the kernel in boot.img. But at least you can see your phone booting!
 

fipsib

Senior Member
Jan 16, 2011
589
781
Munich
You should consider adding an extra 3.5 step like this:
Code:
fastboot boot boot.img
This step is meant to test the kernel & ramdisk before flashing it. Of course, the phone might not be fully functional because the modules in /system/lib/modules might not be paired with the kernel in boot.img. But at least you can see your phone booting!

I don't think that this is necessary as it will only confuse people not so familliar with the matter, but thank you for your input :)
 

fipsib

Senior Member
Jan 16, 2011
589
781
Munich
a doubt, I have a friend who wants to put the rom CM9, the question you have is: how to flash the boot.img fastboot in ubuntu?

Thanks!

שנשלח הוז שלי באמצעות Tapatalk2

should be exactly the same, only with the difference that the Android SDK should be located at

Code:
~/android_sdk/platform-tools/

or

Code:
~/bin/
 
Last edited:
  • Like
Reactions: cualla84

Top Liked Posts

  • There are no posts matching your filters.
  • 420
    Hey Guys,

    since I heard many questions lately concerning flashing a boot.img onto the One S I decided to give you a small tutorial! (which should also work on any other device with bootloadermode)
    If you have fastboot already installed on your PC it's very quick & easy!

    Pls be aware that this could damage your phone & I'm not responsible for this. so only do this if you really feel comfortable with it & you know about the risks!

    First of all you need to have fastboot & adb installed, as well as the drivers for the One S. If you haven't, move on to the second post in this thread!

    If you are on a Sense-based ROM make sure you haven't ticked the fast boot option in the settings!

    Step 0,5
    What is the boot.img?
    -> basically it contains the kernel & the ramdisk. But let's hear what the pros have to say:
    "The boot.img is a small(ish) file that contains 2 main parts, the kernel (the brain of the Android system) and the ramdisk (a core set of instructions and binaries that begins the boot process and controls base aspects of the system, such as mountpoints, memory management and startup services)" Source
    Further information can be found here.


    Do I need to flash the boot.img manually in fastboot?:

    • No, if you're using TWRP and are on a Hboot-version lower than 1.13
    • Yes, if you're using any other recovery (like CWM)
    • Yes, if you're using TWRP and your ville has the Hboot-version 1.13 or higher


    1.Step
    reboot your Phone into the bootloader.
    This can either be done via
    - powering off and keeping volume up & the power-button pressed
    - the extended power-menu (If your ROM has it, just select "reboot" & then "bootloader")
    - via adb, connect your phone with the pc, make sure it says "USB debugging connected", go to Android/platform-tools/ & then press shift while you perform a right click with the mouse, then choose "open prompt here", type
    Code:
    adb reboot-bootloader
    & press enter. Your One S should then reboot into the bootloader

    I personally prefer one of the last two methods, depending which way occurs faster to me at that specific moment.

    2.Step
    make sure it says "Fastboot USB" like in the following picture
    loadera5adad4bJPG.jpg

    (Source = Google)

    3.Step
    Test if it your device has been detected with the following command:
    Code:
    fastboot devices
    if it gives you an answer other than a blank one or an error there you go

    4.Step
    copy the boot.img you want to flash into the folder C:\android\platform-tools\ & then execute the command
    Code:
    fastboot flash boot boot.img
    (if your boot.img is named differently then adjust the last part of the command)
    wait for it to succeed.
    if it says okay two times & the prompt reappears everything should be fine

    5.Step
    reboot your device with
    Code:
    fastboot reboot

    6.Step
    If you want check
    Code:
    Settings -> About phone -> Kernel
    if it matches the boot.img you just flashed

    The whole process should look something like this in your CMD:

    11062696ll.jpg

    Here you go!
    Quick & easy!

    When I helped please press the thanks button!

    If you have any suggestions to make it even easier of found a mistake, please tell me, it's already very late in Germany ;)

    BE AWARE THAT I'M NOT RESPONSIBLE IF IT DOESN'T WORK OR BREAKS YOUR PHONE! THIS IS JUST THE WAY I UPDATE THE BOOT.IMG ON MY PHONE!
    48
    Installing ADB and Fastboot

    It's actually pretty easy!

    1. Step
    download the Android SDK from HERE

    Alternatively you can also download the USB drivers & the runtimes for adb & fastboot as a standalone as provided by Inferi0r in the 4th post:
    [Download carefully, didn't test them for viruses or (mal)function]

    2. Step
    Run the downloaded file & change the extracting-folder directly to C:\
    (..this will take some time...)
    You should then have a folder C:\Android

    3. Step
    If you haven't installed the One S' drivers yet, download HTC Sync (e.g. from here, or here) & install it, which will also install the drivers needed for adb & fastboot to work.
    If you have them installed already, skip this one & proceed to step 4.

    4. Step
    - go to C:\Android again
    - press
    Code:
    Win + R
    on your keyboard to bring up the Run dialog
    - type in
    Code:
    sysdm.cpl
    and hit OK
    - now, the System Properties panel should open. Click on the Advanced tab
    - in the Advanced Tab click on Environment Variables
    - at the Environment Variables window find where it says Path in the Section of System variables, click on it, and press the Edit button
    - when the new window opens, type in
    Code:
    ;C:\Android
    at the very end and klick OK
    - now close all the windows, that's all, you're done!

    5. Step
    - go to C:\Android\platform-tools\ again
    - right-click with your mouse while pressing shift
    - select "open prompt here" & then you're ready to go to.
    - most common adb/fastboot commands:
    - adb commands
    - fastboot commands
    - by entering
    Code:
    adb help
    or
    Code:
    fastboot help



    When I helped please press the thanks button!
    4
    Nice write up so cleanly written.