FORUMS
Remove All Ads from XDA

[MOD] IsoRec: Isolated Recovery for the Galaxy S2 Family

2,488 posts
Thanks Meter: 4,291
 
By Lanchon, Senior Member on 12th January 2016, 04:56 AM
Post Reply Email Thread
IsoRec: Isolated Recovery for the Exynos 4210 / Galaxy S2 Family
UPDATE: This change has been merged into official CyanogenMod 11, 12.1 and 13 !!!
UPDATE: Official IsoRec TWRP 3 for i9100 is now available !!!
UPDATE: You can now use official i9100 TWRP on d710, i777 and n7000 !!!
UPDATE: Unofficial CM13 for i9100g by adxamg now supports IsoRec !!!
What is this about?

For too long the owners of Exynos 4210 family devices have been forced to use whatever recovery was chosen by their ROM or kernel provider of choice. These devices have a dedicated recovery partition that is apparently vestigial, and their bootloaders are seemingly unable to boot it. For this reason, the recovery ramdrive is typically bundled together with the kernel and the Android boot ramdisk in a monolithic binary, usually referred to as simply "the kernel" (both ramdrives share a single embedded kernel image).

This means that using your choice of recovery is a practical impossibility:
  • To change the recovery you must also replace the kernel and the Android boot ramdrive, possibly introducing issues with your ROM.
  • If you update your kernel or kernel-bundling ROM, you will loose your custom recovery if you had one.
  • If the kernel bundled with your choice of custom recovery does not boot, your Android will probably not boot either, and you will need a PC to debrick.

This already bad situation was exacerbated with CM 12.1, which includes a severely restricted recovery in official releases, to the point that some official maintainers have had to release semi-official kernels with alternate recoveries just to keep the XDA crowd from lynching them and ripping their limbs off.

What is IsoRec?

IsoRec (Isolated Recovery) is a very simple proposal aiming to solve this problem once and for all. ROM and kernel maintainers can keep on bundling their preferred default recovery, and users gain the freedom to override. Your kernel maintainer has to merge the IsoRec patch (or implement their own compatible solution) for you to be able to use an isolated recovery.

Kernel maintainers are kindly asked to respect their users' freedom by merging this simple patch. Your rate of adoption will make or break this initiative.

How does it work?

It is extremely simple. The IsoRec-patched boot sequence is as follows:
  • The bootloader loads the kernel and the unified ramdrive, then fires up the kernel.
  • The kernel starts and then invokes the unified ramdrive.
  • If booting Android, the unified ramdrive replaces itself with the nested Android boot ramdrive and invokes it.
  • Else if booting recovery, the IsoRec-patched unified ramdrive chooses the recovery ramdrive as follows:
    • if the raw recovery partition (/dev/block/mmcblk0p6) contains valid lzop-compressed data
    • and said data is a valid cpio archive
    • then use that cpio archive as the recovery ramdrive;
    • else use the default recovery ramdrive that comes nested within the unified ramdrive.
  • Finally the unified ramdrive replaces itself with the chosen recovery ramdrive and invokes it.

Where can I find the IsoRec patches?
These links are of interest only to kernel maintainers:
CyanogenMod patch: https://github.com/CyanogenMod/andro...9a3b760054a6b7
Dorimanx patch: https://github.com/Lanchon/IsoRec-Do...fc7282ee687e68

Where can I find some IsoRec-compatible kernels?
In the future, hopefully everywhere. For now you can use my CM 11/12.1/13 TRIM-IsoRec kernels:
https://www.androidfilehost.com/?w=files&flid=47607
UPDATE: Official CyanogenMod 12.1 and 13 kernels are now IsoRec-compatible !!! (link)
UPDATE: Unofficial Dorimanx builds by gsstudios are now IsoRec-compatible !!! (link)

