Post Reply

[EXPERIMENTAL] MultiROM v19 (discontinued)

15th October 2011, 04:42 PM   |  #1  
Tasssadar's Avatar
OP Recognized Developer
Flag Brno
Thanks Meter: 4,671
 
703 posts
Join Date:Joined: Dec 2010
Donate to Me
More
This project is now discontinued and will recieve no further updates nor support.

First of all, thanks petter (https://github.com/havlenapetr), Czech Samsung Galaxy developer, for idea and source codes.

What do I mean?
You have one ROM in internal memory as usual, and another one in folder on SD card ext partition. You can easily switch between them - just move rom from ext partition to some backup folder.

See guide in second post

How is it done?
Lets look on how android boots - its (roughly) like that:
1. Bootloader - forks between recovery, fastboot and normal boot
2. Linux kernel - Unpacks its initrd, loads drivers and many more things, not important now
3. Init - kernel runs this program, which mounts android partitions, sets correct permissions to files, starts services, and in the end, starts android itself
4. Android - Dunno much about it yet, anyway not important now
So, what we need to do is mount something else than internal memory in init. Init parses & runs simple scripts, which makes it simpler to mount sdcard folders.

We need to add mknod and bind mounting to init binary. Unfortunately, we dont have sources of init modified by LG (that thing is three(!) times larger than init compiled from AOSP, what the hell is in there?!). That is solved by running modified init, which parses "preinit.rc" with mounts and then runs LG init.
Commit: https://github.com/Tasssadar/init/co...c865aa29a54809
preinit.rc: https://github.com/Tasssadar/init/bl...isk/preinit.rc

This would be all, if original LG init would not remount /system and /data from internal memory. Also, nearly every ROM has different init.rc, and wont boot without it.

To solve this, I created "import_boot" command in init, which copies *.rc files and LG init from ramdisk(well, its only folder with these files extracted from ramdisk for now) on sdcard ext partition. This command also puts comments out every line with mount /data, /system or /cache in init.rc file, so LG init wont remount them.
Commit: https://github.com/Tasssadar/init/co...616765ee043e83, https://github.com/Tasssadar/init/co...5c71237231436c and https://github.com/Tasssadar/init/co...229605bc517b52

Format of ROM on ext partition:
All files from paritions in internal memory copied to sd ext partition with preserved owners and permissions(!).
So, when I copy data, I do "cp -r -p /data/* /sd-ext/multirom/rom/data/" (I suggest to run this via adb shell while in recovery).
Currently, I mount /system, /data and /cache from sdcard. If one or more of these folders does not exist, its equivalent from internal memory is used.
It would be nice to have *.img files from nandroid backups instead of this, but as far as I know, they cant be just mounted.

As for *.rc files, I put them into /sd-ext/multirom/rom/boot folder. I would like to just copy boot.img and extract files in init, but I did not find way to extract it when I have hardly STL usable in init. I'd like to use kernel's internal decompressor, but I dont know how.

Limitations
- Both ROMs must be compatible with one kernel - kernel is already loaded in init
- ROMs must be for same baseband, obviously
- Kernel modules(wifi, for example) of both ROMs must be compatible with one kernel. That can be easily solved by copying modules from one ROM to another, though.
- It will be slower than internal memory.

Integration with recovery
Definitely possible & usefull. This is integration in my modified AmonRa recovery: https://github.com/Tasssadar/Amon-Ra...b81e8c55dc3ee2

Security risk
/system on sdcard can't be mounted read-only - I'd have to mount whole sdcard read-only. This is possible security hole, but you cant do much without root anyway, because of permissions. And if you have root, it does not matter if its read-only or not.

Conclusion
So, it is possible to have dual-boot. You can use it to develop ROMs(you can directly edit data in /data and /system), as backup ROM when you are testing something in internal memory which does not boot, and you need to call someone or when our devices will be so old that bad blocks in internal memory wont allow us to boot

But, as you can see, It is not something that average user could do, at least not yet. Maybe I could modify recovery to do everything for the user (copy data from /system, /data and /cache, extract *.rc files from boot) and create some flashable ZIPs which would modify the init.

But there are some problems - some ROMs may not be compatible with this and there are multiple recoveries out there, but theres not single one which is only for our phone - both AmonRa and ClockworkMod are developed for wide range of devices. Yes, both of them can be modified, but I doubt they creators would accept such inflexible and device-specific thing.
What do you think, is it worth it?

Tested ROMs (first one is in internal memory, second one is on SDcard)
Working:
  • Megatron and stock v10a ROM - stock rom is slow
  • Megatron and devoid #froyo-final - like ten times faster than stock xD
  • LightRom(2.2.2) and devoid #froyo-final (and vice versa)
  • Megatron and Megatron - both ROMs can have a2sd
  • Megatron and Mik's CM7 6.5.8 - since v2
  • Gingerbread 2.3.4 from Optimus Net and CM7 6.6.1 (thx eduardogouveia for testing)
  • Stock 2.2.2 and CM7 6.5.8 (thx eduardogouveia for testing) - if you have ext4 partition, you need custom kernel for stock ROM.
  • .void 2.3.4 and stock V20B (thx diazneoones for testing)
  • CM7 6.5.8 and .void 2.3.4 (thx diazneoones for testing)
  • CM7 nightlies and Lupohirp's СM9 (thx aquapp for testing)
Not working
  • None found yet, but when CM7 is on sdcard, it looses root. Trying to figure out why. - fixed in v10


PS: I hope I explained it correctly, not exactly good at this. Do not fear to ask, if you don't understand something.
Last edited by Tasssadar; 1st September 2013 at 07:27 PM.
The Following 57 Users Say Thank You to Tasssadar For This Useful Post: [ View ]
15th October 2011, 04:47 PM   |  #2  
Tasssadar's Avatar
OP Recognized Developer
Flag Brno
Thanks Meter: 4,671
 
703 posts
Join Date:Joined: Dec 2010
Donate to Me
More
OK, here goes guide for average user. This is still highly experimental feature, keep that in mind. Backup, backup backups and backup them to PC, read whole guide first, I am not responsible for your bricked phone etc.
GUIDE:
1. Requirements
  • Ext4/Ext2/Ext3 partition on SDcard big enough to hold all files from /system and /data, which is from 170mb to 400mb (depends on ROM and apps installed), so I think 512mb partition is minimum (if its 90% or so free).
  • Modified recovery. Only AmonRa and CWM version is available at this time, TeamWin is coming "soon". You can find flashable zip at the bottom of this post, flash it before you proceed to next move. If something goes wrong, you can restore your recovery with zips from here.
  • Kernel with ext2/3/4 support, which is basically every but stock
  • Both ROMs you wanna use must be compatible with same kernel. See Limitations in previous post

2. MultiROM instalation
- Via MultiROM Mgr application
I recommend you do nandroid backup before installing via this app.
Download MultiROM Manager (link at the bottom of this), tap to "Tap to install via this app" and wait. As simple as that. Mgr will also install recovery for you (It will ask you which one, you can select AmonRa, CWM and none). App can check & install update, too.
- Via recovery
Just download multirom.zip at the bottom of the post, make nandroid backup and flash it. Your current ROM will be the one in internal memory, we will setup the one on the SDCard in next move.
Now, try to reboot the phone (boot will take little longer, because it has to mount ext partition). If it boots up correctly, then its OK - your ROM is supported. If not, then restore your nandroid backup and post your ROM name here, maybe I'll try to make it working.
3. Setup ROM on the sdcard
Make nandroid backup (I am not kidding, you will need this one), flash ROM which you wanna to have on SDcard, do the first boot (because it will create dalvik-cache, and you dont wanna do that when its already on sdcard) and reboot to recovery again.
Go to "MultiROM options" menu and select "Create from current ROM". It will do everything for you (it takes time, though). ROM on the sdcard is placed in /sd-ext/multirom/rom/, backups are in /sd-ext/multirom/backup/.
Restore nandroid backup from beggining of this step and reboot. Wait until Boot manager shows up, and select SDcard as boot location. ROM from sdcard should boot. If your ROM from internal memory boots or if its stuck, something got wrong and you should restore from backup.

4. MultiROM recovery menu description
Active/deactive state is for recovery only, you can boot ROMs from backup in boot manager - that means its N-times boot rather than dual-boot.

When not active(boot from internal memory):
  • Activate (move from backup) - when you already have backup, this will move it to active folder (fast).
  • Activate (copy from backup) - same as above, but it copies it instead of moving
  • Create from current ROM - pretty self-explanatory
  • Create from ZIP file - see http://forum.xda-developers.com/show...7#post22194117
When active(boot from sdcard):
  • Deactivate (move to backup) - Moves current ROM to backup folder, so next boot will be from internal memory
  • Backup - Creates backup of current ROM
  • Erase current ROM - Deletes current rom, next boot will be from internal memory
  • Copy modules from int mem - Copies modules from ROM in internal memory to SDcard. Try this if WiFi does not work in SDcard ROM.
  • Flash ZIP - flash ZIP file to ROM on SD card, for example gapps.

5. Config file:
It is recommended to use Multirom Manager(see bottom of this post) to change config file.
File itself is placed on sdcard and its name is multirom.txt. Description of its contents is in this post(post is updated if something changes): http://forum.xda-developers.com/show...3#post20045183

6. Key bindings:
Since v11, you also can control MultiROM via touchscreen.
  • Anywhere: Hold Power button to shut down the phone
  • While on main screen:
    • VolUp/Down - list between actions
    • Menu - Confirm action
    • Back - Reboot to recovery
    • Power button - Sleep mode
  • While playing tetris
    • VolUp - return to main screen
    • VolDown - pause
    • Menu - move the piece to left
    • Home - hard-drop
    • Back - rotate piece
    • Search - move the piece to right

FAQ:
Q: It is slow!
A: Its sdcard. It just is slower than nand memory.

Q: It does not work with my ROM
A: Post your ROM combination here, maybe I'll see to it.

Q: When do I need to reflash?
A: When you flash new ROM or do something which rewrites boot partition. Most (if not all) kernels are using Koush's AnyKernel, so they should not cause any problems.

Changelog & Download:
(Always flash newest version)

Uninstaller: http://www.mediafire.com/?3eco51f2t0at77o (info here)

Changelog AND DOWNLOAD LINKS have moved to github: http://tasssadar.github.com/multirom/

Recoveries
AmonRa - based on 3.06: http://www.mediafire.com/?ld9g81igvze7na0 (9th March 2012 21:57)
AmonRa - based on 2.2.1: http://www.multiupload.com/7Y5HHNEPOT (20th October 2011 22:29)
CWM: http://www.mediafire.com/?6rfw0qbrddzq5d8 (9th March 2012 21:57)
TWRP: http://www.mediafire.com/download.php?o8kphxmfk9l01tl (21st October 2012 23:49)

MultiROM Manager app
http://forum.xda-developers.com/show...2#post20610052

(Always use newest version)
v24 - http://www.mediafire.com/download.php?1xy52tamzepibrx (TWRP support)
v21 - http://www.mediafire.com/?u9c3bmfbtf57dtm (Add charger settings)
v18 - http://www.mediafire.com/?g1lpsp66jc1cb1b (Add boot location settings)
v17 - http://www.mediafire.com/?l1li51sseaisz5j (Add brightness setting)
v15 - http://www.multiupload.com/B65WPFMFXP (Show & reset tetris high score)
v14 - http://www.multiupload.com/FWB5UBSMO1 (Updater now also check for app update, some minor fixes)
v13 - http://www.multiupload.com/NYYBX9CAFD (Update translations, add support for optimus V - http://forum.xda-developers.com/show...8#post20657898)
v11 - http://www.multiupload.com/1L3294ZAU7 (Fix mount issues on some roms, add menu to main screen, add link to xda)
v10 - http://www.multiupload.com/B3AVSFKDOW (Create /sd-ext/multirom folder on install)
v9 - http://www.multiupload.com/WW7TUNP7RY (read http://forum.xda-developers.com/show...6#post20624306)
v8 - http://www.multiupload.com/6OD7RQ74OE
v7 - http://www.multiupload.com/DJKMUGIVJ0
Last edited by Tasssadar; 21st October 2012 at 10:49 PM.
The Following 32 Users Say Thank You to Tasssadar For This Useful Post: [ View ]
15th October 2011, 05:29 PM   |  #3  
ciolnadu's Avatar
Senior Member
Flag Simeria
Thanks Meter: 39
 
370 posts
Join Date:Joined: Dec 2010
More
Something like this have the Xperia series. Maybe u find something u can use there.

Sent from my LG-P500 using XDA App
15th October 2011, 08:42 PM   |  #4  
Account currently disabled
Flag W4ZT3D
Thanks Meter: 380
 
1,774 posts
Join Date:Joined: Oct 2010
More
so this means we can test roms without replace current ??
15th October 2011, 08:56 PM   |  #5  
Tasssadar's Avatar
OP Recognized Developer
Flag Brno
Thanks Meter: 4,671
 
703 posts
Join Date:Joined: Dec 2010
Donate to Me
More
Yes. Is my english so bad or you just don't read what I wrote? :P
The Following 7 Users Say Thank You to Tasssadar For This Useful Post: [ View ]
15th October 2011, 09:01 PM   |  #6  
Bytecode's Avatar
Recognized Developer
Flag /dev/null
Thanks Meter: 4,458
 
2,591 posts
Join Date:Joined: Dec 2010
More
Quote:
Originally Posted by Tasssadar

Yes. Is my english so bad or you just don't read what I wrote? :P

For the last time,you're speaking english perfectly ()
15th October 2011, 10:41 PM   |  #7  
lipe082's Avatar
Senior Member
Flag porto
Thanks Meter: 174
 
684 posts
Join Date:Joined: Dec 2010
More
how to install your zip of amonra recovery i try but the recovery says that the zip dont have updatescript so it gives error....

i dont understand how to do this but iim searching this for a long time,if you can make a more frindley all user guide it will be very cool thankyou and hope you could doot....
16th October 2011, 01:33 AM   |  #8  
Tasssadar's Avatar
OP Recognized Developer
Flag Brno
Thanks Meter: 4,671
 
703 posts
Join Date:Joined: Dec 2010
Donate to Me
More
*sigh* once again, this is [dev] thread, this is not something you can flash, at least not yet. You would know that, if you'd read whole post.
The Following 3 Users Say Thank You to Tasssadar For This Useful Post: [ View ]
16th October 2011, 01:41 AM   |  #9  
franciscofranco's Avatar
Recognized Developer
Flag Mountain View, CA
Thanks Meter: 88,537
 
15,699 posts
Join Date:Joined: Dec 2010
Donate to Me
More
Quote:
Originally Posted by eduardogouveia

how to install your zip of amonra recovery i try but the recovery says that the zip dont have updatescript so it gives error....

i dont understand how to do this but iim searching this for a long time,if you can make a more frindley all user guide it will be very cool thankyou and hope you could doot....

[dev] means this is not something ordinary. Don't know what it is, don't mess with it.

Quote:
Originally Posted by Tasssadar

*sigh* once again, this is [dev] thread, this is not something you can flash, at least not yet. You would know that, if you'd read whole post.

Don't worry, you'll get more "hao cn i flush this into ma phones?" questions, good luck.
The Following 5 Users Say Thank You to franciscofranco For This Useful Post: [ View ]
16th October 2011, 08:31 AM   |  #10  
aspee's Avatar
Recognized Contributor
Flag mumbai
Thanks Meter: 1,035
 
667 posts
Join Date:Joined: Aug 2011
More
sounds like fun
thanks for bringing it for optimus one
but i have one question for you
I think in future kernel changing will also possible
because if we can flash kernel then we can make it to change
right?

Post Reply Subscribe to Thread

Tags
dual boot, multirom
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes