[HTC Pico (Explorer)] thewisenerd:
So, I read somewhere that what you've thought, might already have been thought by someone else. Dual-Booting the pico, as most people now know it, isn't something new to this device. When I had made this thread here, most of you might have noticed the init.rc tweak in the post 2. The day before I had written the post, I was experimenting with the possibilities of dual booting my phone, and was successfully able to. How? By changing the mount points, simple.

Now, the problem arises... How many boot.img's do you have to derp? And, how many times would you have to keep flashing your boot partition??? :rolleyes: So, I figured out something, which I will be discussing in this thread, which allows you to boot any and any ROM if they both use the same kernel. Therefore, you don't have to flash separate boot.img's everytime you need to change between your primary ROM and secondary ROM.

There is a small change in terminologies:

So, how will this help me?

No need to repeatedly flash your boot partition (though it ain't gonna cause any damage).

Easier switching of ROMs.

Doesn't need SU (super user) permissions.

So, all talk no show?

You seem to be the typical TDLR; case :laugh:

Again, sorry to interrupt you, but there are a few things you'd need to know. First and foremost, this:

#include
/*
* Your warranty is/was void the time you chose to unlock your bootloader.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about how this works!
* YOU are choosing to make these modifications, and if you point
* the finger at me for messing up your device, I will laugh at you.
*
*/

Note

: If this is to work with Sense 4.0/4.1; or with the new PLL2 OC'ing method, appropriate changes will have to be made, which I would be discussing in later posts. As of now, this method works with all AOSP and derived ROMs, excluding Sense, and those with PLL2 OC'ing.

How it works

:

So, this is what most people want to know! Here's how. :angel:

When the device boots, the init.rc is run, if I remember correctly. Here lies the trick. What I planned to do was creating a place_holder in the SD-Card, use it as a, well, place_holder, and execute <insert-awesome-script-name.sh at bootup, which is bootsdcard.sh in this case.

So, how to do that?

Here's where I was confused. Checking for file existence, in init.rc? Then, I remembered that some init.d scripts run the same way. Searched the init.rc for /etc/init.d, in vain. Finally, found this thread, and opened up the ROM's zip. There was indeed a file named [Isysinit[/I] in /system/bin/sysinit, and it contained commands to run the files in /system/etc/init.d. What's more important is that the exec commands could be executed using exec /something After hours of searching, I found this: http://xdaforums.com/showthread.php?t=1598803&highlight=dual+boot. Cool! The Samsung Galaxy Y has had dual boot before pico, thanks to irfanbagus. Still, it had a lot of bloat, and couldn't be used directly for our device. :p So, I saw how it worked, and, it was efficient. So, I decided to port it to our device.

Prerequisites

:

Patience ~ Learn it, if you don't have it!

Two ROMs that boot with the same kernel

Linux or Notepad++

file-roller or WinRAR

partitioned sdcard, in the order: fat32>sd-data>sd-system>sd-cache

Procedure

:

1. Preparing the ROMs

Get any two ROMs' zip files, which run with the same kernel. Decide which ROM you want as secondary, i.e. in the SD-Card. Now, open up the zip of the ROM which you want in the SD-Card and extract the updater-script from its META-INF/com/google/android/ folder and make the following changes:

Delete these lines:

format("yaffs2", "MTD", "system", "0", "/system");
mount("yaffs2", "MTD", "system", "/system");

Insert these lines:

run_program("/sbin/busybox", "mount", "-t", "auto", "/dev/block/mmcblk0p3", "/system");
run_program("/sbin/busybox", "rm", "-rf", "/system/*");

If you feel you aren't doing it correct, please post the updater script of the ROM here. I will edit it.

Drag and drop the changed updater script into the same /META-INF/com/google/android folder. Hopefully, it should be updated within the zip.

Copy these two files to your SD-Card using *any* means possible.

2. Flashing the ROMs

Open recovery, and flash the zip for primary ROM.

Reboot recovery.

Go to Mounts and storage (CWM) or under a similar option, and unmount /data, /cache and /system.

Now, flash the zip you've created for secondary ROM.

If you reboot, you should go into the Primary ROM.

3. Installing modified kernel

You can do this using fastboot too!

Download appropriate pre-derped kernels, or provide the boot.img for derping.

Then, it is pretty simple.

fastboot flash boot <derped-boot>.img

or via Terminal Emulator

su
flash_image boot /sdcard/<derped-boot>.img

4. Switching ROMs

Primary ROM to Secondary ROM:

As I said, the place holder. It plays an important role. So, if you want to switch to another ROM, just create an empty file in your sdcard named ".bootsdcard" without quotes. You could also do this via terminal emulator using:

touch /sdcard/.bootsdcard

Secondary ROM to Primary ROM:

Remove the .bootsdcard from your SD-Card, and you will boot the primary ROM. This can also be done using terminal emulator using:

rm /sdcard/.bootsdcard

P.S. An application for this is being developed by [MENTION=4832023]omerjerk[/MENTION], to make this easier.

Anything else?

Nothing for now :p Dual booting my phone with CM9 and MiniCM9.

XDA:DevDB Information

Dual Boot ~ the Yin-Yang way!, a Tool/Utility for the HTC Pico (Explorer)

Contributors

thewisenerd

Version Information

Status: Stable

Created 2013-11-16

Last Updated 2013-11-16