Where can I find some IsoRec-compatible recoveries?
https://www.androidfilehost.com/?w=files&flid=47550
(The "disabler" files just clobber the contents of the isolated recovery partition so that the default recovery bundled with the kernel boots instead.)
UPDATE: Unofficial IsoRec TWRP 3 for i9100 by arnab has been released !!!
UPDATE: arnab and Dees_Troy teemed up to give us official TWRP 3 !!!
NOTE: TWRP 3 incompatibilities with CM 12.1 kernels have been fixed as of TWRP 3.0.2.0.

Note: I did not build any of the TWRP recoveries myself, I just bundled images shared by other developers. Big thank you to @arnab, @cyril279 and @dimoochka for the TWRP images! Recovery developers are welcome to reuse my flashing zips, just please remove my name from the filename AND the flashing script. Use lzo -9 compression and remember to sign your zips!


TWRP 3 for n7000, i777 and d710

You can use official i9100 TWRP on d710, i777 and n7000 with TWRP Patcher.


Installing TWRP 3 the Easy Way

There are many ways to skin a lolcat. You can easily flash a TWRP .img file (or any IsoRec recovery .img file) on the Exynos 4210 S2 family via adb from your PC. (Prerequisite: working adb connection and tools.) Try it out:
  1. Download the 'twrp-X.X.X.X-i9100.img' file.
  2. Switch to adb root by typing this in your PC:
    adb root
    (Requires root on your phone. In CM, enable adb root in developer settings.)

  3. Flash the recovery by typing this in your PC:
    adb push twrp-X.X.X-X-i9100.img /dev/block/mmcblk0p6

WARNING: DO NOT MISTYPE ANYTHING !!!
If you do, you can HARD-BRICK your phone FOREVER. Better copy/paste to be sure.
WARNING: DO NOT TRY THIS IN ANY DEVICE EXCEPT EXYNOS 4210 S2 PHONES !!!
If you do, you can HARD-BRICK your device FOREVER. The 4210 devices are: i9100, n7000, i777, d710 and sc02c.




XDA:DevDB Information
IsoRec, Tool/Utility for the Samsung Galaxy S II

Contributors
Lanchon

Version Information
Status: Stable

Created 2016-01-12
Last Updated 2016-06-22
The Following 145 Users Say Thank You to Lanchon For This Useful Post: [ View ] Gift Lanchon Ad-Free
 
 
12th January 2016, 04:56 AM |#2  
Lanchon's Avatar
OP Senior Member
Thanks Meter: 4,291
 
Donate to Me
More
Reserved
The Following 4 Users Say Thank You to Lanchon For This Useful Post: [ View ] Gift Lanchon Ad-Free
12th January 2016, 04:56 AM |#3  
Lanchon's Avatar
OP Senior Member
Thanks Meter: 4,291
 
Donate to Me
More
Reserved
The Following 4 Users Say Thank You to Lanchon For This Useful Post: [ View ] Gift Lanchon Ad-Free
12th January 2016, 05:40 AM |#4  
the.gangster's Avatar
Senior Member
Thanks Meter: 1,333
 
More
Sounds great. If this works reliable without side effects and if @Lysergic Acid merged your patch later (after it has proven that), this would make a dream come true for many here.
Thank you so much!!!
The Following 3 Users Say Thank You to the.gangster For This Useful Post: [ View ] Gift the.gangster Ad-Free
12th January 2016, 07:12 AM |#5  
Lanchon's Avatar
OP Senior Member
Thanks Meter: 4,291
 
Donate to Me
More
hi @Lysergic Acid,

i entered a change on gerrit:
http://review.cyanogenmod.org/#/c/127877/1

tests on the i777 are still pending.
http://forum.xda-developers.com/show...&postcount=149
The Following 9 Users Say Thank You to Lanchon For This Useful Post: [ View ] Gift Lanchon Ad-Free
12th January 2016, 11:19 AM |#6  
Acid0057's Avatar
Senior Member
Flag Hanover, Ontario
Thanks Meter: 345
 
