Where is Bootloader and Recovery stored? - Android Q&A, Help & Troubleshooting

Hello Guys I am new to the community and I'm willing to learn more about phones.
My question is where is the bootloader's code stored?It cant be stored into the /boot partition as according to this the bootloader either starts the kernel, which then starts android, or the recovery mode. Inside the /boot there is only the kernel and the RAMDISK according to this. Is it inside a chipset on the motherboard? In order to be able to be unlocked the code must be editable. It cant be stored inside the /boot because sometimes you need to delete that partition in order to install custom ROM. You dont install a different bootloader....
My second question is where is the recovery mode stored? I 'm sure it is stored inside the phone's hard drive but I couldnt find any partition with that name.
Ok. I have a thrid question now. Theoritically, are we able to flash a custom ROM without unlocking the bootloader? Probably we could but due to the bootloader we won't be able to access it. Am i right? Same rules apply for custom recovery too(correct me if I'm wrong).

@PinkNinja
It depends on both whether Android is a A/B partition slots system or not and on Android version.
BTW: The XDA-thread you cited is a 1:1 copy of an article published in 2011. Today is the year 2020. Things since Android 7 have drastically changed.

What the guy above said, on a only you have a recovery partition and a bootloader stored on boot when on a/b you have both bootloader and recovery on boot partition.
On the last question, no, you cant flash custom rom with bl locked. In order to flash custom rom you need custom recovery and you can't install/boot it without unlocking bootloader because when bootloader is locked you can only flash/boot images signed by oem, that's thw whole point of bl blocking
If you are curious about your partitions you can fastboot oem partition and there you have most info, as well as in the android websitee, it's everything explained https://source.android.com/

Related

[Q] Permanent Recovery

I'm new in the family xperia. And I have a question about recovery. I have read the SE Xperia no recovery partition. So any flash phone (system - loaded on the system in case of a locked bootloader, boot - added to the kernel) removes recovery. Does anyone wondered on adding a partition, eg by reducing the size of a partition system? I know that it is possible to modify the partitions on phones such LG (GT540).
This will result in the partition on which you can upload to a permanent recovery which enable you to flash (update.zip - system.img, boot.img) roms without the need for a computer.
What do you think?
htomasz said:
I'm new in the family xperia. And I have a question about recovery. I have read the SE Xperia no recovery partition. So any flash phone (system - loaded on the system in case of a locked bootloader, boot - added to the kernel) removes recovery. Does anyone wondered on adding a partition, eg by reducing the size of a partition system? I know that it is possible to modify the partitions on phones such LG (GT540).
This will result in the partition on which you can upload to a permanent recovery which enable you to flash (update.zip - system.img, boot.img) roms without the need for a computer.
What do you think?
Click to expand...
Click to collapse
That would be a really good idea, excellent one in fact !
Needs to be done !
PM Wicia, or FXP, or Taaivu
They'll know and answer if possible

[HELP] Write recovery image in recovery partition

Hi XDA. I'm looking for help here, because i have't found anything like i need in many researches that i made. I have a qualcomm based phone that is comercialized only in my country; it's based on ZTE parts but it is sold over a brand called Vtelca.
There's litteraly any official way to flash this phone neither than an official firmware. The only thing that one can find are custom roms that are made by local coockers, based on system dumps of functional phones. There's a port of CWM that one can install in this phone over ADB. One can be able to flash CWM when the phone is operative, but if the phone has a soft brick, one can just do anything.
Theres no fastboot in this device, so one can't flash images over there, but there is a way to connect the phone that mounts all of its partitions (litteraly all of them, including the recovery one). Only linux can obviously read all of this partitions because of the filesystems, and here is my question:
Is there a way to write an image into a partition?
My theory is that if i know which of the partitions corresponds to android recovery, i 'should' be able to write the recovery image into it. Right?
Thank you in advance, even if there's no way to do this.

Question on upgrading bootloader

