[GUIDELINES] Dual-Boot on (theoretically) any Android device

Search This thread
@dreccon I get these errors when running your convert ZIP script. The boot.img gets screwed up

Code:
\DUAL BOOT RECOVERY v3.1                         built by dreccon@XDA

Processing:
nameless-4.4.4-20140621-p920-HOMEMADE.zip
This is a ROM/Kernel zip

Editing...

/mnt/sdcard/_ExternalSD/DualBoot/DBootRecoveryV3.1.sh[532]: [color=red]cpio: not found[/color]
sed: fstab.*: No such file or directory
sed: fstab.*: No such file or directory
sed: fstab.*: No such file or directory
sed: fstab.*: No such file or directory
sed: fstab.*: No such file or directory
sed: fstab.*: No such file or directory
sed: *.rc: No such file or directory
sed: *.rc: No such file or directory
sed: *.rc: No such file or directory
Edited:
 and/or all
relevant files in RamDisk.

Creating new archive...

Compressing...
failed on '/mnt/sdcard/_ExternalSD/DualBoot/img/boot2.img' - No such file or directory

Backing up primary boot.img...
failed on '/mnt/sdcard/_ExternalSD/DualBoot/img/boot1.img' - No such file or directory
20480+0 records in
20480+0 records out
10485760 bytes transferred in 0.653 secs (16057825 bytes/sec)

Operation complete!

Press Enter to continue: [CODE]

//Sent from somewhere in your house[/QUOTE]

 [user=4487432]@lzzar[/user]
Your problem is the missing cpio command, therefore, I believe you need to install/update your busybox.
 
  • Like
Reactions: lzzar
M

Modding.MyMind

Guest
:)

6uhuqu2u.jpg


Sent from my C525c using Tapatalk
 
Thanxz
But after this I Want 2 Go back Normal to stock please tell me revert steps thanxz:good::fingers-crossed:
Just flash the kernel from your primary ROM and reboot. If you used the automated zip converter, then just run the SwitchROM script.
If you want to dump dual boot all together, then boot to your primary ROM and format your SD card (after you back it up, of course).
 

Sharma Manu

Senior Member
Aug 23, 2014
75
3
Ghaziabad,Uttar Pradesh
Just flash the kernel from your primary ROM and reboot. If you used the automated zip converter, then just run the SwitchROM script.
If you want to dump dual boot all together, then boot to your primary ROM and format your SD card (after you back it up, of course).

thanxz for your quick reply but i am unable to boot into recovery mode i used all type of key combination But my phone skip recovery And proceed to boot animation:confused:
 
thanxz for your quick reply but i am unable to boot into recovery mode i used all type of key combination But my phone skip recovery And proceed to boot animation:confused:
OK, let's take things from the beginning. 1. What phone do you have?
2. What ROMs have you installed?
3. Did you use the automatic zip converter before flashing your secondary ROM?
4. Did your secondary ROM boot normally?
5. Is your secondary ROM prerooted?
 

Sharma Manu

Senior Member
Aug 23, 2014
75
3
Ghaziabad,Uttar Pradesh
Thanxz

OK, let's take things from the beginning. 1. What phone do you have?
2. What ROMs have you installed?
3. Did you use the automatic zip converter before flashing your secondary ROM?
4. Did your secondary ROM boot normally?
5. Is your secondary ROM prerooted?

