Dual boot - want to boot full Android OS from recovery partition - General Questions and Answers

Hello XDA learnt members, Is it possible to boot a secondary ROM from recovery partition? I am trying to flash a full ROM image in recovery partition (Ofcourse I resized my recovery partition to fit the ROM first) but it doesn't boot. The idea is to access secondary ROM via key combination (power+volume up) used for recovery. Instead of running recovery image such as TWRP etc I want full Android OS to load. Here is what I have already done and need help and insights from you guys.
1. Repartition the mmc of phone with increased recovery partition size - I have almost 5GB now for recovery partition (I am using Redmi 5)
2. Flash stock ROM normally to /system partition and TWRP to recovery partition
3. Everything works at this stage. TWRP boots up on pressing power+volume up, stock ROM boots up normally too
What I am trying to do is:
Flash stock ROM system into recovery partition - hoping volume up + power key will boot my secondary OS
This doesn't work. While I understand that recovery is just another OS with its own minimal kernel and tools and so bootloader should not have any problem if I flash system into recovery.
I am new to Android internals and still learning. Any help will be great.
Thanks

Related

Simple question about Booting

1. Will I be able to boot into recovery after wiping /boot ?
2. Will I be able to boot into fastboot mode wfter wiping /boot ?
3. If I flash a incompatable rom that contains the incompatable boot.img will I be able to boot into recovery ?
I'm not trying to do any of these, just wondering.
janekmuric said:
1. Will I be able to boot into recovery after wiping /boot ?
2. Will I be able to boot into fastboot mode wfter wiping /boot ?
3. If I flash a incompatable rom that contains the incompatable boot.img will I be able to boot into recovery ?
I'm not trying to do any of these, just wondering.
Click to expand...
Click to collapse
In most cases: Yes, yes and yes.
To be more precise:
1. "boot" partition stores the "kernel" which is needed to boot up android itself. ***
2. "fastboot" or for Samsung devices "download" mode is implemented into the "bootloader" and will mostly not be affected by changing / deleting the kernel.
3. Most devices have seperate partitions for kernel ("boot") and recovery ("recovery") and in that case channging / corrupting the kernel will not affect your (custom) recovery. BUT on some devices e.g. my Samsung Galaxy Ace II (GT-I8160) kernel + recovery are both stored on the "boot" partition, which means there is no dedicated partition for the recovery and if I delete or install a incompatible kernel, I'm not able to enter the recovery anymore.
I have boot and recovery partitions seperated. Also isn't the kernel required so the software (in this case the recovery) would be able to "comunicate" with hardware (screen, buttons, etc.)?

Install TWRP using stock ColorOS recovery?

Hi there, a friend of mine soft-bricked her oppo F1 plus (x9009). Now it's stuck at recovery mode. I tried to flash the latest stock firmware (X9009EX_11_OTA_022_all_201609101758) but the phone does not seem to boot into system. So the questions are: how do I un-brick the phone (or simply bypass recovery mode and boot into system)? Could (or should) I try flashing custom recovery (TWRP for example) using ColorOS recovery?
Actually all I need to do is recover the data stored in internal storage of the phone. I came up with two ideas:
1. Flash stock firmware WITHOUT wiping data & cache. This option does not seem to work since the phone is still stuck at recovery mode.
2. I'll flash TWRP since I could access internal storage from TWRP. I'm a bit worried about this resort since if anything goes wrong, the phone will be hard-bricked since booting into fastboot mode to flash zip appears to be impossible as Oppo locks bootloader

XT1039 booting to recovery

After flashing TWRP 3.1.0.0 from USB-OTG to my XT1039 the phone boots to TWRP and not into system.
The "funny" thing is that if i keep my USB-OTG stick connected after hitting reboot the system boots. It gets even funnier. If i disconnect the stick the phones goes blank (or powers off) immediately. I checked the stick, there are no partitions, besides the storage partition i created.
Does anyone have an idea what i did wrong to achieve this strange behaviour?
EDIT:
Looks like i flashed recovery.img to boot partition. After manually chosing to install boot.img to recovery partition the system boots, but setup assistant crashes. Seems i'm going to have a long night...
Looks like a complete reinstall is necessary, and if you have to use a flashable ZIP instead of just the recovery image to install the recovery, then do that. In the meantime, try installing the boot.img and recovery.img to the correct partitions.
Got it to work, but only after flashing boot.img to recovery partition and wipe all partitions. When i flash to boot.img, reboot takes me to recovery. When i flash to recovery, system boots, but to get to recovery again i have to flash recovery.img to boot via adb.
All in all very strange and i have no idea what i can do in order to make boot and recovery work side by side.

[Recovery Release] Working TWRP for Sony L1 (G3311 Single SIM others to be confirmed)

