[Development discussion] FIREFIREFIRE Extended (dualbooting)

Search This thread

smirkis

Senior Member
Oct 8, 2010
1,820
611
San Diego, CA
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
 

eldarerathis

Senior Member
Jun 21, 2010
159
316
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.
 

jmcoffey

Senior Member
Dec 6, 2011
338
71
Peachtree City
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'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.

I dd'd and everything.. I noticed that the boot.img you uploaded is significantly smaller than the one cm7 came with. Yours reads 3200 kb and the one it came with reads 10240 kb..
 

eldarerathis

Senior Member
Jun 21, 2010
159
316
I dd'd and everything.. I noticed that the boot.img you uploaded is significantly smaller than the one cm7 came with. Yours reads 3200 kb and the one it came with reads 10240 kb..

The CM7 one you're comparing it to must not be packed as a sparse image for some reason. Building CM7 from source spits out one around 3.2 MB:

Code:
thinkpad:/mnt/shared/CyanogenMod7/out/target/product/blaze$ ls -l | grep boot.img
-rwxrwxrwx 1 root root   3272704 2012-02-29 18:07 boot.img

Maybe double check the partition numbers? Mine were actually out of order before, with boot2 being mmcblk0p16 but being physically between p12 and p13. The init.omap4430.rc in the boot image will be trying to mount by number instead of name (I had trouble getting it to work by name for some reason and just never tried it again).
 

jmcoffey

Senior Member
Dec 6, 2011
338
71
Peachtree City
The CM7 one you're comparing it to must not be packed as a sparse image for some reason. Building CM7 from source spits out one around 3.2 MB:

Code:
thinkpad:/mnt/shared/CyanogenMod7/out/target/product/blaze$ ls -l | grep boot.img
-rwxrwxrwx 1 root root   3272704 2012-02-29 18:07 boot.img

Maybe double check the partition numbers? Mine were actually out of order before, with boot2 being mmcblk0p16 but being physically between p12 and p13. The init.omap4430.rc in the boot image will be trying to mount by number instead of name (I had trouble getting it to work by name for some reason and just never tried it again).

Success!! It was the numbers. This works amazingly!! Thanks!
 

lovejoy777

Inactive Recognized Developer
Dec 30, 2011
3,725
4,541
Nottingham
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
 
  • Like
Reactions: CodenameDeadpool

eldarerathis

Senior Member
Jun 21, 2010
159
316
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!
 
Last edited:

pbailey212

Senior Member
Apr 12, 2011
870
308
With this dual boot do all of the Roms have to use the same kernel?
Sent from my GT-P1000 using Tapatalk
 

smirkis

Senior Member
Oct 8, 2010
1,820
611
San Diego, CA
of course, take any rom that's out there and edit the updater-script.

in due time, what u should end up seeing, is rom creators will/should have two rom's listed in release threads, main os, and altboot.

but, on a side note. the timer delay feels a hair long. with the fastboot delay at 5, then the countdown at 5, its a solid 10 seconds before the boot process starts. 5 for fastboot and 2-3 for selection should be fine.

and to elaborate on your idea for adding fastboot to selection, its just unnecessary. u don't need to "catch" fastboot at startup, u gotta run ur fastboot command then reboot, fastboot will catch at startup automatically

Sent from my HTC Glacier using xda premium
 

eldarerathis

Senior Member
Jun 21, 2010
159
316
but, on a side note. the timer delay feels a hair long. with the fastboot delay at 5, then the countdown at 5, its a solid 10 seconds before the boot process starts. 5 for fastboot and 2-3 for selection should be fine.

Yeah, I've been thinking the same thing now that I'm rebooting a lot to test stuff. I'm thinking I'm gonna tweak the timing to be 5 seconds for the initial delay and 2.5 or 3 seconds on each selection change.

Also, for the folks with some questions a few posts back:

  1. Yes, you would be able to use a stock ROM as an alternate ROM. I packaged one up for this late Sunday and it worked fine based on my quick testing. As smirkis noted, it just needs to be packaged such that it will point to the right partitions. I simply chose to test with CM7 because I had KANG builds on my build machine already.
  2. No, you wouldn't use the same kernel for both ROMs. The kernel is packed into the boot image, and this bootloader will allow you to select from two completely separate boot partitions (thus, two different boot images). Each ROM has its own kernel, data storage, system, and (for now at least) cache. The only shared component is the /sdcard partition.

Last thing, just as an update: Initial testing seems to indicate that the partition setup procedure doesn't work correctly on ClockworkMod. I'm not entirely sure why yet, but I'm working on it, and I'll hopefully have a fair amount of free time this weekend. TWRP seems to work pretty reliably, but I want it to work on both.

I also think that the safest option is going to require that you wipe your sdcard partition completely in order to setup the dualboot. It's inconvenient, I know, but I think two batch copy/paste jobs isn't too excessive to ask of people, right?
 

da-pharoah

Senior Member
Mar 24, 2009
2,779
1,593
Seacoast near Joppa
Patiently awaiting updates for this.. I wouldn't mind trying to dual boot my Hellfire kindle! I had dual boot on my hd2 and that was pimp! Thanks for your hardwork here!

Sent from my LG-P999 using xda premium
 

da-pharoah

Senior Member
Mar 24, 2009
2,779
1,593
Seacoast near Joppa
Ok so whats up I'm most likely going to do this. However a pregunta, I'm now using cwm. Since iv last read the whole thread before you put the binary backup... I believe I read cwm is being picky with this awesomeness, is that the case still? Just have to ask because I will go back to twrp if need be..

Sent from my Hellfire Kindle using xda premium
 

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.