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

Search This thread

Lanchon

Senior Member
Jun 19, 2011
2,712
4,461
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/andr...mmit/9bfbaf337207359ef6aefe0a329a3b760054a6b7
Dorimanx patch: https://github.com/Lanchon/IsoRec-D...mmit/fe2288665fca2eb33426b71086fc7282ee687e68

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
 

Klaerchen

Senior Member
Nov 6, 2011
416
389
Stuttgart
@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?
 
  • Like
Reactions: Lanchon

effgee

Member
Dec 30, 2010
30
4
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
 

Lanchon

Senior Member
Jun 19, 2011
2,712
4,461
@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.
 

franticfreddy

Senior Member
Jan 7, 2016
198
103
@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
 
  • Like
Reactions: Lanchon

Lanchon

Senior Member
Jun 19, 2011
2,712
4,461
UPDATE: new devices, kernels, recoveries..

added:
  • CM 11 IsoRec-compatible kernels
  • CM (CWM-based) 6.0.5.1 IsoRec-compatible recoveries
for all supported devices:
  • d710
  • i777
  • i9100
  • n1000
this time i built the recoveries myself. these recoveries are the run-of-the-mill, old-style CM recoveries we all love and miss that used to come bundled with CM in the Kitkat days. they are compatible with CM 11 and CM 12.1 kernels, so you can use them with your Lollipop ROMs.

finally, i also added IsoRec disablers for the newly supported devices.

please note:
the (previously) published TWRP-i9100 recovery has a bug: adb sideload does not work.
EDIT: adb sideload works correctly on the newest i9100 TWRP (by arnab).
 
Last edited:

chrisXL

Senior Member
Dec 26, 2012
388
161
@Lanchon
I read the OP, but it's not fully clear to me how it works. Where should I put the preferred recovery after having flashed the isorec compatible kernel?

Anyway thank you for the great job you did.

Sent from my GT-I9100 using XDA Free mobile app
 

Lanchon

Senior Member
Jun 19, 2011
2,712
4,461
@Lanchon
I read the OP, but it's not fully clear to me how it works. Where should I put the preferred recovery after having flashed the isorec compatible kernel?

Anyway thank you for the great job you did.

Sent from my GT-I9100 using XDA Free mobile app

you flash it whenever you want, independently of the kernel. it has to be an IsoRec-compatible recovery; it CANNOT be a "legacy" (non-IsoRec; lol) monolithic kernel+recovery. look for some recoveries in the OP of this thread.
 
  • Like
Reactions: chrisXL

ringen00

Senior Member
Oct 18, 2006
222
34
Using
'kernel-Lanchon-TRIM-FreezeFix-TWRP-20160111-cm-12.1-i9100.zip'
right now.

In which order shall I flash:

1. kernel-Lanchon-TRIM-IsoRec-20160112-cm-11-i9100.zip

2. recovery-Lanchon-IsoRec-TWRP-2.8.7.0-20160113-i9100-(by-arnab).zip

3. Lanchon-IsoRec-Disabler-i9100.zip

- Which zip's will i have to put into CyanDelta to flash along with upcoming nightlies?
- Will I be able to go back to older TWRP etc. anytime?
- What is the benefit in one sentence?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 150
    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/andr...mmit/9bfbaf337207359ef6aefe0a329a3b760054a6b7
    Dorimanx patch: https://github.com/Lanchon/IsoRec-D...mmit/fe2288665fca2eb33426b71086fc7282ee687e68

    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
    37
    Il release TWRP 3.0.0 soon.
    22
    cool! lol yes extremely simple :) and yes, it's working fine on devices affected by the change, i9100 and i777, both tested.

    the change would also affect n7000 and d710, but only theoretically as those devices dont have cm12.1 branches. yet it should work fine on those devices too, they identical in this regard.

    btw, i made cm11 isorec kernels for n7000 and d710 but received no feedback. i also made a cm11 kernel for i9100 and tested: isorec works fine on cm11 too.
    Sir, your implementation is now on CM kernel, I hope nothing breaks :silly:
    20
    I had a internal stotage bug.. I just fixed it for du as well as for i9100g cm13. Without that fixing first i cudnt get a lastksmg as mtp didnt work.. Plz have patience. Iam wotking on twrp now.
    12
    Somewhere on this thread @arnab confirmed that twrp 3 is coming to IsoRec. Be patient

    Sent from my Nexus 6P using Tapatalk

    TWRP 3.0 as of now doesnt work. Ethen yonker asked a kmsg log from me.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone