What's the purpose of flashing boot.img? - myTouch 3G, Magic Android Development

Hey,
Sorry for the noob question - but I wasn't able to find anything on this. Everyone seems to take this as it is, but I simply want to know why boot.img is flashed in order to get root and how it affects the phone.
I followed this tutorial to get my Rogers Magic rooted.
What did the boot.img do in this case and can I use Amon_RA's RAv1.1.2 ION Recovery or do I need to flash another boot image in order to use a different recovery.img.
Basically, I just want to know why I do the steps that I do.

vladkor said:
Hey,
Sorry for the noob question - but I wasn't able to find anything on this. Everyone seems to take this as it is, but I simply want to know why boot.img is flashed in order to get root and how it affects the phone.
I followed this tutorial to get my Rogers Magic rooted.
What did the boot.img do in this case and can I use Amon_RA's RAv1.1.2 ION Recovery or do I need to flash another boot image in order to use a different recovery.img.
Basically, I just want to know why I do the steps that I do.
Click to expand...
Click to collapse
boot.img contains
the actual linux kernel for the phone
small ramdrive to start the system
system.img contains
android os, libraries,system settings and applications
userdata.img contains apps, and user settings
br

jerpelea said:
boot.img contains
the actual linux kernel for the phone
small ramdrive to start the system
system.img contains
android os, libraries,system settings and applications
userdata.img contains apps, and user settings
br
Click to expand...
Click to collapse
Thanks for the reply! I'm still lost though on the whole 'fastboot flash boot boot.img' part.
Is there a specific/best/newest boot.img that I should be using with the Rogers Magic? Are there different ones out there or is it just one standard one?

Related

How to gain root access to google ion rom?

