yashsingh1/xdaforums huggingface dataset:
[Defy Android Development] nepotu:
@dlhxr as it was stated previously the ROM's that are build starting from stock ones are not working with current versions of multiboot. The main issue with the stock ROM's is they are not booting up if you choose to start the ROM using 2nd-init method (you will get a bootloop). Check out the lines in 2nd-system.sh

...
cp -f /system/bootmenu/2nd-init/* /
...
######## Let's go
/system/bootmenu/binary/2nd-init

However I think we can modify the code so we can boot stock ROM's but unfortunately it is not possible to keep both options (boot virtual ROM based on Stock and boot virtual ROM using 2nd-init). It's hard to keep both. This can be achieved with a double set of scripts and an updated multiboot binary, that will add an extra step to allow user select which type is the virtual ROM. Based on that selection the ROM will be started using 2nd-init script or as stock.

Bare in mind that what I've said above is just an assumption. Maybe m11kkaa could share his thoughts on the matter.

@joydeep1985 I think 160MB for cache and 300MB for data and system are quite enough for most of the virtual ROM's. For example the system partition on NAND has 325.1MB.

Btw I've created an update.zip starting from m11kkaa's multiboot script (v0.5.1) and the latest CM7.2 nightly by Epsylon3 (CM72-20120405-NIGHTLY-Defy) that includes following:

bootmenu 1.1.8

CWM v5.0.6 – jordan (Custom)

CWM v5.0.6 – jordan (Stable)

Multiboot script v0.5.1

Defy Multiboot binary v0.1

Defy Overclock (default values: 1GHz, 600MHz și 300MHz)

I have uploaded it to dropbox (bm_cwm_mb – v0.2) if there is anyone eager to try it. I've applied this patch over stock Froyo CEE (2.2.2) and I was able to boot CM9. It also works fine on MIUI. I did not tested it on CM7, but it should work fine, as MIUI is based on cyanogen sources. The best part of it is that on stock Froyo the nopreview camera bug, which was present on the old 2ndinit version, was squashed.

The known multiboot usage procedures applies to this patch as well (the virtual ROM should be placed on the SD Card in the multiboot folder) and has all the known multiboot "bugs" (eg: folder name should be less than or equal to 9 chars and it should not contain spaces). The only difference is that in bootmenu 1.1.8 there is a working 2n-system option. Please use it instead of the 2n-boot, otherwise the script will not work and you won't be able to boot the virtual ROM.

The default bootmode is set to 2nd-init and the update.zip will back-up the files it replaces but I do not have at the moment a file to revert the changes, therefore I strongly recommend anyone to take a full nandroid backup before applying it.

PS: I do not take any credit for this update.zip file as all I did was to put together some files/script made by real devs. All the credits for this update.zip file that I've created should go to m11kkaa, Epsylon3 and all the other folks involved directly or indirectly in this project.
[Defy Android Development] Epsylon3:
yes are just partitions ... on a sdcard which cost 10x less than a NAND chip (not sure about the price, but a sdcard has less pins, should be slower)

our CM7/9 versions doesnt use the /cache at all except for market downloads (and its maybe not the case in ics anymore)

standard roms use the /cache to dexopt all the system apks (the slow start on rom update)

its a build option
[Defy Android Development] m11kkaa:
@Epsilon(or quarx): is it possible to write a kernel-module which can edit the devtree? That would make the hook safe against remounting "/dev".

Just if it doesn't take too much time because that would only be a more clean way but not really important.
[Defy Android Development] leodfs:
why not? If you create a image smaller then data it should have, it will not boot. In my own experience it may cause bootloop or motologo stuck. It all depends of what you didnt install due to space.
[Defy Android Development] joydeep1985:
Yes true, But in the case the size which we are actually facing the bootloop isnt something less than our required size for example 150 MB for cache , 250 MB for Data and 300 MB for system isn't undesirable at all. We have faced that boot loop in this scenario only . I guess Nogoodnameuser was pointing out regarding this size matter only that if we have this size already and we get boot loop . Then its obvious the boot loop shouldnt be dependent on the size factor . He meant in that way .
[Defy Android Development] Epsylon3:
We dont need a kernel module to do that, just "busybox mknod" and update the the number of the partitions
[Defy Android Development] leodfs:
i dont know about a good absolute size. But what i do is open the rom zip and see the size of system and data folder add some more space to create a Custom img.

I got boot loop after correct install cm9 (and boot it) just for installing gapps with a custom data folder size.
[Defy Android Development] m11kkaa:
Yes I know, that's what I'm currently doing. The problem is that an unmount does remove the changes. I used init.rc hooks to repatch the devtree after filesystem-initialisation is done.
[Defy Android Development] m11kkaa:
updated multiboot to v0.5.2.

I improved rom-compatibility. I hope this will fix all the booting-problems.
[Defy Android Development] nepotu:
Thanks for the new version! I test it out and it works flawlessly. I have also updated the script that contains the latest bootmenu from Epsylon3's latest CM7 nightly, which fully supports 2nd-system (I've wrote a bit more about it few days ago -link-). As I said previously this is from my point of view helpful for those folks on Stock ROM's or those whom would like to update their bootmenu and CWM. Hope you don't mind and if it does please accept my apologies and let me know so I do not pollute this thread.

PS: the 9 char bug is still there (log).

EDIT: Please use the [2nd-system] option in the bootmenu instead of 2nd-boot if you apply this patch, otherwise you won't get it working.
[Defy Android Development] dlhxr:
official moto rom is still unsupported?

i tested it with no luck with virtual moto rom

Did you test the official moto rom or modified moto rom?
[Defy Android Development] nepotu:
@dlhxr I did not tested ROM's based on stock. As I said previously booting Moto ROM as virtual system is not that easy to achieve. Atm the virtual ROM is booted using the 2nd-init method (see my previous post). The stock ROM should be booted directly otherwise you will get a bootloop. I do not think it's possible to create a script that will detect which type of ROM are you trying to boot.

This can be achieved if the Multiboot binary is updated. A new option should be added on the GUI that will allow user to select how to boot the virtual ROM: using 2nd-init (for ROM's based on cyanogenmod) or directly (for ROM's based on Moto SBF's). m11kkaa what do you think? Can this be achieved?
[Defy Android Development] m11kkaa:
first, 9char-bug will be fixed in next release.

I played a little bit with booting stock-roms as virtual but that seems to be very hard for some reason. This needs more analysis to find the problem.
[Defy Android Development] joydeep1985:
Can you retest this and confirm ? Cause as far as i have tested this . The bootmenu is working fine but multiboot is screwed up . 2nd boot doesnt goes and boot into multiboot 0.5.2.
[Defy Android Development] nepotu:
My bad. I forgot to mention in my previous post that you should use [2nd-system] option in the bootmenu. That was the sole reason I've built the update.zip, so we can benefit from the latest changes to bootmenu made by Epsylon3.

PS: I have played a bit with the 2nd-system.sh script and I managed to boot Froyo CEE as a virtual system, but it was bloody slow. Btw if we use the latest bootmenu

we can

set the script in the 2nd-system option to boot virtual ROM's based on cyanogenmod soruces (ROM's that are using 2nd-init) and we can modify the 2nd-boot script to load Moto based ROM's.
[Defy Android Development] m11kkaa:
Did you tried that?

Because I've a lot of trouble booting stock-roms as virtual.

BTW: next version will recognize the installed version of bootmenu and depending on that it installs as 2nd-system or 2nd-boot.
[Defy Android Development] nepotu:
I have changed the 2nd-system.sh script to this and I managed to boot Froyo CEE as a virtual system but it was (extremely) slow. It should also work if the code is put in 2nd-boot and we let 2nd-system intact. This way we will have an option to boot stock ROM's using 2nd-boot option or we can boot cyanogen like ROM's using 2nd-system. However the code for stock ROM's should be refined.

PS: I use MIUI 2.4.6 (GB) as base system with the latest bootemnu and multiboot scripts (from the update.zip file I've enclosed in my previous post). For Froyo CEE I used this nandroid.
[Defy Android Development] fiskenigaten:
Hey, m11kkaa! Just a small request. Don't mean to be picky or anything, but is it possible to use the white led as indicator instead of red in multiboot?

Red is often associated with error and white looks better :D

Also, can we have "boot from nand" at the top of the list so that all we have to do to boot the real system is to press power button instead of having to press volume keys to select it (at least I use nand more often than virtual system)?

Happy easter! :) Sent from my MB526 using Tapatalk 2 Beta-5
[Defy Android Development] hackergnome:
Hey! U wrote my username wrong!Correct that! Hehehe :P
[Defy Android Development] joydeep1985:
Lol confusion made my day :p Correction made :p
[Defy Android Development] m11kkaa:
This would need a change in bootmenu. But with 2nd-system-option the led will be yellow.

Maybe in future I allow setting a default-bootoption and start this automatically with a timer(like bootmenu's 2ndinit,2ndsystem,...)
[Defy Android Development] ganesh0992:
what is 2nd system??.... what is difference between 2nd system and 2nd boot???
[Defy Android Development] m11kkaa:
2nd-init, 2nd-boot and 2nd-system are scripts which can be booted from bootmenu.

You should know that because you can set the default bootmode in bootmenu.

multiboot ist started via 2nd-system. But because old versions of bootmenu don't have this feature a fix is installed which allows you to boot multiboot via 2nd-boot.
[Defy Android Development] m11kkaa:
release v0.5.3 of multiboot-mod.

The biggest changes are experimental support for stock-roms and a graphical message when an error occurs(I hope you will never see this :P )

PS: I think I'm spending too much time to this mod :D:D:D
[Defy Android Development] nepotu:
Many, many thanks! Can't wait to go home and test the new version. I will keep you posted. I'd like to get involved more on such projects, but my spare time is quite limited. :(

PS: Do you mind if I will update my file with the latest bootmenu and CWM and share it here again?
[Defy Android Development] m11kkaa:
It's ok if you do that but 2nd-boot-mod(for stock roms) isn't needed anymore.

BTW: The installer now automatically detects if installed version of bootmenu supports 2nd-system.
[Defy Android Development] Gazm4n:
Little typo in OP: there´s still v 0.5.2 :)

Nice to see such great advance!
[Defy Android Development] m11kkaa:
changed that, thanks :)
[Defy Android Development] darshanonline:
does anyone get 'codename' working on virtual system?? :confused:
[Defy Android Development] hackergnome:
yes...

300mb system 250mb data 150mb cache...
[Defy Android Development] m11kkaa:
added 0.5.4.

just fixed a little bug in install-script which caused problems with bootmenu's without 2nd-system.

PS: please report if stock-systems are working ...
[Defy Android Development] nepotu:
m11kkaa I've tested the updated version (0.5.3). I'm speechless.;) Since you "encapsulated" the path, there is no longer an issue with the long ROM names. BTW nice one with the framework check for Moto ROM's. The solution was quite simple. I'm ashamed I was looking so far (changes in bootmenu binary or 2 scripts: 2nd-system and 2nd-boot) for it. I wasn't able to see the forest for the trees.

PS: the update.zip I provided was also useful for those folks that are on stock ROM's (as base) or MIUI/CM7 (old version) and they would like to use the latest bootmenu and CWM modules. If there will be people eager to use it for those reasons I will gladly upload it, otherwise I will keep the thread clean.
[Defy Android Development] douglasanpa:
What are the options and which file to make this setting?
[Defy Android Development] dlhxr:
no luck with stock rom.

i tried a me722 modified rom and a defy+ modified rom with froyo kernel.

maybe i got something wrong~ i'll test them again

interesting~

test for stock rom (based on official 2.3 roms and using gingerbreadmod with froyo kernel)

it rebooted twice and after that it showed black screen when i enter the virtual stock rom
[Defy Android Development] Epsylon3:
could we make the cache partition "optional" ?

most of the time its empty or almost not used (cm7/ics)... i think its a waste of space for a "temporary" partition (only used in stock roms)
[Defy Android Development] royale1223:
I agree..
[Defy Android Development] joydeep1985:
Completely went out of my mind . Cache indeed is just for stock roms . it would be really useful addition and would save a lot of space anyway :) ( My 8 GB sdcard is almost bottleneck :( yet to buy another 16 GB )
[Defy Android Development] m11kkaa:
The file is "/system/bootmenu/config/multiboot.conf" and allows changing default partition (sdcard) and path(/multiboot)

Currently only unmodified stock-roms(without greenbread) are supported, because Greenbread uses 2nd-init and stock-init-binaries don't want to load the devtree-patch

I will look for a solution, but you could also resize your cache-image to 1MB.

To the topic above with the devtree: I saw, that the problem is, that the init-binaries mounts the devtree /dev over existing mount. That is the reason I'm looking for a way to permanently modify the devtree.
[Defy Android Development] walter79:
You can run all original rom as second system if you use ramdisk from original motorola kernel for 2nd-init.

There are 4 different ramdisk eclair, froyo, gb 2.3.4 and gb 2.3.6.
[Defy Android Development] m11kkaa:
The problem is, that moto's init-binaries don't want to execute my init.rc-hook to patch devtree. But thanks for that info.

If I find a solution for the problem above I can just extract the ramdisk from boot.img so you don't need to install Greenbreadmod.
[Defy Android Development] N34S:
this new version 0.5.4 still not working with CM9 GB Kernel. black screen but no led blink. i have used bootmenu 1.1.8 and i captured some log screens (cos the dalvik log is unable to be saved in text), if i try to boot with 2nd-system, it gives me this error continuously.

on the bottom row (tid xxxx) xxxx still change for every log update.

and instead of 2nd-boot case appear these errors

where's the problem?
[Defy Android Development] chachoi:
the 0.54 is somewhat confusing,

im going back to 0.41 for now

please write a manual on what the options mean?
[Defy Android Development] m11kkaa:
Seems it can't create "/cache/dalvik-cache". Try to create this folder on virtual cache-partition and try again.

Since 0.5 multiboot is much easier!

If you read installation instructions and this tutorial you should be fine:

http://xdaforums.com/showpost.php?p=24237176&postcount=524
[Defy Android Development] joydeep1985:
Did anyone try to multiboot MS2Ginger GB with CM9 GB build ?
[Defy Android Development] N34S:
i've placed the folder /cache/dalvik-cache by update.zip, and the problem remains the same. also appears in the log this problem.

I am no expert, but imho there is a general problem with cache. why this problem didn't appear in multiboot 0.4?
[Defy Android Development] m11kkaa:
I will install CM9-GB as host-system and try to debug this problem.

Which ROM you installed as virtual?
[Defy Android Development] N34S:
i have installed CM9-NIGHTLY-120330-Defy+ as virtual rom.

btw i have cm72-20120321-NIGHTLY-Defy+ as phone rom.
[Defy Android Development] hackergnome:
I have cm9 gb and use multiboot .5.4 w/o problem!
[Defy Android Development] Epsylon3:
twrp 2.1.0 can introduce a new problem for the Multiboot apk which use tune2fs from the recovery folder...

it can be fixed in the apk code :

LD_LIBRARY_PATH=/system/bootmenu/recovery/sbin:$LD_LIBRARY_PATH /system/bootmenu/recovery/sbin/tune2fs -l part.img

Its because this recovery use libraries to reduce the size of all other binaries, like a normal system do... i will try to add this tool in system, it can be useful...
[Defy Android Development] royale1223:
I already use absolute filepath for executables, so nothing to worry right? I hope these binaries will not be moved/deleted. Isn't that so?
[Defy Android Development] walter79:
MS2Ginger 4.0 beta 4

Hostsystem: MS2Ginger 4.0 beta 4 with latest CM7.2 defy plus bootmenu and recovery. *

2nd-system: CM7.2 defy+ works fine

2nd-system: MS2Ginger 4.0 beta 4 did not boot *

Problem with 2500 D : MOTO_PUPD: mot_boot_mode 07:12.476 2500 2500 D

*(MS2Ginger 4.0 boot via 2nd-init with motorola ramdisk)

Can someone help:

Full log:

http://pastebin.com/Wr5Xa40C
[Defy Android Development] N34S:
which bootmenu version u use? and what phone rom? which kernel?
[Defy Android Development] walter79:
I fixed the problems. MS2Ginger 4.0 beta 4 is 2nd-system ready now..
[Defy Android Development] dlhxr:
could you tell us how to modify the stock-rom and make it boot via 2nd-system?
[Defy Android Development] baxtandroid:
Codename

Anyone managed to boot with codename-defy-1.6 as virtual ?

It doesn't work for me with latest CM9 (defy) as principal...
[Defy Android Development] joydeep1985:
Please check the notes section in my thread here. I have given the Img sizes as mentioned by nogoodusername for booting codename . you can use Multiboot Manager by royal (MultiBootManagerFree_v1.32_royale1223.apk ) in the same post as attachment to create the file systems.
[Defy Android Development] N34S:
ok now i'm on bm_cwm_mb_v0.5-signed and multiboot 0.5.4 and i've tried to boot with small image files from joydeep's guide (credits pabloltg) and gives me defy-multiboot error screen - an error occured. if i try to boot with default fsimages (300mb size each one) it reboots on nand system. I hope that m11kkaa will fix this :)

i've flashed CM9-NIGHTLY-120411-Defy+.zip as virtual system.
[Defy Android Development] m11kkaa:
It would be nice if you can create issues on github if you are facing problems so I have an overview over all problems and you will be informed if it's fixed:

https://github.com/M1cha/DefyMultiboot/issues
[Defy Android Development] joydeep1985:
You didnt mention which is your primary rom . Is it GB or Froyo kernel one ?

It depends what kernel you are using . If you flashed Defy+ zip as virtual system . your Nand system also should be a GB rom and specifically not froyo . I would try to make the reason why is it so . The kernel is like the Bios of a computer . At a time only one kernel works out . Arpith Fbi mentioned it in his posts . So if you are already using a GB kernel only then you can use a combination of NAND + Virtual system = GB kernel + GB Kernel . And also if you are facing problem with fsimages i suggest you to go alongwith the fsimages in M1kkaa . The zip bm_cwm_mb_v0.5 contains touch recovery i am yet to test . I would try to recreate the issues as per told by you when i return home :)
[Defy Android Development] nepotu:
Hello everyone!

I will share my findings and I hope this post will shade some light on the matter. After I read N34S comment I tried to install Ep3 latest CM9 nightly for Defy+ (CM9-NIGHTLY-120411-Defy+.zip).

My setup:

- Defy (green lenses)

- MIUI GB 2.4.6 (base system)

- bm_cwm_mb_v0.5-signed (installed in order to use latest bootmenu, twrp and multiboot on MIUI)

CM9 installation steps:

- created a folder for the virtual ROM (/sdcard/multiboot/Ep3-ICS-gb/) and placed inside the "original" fsimages (system.img, data.img, cache.img) - the images m11kkaa put on OP since multiboot v0.4-

- reboot into bootmenu and selected 2nd-system

- selected Recovery (CWM) option, then I selected my virtual ROM.

- on Multiboot Recovery (twrp) selected Install option and then CM9 zip file and installed it (did the same for GApps)

- rebooted the phone and entered in stable recovery (twrp) [base system]

- flashed kernel-gb-234.zip kernel and rebooted

- entered in bootmenu and selected 2nd-system

- selected CM9 ROM (CM9-NIGHTLY-120411-Defy+.zip) and booted it succesfully

Here is the installation log for CM9-NIGHTLY-120411-Defy+.zip using the "original" fsimages. So far so good.

As you can see, everything went smooth, but if you try to do the same with some virtual partitions created with Multi Boot Manager 1.32 by royale1223 after installing twrp (using the original update.zip file from their site or the bm_cwm_mb_v0.5-signed created by me) you will not be able to install anything as a virtual system. Same happens if you choose only to format the VSF with MBM (Wipe whole VFS).

I uploaded a log from twrp (on multiboot) after I formatted my virtual partitions using MBM. You can see it here. As you can see the virtual images are corrupted and cannot be mounted.

The culprit seems to be related to twrp installation. The path for tune2fs in MBM should be changed, as Epsylon3 said here, otherwise it will break the virtual partitions.

@royale1223 can you please have a look and fix the MBM?

@others please use the "original" images or create new ones on your pc using toporesize-0.7.1.

Hope it helps!
[Defy Android Development] joydeep1985:
Hmm makes sense that's why i didnt get any error cause i used the original fsimages or the images created by pablotg to install CM9 defy+ on virtual system . Didn't use Royalee'e MBM to create the images . As a result i didnt face the error as well
[Defy Android Development] royale1223:
From the log file I can understand that tune2fs is missing. I'll make a zip that contains tune2fs. By the way can you paste output of 'which tune2fs	'?
[Defy Android Development] nepotu:
Here is the output:

# which tune2fs

which tune2fs

/system/bin/tune2fs

EDIT: I'm on MIUIandroid and had no issues with MBM before TWRP.
[Defy Android Development] royale1223:
The error is because twrp uses tune2fs library instead of exectable.
[Defy Android Development] trurl3:
Till now I undestand

That's what I do not understand. Is it really needed to flash kernel into NAND system when installing into virtual? What about functioning of NAND sytem in such situation?

Forgive me my noobish questions but maybe somebody could enlighten me in matter of flashing GB kernel when istalling Defy+ ROM on normal Defy with Froyo. How it should be done properly?
[Defy Android Development] nepotu:
As far as I know you can not reload the kernel from the virtual system in order to boot the virtual ROM, therefore you have to update the main/NAND one (the kernel is already loaded when the bootmenu screen is shown).
[Defy Android Development] royale1223:
Change log version 1.40

Cheers :D:D:D
[Defy Android Development] m11kkaa:
I found the problem which caused errors booting stock-roms with Greenbreadmod. I will update the mod soon :)

I will try to analyse GB-Kernel and tune2fs-problems, too...
[Defy Android Development] nepotu:
Many thanks to royale1223 and m11kkaa. Can't hardly wait to try the new versions. A nice weekend to you all and Happy Easter for those who are celebrating it this weekend!
[Defy Android Development] dlhxr:
i am waiting for this time so long. haha!

thx for your great effort!!!
[Defy Android Development] baxtandroid:
AOKP

How can we virtualy boot on the AOKP rom ?

I tried with the MBM images: cache:75 system:200 data:450 and with the stock fsimages (300x3) :)
[Defy Android Development] m11kkaa:
v0.5.5 is up with support for stock-roms with Greenbreadmod.

Still can't boot Froyo-Rom's via 2nd-init. They will boot (on a froyo-kernel) but recovery/bootmenu-reboot will not work.
[Defy Android Development] pabloltg:
I cant open the .zip.. :confused:

View attachment 1001524
[Defy Android Development] m11kkaa:
upload fail :eek:

Now it works...