Jump to content


Photo

[idea] two ROMs on one device (aka dualboot)

- - - - -

  • Please log in to reply
75 replies to this topic

#1
karololszak

karololszak

    Regular

  • Members
  • PipPip
  • 72 posts
So I've had this idea in my head for a few days: we could have one ROM on the /system partition and the other on the /recovery partition.
AFAIK we can change partition layouts via TPT with no problems at all, and AFAIR there was an old way of TPTing and flashing a ROM in which the recovery was flashed to the /system partition, the phone booted to it and from the recovery you were supposed to install another (same) recovery to the /recovery partition and from there (after rebooting) we had to flash the ROM; and so I assume we can also flash a ROM into the /recovery partition and it should boot just fine.
Two ROMs would require twice the space so it would be necessary to use sd-ext partition for /data (but we have already got working solutions like Apps2SD, Link2SD and others so it shouldn't be a problem).
The last problem would be an actual recovery - it just wouldn't be anywhere. So I thought of a few solutions:
1. Flash it onto the /oem or any other partition and find a way to boot it (eg. from the system with an app with root).
2. Integrate it with the ROM; if recoveries are open source it should be easy to do (and I believe they are, but I couldn't find recent source for CWM though)
3. Don't bother with it. ROMs can be swaped with TPT, and if someone would need a recovery they would need to flash it back to it's partition.

Do you think it's possible? If it was, it would be great! Being able to run ICS/JB on the /system and switching to GB [CM7] that is installed on /recovery (or any other ROMs) would be awesome.

  • 1

FREE BITCOINS! Yes, we give away bitcoins for absolutely free! Check it out!


#2
mannas

mannas

    Regular

  • Members
  • PipPip
  • 58 posts
It would be easier to flash the second ROM to the sd ext. The problem is that there arent developers that would work on it because of the amount of work it would require. Ive seen it done to other devices but those have a larger developer community than blade. Even nexus s doesnt have that because of the amount of work required and it is a Google phone

  • 1

#3
karololszak

karololszak

    Regular

  • Members
  • PipPip
  • 72 posts
I've been aware that other devices do it with the second ROM on the sd ext, like with this app (Boot Manager), but I guess that NAND is faster and more wear-proof than an sd card.
And an another point is that we can boot into the /recovery partition easily, using a combination of buttons - whilst to boot to the sd-ext it requires work and knowledge. So although my idea seems to be more complicated I guess it could be easier to implement.

  • 1

FREE BITCOINS! Yes, we give away bitcoins for absolutely free! Check it out!


#4
Snap.IT

Snap.IT

    Addict

  • Members
  • PipPipPipPipPip
  • 861 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Devices:ZTE Blade 3, Alcatel OT995

I've been aware that other devices do it with the second ROM on the sd ext, like with this app (Boot Manager), but I guess that NAND is faster and more wear-proof than an sd card.
And an another point is that we can boot into the /recovery partition easily, using a combination of buttons - whilst to boot to the sd-ext it requires work and knowledge. So although my idea seems to be more complicated I guess it could be easier to implement.


The recovery partition is awfully small, it houses the recovery which is 3-4MB in size, you could fit the kernel in there but not much else.

The bootmanager you linked doesn't install to SD-ext partitions, it installs to loop filesystems on the SD cards Fat32 partition, kinda like how Ubuntu installs into a file when installing it via WUBI.

Installs to SD-ext partitions would be a lot faster but also more work, it's perfectly doable though, all you need is a way to install them where you want them and a bootloader to choose between them (such as grub).

  • 1

#5
karololszak

karololszak

    Regular

  • Members
  • PipPip
  • 72 posts

The recovery partition is awfully small, it houses the recovery which is 3-4MB in size, you could fit the kernel in there but not much else.

But you can resize it via TPT to any size you want, can't you? You would need to use the space that is taken by /data but you can move /data to /sd-ext ...

And writing a bootloader for our Blades (as in your idea) doesn't seem to be an easy task...

  • 1

FREE BITCOINS! Yes, we give away bitcoins for absolutely free! Check it out!


#6
Sulthekk

Sulthekk

    Addict

  • Members
  • PipPipPipPipPip
  • 619 posts
  • Devices:ZTE Blade

The recovery partition is awfully small, it houses the recovery which is 3-4MB in size, you could fit the kernel in there but not much else.

The bootmanager you linked doesn't install to SD-ext partitions, it installs to loop filesystems on the SD cards Fat32 partition, kinda like how Ubuntu installs into a file when installing it via WUBI.

Installs to SD-ext partitions would be a lot faster but also more work, it's perfectly doable though, all you need is a way to install them where you want them and a bootloader to choose between them (such as grub).


I have already flashed boot.img to the recovery partition, and I can confirm that it can be booted up, although I wouldn't recommend using that, because on failure the recovery is probably the safest tool we have got.

Grub would be great to have, but as far as I know it requires either MBR or UEFI to be booted...

In my opinion the ideal solution would look to the user like 2ndInit on the Defy: during the boot, the green led lights up, and if the user presses a specific button, the secondary system would boot. It could be done with a specially crafted boot.img and kexec I think... But placing the second /system and /data on the sdcard could be problematic... The easiest solution would be an ext2 or yaffs2 partition on the card where both of them can be placed, but I'm not sure that a casual card can take that usage everyday for long... There would be a lot of unusable cards very soon.

Also on Milestone they never got RILs working with kexec... :(

  • 0

#7
android@sam

android@sam

    Enthusiast

  • Members
  • PipPipPip
  • 259 posts
  • Gender:Male
  • Location:Nagpur,India
  • Interests:Computers, MObilez...
  • Devices:DELL XCD35 aka ZTE BLADE
First of all we will have to compile a dual boot kernel which takes some weird reverse engineering.

  • 0

Sony Ericsson UI On your ZTE BLADE

"CYANSCAPE"


#8
Sulthekk

Sulthekk

    Addict

  • Members
  • PipPipPipPipPip
  • 619 posts
  • Devices:ZTE Blade

First of all we will have to compile a dual boot kernel which takes some weird reverse engineering.


Think that again... We need nothing to reverse engineer (If we had to, then we should reverse-engineer the armv7 ICS libstagefright instead, so we wouldn't need dualboot :)), just a script in initramfs which lights up the led, waits for a keycode for X seconds, if pressed then mounts the first partition of the sd for root and kexec-es a zImage on it, but if not it continues booting. Well, that's the theory... But we either need advanced users or we have to modify recovery to be able to 'flash' packages to that other partition, and... I have absolutely no experience with kexec, I just read about it, and thus it may not work in the way I think it works. :(

Edited by Sulthekk, 13 July 2012 - 09:30 AM.

  • 0

#9
Snap.IT

Snap.IT

    Addict

  • Members
  • PipPipPipPipPip
  • 861 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Devices:ZTE Blade 3, Alcatel OT995

But you can resize it via TPT to any size you want, can't you? You would need to use the space that is taken by /data but you can move /data to /sd-ext ...

And writing a bootloader for our Blades (as in your idea) doesn't seem to be an easy task...


We have 512MB to work with so even if partition layout wasn't a deal breaker there simply isn't enough room, remember that you'd not only need 2 system partitions to house each rom, you'd need two data partitions to house all the apps and data too (If you want to dualboot ICS and GB). It's way easier to just use external memory where you can have up to 32GB per SD and as many SD's as you like.

  • 0

#10
android@sam

android@sam

    Enthusiast

  • Members
  • PipPipPip
  • 259 posts
  • Gender:Male
  • Location:Nagpur,India
  • Interests:Computers, MObilez...
  • Devices:DELL XCD35 aka ZTE BLADE

Think that again... We need nothing to reverse engineer (If we had to, then we should reverse-engineer the armv7 ICS libstagefright instead, so we wouldn't need dualboot :)), just a script in initramfs which lights up the led, waits for a keycode for X seconds, if pressed then mounts the first partition of the sd for root and kexec-es a zImage on it, but if not it continues booting. Well, that's the theory... But we either need advanced users or we have to modify recovery to be able to 'flash' packages to that other partition, and... I have absolutely no experience with kexec, I just read about it, and thus it may not work in the way I think it works. :(

Thanks for the knowledge.it means that the script needs to be edited for mounting different blocks at the boot.Thanks

  • 0

Sony Ericsson UI On your ZTE BLADE

"CYANSCAPE"


#11
Sulthekk

Sulthekk

    Addict

  • Members
  • PipPipPipPipPip
  • 619 posts
  • Devices:ZTE Blade

Thanks for the knowledge.it means that the script needs to be edited for mounting different blocks at the boot.Thanks


That's not that simple, ICS needs a hacked kernel which may not be compatible with the GB one, so we also need to place a zImage on the second partition, that way we can always load the one supplied with the rom. And until there is no util to install packages to that other partition, it needs the user some knowledge of the system...

If you want things to work well then you should first decide how do you want it to work, after that it can be implemented.

  • 1

#12
android@sam

android@sam

    Enthusiast

  • Members
  • PipPipPip
  • 259 posts
  • Gender:Male
  • Location:Nagpur,India
  • Interests:Computers, MObilez...
  • Devices:DELL XCD35 aka ZTE BLADE
Can you tell me where this initramfs is found in kernel source?

  • 0

Sony Ericsson UI On your ZTE BLADE

"CYANSCAPE"


#13
Sulthekk

Sulthekk

    Addict

  • Members
  • PipPipPipPipPip
  • 619 posts
  • Devices:ZTE Blade

Can you tell me where this initramfs is found in kernel source?

Well, on desktop PCs it's built for an already compiled kernel, I don't have the kernel source at hand but I would say it's the same on Android. I have no idea where is it, you may want to ask a kernel dev about it, but I know that one can extract a boot.img to edit it's initrd.

More info about the boot.img format can be found here: http://android-dls.c...ack_Boot_Images

  • 0

#14
breatherII

breatherII

    Newbie

  • Members
  • Pip
  • 1 posts
  • Gender:Male
  • Devices:ZTE Blade
  • Twitter:@TBaratin
Maybe i'm ignorant but... What's the interest ? Any Rom got the same apps (exept MIUI's and maybe some others...)
So why do you really want to overload your phone with a 2nd Rom ?

If it's for the challenge or anything else I can understand it but this kind of project will not be really usefull for the majority of users...

Is there someone who could explain me the advantages of dual boot on a phone ?

( I'm French so I count on you to excuse my bad (but not so terrible) English. :) )

Edited by breatherII, 14 July 2012 - 10:53 AM.

  • 1

#15
karololszak

karololszak

    Regular

  • Members
  • PipPip
  • 72 posts
The point is being able to have two ROMs at the same time, a stable one and a testing one; i.e. GB & ICS or CM7 & CM10, Swedish Snow & CM10 and so on. Some ROMs are believed to be better for gamers (eg. playing GTA3 is possible on most of our ROMs but it doesn't lag as much on some as on the others), other give you more customisation (CM), and some aren't stable enough or are missing some features you might consider as essential (personally I haven't installed any ICS ROM yet because I use YouTube a lot and no HQ is a deal breaker for me).
And it can be also an intresting project, not many devices can manage any kind of dualboot, and if it would be possible on our Blades - why not try it? :)

  • 0

FREE BITCOINS! Yes, we give away bitcoins for absolutely free! Check it out!


#16
sape_

sape_

    Newbie

  • Members
  • Pip
  • 15 posts
  • Gender:Male
  • Devices:ZTE Blade
Very nice idea :D ! I think that the bootloader (grub-like)and recovery could be the same and one .img file on the recovery partition. That means everytime you boot to recovery you should 1) choose witch rom to use 2) perform any tasks you perform in recovery, like flashing a new rom (it may be "a bit "different with two ROM's, huh?).
The problem is, what happens when not booting to recovery partition? Should the first ROM boot up or is it possible to always boot to recovery, even there still is something on the /system partition...

This feature would be great, because I had to switch back to GB because of some gps-problems on Tilals ColdFusion cm9 (ICS).

Of course, developing a recovery that is also a bootloader...propably VEERY hard thing. And maybe no developer thinks it's worth coding :P But I'm just thinking :)

  • 0

#17
Sulthekk

Sulthekk

    Addict

  • Members
  • PipPipPipPipPip
  • 619 posts
  • Devices:ZTE Blade
Ookay, there should be a decision made: How do we want it to work? It's pointless to work on different implementatitions at the same time.

  • 0

#18
sape_

sape_

    Newbie

  • Members
  • Pip
  • 15 posts
  • Gender:Male
  • Devices:ZTE Blade
Yeah, but no-one is working with this, am I right? Now we are just thinking how would it be possible...I just said how I think it would work :D
So, as someone said, there aren't any developers to make multiboot for blade possible. So, if someone is interested, you are hired :)

BTW, is it possible to have more partitions or extended partitions? (I am not very familiar with blade's partitions or TPT-flashes, upgraded my blade with windows...)

  • 0

#19
Sulthekk

Sulthekk

    Addict

  • Members
  • PipPipPipPipPip
  • 619 posts
  • Devices:ZTE Blade

Yeah, but no-one is working with this, am I right? Now we are just thinking how would it be possible...I just said how I think it would work :D
So, as someone said, there aren't any developers to make multiboot for blade possible. So, if someone is interested, you are hired :)

BTW, is it possible to have more partitions or extended partitions? (I am not very familiar with blade's partitions or TPT-flashes, upgraded my blade with windows...)

With the two system partitions there would a be pointlessly small amount of space for even a single /data. At least one of the system should be on the sd-card. People are actually doing less IO on /system than on /data, aren't they?

  • 0

#20
sape_

sape_

    Newbie

  • Members
  • Pip
  • 15 posts
  • Gender:Male
  • Devices:ZTE Blade
Yes, that's the problem of Blade... :(
Anyway, Blade has only 512 mb of storage (correct me if I'm wrong), so it is just enough for two roms (without any data). But that's not good if there is no space for data, at least other /system and/or /data must be on sdcard(Now I'm just repeating what Sulthekk said...). It may be bootable with bootloader?

So, do we have a opinion how should dualboot be done? Does someone know sombady who could start dualboot developing for Blade?

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users