I'm have the original ION phone with Ion Rom...
But from what i search from wiki to forum's here, mostly I see is reflashing the whole rom to get root access..
is it possible to get the root access on the rom I have now rather than reflashing it?
This is what I have right now in my phone:
HBoot-1.33.3004 (SAPP30000)
CPLD-10
RADIO-2.22.19.261
Yes this is possible.
1. Download a rooted recovery image (recovery.img) with nandroid support.
2. Switch your ion to fastboot mode.
3. Execute "Fastboot boot recovery.img" (this will not flash the recovery to your Ion, it will just load it).
4. perform a nandroid backup.
5. unpack the boot.img you find in the nandroid directory on your sdcard.
6. change the ro.secure property and repack the boot.img.
7. flash the rooted boot.img image to your ion.
So the instruction mention is the same as the one posted on wiki?
http://android-dls.com/wiki/index.php?title=Magic_Rooting
Many thanks!
Mike
Amon_RA said:
Yes this is possible.
1. Download a rooted recovery image (recovery.img) with nandroid support.
2. Switch your ion to fastboot mode.
3. Execute "Fastboot boot recovery.img" (this will not flash the recovery to your Ion, it will just load it).
4. perform a nandroid backup.
5. unpack the boot.img you find in the nandroid directory on your sdcard.
6. change the ro.secure property and repack the boot.img.
7. flash the rooted boot.img image to your ion.
Click to expand...
Click to collapse
No, it's not the same, with the instructions on the wiki your are overwriting your ROM with a different one... so you basically undo the ion rom.
Im very new to this, do you mind bring me throught the how process?
I have just went ahead to try that process..(as i thought its just bascially rooting the magic with the recovery rom and ended up on a boot loop)
Amon_RA said:
No, it's not the same, with the instructions on the wiki your are overwriting your ROM with a different one... so you basically undo the ion rom.
Click to expand...
Click to collapse
5. unpack the boot.img you find in the nandroid directory on your sdcard.
Click to expand...
Click to collapse
How do you do that?
ultraMX said:
How do you do that?
Click to expand...
Click to collapse
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
Thank you Amon_RA!
Hello,
Just got a google ion. Originally followed the instructions in the link above about rooting an htc magic... which allowed me to put haykuro's rootme on. Everything works fine now, I have root (I was able to add new fonts as su). However I do not have a superuser app--- and I am a bit confused about who I receive updates from now. I have read that jf1.5 does not work on this phone.
I did not need to unpack any .img files.
I have a recovery where I can flash new update.zip files, do nandroid backups, etc.
Can anyone fill me in on where I can get a superuser app, who should I receive updated update.zip fles from, etc?
The ion rom that is floating around installs but wifi doesn't work, so I'm back at rootme.zip.
Amon_RA said:
No, it's not the same, with the instructions on the wiki your are overwriting your ROM with a different one... so you basically undo the ion rom.
Click to expand...
Click to collapse
no you don't
I followed the wiki and had ROOT and Hard SPL but the rom was unchanged
When you had root, were you able to install the superuser app or a rom with it?
yochaigal said:
When you had root, were you able to install the superuser app or a rom with it?
Click to expand...
Click to collapse
haven't tried yet
root works fine when plugged into a PC
I have the original Ion as well. The way I rooted my phone was by followed an excellent written tutorial http://www.youtube.com/watch?v=2w_Iyv7wctA (in the upper right hand corner click more details. Then after step step 17 or so continue from the guide on http://android-dls.com/wiki/index.php?title=Magic_Rooting
Great for noobs like me, wouldn'nt have known the commands to put into prompt up to that point and from other guides was not clear if I was supposed to input from phone terminal or prompt on PC but the combination of these two guides helped me get my phone rooted and now I have been trying out the french ROMS 1.8/1.9 and Nok2's V4 full, which is great.
Amon_RA said:
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
Click to expand...
Click to collapse
Could anyone complete this process succesfully? Can post step by step instructions? the webpage has a lot of information and can be a little confusing...
image - ination
Amon_RA said:
1. Download a rooted recovery image (recovery.img) with nandroid support.
Click to expand...
Click to collapse
Where could I get an image as mentioned here?
Second question: Once rooted, will my phone auto-update the system anymore?
thanks for all the thoughtful answers,
m0j0
mojotexas said:
Where could I get an image as mentioned here?
Click to expand...
Click to collapse
Look at the threads in this same forum...
hankit said:
Im very new to this, do you mind bring me throught the how process?
I have just went ahead to try that process..(as i thought its just bascially rooting the magic with the recovery rom and ended up on a boot loop)
Click to expand...
Click to collapse
I had the same problem and had to restore from nandroid backup... did you solve this issue?
mojotexas said:
Where could I get an image as mentioned here?
Second question: Once rooted, will my phone auto-update the system anymore?
thanks for all the thoughtful answers,
m0j0
Click to expand...
Click to collapse
Mojo, if the root process is done by unpacking and repacking the boot.img you won't alter the original rom so all the features will be untouched.
I've complete the root process on my original ION, if you need any help... post in this threath...
The manual total-geek method on N1?
Yes, I am aware of superboot. downloaded it. Looked at it, and noticed it was an image.
I am one of the weird ones that would rather do this process with the least disruption of the stock bits as possible, or at least know exactly what this image modifies. And while I could be totally blind, I didn't see this listed in my Googling.
I tried the procedure for the ION in this thread and it appears that the Nexus One does something different (maybe an extra checksum check??). Note: I also do have an ION and this procedure worked - so it appears that the procedure is known.
Any further information either about how to modify the appropriate images manually or a description of what the superboot image actually plays with?
Thanks!
I too have a ION and if 2.1 doesn't hit soon I want to root. I am confused. Can someone just post the instructions in order with out having to got a billion links to get the next step.

[GUIDE][NOOB PROOF]How to Flash Custom Roms with S-ON