More
@Lanchon you are awesome. What a cool idea to fix a Samsung problem of putting the recovery and kernel together.

Sent from my Nexus 6P using Tapatalk
The Following 3 Users Say Thank You to Acid0057 For This Useful Post: [ View ] Gift Acid0057 Ad-Free
12th January 2016, 11:34 AM |#7  
Senior Member
Flag Stuttgart
Thanks Meter: 176
 
More
@Lanchon is there a possibility of some compatibility check? I mean, what happens, if the isolated recovery somehow does not match the kernel, e.g. I (hypothetically) start with CM12.1 plus isolated recovery and want to switch to CM13 with corresponding feature, but the kernels have to differ in some way so that the isolated recovery still in the partition fails. Can the isolated recovery be invalidated somehow?
Could this be done with Odin?
The Following User Says Thank You to Klaerchen For This Useful Post: [ View ] Gift Klaerchen Ad-Free
12th January 2016, 02:38 PM |#8  
Member
Thanks Meter: 4
 
More
Have found a hilarious bug, don't worry, don't need support but if someone else can confirm, that would be fun.
Xposed 79, if Gravitybox is enabled (its settings don't matter.), and the screen is off, receiving a Skype message, reboots the phone. Completely reproducible here. LOL
12th January 2016, 03:05 PM |#9  
Lanchon's Avatar
OP Senior Member
Thanks Meter: 4,291
 
Donate to Me
More
Quote:
Originally Posted by Klaerchen

@Lanchon is there a possibility of some compatibility check? I mean, what happens, if the isolated recovery somehow does not match the kernel, e.g. I (hypothetically) start with CM12.1 plus isolated recovery and want to switch to CM13 with corresponding feature, but the kernels have to differ in some way so that the isolated recovery still in the partition fails. Can the isolated recovery be invalidated somehow?
Could this be done with Odin?

simple, if that happens then the person goes into android and clobbers the recovery partition from there. or writes a different recovery from there. or overwrites the kernel (manually or flashify style). or goes to download mode and uses odin or heimdall to flash a kernel or recovery or just to clobber. basically you are describing a situation of flashing the wrong kernel: the standard cure is using download mode.

that said, i thought of disabling the alternate check by pressing VOL DOWN during boot. but...
a) this affects several devices and, though IsoRec is compatible with all, the button setup could be different; that means investigating and testing, testing, testing with owners of obscure devices.
b) i don't know how to read button state directly using the kernel so i would have to research that.
c) most importantly, i don't have time to do a) nor b)! the patch took a few minutes; then building the kernels, packing the recoveries, testing, entering the change on gerrit, and writing all this down took a couple of hours already, hours that btw i shouldn't have spent on this AT ALL.

this is the best i could make it in the time i didn't have. IMHO the missing VOL DOWN functionality does not justify stopping people from having this. let's see what the CM gerrit people think. one thing is for sure: i don't have the time to make it better.
The Following 7 Users Say Thank You to Lanchon For This Useful Post: [ View ] Gift Lanchon Ad-Free
12th January 2016, 04:18 PM |#10  
@Lanchon
Hi,
many thanks and much respect for your great work!
Im gonna test the IsoRec now, seems its working good so far,
hopefully the trim will not destroy my phone..
(Im still would be feel much more safe when kernel dont have trim functionality!)
Best regards
The Following User Says Thank You to franticfreddy For This Useful Post: [ View ] Gift franticfreddy Ad-Free
12th January 2016, 07:21 PM |#11  
Senior Member
Thanks Meter: 103
 
More
Quote:
Originally Posted by Lanchon

IsoRec: Isolated Recovery for the Exynos 4210 / Galaxy S2 Family

Badass. This is a really elegant solution - no need to reflash on every boot. Great job!

PS. It's awesome that you're also ripped. Are you a luchador in your day job?
The Following 2 Users Say Thank You to dimoochka For This Useful Post: [ View ] Gift dimoochka Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes