Jump to content


Photo

How To Patch A Boot.img From An Update .zip To A Fastboot File


  • Please log in to reply
20 replies to this topic

#1 mattlgroff

mattlgroff

    The Dark Knight

  • Developer
  • 2,298 posts

Posted 09 June 2012 - 10:31 PM

Patching a boot.img using applypatch.


Be rooted. Have a computer with adb working, or do this from an android terminal emulator. The instructions are for adb.

The applypatch commands are going to have [] around them to show you what to put, but we not used in the actualy script.


-----------------------------------------------------------------

Please Login or Register to see this Hidden Content

-----------------------------------------------------------------

A = Desired Boot.img's Sha-1 sum
B = Size (in bytes) of the desired boot.img
C = Original Boot.img's Sha-1sum




Looking at the updater-script you can see this line of code or something similar for applying the boot.img.p to the phone's boot.img.
You need this as a reference for the SHA-1 sums of the patch and boot.img and desired final boot.img.


//Reference script\\

Please Login or Register to see this Hidden Content




//Actual script\\

Please Login or Register to see this Hidden Content





Actual commands used to patch D4 .219 fastboot file boot.img with D4 6.16.208 boot.img.p:
------------------------------------------------------------------------------------------

adb shell
su
cd sdcard-ext
applypatch boot219.img boot208.img 4a7070c32d0312aa48e52e207c7932434bc46cb1 8388608 fe086e1f547082c3cf2a5f65dacb81fd232ecd89:boot208.img.p

------------------------------------------------------------------------------------------
  • trimax84, cynnar, jimyv and 2 others like this

Please do not Personal Message me for help or troubleshooting. They will be ignored. Post in threads or start one in Q&A sections.

If you feel the need to donate to me, click here.


#2 STiK

STiK

    STiK in the Mud

  • Members
  • PipPipPip
  • 304 posts
  • LocationEverett, WA
  • Current Device(s):LG Nexus 4

Posted 10 June 2012 - 01:16 PM

Listen to Matt.. This works.. It will *NOT* brick your phone beyond repair :)

#3 artistan

artistan

    n00b

  • Members
  • Pip
  • 7 posts

Posted 10 June 2012 - 01:18 PM

Wait, we can't stop here... this is bat country!

#4 wardo5757

wardo5757

    n00b

  • Members
  • Pip
  • 21 posts

Posted 10 June 2012 - 04:41 PM

Help out a noob... What would you use this For?

#5 kbuck13

kbuck13

    Member

  • Members
  • PipPip
  • 105 posts

Posted 10 June 2012 - 07:13 PM

Does this mean that once the true OTA for ICS is released that it can be used to get all of us back on the path so to speak?

#6 Guest_BDH_*

Guest_BDH_*
  • Guests

Posted 10 June 2012 - 08:53 PM

Does this mean that once the true OTA for ICS is released that it can be used to get all of us back on the path so to speak?


Yes

Sent from my XT912 using Tapatalk 2
  • mattlgroff likes this

#7 etrorteepe

etrorteepe

    Not a Belieber

  • Members
  • PipPip
  • 221 posts
  • Current Device(s):Nexus 5

Posted 11 June 2012 - 01:21 PM

@matt -

Any chance you could make a thread called "How To Patch A Radio.img From An Update .zip To A Fastboot File"

#8 mattlgroff

mattlgroff

    The Dark Knight

  • Developer
  • 2,298 posts

Posted 12 June 2012 - 04:52 PM

@matt - Any chance you could make a thread called "How To Patch A Radio.img From An Update .zip To A Fastboot File"

Patching a radio.img is not possible. The radio.img is extracted onto the phone and it contains the lte.img and the bp.img. Changing anything inside an older radio.img also breaks the signature... Why do you want to patch a radio.img?

Please do not Personal Message me for help or troubleshooting. They will be ignored. Post in threads or start one in Q&A sections.

If you feel the need to donate to me, click here.


#9 theonlycosmic

theonlycosmic

    Droid Master

  • Members
  • PipPipPip
  • 470 posts
  • LocationCalifornia

Posted 12 June 2012 - 10:29 PM

I tried patching the .181 boot.img with the .210 boot.img.p but got errors saying:

applying patch to boot181.img
failed to stat "boot210.img": No such file or directory
failed to statfs "boot210.img": No such file or directory
target 8388608; free space -1 bytes; retry 1; enough 1

any help?
Current Phone: Motorola Droid Razr MAXX Stuck on .210 Running Black Widow ICS ROM (leak)

#10 mattlgroff

mattlgroff

    The Dark Knight

  • Developer
  • 2,298 posts

