[GUIDELINES]Dual-Boot on (theoretically) any device
A lot of people around these fora could easily be called "flashaholics". It's common practice for flashaholics to keep a backup of a stable (probably stock) ROM in their SDcard in case of emergency and then try different, usually unstable beta ROMs that are more advanced. 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 a certain device (e.g. 3D displays and cameras), so a stock based ROM must always be handy. This is why Dual-Boot can be useful. It allows people to switch ROMs just as quickly as a simple reboot.
I have followed these guidelines to create Dual-Boot on two phones (LG and HTC) 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 a 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 still want to try, remember, you are on your own!
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 two that I have tested for mine.
Steps:
1. First you need to figure out the sizes of your system, data and cache 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.
(HINT: You may want to create a larger Data partition, so that you can have more space to install apps)
3. Then 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. 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");
5. Pack and zip everything back and reboot to recovery.
6. 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/mmcblk0px (where x 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.
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 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) This one works on my HTC.
ii) This one works on my HTC but only unpacks my LG boot.img
iii) and this one 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.
Special thanks to @berni987654321 from whom I learned almost everything there is to know about Dual-Boot. This guide is based on his work.
A lot of people around these fora could easily be called "flashaholics". It's common practice for flashaholics to keep a backup of a stable (probably stock) ROM in their SDcard in case of emergency and then try different, usually unstable beta ROMs that are more advanced. 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 a certain device (e.g. 3D displays and cameras), so a stock based ROM must always be handy. This is why Dual-Boot can be useful. It allows people to switch ROMs just as quickly as a simple reboot.
I have followed these guidelines to create Dual-Boot on two phones (LG and HTC) 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 a 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 still want to try, remember, you are on your own!
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 two that I have tested for mine.
Steps:
1. First you need to figure out the sizes of your system, data and cache 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.
(HINT: You may want to create a larger Data partition, so that you can have more space to install apps)
3. Then 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. 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");
5. Pack and zip everything back and reboot to recovery.
6. 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/mmcblk0px (where x 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.
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 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) This one works on my HTC.
ii) This one works on my HTC but only unpacks my LG boot.img
iii) and this one 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.
Special thanks to @berni987654321 from whom I learned almost everything there is to know about Dual-Boot. This guide is based on his work.
Aucun commentaire:
Enregistrer un commentaire