Hello everyone! in this guide i'll show you how to flash custom roms which requires s-off when your device is not.
For example for the people who have unlocked the sensation through HTCdev.com, don't have s-off and want to flash custom roms :good:
ok so you will need at least:
Unlocked Bootloader
Rooted Device
PC with Android SDK Installed (ADB, Fastboot)
Custom Rom (to be installed)
Ok you if you have these things you're half way to flash a custom rom, Now what s-off devices can do is to flash the rom's boot.img
So this is really simple, we need to flash ourselves the boot.img, which our s-on devices can't do by itself
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Step 1.
First you need to extract the rom.zip and inside of it you'll find a folder named Kernel (most of the rom's boot.img are in that folder, if it is not there find it out in the other folders)
Step 2.
Now that you have your boot.img you need to copy that file into your Android-sdk/tools folder
Step 3.
Next we need to flash that file onto our Sensation so reboot your device in fastboot mode, open the cmd and type:
Code:
fastboot flash boot boot.img
at this point the cmd will proceed to flash the boot.img file and when it's done type:
Code:
fastboot reboot recovery
Step 4.
Ok, now that we have flashed the most important file we need simply to flash the rom through recovery
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Reboot and it's done you have flashed the rom correctly :good::victory:
NOTE: YOU NEED TO FLASH THE BOOT.IMG FILE EVERY TIME YOU WANT TO FLASH A CUSTOM ROM, IF YOU DON'T YOUR DEVICE WON'T BOOT
sorry to butt in but ..this was already covered here
ganeshp said:
sorry to butt in but ..this was already covered here
Click to expand...
Click to collapse
yep, i've seen that after doing this, however this is an easier method and it is different....
matt95 said:
yep, i've seen that after doing this, however this is an easier method and it is different....
Click to expand...
Click to collapse
Thanks for the effort but as ganeshp already pointed out this has been covered in great detail already in the guide he linked. Also I do not see how this is easier, for one this method is covered in the guide, and two how can it be easier than enabling smart flash in 4EXT Recovery. When you do this you do not even have to connect your device to a computer via USB to flash the boot.img, it is all done on the device itself. No extracting the boot.img, which is not in a folder named kernel normally, only with Aroma do you have that. As I said thanks for your effort, your heart is in the right place, but this was just not needed.
T-Macgnolia said:
Thanks for the effort but as ganeshp already pointed out this has been covered in great detail already in the guide he linked. Also I do not see how this is easier, for one this method is covered in the guide, and two how can it be easier than enabling smart flash in 4EXT Recovery. When you do this you do not even have to connect your device to a computer via USB to flash the boot.img, it is all done on the device itself. No extracting the boot.img, which is not in a folder named kernel normally, only with Aroma do you have that. As I said thanks for your effort, your heart is in the right place, but this was just not needed.
Click to expand...
Click to collapse
yeah, maybe it is not easier than the other method but i did it cause my friend wasn't able to star the 4ext application and he couldn't flash the recovery properly, even in fastboot. So i decided to make this guide to help people who have such problems, more guides/different methods = more possibility to have success

[Q] Exctracting boot partition on LB?

Hi, can someone help me with extracting boot ramdisk from boot partition?
I am on Z3 .690 LB and need to modify init.rc and other files. I can without problems extract the boot partition using dd from /dev/block/mmcblk0p14
however the resulting image fails any extraction tries with abootimg or unmkbootimg, reporting that it is not valid Android boot image...
Is it in any way possible to get the ramdisk from boot partition (and best put it modified back)?
Thanks..
I am not an expert in that, but for clarity you need to know that even you decompile and recompile a boot.img and make NO changes you are unable to flash it back on a Locked Bootloader.
gregbradley said:
I am not an expert in that, but for clarity you need to know that even you decompile and recompile a boot.img and make NO changes you are unable to flash it back on a Locked Bootloader.
Click to expand...
Click to collapse
Thanks. At the end I used ability of Xzdr to invoke init scripts...
Sent from my D6603 using XDA Free mobile app
gregbradley said:
I am not an expert in that, but for clarity you need to know that even you decompile and recompile a boot.img and make NO changes you are unable to flash it back on a Locked Bootloader.
Click to expand...
Click to collapse
Hm, just from pure curiosity, I copied boot partition (dd) into file and then wrote it (dd) back unchanged. dd seemed to work, and phone booted normally after reboot. I have locked bootloader....
Did you actually decompile the boot.img? Or just pull it from the rom and push it back?
Its the act of compiling the ROM that needs Sony's keys in order to ensure it boot on a locked bootloader
gregbradley said:
Did you actually decompile the boot.img? Or just pull it from the rom and push it back?
Its the act of compiling the ROM that needs Sony's keys in order to ensure it boot on a locked bootloader
Click to expand...
Click to collapse
Cool, finally I got the answer I was looking for. It is not easy to get the right answers regarding locked bootloaders. It confirms what I was a bit feared, that boot.img is compiled with such keys so without it you can not actually do anything on locked bootloader. And I guess there is no way to get the corresponding key in order to tamper with boot.img in any way. Of course it would lead to people being able to flash what they want on LB.
Ok, so I will have to think and count benefits vs. annoyances if it pays me off to unlock... Thank you.

