[Development discussion] FIREFIREFIRE Extended (dualbooting)

Search This thread

eldarerathis

Senior Member
Jun 21, 2010
159
316
Update: For anyone interested in simply USING this, I have started a new thread for the public release of FFF Extended: http://xdaforums.com/showthread.php?t=1615093. I wanted to keep all of this development discussion separate from the release.

I'm going to re-purpose the title a bit to leave this as a general discussion thread (at least for now) since there's still a lot of interesting discussion still taking place.

-----

Please understand the following: This is what I consider a proof-of-concept only. It will probably not be all that useful to most people unless you have your device partitioned the same way mine is (protip: you almost certainly DON'T). Please please PLEASE don't mess with this (for now) unless you understand what you're doing. Thanks!

-----

So as the title and little disclaimer above states, I've got something of a proof-of-concept that I wanted to share in case it proves to be useful for others down the line. What I've basically done is taken FIREFIREFIRE 1.2 (thank you pokey9000!) and modified it a bit so that I can dual boot my Fire.

The way this works is actually pretty simple. FFF1.2 lets you get into recovery by starting up fastboot and listening for 10 seconds for you to press the power button. If you press it then it boots into recovery instead of doing a normal boot.

What this version does is somewhat different: it listens for 5 seconds and starts up fastboot like FFF1.2 does, but when you press the power button it restarts the 5 second countdown and effectively changes the selected boot state. This provides more flexibility because it allows you to "cycle" between boot options instead of just being a one-shot thing.

Here's a (somewhat blurry) video demo to help illustrate how it works:


In the video I'm dual booting CM9 (which is on my normal boot partition) and CM7 (which is set up on a "boot2" partition). I know it's really hard to read, but the boot options are "Normal boot", "Recovery", and "Alternate boot". Here's a screenshot:

normalboot.png


Before you say anything, I know it's not fancy. The u-boot image needs to fit onto the bootloader partition, and fancy images are simply too big to fit, whereas ones with a lot of solid colors (in this case mostly black) can be compressed much smaller when using RLE. Sorry to all you graphics types out there :D

This is still rough around the edges, but the basic breakdown of what's been changed is:

  • Fastboot delay is 5 seconds instead of 10
  • Delay resets to 5 after each button press
  • Visually indicates what you're selecting to boot
  • Adds the option to boot from a boot2 partition (in addition to boot and recovery as normal)

Also note, if you decide to try this out: the button still has a slight delay at startup before it will accept input. You can tell when it's ready for input when the LED fades a bit (from bright green to darker green), just like on FFF 1.2 (this is simply unchanged). So don't mash the button right after the screen comes up, because it won't respond. You also may need to press and hold it for just a split second to make sure it registers the press properly. Just a few minor niggles.

The source for this can all be found on my GitHub here: https://github.com/eldarerathis/FIREFIREFIRE-Multiboot-PoC. Fair warning: I'm not really a C guy, I'm a C#/Java guy by trade, so this may not be the prettiest C (it's been a few years). However, I hope that it's easy enough to follow to perhaps be useful in a more friendly dual-boot solution that doesn't involve repartitioning like I did.

Again, this probably needs some more work, but I wanted to share nonetheless. Also, if you really want to you can use this as a bootloader just for getting into recovery. Selecting "Alternate boot" will in theory not really do anything if you try to use it but you don't have a boot2 partition (and you'd simply need to restart your device), so...don't select it from the menu and you're fine. This also boots fine using pokey9000's omap4boot (see it here: http://xdaforums.com/showpost.php?p=19800610&postcount=74) for testing it out.

With that in mind, here's a binary you can play with if you want to, but remember - use at your own risk! Just unzip and flash it with fastboot ('fastboot flash bootloader u-boot.bin') or boot it from omap4boot.


I may also make a version that replaces the "Alternate boot" option with something like "Fastboot" so that it will be more useful to the general public for the time being. I was thinking that might be nice so you don't have to worry about catching the fastboot delay from your computer.

Lastly, thanks again to pokey9000 for his FIREFIREFIRE work that this is all built on. Remember where it started people!
 
Last edited:

eldarerathis

Senior Member
Jun 21, 2010
159
316
Thats awesome, i have been testing Bootmanager on my KF and it seems to work pretty smooth. I like this concept though, if you want someone else to give it a try i'm willing. Definitely Good stuff though!

At some point I may try to write up what I did to create my dual boot setup, at which point you'd certainly be welcome to try it out. The thing is that I did mine by creating a second set of partitions which I named boot2, system2, userdata2 and cache2, then I put CM7 on these secondary partitions. In doing that, I also had to modify the boot image to point to the right places.