Posted 12 June 2012 - 10:41 PM

There is an error even if it works. lightwaver patched it and it worked.

Please do not Personal Message me for help or troubleshooting. They will be ignored. Post in threads or start one in Q&A sections.

If you feel the need to donate to me, click here.


#11 theonlycosmic

theonlycosmic

    Droid Master

  • Members
  • PipPipPip
  • 470 posts
  • LocationCalifornia

Posted 13 June 2012 - 12:04 AM

Oh I was unaware my bad.
Current Phone: Motorola Droid Razr MAXX Stuck on .210 Running Black Widow ICS ROM (leak)

#12 etrorteepe

etrorteepe

    Not a Belieber

  • Members
  • PipPip
  • 221 posts
  • Current Device(s):Nexus 5

Posted 13 June 2012 - 02:44 PM

Patching a radio.img is not possible. The radio.img is extracted onto the phone and it contains the lte.img and the bp.img. Changing anything inside an older radio.img also breaks the signature... Why do you want to patch a radio.img?


I want to patch or create a radio.img so I can fastboot it to my phone. For some reason my radio won't work on .203+ and I end up having to use fastboot to flash the radio.img from .79 (.79 is the latest leak to have a full radio.img). I haven't found a way to use fastboot to properly flash bp.img and lte.img.

#13 dtrail

dtrail

    Member

  • Members
  • PipPip
  • 94 posts

Posted 17 June 2012 - 02:17 PM

how can I update an old boot.img to the newer one using the boot.img.p? Tried a lot, but I get just errors..

#14 mattlgroff

mattlgroff

    The Dark Knight

  • Developer
  • 2,298 posts

Posted 17 June 2012 - 02:19 PM

how can I update an old boot.img to the newer one using the boot.img.p? Tried a lot, but I get just errors..

If there is success there is still an error. Check your SDcard it probably made one correctly

Please do not Personal Message me for help or troubleshooting. They will be ignored. Post in threads or start one in Q&A sections.

If you feel the need to donate to me, click here.


#15 dtrail

dtrail

    Member

  • Members
  • PipPip
  • 94 posts

Posted 17 June 2012 - 02:22 PM

nope, nothing there... Does I have to put in the sha-1sums backwards or anything like that ([C] [B] [A])?

#16 mattlgroff

mattlgroff

    The Dark Knight

  • Developer
  • 2,298 posts

Posted 17 June 2012 - 02:24 PM

No...just follow the right order. A B C are not in order in the updater-script and make sure all the syntax is right. What boot.img.p are you trying?

Please do not Personal Message me for help or troubleshooting. They will be ignored. Post in threads or start one in Q&A sections.

If you feel the need to donate to me, click here.


#17 dtrail

dtrail

    Member

  • Members
  • PipPip
  • 94 posts

Posted 17 June 2012 - 02:26 PM

I want to update the kernel from 651.167.21.T-Mobile.en.EU to the 180.33 ICS kernel. I am using the boot.img.p from the OTA update to 180.33.

The error message:

boot308.img is already target; no patch needed

Now another error:

1|root@umts_spyder:/sdcard-ext/boot # applypatch boot26.img boot404.img cbdeed4a
84ee7b771806009800df27607874608b 8388608 911ff5bf49858c4ca5f72d2c03093d2327fbda1
4:boot.img.p
0df27607874608b 8388608 911ff5bf49858c4ca5f72d2c03093d2327fbda14:boot.img.p <

applying patch to boot26.img
failed to stat "boot404.img": No such file or directory
failed to statfs boot404.img: No such file or directory
target 8388608 bytes; free space -1 bytes; retry 1; enough 1
root@umts_spyder:/sdcard-ext/boot #


Tried it with several names, but nothing works...

#18 dtrail

dtrail

    Member

  • Members
  • PipPip
  • 94 posts

Posted 17 June 2012 - 02:57 PM

No idea?

#19 dtrail

dtrail

    Member

  • Members
  • PipPip
  • 94 posts

Posted 18 June 2012 - 02:56 PM

Ok it worked. The funny thing is that yesterday it didn't show me the file.. but today I found it when I plugged on my device to USB.

Many thanks, matt.

#20 Zeklandia

Zeklandia

    Developer

  • Members
  • PipPip
  • 75 posts
  • Twitter:@Zeklandia
  • Google+:+Asher Wood
  • LocationThe Internet
  • Current Device(s):Droid RAZR

Posted 18 June 2012 - 05:31 PM

There is an error even if it works. lightwaver patched it and it worked.


:P

Sent from my Battle Droid

Attached Files


Asher Wood
Linux, Android, Java, C/C++ Developer.
Google+ | Github





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users