Is it possible to back up all thats modified by flashing full recovery? device tree?

Ok, I am very interested to know if this is possible.
Is it possible to take a working device and back up every thing that would be overwritten by flashing a PRE NVIDIA 3.1.1 Android 5.1.1 Full Recovery?
Those earlier Full Recoveries flash the following (as a reminder):
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot flash staging blob
fastboot flash dtb tegra124-tn8-p1761-1270-a04-e-battery.dtb
I know TWRP can back up boot, system, and userdata.
Are there any ways to back up the rest?
I'm most interested in the one no longer included in NVIDIA ROMs (dtb). Is it possible to pull that from a running system in some way that could then be flashed to another system?
Still hoping someone has some thoughts or instructional help here as I am not quite familiar with the OS and partitions enough to know how to do this without some insight from you folks with brains much heavier than mine. Thanks.
zarish said:
Still hoping someone has some thoughts or instructional help here as I am not quite familiar with the OS and partitions enough to know how to do this without some insight from you folks with brains much heavier than mine. Thanks.
Click to expand...
Click to collapse
You might want to look into flashfire from chainfire. I can't remember for sure but I *THINK* it might let you do a true full backup
Sent from my SM-G386T1 using Tapatalk

Moto G7 river xt1962-1 firmware 29.114-16-5

