• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

LolBoot xD SGS2 dualboot - NEW 12.12.11: Easy-Setup App v2.51

Search This thread

HellcatDroid

Senior Member
Jul 15, 2011
1,043
754
Cologne Area
(I wasn't really sure if this might fit into "Development", so I put it here, maybe a mod will move it, if it's a dev topic :))

Anyways, here we go, I DUALBOOTED two different, independant ROMs on the S2

Video of dualboot in action: http://www.youtube.com/watch?v=l9-V_6Ua_D0

** THIS IS NOT (YET) COMPATIBLE **
** WITH ICS (ANDROID 4.0.x) ROMS! **

-- this goes for custom ROMs as well as stock ROMs --
Icey Sammich compatibility will be added once Sammy released their ICS kernel sources.


!!! :D There now is an app for more convinient and easy setup of the dualboot :D !!!

(04.11.2011) DualBoot setup app v2.00: http://forum.xda-developers.com/showpost.php?p=19049047&postcount=94

(12.12.2011) App has been updated to 2.51, lot's of good new stuff! >> Free Version -- Donate Version <<


First off:
This is only a little experiment I did like "c'mon, has to be possible" - this is NOT (at least yet) tweaked for usability and anything the like, just a humble experiment.
That said, don't flame me if things are rather complexicated to do this ATM.
Maybe I'll come up with a more userfriendly way of setting this up, maybe someone else does, maybe no one does.

Also now that I found a base on what to do, there might be different ways (more easy ones maybe) to set this up, I'll keep toying around with it.


But let's cut to the chase, shall we :D

So, how was this set up? I'll give a brief rundown of what I did:

I edited a few .rc files in the initramfs of the kernel to make it actually perform a full boot when recovery mode was triggered and to fire up recovery mode when in battery-charging mode.
I also edited a few mounts in the boot .rc for the 2nd OS (in "recovery" mode) to use different partitions for /system and /data, so that we'd end up with really independant installs.

What partitions did I missuse for that:
  • partition 12 (mostly unused, only when installing a stock ROM AFAIK) for /system - that's a neat choice IMO as p12 is 512MB in size, just as p9 where /system usually sits on
  • partition 7 (which is usually /cache) for /data
    gives us only 100MB of user data space, but for now that's OK, as said, it's only an experiment on how such a thing could be done.
  • with the original partition for /cache "gone", I mounted a tmpfs for it.
    So the OS still has a usable /cache

Then I set up the two OSes:
(dualboot kernel not yet flashed)