Hello
I have the L22 variant, with TWRP installed and CM12.
Bootloader is unlocked.
I want to upgrade to CM13. It won't flash because I need to upgrade to a marshmallow (MM) bootloader first.
I extracted boot.img from an official MM rom using the update extractor.
Questions:
1. If I flash it, do I need to go again thru the procedure of bootlader unlook? (getting the code from the huawei site)
If so, I'd assume the code I used first will work, for some reason CM12 is now reporting different serial number. Though I saved the original values.
2. If I flash it, will CM12 boot? Or I will need to also flash system.img, which I also extracted.
3. If I flash it, will I loose TWRP? I guess no...
4. What is cust.img for? I am more a Samsung guy, not familiar with that file.
Thanks in advance.
i would restore to latest stock rom available and install from there to be safe, careful when wiping boot.img
Thank you...
Here is how I fixed, and put some answers if helpful for anyone else in the future.
1. Bootloader and Boot are different. During the startup process the bootloader calls either boot for a normal startup or call recovery.
Messing with boot won't touch the bootloader or the recovery areas.
2. I did not flash boot at the end, I used the ResurrectionMix which already comes with its own boot image. It took me to Marshmallow (MM).
In theory, this boot image will support any other MM ROM. I did not try because I ended up liking it.
3. As explained in (1). Flashing boot wont touch recovery
4. I haven't found an answer to this one. Anyway, I did not touch it.
Cheers.
boot only contains kernel and ramdisk , recovery its a separate paritition alternative to boot, at startup depending on what is pressed bootloader either calls boot partition or recovery parition or fastboot
Hello
I have honor 5x KIW-L22 & suddenly my mobile shows no service what should i do.
My sim is working in another phone and since i checked in the phone information option while using the ussd code to dispaly the details radio signal button is not showing
in the menu and when i call someone it shows radio off.
Please help me to sort out this.

Attempting to port TWRP. Need Recovery.img Partition

Hey Guys,
Since it doesnt seem like anybody else is-- im trying to port TWRP to the Duo.
Problem im running into is after extracting all the partitions i dont get a "Recovery.img" partition but i get a Boot_A and Boot_B partitions.
After extracting the Boot_A partition to check for recovery.img (or something relative) theres a recovery.fstab in there.
Does anyone know how I can get the recovery.img partition? or what I might be able to do with Boot_A/B?
none24 said:
Hey Guys,
Since it doesnt seem like anybody else is-- im trying to port TWRP to the Duo.
Problem im running into is after extracting all the partitions i dont get a "Recovery.img" partition but i get a Boot_A and Boot_B partitions.
After extracting the Boot_A partition to check for recovery.img (or something relative) theres a recovery.fstab in there.
Does anyone know how I can get the recovery.img partition? or what I might be able to do with Boot_A/B?
Click to expand...
Click to collapse
Pretty sure that modern A/B devices usually don’t come with a separate recovery partition. In my experience it’s a part of the boot image.
filfat said:
Pretty sure that modern A/B devices usually don’t come with a separate recovery partition. In my experience it’s a part of the boot image.
Click to expand...
Click to collapse
Correct.
Would u know what I could do as next steps given that I only have the a/b partition? I'm not sure where to transfer the files to. Or if there's a twrp porting guide that details A/B partitions
none24 said:
Correct.
Would u know what I could do as next steps given that I only have the a/b partition? I'm not sure where to transfer the files to. Or if there's a twrp porting guide that details A/B partitions
Click to expand...
Click to collapse
Im not 100% about this, but i think TWRP is dead as of the newer hardware specification in android, as it stands. You would have to package a boot image with the recovery programming, making it difficult to match up with existing setups. You would have to package for every kernel available, and hope your users dont pick the wrong one when they go to install, or else they will be stuck in a bootloop, with no way to force into recovery, because there is no recovery. I have been working on TWRP for the Unihertz Titan and have increasingly found information that TWRP if still active, is in its final days. I just bought a Duo, so there is a lot i dont know yet, but on the unihertz devices, there are tools to force your phone into preloader mode that all mediatek devices have, to flash your roms back to stock state. Even in a 100% not bootable state, you can save your device. Super slick. But if you nuke both your boot partitions by accident, there is effectively no way to recover to my knowledge, on the Duo. These tools are Very handy for developers. I am unaware of any tool that exists for the Duo that will do the same, not to say one can't or hasn't been written yet. But without someone with deep (im talking super deep) android experience, a Duo to spare, and the time and effort needed for the project, it might be safe to assume that most custom software will not arrive on the Duo, even with its ease of rooting and unlocking. I will be taking a close look at the kernel and everything else i can find to determine what will be possible for the Duo in the coming months.
Upon further research, there is a bootloader mode that does not seem to be based on boot/recovery partition. In powered off state, hold volume down and plug in to a computer. This will allow you to get into fastboot and flash anything you'd like.

Doubt about image kitchens

Hello everyone. As I said on earlier posts, I'm trying to port TWRP recovery for an Alcatel 1T 7 8067 Tablet (mt6580 processor, 600x1024 px resolution). I've tried the kitchen method; I've used auto TWRP porter, Carliv Image kitchen, Android image kitchen, image tool; but none of them have worked for me. Worried for these failures, I decided to make an "experiment". I tried just to unpack stock recovery, without altering it, and after, repack it, and then, reflash it to my device. I did that with carliv Image kitchen, android kitchen, and image tool, and suprisingly, none of the repacked images worked. So I thought, "If the repacked original recovery, doesn't work, ¿how could work a ported recovery?"
At this time I don't if that is a bug of these programs or a bug or lock of my device. About the last, I must say that when I flash an edited recovery (that doesn't works), system boots warning me with "red or orange state", and when I flash the stock recovery, that warning dissappears. As I understand, that warning comes from a security system on the tablet, to ensure the integrity of the files, I mean, the authenticity of the files; so I don't if when the system detects an unoriginal image, it will lock it o something like that.
I don't know... so please guide me if you know about this. Thanks in advance.
only stock recovery can work on locked bootloader. if you are using osm0sis AIK (as recommended in linked guide to your double post) you might have noticed that AVB signature. unlock bootloader first
aIecxs said:
only stock recovery can work on locked bootloader. if you are using osm0sis AIK (as recommended in linked guide to your double post) you might have noticed that AVB signature. unlock bootloader first
Click to expand...
Click to collapse
Ah ok. So you're saying that I can flash any image that I want with sp flash tool for instance (that I know if bootloader is locked I can't do that via fastboot commands without unlock bootloader first) , but if this device has its booloader locked, despite image works, it won't with locked bootloader... I'm gonna do the homework (unlock bootloader and repeat the "experiment") and I'll tell you if that worked.
Camilo Gil said:
Ah ok. So you're saying that I can flash any image that I want with sp flash tool for instance (that I know if bootloader is locked I can't do that via fastboot commands without unlock bootloader first) , but if this device has its booloader locked, despite image works, it won't with locked bootloader... I'm gonna do the homework (unlock bootloader and repeat the "experiment") and I'll tell you if that worked.
Click to expand...
Click to collapse
Ok, I did the "homework"; took me a while unlock my bootloader, because it was a little tricky, but finally I made it. So then, I did the "experiment" of unpack and repack stock recovery without any modification; then reflashed it, and tried to enter recovery, and... yes you did have reason Cheerful for this news, I decided to "cook" again, a TWRP using Mediatek TWRP Auto Porter 1.3, flashed it, booted on recovery mode and... ¡Woo hoo! it booted on TWRP version 3.2.1. And the best is, that someone told me that posibly if I could port TWRP, touch screen support won't work, ¡but it's working!
PS 1: I guess that on every tutorial about recovery porting, the publisher must warn firstly, that as previous requirement, is needed to have an unlocked bootloader, to avoid all this odissey.
PS 2: Now i'm having rooting issues with TWRP, but that's another topic.
the generic twrp I used was 3.3.1

Categories

Resources