Moto G7 river xt1962-1 firmware 29.114-16-5
firmware_moto-g7_river_xt1962-1_29.114-16-5_copyparts
will be needed for custom roms
firmware_moto-g7_river_xt1962-1_29.114-16-5_full
is all partitions, not required for custom roms, just for curious developers
windows users will need to make their own .bat files I don't use windows
two things:
1. working on twrp for river
2. working on lineageos 16 for river based on payton... errors with some vendor files
actually errors all over
please help I have two newborns and only get a few minutes to myself each night
good luck on building lineage, the g6 never had any development so i dont anticipate the g7 will get much either. if i was you id concentrate on twrp so we can at least flash gsi based roms.
Is this the original factory signed rom? (I.e. is it possible to fully flash and relock bootloader?)
Also wondering if anyone has the latest full rom (29.114-16-7).
Thanks in advance!
ptn107 said:
Moto G7 river xt1962-1 firmware 29.114-16-5
firmware_moto-g7_river_xt1962-1_29.114-16-5_copyparts
will be needed for custom roms
firmware_moto-g7_river_xt1962-1_29.114-16-5_full
is all partitions, not required for custom roms, just for curious developers
windows users will need to make their own .bat files I don't use windows
two things:
1. working on twrp for river
2. working on lineageos 16 for river based on payton... errors with some vendor files
actually errors all over
please help I have two newborns and only get a few minutes to myself each night
Click to expand...
Click to collapse
Confirmed that at least boot.img is correctly signed. You rock ptn107!! However I did confirm (from the version number displayed in recovery) that this is 29.114.16 and not 29.114.16-5.
How were you able to extract the partitions? Specifically boot.img. If I can learn that, then it would be easy to unroot, take OTA updates, copy and save boot.img, and patch with Magisk. Thanks in advance!!!
smokinu said:
Confirmed that at least boot.img is correctly signed. You rock ptn107!! However I did confirm (from the version number displayed in recovery) that this is 29.114.16 and not 29.114.16-5.
How were you able to extract the partitions? Specifically boot.img. If I can learn that, then it would be easy to unroot, take OTA updates, copy and save boot.img, and patch with Magisk. Thanks in advance!!!
Click to expand...
Click to collapse
The boot image version does not change with every little update. For every version of 29.114.16-* released it will be the same boot.img. 29.114.16-7 is getting around and most likely uses the exact same boot.img as ours.
As for extracting the .img files I use a linux shell script I wrote here. Makes doing this quick with each new firmware image.
It needs to be placed in /sdcard on your device (root is required to work):
Code:
adb push mkimg.sh /sdcard/
adb shell
cd /sdcard/
su -c sh ./mkimg.sh
I do this in Linux. Not much of a Windows user anymore.
Output files go into /sdcard/firmware-images but you can change that with the 'outfolder' variable if you wish.
Long story short it takes the list of partitions from /dev/block/bootdevice/by-name/ and uses 'dd' to create the .img.
If you are looking to just get a boot.img from our device and nothing else the command would be as follows (needs root):
Code:
su dd if=/dev/block/mmcblk0p41 of=/sdcard/boot.img > /dev/null 2>&1
ptn107,
Thanks for the write-up. I'm familiar with a similar approach using TWRP (booted, but not installed) and dd copying the individual partitions. I will give your script a try. Should save a lot of time!
Is there a way to copy partitions without root? My biggest concern is taking on an OTA update (currently 16-7), without having the original signed images to revert back to stock and relock the bootloader. Motorola has historically been bad at providing factory roms. If there is a clever way to unroot, take an OTA, save original, and re-root....I'd be a happy camper!
/dev is user root and group root so root is necessary.
Is there a clever way to take an OTA update and get a copy of the new boot.img? From what i understand, you have to unroot to take an OTA update.
BTW...good luck with the newborns!! Mine is now 3 and is still as much of a handful as when he was a newborn.
ptn107 said:
The boot image version does not change with every little update. For every version of 29.114.16-* released it will be the same boot.img. 29.114.16-7 is getting around and most likely uses the exact same boot.img as ours.
As for extracting the .img files I use a linux shell script I wrote here. Makes doing this quick with each new firmware image.
It needs to be placed in /sdcard on your device (root is required to work):
Code:
adb push mkimg.sh /sdcard/
adb shell
cd /sdcard/
su -c sh ./mkimg.sh
I do this in Linux. Not much of a Windows user anymore.
Output files go into /sdcard/firmware-images but you can change that with the 'outfolder' variable if you wish.
Long story short it takes the list of partitions from /dev/block/bootdevice/by-name/ and uses 'dd' to create the .img.
If you are looking to just get a boot.img from our device and nothing else the command would be as follows (needs root):
Code:
su dd if=/dev/block/mmcblk0p41 of=/sdcard/boot.img > /dev/null 2>&1
Click to expand...
Click to collapse
Boot img sometimes changes, you never know. I bricked a g6 by flashing a boot img that the last number in the version was 2 instead of 4. Flashed, and got stuck in a bootloop. Had to completely reflash stock firmware, then took an OTA that bricked it.
clcombs262 said:
Boot img sometimes changes, you never know. I bricked a g6 by flashing a boot img that the last number in the version was 2 instead of 4. Flashed, and got stuck in a bootloop. Had to completely reflash stock firmware, then took an OTA that bricked it.
Click to expand...
Click to collapse
I did confirm that the boot.img between 16 and 16-5 is different. The recovery mode displays the correct version for each of the boot.imgs, and MD5 checksums are different, although same file size.
That being said, flashing a 16 boot.img on a 16-5 device will mearly result in bootloop until the correct version is flashed. People should keep track of which slot they loaded the boot.img into (A/B).
smokinu said:
I did confirm that the boot.img between 16 and 16-5 is different. The recovery mode displays the correct version for each of the boot.imgs, and MD5 checksums are different, although same file size.
That being said, flashing a 16 boot.img on a 16-5 device will mearly result in bootloop until the correct version is flashed. People should keep track of which slot they loaded the boot.img into (A/B).
Click to expand...
Click to collapse
Code:
fastboot oem lock
doesn't work with PPO29.114-16-5
says boot.img is not signed
update: same for PPO29.114-16 and PPO29.80-61
ptn107 said:
Code:
fastboot oem lock
doesn't work with PPO29.114-16-5
says boot.img is not signed
update: same for PPO29.114-16 and PPO29.80-61
Click to expand...
Click to collapse
I saw the same thing on my end at first. Found this to work repeatedly....
fastboot oem lock (enter this a few times until i says something to the effect of...."you still need to flash a signed boot.img")
fastboot flash boot boot.img (this will now flash fine without saying the image is not signed)
fastboot oem lock (if you prefer to re-lock. You'll need the unlock key again if you plan to unlock).
smokinu said:
I saw the same thing on my end at first. Found this to work repeatedly....
fastboot oem lock (enter this a few times until i says something to the effect of...."you still need to flash a signed boot.img")
fastboot flash boot boot.img (this will now flash fine without saying the image is not signed)
fastboot oem lock (if you prefer to re-lock. You'll need the unlock key again if you plan to unlock).
Click to expand...
Click to collapse
Wow. That actually worked. I had to do both commands like 6 times one after the other but it worked.
Thank you!
No problem! Glad I could help. Found that one by accident.
smokinu said:
No problem! Glad I could help. Found that one by accident.
Click to expand...
Click to collapse
I would have never found that out.
fastboot without root
I have been foolish and used twrp to wipe my G7. I am trying to use twrp to flash or fastboot update provided in this thread but neither approach works.
error is invalid zip file.
I was running -7 not -5
as in my title, there is no root. and because of my stupidity, no OS either! I am happy to give any details
Any help would be amazing. Thanks in advance!
Mr_navillus said:
I have been foolish and used twrp to wipe my G7. I am trying to use twrp to flash or fastboot update provided in this thread but neither approach works.
error is invalid zip file.
I was running -7 not -5
as in my title, there is no root. and because of my stupidity, no OS either! I am happy to give any details
Any help would be amazing. Thanks in advance!
Click to expand...
Click to collapse
The zip file itself cannot be flashed as it's not in proper update format. You'll have to extract and flash the contents via fastboot. To get to fastboot, power off the device then hold power and volume down until you see the bootloader screen, and then connect it via USB to a pc
Follow the instructions here to get back to stock
Mr_navillus said:
I have been foolish and used twrp to wipe my G7. I am trying to use twrp to flash or fastboot update provided in this thread but neither approach works.
error is invalid zip file.
I was running -7 not -5
as in my title, there is no root. and because of my stupidity, no OS either! I am happy to give any details
Any help would be amazing. Thanks in advance!
Click to expand...
Click to collapse
Sounds like you wiped the system partition then tried to flash the unflashable zip file (hence, no system)
First, always make backups.
Second, you can still get into fastboot and manually update/restore
You can also use the moto software to recover the device.
Get it into fastboot, start from there. It is 100% an easy recovery process
warBeard_actual said:
You can also use the moto software to recover the device.
Click to expand...
Click to collapse
This fixed it in a jiffy. Making backups from now on!
Question to the experts:
Unlocking the bootloader and rooting a phone is stressful times for those of us who (like me) only do this once every few years when we buy a new phone. On some phones, after attempts at routing, I've been stuck for days without a phone till some distant helpful person helped me back to a working rooted phone. Other times it was very simple. But the experience leaves you scared.
Yes I know it's my own (and similar other uneducated) fault because we did something wrong that would be obvious to any expert. But it happens to the rest of us no matter how many threads we read.
So my question is, if the phone becomes non functional following erroneous commands or files (my own unintentional error), will this same 'moto recovery' restore things?
Where do I find out more 'how' to use this Moto software and where this 'Moto software recovery' is to be found?
Thank you.
Edit
Just to clarify things, this is my first Moto phone which is why I don't know what the Moto software recovery is. Is it what you get by pressing Power-volume down?

Categories

Resources