Thanxz Again for your Quick Reply :victory:
1) My Phone Model No Is Lg p920(Optimus 3D)
2)Currently My phone Runs On CyanogenMod-7.2.0-p920
Kernal Version-2.6.35.7-cyanogenmod rmcc@tenkian) )
Baseband Version LGP920AT00-V21e-EUR-XXX-Apr-19-2012+0
3)Don`t Known sorry i forgot:(
4)Currently I Am only on cyanogen mod 7 and its boot normally:laugh:
5)Yes my Rom is root With superuser
One More thing Recently I Install Diskinfo Pro And I got This Please See Attachment(ScreenShot Images)
My Some Partitions Is Unmount:crying: Thanxz Again:good:
 

Attachments

  • screenshot-1418056677917.png
    screenshot-1418056677917.png
    74.7 KB · Views: 92
  • screenshot-1418056696581.png
    screenshot-1418056696581.png
    78.7 KB · Views: 88
  • screenshot-1418056705632.png
    screenshot-1418056705632.png
    68.7 KB · Views: 93
  • screenshot-1418056714939.png
    screenshot-1418056714939.png
    59.6 KB · Views: 92
Thanxz Again for your Quick Reply :victory:
1) My Phone Model No Is Lg p920(Optimus 3D)
2)Currently My phone Runs On CyanogenMod-7.2.0-p920
...

Good idea to take those screenshots. They helped a lot.

So, you have installed CM7 as your primary ROM (was it meant to be your secondary one?). The only way to return to the ROM you previously had is to restore your backup. I hope you have one.

I can see that you have created partitions for a secondary ROM but they are not being used at the moment. The P920 is a little stubborn when it comes to its boot images. The only ROM that can be correctly converted for use as a secondary with the automatic zip converter (in this thread) is Nameless 4.4.4 by troopii. If you want to use CM10 or berni's PACman 10.1, then I suggest you take a look at the P920-specific thread (link is in my signature). Take your time and read the guide carefully. Make sure you have understood everything before you begin.
 

Sharma Manu

Senior Member
Aug 23, 2014
75
3
Ghaziabad,Uttar Pradesh
Sorry for my Late Reply

Good idea to take those screenshots. They helped a lot.

So, you have installed CM7 as your primary ROM (was it meant to be your secondary one?). The only way to return to the ROM you previously had is to restore your backup. I hope you have one.

I can see that you have created partitions for a secondary ROM but they are not being used at the moment. The P920 is a little stubborn when it comes to its boot images. The only ROM that can be correctly converted for use as a secondary with the automatic zip converter (in this thread) is Nameless 4.4.4 by troopii. If you want to use CM10 or berni's PACman 10.1, then I suggest you take a look at the P920-specific thread (link is in my signature). Take your time and read the guide carefully. Make sure you have understood everything before you begin.
Sorry for my late reply and thanxz for your quick help!
Before doing this i make full backup of my rom with cwm
But i am unable to enter into recovery mode. I think my recovery partition is unmount Please See again my Screenshots.
Do you have any way to remount my recovery partition using terminal emulator:confused:
 
Sorry for my late reply and thanxz for your quick help!
Before doing this i make full backup of my rom with cwm
But i am unable to enter into recovery mode. I think my recovery partition is unmount Please See again my Screenshots.
Do you have any way to remount my recovery partition using terminal emulator:confused:
Your recovery partition has no reason to be mounted while Android is booted. Also, your question is off topic. For P920 specific questions, please post in a P920 thread. See my signature.

Sent from my Oppo Find 7a X9007 with rare/no GSM/3G reception
 

Sharma Manu

Senior Member
Aug 23, 2014
75
3
Ghaziabad,Uttar Pradesh
No Luck

Your recovery partition has no reason to be mounted while Android is booted. Also, your question is off topic. For P920 specific questions, please post in a P920 thread. See my signature.

Sent from my Oppo Find 7a X9007 with rare/no GSM/3G reception
Hello And thanxz Again
Last Second post you say to me:-
So, you have installed CM7 as your primary ROM (was it meant to be your secondary one?). The only way to return to the ROM you previously had is to restore your backup. I hope you have one.

Yes i have one fresh backup of my p920(cwm)But problem is i am unable enter into recovery mode
i use these keys combinations to enter into recovery mode

vol down+3d+power button

But no luck
 
Last edited:

Sharma Manu

Senior Member
Aug 23, 2014
75
3
Ghaziabad,Uttar Pradesh
thanxz

Hello And thanxz Again
Last Second post you say to me:-
So, you have installed CM7 as your primary ROM (was it meant to be your secondary one?). The only way to return to the ROM you previously had is to restore your backup. I hope you have one.

Yes i have one fresh backup of my p920(cwm)But problem is i am unable enter into recovery mode
i use these keys combinations to enter into recovery mode

vol down+3d+power button

But no luck
thanxz dreccon
I think A external flashing box Solve my all problems Like ufs 2 or octopus box Thanxz For Your Quick Support My Friend Take Care:good:
 
  • Like
Reactions: dreccon

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    A lot of users around here like to try out different kinds of ROMs on their devices. It is advisable though, to always keep a backup of a stable (usually stock) ROM on your SD card. The truth is that it is very time-consuming to have to backup and restore ROMs in recovery just to boot to a new ROM for a few hours, run some tests and then go back to the stable one. It is also true that AOSP based ROMs may not support special features of certain devices (e.g. 3D displays and cameras or FM tuners), so a stock-based ROM must always be handy in case you need those features. This is why Dual-Boot can be useful. It allows people to switch between two ROMs almost as quickly as a simple reboot.

    I have followed these guidelines to create Dual-Boot on four different phones and I suppose that the same method can be used for any phone.
    The idea is to keep any stable ROM as primary and install an AOSP-based JB (4.1) or newer ROM on the SD-card.


    WARNING: If you are not familiar with the way Android works, you can easily brick your device by flashing the wrong partition. I won't assume responsibility if you do and I can't offer support since I cannot possibly own all the devices this guide may be applicable to. If you don't fully understand these guidelines, then stay away. If you still want to try, remember, you are on your own! Questions, suggestions and remarks should be properly posted in the thread for everyone to read. Take no ofense, I will not reply to PMs.



    Prerequisites:

    A) You need to fully unlock your device (Root, Bootloader unlock, S-Off or whatever else your device has that may prevent you from flashing partitions).

    B) You need to find a suitable way to unpack and repack your boot.img. Different ways are available for different devices. I can only suggest those that I have tested for mine.

    C) You need to have a working updated busybox.

    D) A ROM zip file to install onto the SD card. This ROM must NOT be using Aroma Installer.



    Steps:

    1. First you need to figure out the locations and sizes of your system, data, cache and boot partitions (you can use Partition Table from Play Store).

    2. Create three additional partitions at the end of your SD card with the sizes you found. You can either use AParted on your phone or MiniTool and a card adapter on your PC. The partitions must be all primary and formatted to ext4.
    (HINT1: If you use AParted, you probably want go hit "Decline" on the agreement, otherwise it will install adware junk)
    (HINT2: You may want to create a larger Data partition, so that you have more space to install apps)
    (HINT3: If you can convert ZIPs using DBootRecovery from 2nd post, then do it and jump to step 7)

    3. Now you have to unzip the ROM file you want to install, browse to /META-INF/com/google/android, find the updater-script and edit all lines that contain mmcblk0ps (where s is your internal system partition number) to mmcblk1p2 (your new SD-system partition). Some ROM zips (like MIUI) also install stuff to the data partition, so be careful and change the respective lines from mmcblk1pd (where d is the number of your internal data partition) to mmcblk1p3.

    4. You also need to unpack the boot.img, find the fstab.nick in the ramdisk (nick is the nickname of your device) and edit the sysyem, data and cache mountpoints to /dev/block/mmcblk1p2, 3 and 4 accordingly.
    In some ROMs, the fstab. file plays no important role. In this case you must search inside files ending in .rc in the RamDisk for lines that have to do with the system, data and cache partitions. For example, in HTC One SV stock-based ROMs, you must change emmc@system with /dev/block/mmcblk1p2. Data and cache also follow this pattern.

    5. If you need to flash GApps, then you must also modify that updater-script by changing the line run_program("/sbin/busybox","mount","/system"); into mount("ext4","EMMC","/dev/block/mmcblk1p2","/system");
    Any other add-on you may want to flash must first be edited as described in steps 4 & 5.

    6. Pack and zip everything back and reboot to recovery.

    7. Make a backup of your current ROM and flash your modified zip(s).
    When you reboot, your device should load your secondary ROM.


    To switch back to the primary ROM you need to reflash your primary kernel (from the backup you took). Use dd if=path/backup.boot.img of=/dev/block/mmcblk0pb (where b is your boot partition) and reboot.
    To boot back to your secondary ROM, just use the above command to flash the boot.img extracted from your modified ROM.zip. This process can now be done automatically using SwitchROM.sh from 2nd post

    If you don't like scripts or terminal commands, another way to flash your boot images is Flashify.

    If for any reason your 2nd ROM doesn't boot (e.g you haven't found the right method to pack your boot.img), you can advanced-restore just your primary boot.img from your backup in recovery. This way you'll be able to boot back to your primary ROM which is otherwise unaffected by the procedure.



    In order to complete step 4, these links may be a good start:

    i) These tools by Modding.MyMind work on my HTC.

    ii) These ones by michfood work on my HTC but only unpack my LG boot.img

    iii) and this one by berni987654321 packs my LG boot.img (download dualboot_tool.zip at the end of 1st post).
    Don't forget to hit "Thanks" on those pages too.



    Important:

    - Be extra careful if your secondary ROM supports OTA updates which are applied through recovery. Only download but NEVER apply them before you tweak the zips as described above. Otherwise they will overwrite your primary ROM!

    - Actually, every zip you want to flash to your secondary ROM must be edited first, otherwise it will flash to your primary.

    - You can only use your regular custom recovery to flash edited zips to your secondary partitions. You can't use it to backup, restore or wipe them. Those functions will only affect the primary ROM. For this reason, I have created the DBoot Recovery script. For more info, read on to the second post.



    Special thanks to @berni987654321 from whom I learned almost everything there is to know about Dual-Boot. This guide is based on his work.
    9
    DBoot Recovery Tools

    Here are the scripts I promised.


    Initial Setup

    1. In order to use the scripts, you need to have partitioned your SD card the way I described in the previous post.
    2. Download the zip from the link at the end of this post, unzip it and copy the DualBoot folder to the root of your SD card.
    3. Install Script Manager from Play Store
    4. Install (or update) Busybox

    Inside the Dual Boot folder you will find two scripts and some more folders. Please do not change anything there. Just use ScriptManager to run the scripts. Their usage is explained below.




    DBootRecovery.sh

    Purpose: Manage your secondary ROM.
    This tool is designed to run on the primary ROM, but some major functions are also available on the secondary.



    1st run

    Open ScriptManager, browse to the DualBoot folder and tap on DBootRecovery.sh. At the top of the screen that follows, select the first two icons (Fav and SU). I also prefer to enable the Wklock icon (it has to be enabled in settings first). Then you can hit Run.
    When you run the script for the first time, it will try to read the /proc/emmc file (if it exists on your system) in order to determine your normal partitions. If the file exists, it will present you the data, so you can accept or reject them. If it doesn't exist, it will ask you to enter your partition numbers manually. In both cases, the data will be exported to a new file (part.ini) in the DualBoot folder and you will not be asked again.



    The main screen

    The top two lines are important. After a selection you made completes and returns to the main screen, the first two lines will inform you of its success or if any errors occurred.



    Main menu

    1. Backup ROM2
    This option will create a backup of your secondary ROM. It will actually create images of your secondary system (mmcblk1p2) and data (mmcblk1p3) partitions. Those two will be saved in the backup folder inside DualBoot. Be careful, a new backup will overwrite the old one. If you want to keep an old backup, make sure you move or rename it.

    2. Restore ROM2
    This option will flash the images you took with option 1 back to their respective secondary partitions. It will only be available while you are on your primary ROM (you don't really expect to flash a partition while it's being used).

    3. Convert ZIPs
    This tool wil automatically do all the edits described in the 1st post to all ZIPs it can find in the OriginalZIPs folder. It is based on @Modding.MyMind's binaries [point (i) in 1st post]. If they don't work for you, you will see an error message. The original ZIPs will be kept intact and the edited ones will be created in the DBootZIPs folder. It is not certain that it will function equally well on all devices/ROMs, so before you flash your edited ZIPs, please check that they were edited correctly. This tool will NOT flash ZIPs. It will only convert them, so they can be flashed as secondary ROMs using your regular custom recovery. The tool will also put boot2.img in the img folder for use with the Switch ROM function. If you are on your primary ROM, it will also backup your current boot partition into a boot1.img in the img folder.

    4. Advanced options
    After selecting this, you will be taken to another menu where you can find more options. Most of them are not available while on your secondary ROM.

    9. Switch ROM
    This does the same as the individual SwitchROM.sh script. Read below.

    0. Exit
    I have decided not to explain this option.



    Advanced menu

    1. Wipe System2
    2. Wipe Data2
    3. Wipe Cache2
    4. Wipe Dalvik2

    These options just do to the secondary ROM what their name implies. They will only be available while on your primary ROM. If you want to factory-reset your secondary ROM, just wipe your Data2 and Cache2. When you flash new addons, it is advised to wipe Cache2 and Dalvik2. You can also wipe everything if you want to clean-install a completely new ROM.

    5. Update binaries
    Whenever Modding.MyMind updates his binaries, download and put them in your DualBoot/bin folder. Then, use this option to update existing binaries in your /system/bin folder.

    0. Main Menu
    Returns to the previous menu




    SwitchROM.sh

    The name is self-explanatory. This tool can only function if it finds the files boot1.img and boot2.img inside the DualBoot/img folder. These files will be automatically generated when you convert a ROM zip (using option 3). Alternatively, if you know what you are doing, you can create and put them there yourself.
    Tap it in Script Manager and again select the first two icons (Fav and SU) and Run. It will automatically detect the current ROM, flash the boot image of the other one and prompt you to reboot. Use your Power-Menu and reboot your device. Your device will now boot to the other ROM.
    In previous versions of this script for the LG Optimus 3D, I had included a reboot command. The reason why I am not using it any more is that the device would turn off abruptly and not "shutdown" the way it does when selecting it from the Power-Menu.





    DOWNLOAD:
    Get the latest version from here.





    TROUBLESHOOTING:
    If, while converting a zip, the script gives you an error that yourboot.img is incompatible, then either you have an encrypted header, or you have a truly incompatible boot.img! In any case, visit [Without PC] Unpack, Edit, Repack boot.img to read how to deal with encrypted headers, or to download the latest boot_manipulation.zip





    Changelog:

    13.03.2014 Initial upload of ZipEditor and SwitchROM.

    17.03.2014 Updated ZipEditor to support the conversion of HTC-OneSV ROMs (AOSP and Stock based). Thanks to Modding.MyMind for assisting.

    23.03.2014 First upload of DBootRecovery. The ZipEditor is now contained in it. If you are wondering about the v3.0, previous versions were device specific (only for the LG-P920). This is the first one for use on any Android.

    21.06.2014 Version 3.1: Added support for the new LG P920 KitKat ROM. Fixed a bug where Dalvik2 cache would not be properly wiped. Changed a few minor details for better script operation.
    3
    Thanks:good:
    I edited all /system mounts so far.

    And does the following line has to stay like it is?
    package_extract_file("boot.img", "/dev/block/platform/omap/omap_hsmmc.1/by-name/boot");
    (as I don´t want to destroy my boot partition ;) )

    Finally, I got two questions about the rom switching and backup scripts: 1. Will they work for the path structure of my phone? Do you have to place them on the internal sd card?

    You must leave your boot line as is. This way your edited boot.img will be flashed into your boot partition and your phone will load your secondary ROM.

    Have you found a suitable way to unpack and repack your boot.img?

    In order for the scripts to work, you must find the actual numbers of your partitions (read OP) and run the DBootRecovery script once. The first time it is run, it will try to detect the partitions itself and ask you for confirmation. If it doesn't detect them, it will ask you to provide them manually. Then the scripts will work.

    I cannot stress enough that you must make a nandroid of your primary ROM before you flash anything!

    Sent from the 3rd dimension!
    2
    Hey, getting ready to do this now with a 2gig. Using it as a test run lol. Anyways, to confirm, you leave the first part as is, meaning, fat 32, but add three additional parts to make a total of four partitions within the sdcard. So for example, part 1 (fat32), part 2-4 (ext4) which those would be the system, data, and cache. I'm confident that is how it is done, but wanted to clarify. Will do it now and check back for a reply later lol. Meanwhile, this has also given me a couple of dev ideas :)

    Sent from my C525c using Tapatalk

    Trust your confidence. You are right!

    If you have a large card and use MiniTool, you can "shrink" your main partition to make room for the additional three. This way it won't be wiped.

    Sent from the 3rd dimension!
    2
    Here's HTC OneSV K2_CL recovery.fstab

    # mount pointfstypedevice[device2]
    /boot emmc/dev/block/mmcblk0p20
    /cacheext4/dev/block/mmcblk0p36
    /dataext4/dev/block/mmcblk0p37
    /devlogext4/dev/block/mmcblk0p25
    /miscemmc/dev/block/mmcblk0p22
    /int_sdvfat/dev/block/mmcblk0p38
    /recoveryemmc/dev/block/mmcblk0p21
    /sdcardvfat/dev/block/mmcblk1p1 /dev/block/mmcblk1
    /systemext4/dev/block/mmcblk0p35