In other words, it's probably not for the faint of heart at this point, but if something easier can be worked out then maybe this will prove to be a useful bootloader. I might try to figure out how the NC/NT are doing their boot from SD card stuff since we could probably fake it with the /sdcard partition even though it's not a physically separate card (or something like that).

Cool, looks great.
Thanks for making dual boot possible!
BTW, what is the ICS rom you're using?
and where do you get it?
:D

It's CyanogenMod 9, from nind's source tree. You can grab the latest unofficial build from this thread: http://xdaforums.com/showthread.php?t=1411895.
 

smirkis

Senior Member
Oct 8, 2010
1,820
611
San Diego, CA
very nice! I was talking with fattire about porting cyanoboot but you pretty much made it out of fff, I'm astonished. bravo.

Sent from my Kindle Fire using xda premium
 

eldarerathis

Senior Member
Jun 21, 2010
159
316
We need to re-partition in order to user this?

To use the alternate boot at this point, yes. I mainly did it just to see if I could do it (and for my own use) so it's not yet ideal for mass consumption. You could also use it strictly for getting into recovery if you wanted, you'd just have no use for the third option in the boot menu. Nothing damaging should happen if you were to accidentally choose "Alternate Boot" in that case. I've tested it after deleting my boot2 partition and it just hangs at the splash screen, forcing me to simply hold down the power button to restart it.
 
Last edited:
  • Like
Reactions: CodenameDeadpool

foxdog66

Senior Member
Jul 28, 2010
471
53
Sweet. Just out of curiosity, would it be possible to have an option to repartition the device built into the bootloader that works like the fastboot OEM format option? With say pre defined layouts
 

aaricchavez

Senior Member
Aug 9, 2010
206
105
Tampa
This is pretty cool. I don't think i'll use it right now as it seems like too much work, but thanks alot for sharing this with us.
 

smirkis

Senior Member
Oct 8, 2010
1,820
611
San Diego, CA
I flashed this and it works as it should. definately check out how the NT forums utilize cyanoboot for dualboot. I love where this is going! I'm leaving this one on my device, I like the selection menu regardless of no fancy logo lol

Sent from my Kindle Fire using xda premium
 

jmcoffey

Senior Member
Dec 6, 2011
338
71
Peachtree City
At some point I may try to write up what I did to create my dual boot setup, at which point you'd certainly be welcome to try it out. The thing is that I did mine by creating a second set of partitions which I named boot2, system2, userdata2 and cache2, then I put CM7 on these secondary partitions. In doing that, I also had to modify the boot image to point to the right places.

In other words, it's probably not for the faint of heart at this point, but if something easier can be worked out then maybe this will prove to be a useful bootloader. I might try to figure out how the NC/NT are doing their boot from SD card stuff since we could probably fake it with the /sdcard partition even though it's not a physically separate card (or something like that).



It's CyanogenMod 9, from nind's source tree. You can grab the latest unofficial build from this thread: http://xdaforums.com/showthread.php?t=1411895.

Could you just post the modified boot2 image?

Sent from my HTC Sensation XE with Beats Audio using XDA
 

eldarerathis

Senior Member
Jun 21, 2010
159
316
Sweet. Just out of curiosity, would it be possible to have an option to repartition the device built into the bootloader that works like the fastboot OEM format option? With say pre defined layouts

I actually considered this idea, too, and I may still look into it as a third boot menu item to replace "Alternate Boot" for people who don't want a dual boot setup. I can definitely see how that would be useful to access from the boot menu if it's feasible.

Could you just post the modified boot2 image?

Sent from my HTC Sensation XE with Beats Audio using XDA

Sure, have at it: http://www.mediafire.com/?wlv7yjeynilie6g
 

uoY_redruM

Senior Member
May 1, 2010
3,469
1,941
Longwood, FL
This could be particularly useful for me while 3.0 kernel is still in development. I don't like CM7 but I must use it for Netflix. I keep keep CM9 as the primary boot and use a clean CM7 as the alternate boot.

Hmmm....how hard is it to do the repartition?

Sent from my Nexus One using xda premium
 

1loudsvt

Senior Member
Aug 27, 2007
304
1
You may want to check how they are multi booting the hp touchpad.

Sent from my DROIDX using XDA
 

eldarerathis

Senior Member
Jun 21, 2010
159
316
What is your partition layout?

Sent from my Kindle Fire using XDA

This is my current layout:

Code:
~ # parted /dev/block/mmcblk0 print
Model: MMC M8G2FA (sd/mmc)
Disk /dev/block/mmcblk0: 7734MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name        Flags
 1      131kB   262kB   131kB                xloader
 2      262kB   524kB   262kB                bootloader
 3      524kB   11.0MB  10.5MB               dkernel
 4      11.0MB  212MB   201MB   ext4         dfs
 5      212MB   229MB   16.8MB               recovery
 6      229MB   296MB   67.1MB  ext4         backup
 7      296MB   307MB   10.5MB               boot
 8      307MB   312MB   5243kB  ext4         splash
 9      312MB   849MB   537MB   ext4         system
10      849MB   2241MB  1392MB  ext4         userdata
11      2241MB  2369MB  128MB   ext4         cache
12      2369MB  5945MB  3576MB  fat32        media       msftres
16      5945MB  5956MB  11.0MB               boot2
13      5956MB  6356MB  400MB   ext4         system2
14      6356MB  7606MB  1250MB  ext4         userdata2
15      7606MB  7734MB  128MB   ext4         cache2
 

jmcoffey

Senior Member
Dec 6, 2011
338
71
Peachtree City
This is my current layout:

Code:
~ # parted /dev/block/mmcblk0 print
Model: MMC M8G2FA (sd/mmc)
Disk /dev/block/mmcblk0: 7734MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name        Flags
 1      131kB   262kB   131kB                xloader
 2      262kB   524kB   262kB                bootloader
 3      524kB   11.0MB  10.5MB               dkernel
 4      11.0MB  212MB   201MB   ext4         dfs
 5      212MB   229MB   16.8MB               recovery
 6      229MB   296MB   67.1MB  ext4         backup
 7      296MB   307MB   10.5MB               boot
 8      307MB   312MB   5243kB  ext4         splash
 9      312MB   849MB   537MB   ext4         system
10      849MB   2241MB  1392MB  ext4         userdata
11      2241MB  2369MB  128MB   ext4         cache
12      2369MB  5945MB  3576MB  fat32        media       msftres
16      5945MB  5956MB  11.0MB               boot2
13      5956MB  6356MB  400MB   ext4         system2
14      6356MB  7606MB  1250MB  ext4         userdata2
15      7606MB  7734MB  128MB   ext4         cache2

I copied your partition layout and cant get CM7 to boot. i flashed your boot2.img but to no avail... any help?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 14
    Update: For anyone interested in simply USING this, I have started a new thread for the public release of FFF Extended: http://xdaforums.com/showthread.php?t=1615093. I wanted to keep all of this development discussion separate from the release.

    I'm going to re-purpose the title a bit to leave this as a general discussion thread (at least for now) since there's still a lot of interesting discussion still taking place.

    -----

    Please understand the following: This is what I consider a proof-of-concept only. It will probably not be all that useful to most people unless you have your device partitioned the same way mine is (protip: you almost certainly DON'T). Please please PLEASE don't mess with this (for now) unless you understand what you're doing. Thanks!

    -----

    So as the title and little disclaimer above states, I've got something of a proof-of-concept that I wanted to share in case it proves to be useful for others down the line. What I've basically done is taken FIREFIREFIRE 1.2 (thank you pokey9000!) and modified it a bit so that I can dual boot my Fire.

    The way this works is actually pretty simple. FFF1.2 lets you get into recovery by starting up fastboot and listening for 10 seconds for you to press the power button. If you press it then it boots into recovery instead of doing a normal boot.

    What this version does is somewhat different: it listens for 5 seconds and starts up fastboot like FFF1.2 does, but when you press the power button it restarts the 5 second countdown and effectively changes the selected boot state. This provides more flexibility because it allows you to "cycle" between boot options instead of just being a one-shot thing.

    Here's a (somewhat blurry) video demo to help illustrate how it works:


    In the video I'm dual booting CM9 (which is on my normal boot partition) and CM7 (which is set up on a "boot2" partition). I know it's really hard to read, but the boot options are "Normal boot", "Recovery", and "Alternate boot". Here's a screenshot:

    normalboot.png


    Before you say anything, I know it's not fancy. The u-boot image needs to fit onto the bootloader partition, and fancy images are simply too big to fit, whereas ones with a lot of solid colors (in this case mostly black) can be compressed much smaller when using RLE. Sorry to all you graphics types out there :D

    This is still rough around the edges, but the basic breakdown of what's been changed is:

    • Fastboot delay is 5 seconds instead of 10
    • Delay resets to 5 after each button press
    • Visually indicates what you're selecting to boot
    • Adds the option to boot from a boot2 partition (in addition to boot and recovery as normal)

    Also note, if you decide to try this out: the button still has a slight delay at startup before it will accept input. You can tell when it's ready for input when the LED fades a bit (from bright green to darker green), just like on FFF 1.2 (this is simply unchanged). So don't mash the button right after the screen comes up, because it won't respond. You also may need to press and hold it for just a split second to make sure it registers the press properly. Just a few minor niggles.

    The source for this can all be found on my GitHub here: https://github.com/eldarerathis/FIREFIREFIRE-Multiboot-PoC. Fair warning: I'm not really a C guy, I'm a C#/Java guy by trade, so this may not be the prettiest C (it's been a few years). However, I hope that it's easy enough to follow to perhaps be useful in a more friendly dual-boot solution that doesn't involve repartitioning like I did.

    Again, this probably needs some more work, but I wanted to share nonetheless. Also, if you really want to you can use this as a bootloader just for getting into recovery. Selecting "Alternate boot" will in theory not really do anything if you try to use it but you don't have a boot2 partition (and you'd simply need to restart your device), so...don't select it from the menu and you're fine. This also boots fine using pokey9000's omap4boot (see it here: http://xdaforums.com/showpost.php?p=19800610&postcount=74) for testing it out.

    With that in mind, here's a binary you can play with if you want to, but remember - use at your own risk! Just unzip and flash it with fastboot ('fastboot flash bootloader u-boot.bin') or boot it from omap4boot.


    I may also make a version that replaces the "Alternate boot" option with something like "Fastboot" so that it will be more useful to the general public for the time being. I was thinking that might be nice so you don't have to worry about catching the fastboot delay from your computer.

    Lastly, thanks again to pokey9000 for his FIREFIREFIRE work that this is all built on. Remember where it started people!
    7
    For anyone following this, I just want to give a quick update:

    This appears to be in a pretty much working state at the moment, but I have a few things I want to try to see if I can alleviate the weirdness on some ROMs (ICS and stock ones, basically). It's just a bunch of shots in the dark, basically, but who knows.

    I'm going to be absolutely slammed at work this week because we're getting ready to ship a new software release on Friday, but I'm hoping to have some time this weekend if all goes well at work. If not then I'll drop in sometime next week to update and hopefully post a "release" thread for the general public shortly thereafter.

    Thanks for your patience!
    5
    this sounds very nice.
    unfortunately a bit to advanced for me to try.
    please excuse my ignorance.
    but can/will, this process be simplified?


    Sent from my Galaxy Nexus using xda premium

    This is what I'm working on now.

    Update: I've already received a sufficient number of PMs from people willing to test, so I'm going to hold off on accepting any additional testers for now so that I can properly attend to any problems the testers may encounter. Thanks for the help everyone!
    4
    I copied your partition layout and cant get CM7 to boot. i flashed your boot2.img but to no avail... any help?

    How did you flash it, and how did you install CM7? For the record, I used dd to copy it over, i.e. from an adb shell in recovery:

    Code:
    # dd if=/sdcard/boot2.img of=/dev/block/mmcblk0p16 bs=512

    Obviously make sure the partition you specify in 'of' is correct so you don't clobber something else. I haven't tried using fastboot to flash it, so I have no idea if that would work or not. To install CM7 I basically just extracted one of the flashable zips and copied everything in /system onto /system2.

    I say wait, we need something similiar to OEM format, but for this. something like multiboot format and it can set this layout, redo OEM format to go back to stock tables.

    Sent from my HTC Glacier using xda premium

    I've been testing a few shell scripts to do the partitioning (and undo it) this evening. It seems to be working okay, so I'd like to try packaging them into zips that can be flashed via recovery.

    So far it's promising, and it's actually pretty safe since the *only* partition that gets modified is /sdcard, so even an error doesn't make my system unbootable or anything. I also repackaged a CM7 build such that it can be flashed from recovery and it will successfully write to the secondary partition set, so no manual copying is required (yay!) but I had to modify the boot image and updater-script (meh).

    Earlier today I experimented a bit with trying to boot from filesystem images kind of like BootManager does, but I haven't been able to make it work (it hangs at the boot splash). I'm not sure if it's worth investigating that angle further at this point.
    4
    I don't want any puppies to die, but is there an update on your progress to this much wanted concept:)

    Sent from my Kindle Fire using xda premium

    I've got some testing in motion. Everything works on my own Fire in both ClockworkMod and TWRP, so I'm hoping I've got this nailed down for the most part. Ideally we'll have some broader testing results in the next couple of days. In the meantime I'll be kind of on hold code-wise to see how my latest changes shake out.

    Incidentally, I don't have a Twitter account (because I think it's kind of stupid) and I don't really use Google+ much, but anyone who wants to keep up on progress is free to poke around my GitHub activity. You'll generally only see when I've committed or uploaded stuff, but it's the fastest way to keep track of what I'm working on, I suppose. Or keeping an eye on this thread. I'll try to keep popping back in here for regular-ish updates when I have them.