Requirements:
1. Bootloader Must Be Unlocked.
2. Have a backup of your working Magisk Patched boot.img saved to your External SDcard.​A little INFO:
The Sony L1 recovery seems to be disabled by SONY for some unknown and Probably stupid reason.
I have tried all ways to get the TWRP and Stock recovery to boot up from the fotakernel partition (recovery) but TWRP and even the stock recovery refuse to boot.
Anyway to cut a very long story short I am releasing this TWRP which is 95% functional and needs to be flashed to the boot partition
Working Method/flow:
Make sure you have a Back up of your working Boot.img "You know the one you used to root the device in the first place".
For ease of use You can use this app by XDA dev @wanam (Thread here) app on playstore Here You can also use this app to flash the v5-twrp-l1.img to your "boot" partition or you can go old skool and use dd (Via adb shell) or use the Magisk patched_boot.img you first rooted with..
Make SURE to Copy this working boot.img to your External SDcard.
When you require TWRP flash the downloaded TWRP to your boot partition using Fastboot (cmd's below) or the above app then reboot
You will now boot to TWRP.
Do what you need to do in TWRP.
IMPORTANT:
Remember Just before you leave TWRP go to INSTALL choose your external SDCard choose "image" from the install screen find your boot.img and select "boot" with the little radio button.
Once flashed choose reboot system.
Now when you boot you will be back to normal :good:
Things Not Working:
1. You will not be able to mount encrypted data therefore you would need to FORMAT your data and then leave it unencrypted.
SuperSU and Magisk will disable forceencrypt for you.
2. Does not Charge or show battery % so I don't know if it's actually charging. (Probably Qnovo battery module used by sony)
It will probably work on all variants but I am not able to test that.
It's use is for backups and restores wipes and installs for which it seems fully functional. :good:
Install Instructios.
Boot to the bootloader then
Code:
fastboot flash boot v5-twrp-l1.img
Then
Code:
fastboot reboot
Download HERE v5-twrp-l1.img
Hi @bigrammy!! I have it booting ok, obviously encryption is not working! I was able to do a backup but couldn't boot back into system, just keeps going back to twrp! I had to flashi the patched 3313 boot image from another post to get back into system! Good work though! Tested on g3311
Chronic2k13 said:
Hi @bigrammy!! I have it booting ok, obviously encryption is not working! I was able to do a backup but couldn't boot back into system, just keeps going back to twrp! I had to flashi the patched 3313 boot image from another post to get back into system! Good work though! Tested on g3311
Click to expand...
Click to collapse
:laugh:
Ok maybe I should update the OP as it seems it's not really clear enough that obviously the boot is replaced by the recovery.
Method would be make sure you have a Back up your working Boot.img You know the one you used to root the device in the first place.
You can also use dd (Via adb shell) or a app from the playstore or better still use the Magisk patched_boot.img .
Copy this working boot.img to your External SDcard.
When required flash the recovery to your boot partition using Fastboot then reboot
You will now boot to TWRP.
Do what you need to do in TWRP.
Then just before you leave TWRP go to INSTALL choose your external SDCard choose "image" from the install screen find your boot.img and select "boot" with the little radio button.
Once flashed choose reboot system.
Now when you boot you will be back to normal :good:
OP Updated let me know if it's clearer to understand now.
Thanks for reporting back. :good:
I'll give it a go! Many thanks! Just one question though. How do I enter recovery mode from then on? Is it still power down, power and volume down yeah?
Chronic2k13 said:
I'll give it a go! Many thanks! Just one question though. How do I enter recovery mode from then on? Is it still power down, power and volume down yeah?
Click to expand...
Click to collapse
I don't think you have really read or understood the OP
You are only ever flashing the "boot partition".
When you need to use TWRP you flash the TWRP.img to the boot partition and when your done you flash back your boot.img again to the boot partition as in the OP.
BTW Have you ever been able to enter the STOCK recovery using Power and Volume Down or using any commands
My phone could not enter the STOCK recovery at all let alone a custom one and since no one ever replied to my question about this I assumed this was the case for everyone as many sony devices from 7.0 had the recovery disabled?
I'm unable to get into stock recovery too!
So,
If we don't have a Recovery partition maybe we can
Create one...
Tutorial in here
https://iwf1.com/how-to-re-partitio...-all-options-included-change-size-fs-type-etc
I'll try it if i have time.
I tested twrp 2 times
Worked every time.
I've tried to install superSu.zip via twrp, looked all right, rebooted the phone and now it's in bootloop for over 2 hours...
It's getting hotter... i ca't turn it off
The only thing that works is keeping Power and Volume Up pressed and it looks restarting...
What can i do to revive it safely?
alegatorul said:
I tested twrp 2 times
Worked every time.
I've tried to install superSu.zip via twrp, looked all right, rebooted the phone and now it's in bootloop for over 2 hours...
It's getting hotter... i ca't turn it off
The only thing that works is keeping Power and Volume Up pressed and it looks restarting...
What can i do to revive it safely?
Click to expand...
Click to collapse
Mate you really need to be careful unless you really know what your doing
You will likely brick the phone if you continue to blindly mess with re-partitioning and the like.
If you were in TWRP which was flashed to the boot partition as directed in the OP then flashing the supersu.zip will simply modify your TWRP.img not your boot.img since TWRP is living in the boot partition at the time you run the .zip hence your looping.
This device has bootloader issues since it will not allow the booting of another partition except "boot" recovery, fotakernel, rdimage, all tested all failed to boot the TWRP recovery and stock recovery.
There is another method used by some sony devices but this will need to be heavily modified for this MediaTek SoC and will require a lot of study and script re-writes.
Spending all this time on a device that's pretty much obsolete before it was launched since it's not planned to receive oreo and Sony 90% locked down the bootloader is kinda futile so use the phone for what it is then throw it in the bin when done in a year or two.
Mate, you are right
Hi, please make recovery for L1 G3312 i hope you can do it.
tweak8 said:
Hi, please make recovery for L1 G3312 i hope you can do it.
Click to expand...
Click to collapse
I think this one may very well work for the dual SIM also so please try it and then report back with some actual details.
eg: bootloader status, firmware version, your region, etc etc.
Thanks.
Works great on the G3113 model, thank you for developing this! Now hoping to find a custom rom to install via .zip.
This "HERE v5-twrp-l1.img" is working in my Xperia L1 G3312.
But, after installing TWRP, phone does not get into boot normally. Everytime it boots into recovery mode. I think that it needs separate twrp partition. This twrp is overwriting the main boot. If anyone can make separate partition for TWRP recovery. This problem will be solved.
Hello. I ignored all your post like a retard and basically just went to the last step to flash the image. The twrp works but it wouldn't boot into normal mode but just boot to twrp everytime so I downloaded some random boot image I saw online and installed it. Now it's just stuck in the sony logo and won't even turn off. Is there anything I can do or is it rip for good?
dumb person said:
Hello. I ignored all your post like a retard and basically just went to the last step to flash the image. The twrp works but it wouldn't boot into normal mode but just boot to twrp everytime so I downloaded some random boot image I saw online and installed it. Now it's just stuck in the sony logo and won't even turn off. Is there anything I can do or is it rip for good?
Click to expand...
Click to collapse
No it's only the boot.img Flash the boot.img in this thread https://forum.xda-developers.com/xperia-l1/how-to/root-l1-g3313-magisk-t3693350 if you can get into fastboot that is.
If not then use FlashTool to flash the stock boot.sin and system.sin only. That should get you working again.
This "HERE v5-twrp-l1.img" is working in my Xperia L1 G3312.
But, after installing TWRP, phone does not get into boot normally. Everytime it boots into recovery mode. I think that it needs separate twrp partition. This twrp is overwriting the main boot. If anyone can make separate partition for TWRP recovery. This problem will be solved.
In twrp mode, I can do everything smoothly..... but phone does not get into boot normally..... After installing stock boot again, phone boot into normally, but twrp has gone completely..... So, it is clear that boot & twrp partition overwrites each other due to no separate partition.... So, we need separate partition for boot & twrp.... then everything will be solved...
bigrammy said:
No it's only the boot.img Flash the boot.img in this thread https://forum.xda-developers.com/xperia-l1/how-to/root-l1-g3313-magisk-t3693350 if you can get into fastboot that is.
If not then use FlashTool to flash the stock boot.sin and system.sin only. That should get you working again.
Click to expand...
Click to collapse
I downloaded the boot from the link you posted and flashed it. Now it phone works again. Many thanks!!
riadjblicd said:
This "HERE v5-twrp-l1.img" is working in my Xperia L1 G3312.
But, after installing TWRP, phone does not get into boot normally. Everytime it boots into recovery mode. I think that it needs separate twrp partition. This twrp is overwriting the main boot. If anyone can make separate partition for TWRP recovery. This problem will be solved.
In twrp mode, I can do everything smoothly..... but phone does not get into boot normally..... After installing stock boot again, phone boot into normally, but twrp has gone completely..... So, it is clear that boot & twrp partition overwrites each other due to no separate partition.... So, we need separate partition for boot & twrp.... then everything will be solved...
Click to expand...
Click to collapse
Yes but Sony Disabled the recovery partition (fotakernel) by design so you can not boot from it.
The OP is clear about the need to flash the TWRP to your boot partition and the reason I also give full instruction in the workflow/method but people simply don't read anymore it seems. :crying:
TWRP can be injected into the boot.img so you can boot normally or boot TWRP using the volume keys at boot time but I can't be bothered working on this since Sony are not going to update the Android Version.
While the phone is OK I have far better phones to spend my time on at the moment.
how to backup boot.img without root? if its impossible then how do i root this phone?

Can an Android device still boot without the recovery partition?

Hello, I was wondering could an Android device still boot if I were to lets say try and flash a custom recovery and it not go so well or is something during booting of the device dependent upon the recovery being there and being functional?
Of course you can. The recovery partition can be considered as an alternative boot partition that lets you boot the device into a recovery console for performing advanced recovery and maintenance operations on it.

Categories

Resources