Launchprep part 1:

  • I made a CWM backup of my normal installation I was running (stock XXKG6 at the time).
  • I installed DevNull-Test AOSP as to it's instructions
  • Some su'ed voodoo via a terminal while having the 2nd OS (the DevNull AOSP one, in this case) installed - best done in recovery mode via ADB:
    rm -Rf /cache/*
    cp -Rp /data/* /cache/
    dd if=/dev/block/mmcblk0p9 of=/dev/block/mmcblk0p12 bs=4096

That did "set up" the 2nd OS to where it's supposed to go.


Launchprep part 2:

Then, "advanced restore" of the backup made a few minutes earlier:
- boot
- system
- data

Reboot


At this point OS #1 is running again and OS #2 is sitting in hiding, prepared to roll - so, let's roll:

Flashed the modified "dualboot kernel" (via an App or Odin or magic, doesn't matter).


---> DONE <---
reached the point to where everything works as shown in the video.


As said above already, yes it needs some manual work to set it up, yes there's a lot of things that might not work, yes there are other/better ways to set it up.

It's only a humble experiment - lot's of space for improvement.
Maybe you like it - for those who do, I wanted to share this :)

Attached to this post you find the modified kernel I used, it's based on my v1.20 custom kernel (see sig) but with the above mentioned changes.
 

Attachments

  • LolBoot_SGS2dualboot-experiment-kernel.rar
    6.8 MB · Views: 2,589
Last edited:

HellcatDroid

Senior Member
Jul 15, 2011
1,043
754
Cologne Area
there currently an app called Bootmanager which also handle up to quadruple booting. But sadly currently only support HTC phones.
Yeah, that's the thing.... that app is HTC only.... but we have Samsung S-II and want dualboot as well.

I'm already brainstorming on how to enhance the actual usability of this, i.e. flashing a 2nd OS directely to it's place instead of first installing it to the main system partition. But there is problems when /data is not mounted to the original partition, at least stock doesn't like it on initial boot.... well, well....
 
  • Like
Reactions: pSyCh¤_O_O

jackleung

Inactive Recognized Developer
Apr 10, 2005
2,307
47
USA
That would be really cool (and definitely should goes to original development). Does it work with CM7/MIUI + custom rom?
 

Tricky103

Inactive Recognized Developer
Aug 4, 2010
3,409
709
Exeter, UK
www.appliancecare.tv
Hi i tried this with instanity rom last night. When I use the three buttons to boot it just sits there not booting. My guess is the kernel is not compatible. Unless I made a mistake somewhere.

Sent from my GT-I9100 using Tapatalk
 
Last edited:

HellcatDroid

Senior Member
Jul 15, 2011
1,043
754
Cologne Area
Hm, yah, might be that the kernel isn't fully compatible with that ROM, what kernel does the ROM usually use?

Did you boot it up fully at least once before copying /data to /cache ?
 

Tricky103

Inactive Recognized Developer
Aug 4, 2010
3,409
709
Exeter, UK
www.appliancecare.tv
Yes I did fully boot up. But his kernel didn't have advanced activated in recovery so I flashed your kernel and moved the cache okay. But it said /data not found when I ran the 2nd command line.

I will flash aosp later. I like that rom.

I am not sure what kernel nitr8 uses. I think it is his own, Insane.tar would you like it to see if they can work together.

Sent from my GT-I9100 using Tapatalk
 

HellcatDroid

Senior Member
Jul 15, 2011
1,043
754
Cologne Area
But it said /data not found when I ran the 2nd command line.
Hm, yeah, that sounds like something didn't work.... make sure you run those commands as root, i.e. "su" as very first command (I'll add that to the first post).

Give me a direct link to the ROM and I'll try it.
Make take a few days though as I'm away from my computer a lot because of work the next two days, but I'll try once time permits.


Well yeah, and this still is in highly experimental stage, if I (or someone else) should ever get this to more stable and reliable state, I'll make an easy to use installer/setup tool ;)

But I got a few other ideas on setting it up I have to try first....
 

Tricky103

Inactive Recognized Developer
Aug 4, 2010
3,409
709
Exeter, UK
www.appliancecare.tv
Hi

I tried again with Aosp Dev-null. I still get this error "cp: can't stat '/data/*': No such file or directory "

after running this command line " cp -Rp /data/* /cache/ "

Any Ideas ?

It still doesn't boot if I press 3 button it brings up the boot logo and then black screens until it boots to the 1st partition.
 

HellcatDroid

Senior Member
Jul 15, 2011
1,043
754
Cologne Area
Thanks for the link, will download and try as soon as time permits.

Also, try this command sequence, I got an idea what the issue maybe might be, give it a shot:
Code:
su
rm -Rf /cache/*
busybox cp -Rp /data/* /cache/
dd if=/dev/block/mmcblk0p9 of=/dev/block/mmcblk0p12 bs=4096

(use "busybox cp" instead of plain "cp", maybe it helps)


And some update on my ongoing thoughts for those interested:

- got an idea on how to make a more easy to use App for prepping and setting up the dualboot environment
- managed to do a neat thing I didn't really think it would work: issued a "mount" command and the OS thought it was mounting a partition of the internal flash (/dev/block/mmcblk0p12 in this test, but was testing for later on actually doing it with p9 - you might see where I'm headed here ;)) but instead of the partition it actually mounted from an .img file! (loopback) :D
i.e. "mount /dev/block/mmcblk0p12 /somedir" actually mounted "/somepath/someimage.img" to "/somedir" instead of the partition from /dev/block/... :cool: (you just gotta love Linux and it's flexible way of handling things....)

NOW, imagine /dev/block/mmcblk0p9 (the partition carrying the system) and p10 (data) being (kinda) transparently mounted from an IMAGE FILE :eek:

I "only" have to find a way to sneak this in before init starts mounting stuff.
If there's a way to do THAT.... unlimited multiboot from OS images, anyone?

(so far this is kinda dreaming, but would be cool to get it working :D)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 52
    (I wasn't really sure if this might fit into "Development", so I put it here, maybe a mod will move it, if it's a dev topic :))

    Anyways, here we go, I DUALBOOTED two different, independant ROMs on the S2

    Video of dualboot in action: http://www.youtube.com/watch?v=l9-V_6Ua_D0

    ** THIS IS NOT (YET) COMPATIBLE **
    ** WITH ICS (ANDROID 4.0.x) ROMS! **

    -- this goes for custom ROMs as well as stock ROMs --
    Icey Sammich compatibility will be added once Sammy released their ICS kernel sources.


    !!! :D There now is an app for more convinient and easy setup of the dualboot :D !!!

    (04.11.2011) DualBoot setup app v2.00: http://forum.xda-developers.com/showpost.php?p=19049047&postcount=94

    (12.12.2011) App has been updated to 2.51, lot's of good new stuff! >> Free Version -- Donate Version <<


    First off:
    This is only a little experiment I did like "c'mon, has to be possible" - this is NOT (at least yet) tweaked for usability and anything the like, just a humble experiment.
    That said, don't flame me if things are rather complexicated to do this ATM.
    Maybe I'll come up with a more userfriendly way of setting this up, maybe someone else does, maybe no one does.

    Also now that I found a base on what to do, there might be different ways (more easy ones maybe) to set this up, I'll keep toying around with it.


    But let's cut to the chase, shall we :D

    So, how was this set up? I'll give a brief rundown of what I did:

    I edited a few .rc files in the initramfs of the kernel to make it actually perform a full boot when recovery mode was triggered and to fire up recovery mode when in battery-charging mode.
    I also edited a few mounts in the boot .rc for the 2nd OS (in "recovery" mode) to use different partitions for /system and /data, so that we'd end up with really independant installs.

    What partitions did I missuse for that:
    • partition 12 (mostly unused, only when installing a stock ROM AFAIK) for /system - that's a neat choice IMO as p12 is 512MB in size, just as p9 where /system usually sits on
    • partition 7 (which is usually /cache) for /data
      gives us only 100MB of user data space, but for now that's OK, as said, it's only an experiment on how such a thing could be done.
    • with the original partition for /cache "gone", I mounted a tmpfs for it.
      So the OS still has a usable /cache

    Then I set up the two OSes:
    (dualboot kernel not yet flashed)

    Launchprep part 1:

    • I made a CWM backup of my normal installation I was running (stock XXKG6 at the time).
    • I installed DevNull-Test AOSP as to it's instructions
    • Some su'ed voodoo via a terminal while having the 2nd OS (the DevNull AOSP one, in this case) installed - best done in recovery mode via ADB:
      rm -Rf /cache/*
      cp -Rp /data/* /cache/
      dd if=/dev/block/mmcblk0p9 of=/dev/block/mmcblk0p12 bs=4096

    That did "set up" the 2nd OS to where it's supposed to go.


    Launchprep part 2:

    Then, "advanced restore" of the backup made a few minutes earlier:
    - boot
    - system
    - data

    Reboot


    At this point OS #1 is running again and OS #2 is sitting in hiding, prepared to roll - so, let's roll:

    Flashed the modified "dualboot kernel" (via an App or Odin or magic, doesn't matter).


    ---> DONE <---
    reached the point to where everything works as shown in the video.


    As said above already, yes it needs some manual work to set it up, yes there's a lot of things that might not work, yes there are other/better ways to set it up.

    It's only a humble experiment - lot's of space for improvement.
    Maybe you like it - for those who do, I wanted to share this :)

    Attached to this post you find the modified kernel I used, it's based on my v1.20 custom kernel (see sig) but with the above mentioned changes.
    9
    IT IS DONE! LolBoot v2.00 is in the wild!

    Market link: [ LolBoot v2.00 ]

    Detaily video showing it off:
    http://www.youtube.com/watch?v=BeOFTGESn0g

    A bunch'o'screenshots:
    (click each one for larger view)

    . . . .


    Enjoy :)

    And be kind when you find flaws/problems/issues.... ;)
    9
    It's done:

    img-11026_icon_p-r-full.png
    LolBoot - SGS2 Dual-Boot Easy Set-Up App
    needs root!


    (click images for larger view)

    [ Video (also explains how to use it) ]-|-[ Download ]

    Quick rundown of how to setup the dualboot with this app:
    • Install ROM you want to use as PRIMARY (ignore this if your current one shall stay primary boot)
    • Boot to CWM recovery and make a full backup of your designated primary installation
    • Install ROM you want to use as SECONDARY boot and do initial settings stuff
    • Run app - use first option ("cache current OS")
    • Restore backup of PRIMARY ROM
    • Run app again - use second option ("install cached as secondary")
    • use third option ("flash lolkernel")
    • Enjoy dualbooting :) (normal power on: primary ROM; VOL-UP+HOME+POWER (usually recovery): boot secondary ROM; power off and connect charger: CWM recovery

    The kernel the app flashes for dualbooting:
    • Samsung stock compatible (some things don't work on AOSP based ROMs)
    • based on my v1.24 root kernel (i.e. has all features my root kernel has), but already compiled from latest Update_3 Samsung sources

    Have fun :)
    5
    Following therealhellcat on twitter
    Good choice :D ;)


    I can't wait for the next upgrade.
    Good news about that!

    I played around a bit with Siyah 2.0 kernel and edited it a bit to dance the dualboot - compiling a new testkernel as I type this.

    Looking good so far to use it (it's way more complicated to edit the init's on this one for dualboot due to gokhanmoral's clever way of booting Sammy-stock or AOSP based ROMs - there's so much scriptage to go through xD) and he also approved of his kernel being added to the installer app.

    So, if things go well, we'll end up with a dualboot that'll work nice for at least most ROMs, not only stock Sammy ones :)


    // EDIT

    Just tried the testbuilt of my edited Siyah 2.0.

    I am happy to report that it properly (dual)booted a Sammy stock ROM and the AOSP ROM "Oxygen" as secondary - WiFi, USB, vibra and SDCard mountage, everything worked fine on BOTH boots (did not test bluetooth).

    This is a happy day, I think we reached a level of "stable" that actually makes this "every day use" capable :)
    Now I just gotta tweak'n'tune my setup-helper-app so that setting it up will be a breeze :D
    4
    OK, v2.51 is now live :D
    (FREE *and* Donate versions)

    Siyah based dualboot kernel has been updated to Siyah v2.2

    Before someone complains once again:

    I know Siyah is at v2.4.2 already, I know you all would want that, I would want that too, but I need sources to make a dual-boot mod of that kernel, the most recent sources available for Siyah are of v2.2, so yes, Siyah is at v2.4.2 now, but I have no sources of v2.4.2 to make a dual-boot mod of it, I only have v2.2 sources, so Siyah v2.2 is the newest Siyah kernel I am able to mod as no v2.4.2 sources are released to the public yet!

    I can only make a Siyah v2.4.2 or v3.5 or v17.4 or w/e you want version based Siyah dual-boot mod IF I HAVE THE SOURCES TO IT, and if they are not released I just don't have them....


    I hope this cleares this up a bit.


    // EDIT:

    Oh and yeah. Free version and Donation version are 100% identical in features, nothing is missing in the free version that the donation version might have, getting the donation version is totally voluntary.

    Ah, and did I mention I can't do a Siyah 2.4.2 based dual-boot kernel 'cause I don't have the sources to that? ;)