[GUIDE]Adding Support for Different ROMs for Dual Boot - HTC Pico (Explorer)

#THIS GUIDE IS ONLY FOR ADVANCED USERS, WHO KNOW HOW TO COMPILE AND MAKE MODIFICATIONS TO KERNEL AND MODIFYING VARIOUS PARAMETERS IN RAMDISK IN THE RAMDISK LEVEL #
Hey guys this guide will tell you how to add support for Dual bootinga as primary ROM.
YOU MUST USE ATLEAST CLASS 6 OR ABOVE SDCARD WITH MINIMUM 8GB CAPACITY
First you need 3 EXT4 partitions on SD-card, using minitool partition wizard
1) around 400 MB - SD-SYSTEM (ext4)
2) around 1 GB (or can be less) - SD-DATA(ext4 format),
3)around 75MB (can be less) SD-CACHE(ext4 format) (refer to the screenshot):
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This is very important : You should remove any memory increasing script that you were using. Because /data partition is now on SDcard, using memory increasing script will cause conflict and makes ROM unbootable.
Now making kernel level Changes :
Step 1- open the defconfig of your kernel source and make this change in it
Enable LBDAF (for multiple partitions to work)
Code:
[COLOR="Navy"]CONFIG_LBDAF=y[/COLOR]
Now compile the kernel.
Step 2- Ramdisk level changes:
All modifications are performed on init.rc file.
Step 1- Search for this line :
Code:
mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /system ro remount
Replace it with this :
Code:
[COLOR="Navy"]# Mount SD-SYSTEM
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
mount ext4 /dev/block/mmcblk0p2 /system
mount ext4 /dev/block/mmcblk0p2 /system ro remount[/COLOR]
Step 2 - find this line :
Code:
mount yaffs2 [email protected] /data nosuid nodev
Now replace it with :
Code:
[COLOR="navy"]# Mount SD-DATA
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
mount ext4 /dev/block/mmcblk0p3 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue[/COLOR]
Step 3- Find this line :
Code:
mount yaffs2 [email protected] /cache nosuid nodev
Replace it with :
Code:
[COLOR="navy"]# Mount SD-CACHE
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
mount ext4 /dev/block/mmcblk0p4 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue[/COLOR]
That's it now pack the ramdisk with the kernel you made earlier
All of this is much similar like pll2 Oc by cute_prince.
Now the Updater-script changes
This was the real pain in finding out, It took me nearly a month to figure out how to extract system on the partition, and learn the mount function.. If you are using it PLEASE give me some credits
Step 1- one the updater-script of the ROM find these lines :
Code:
format("yaffs2", "MTD", "system", "0", "/system");
mount("yaffs2", "MTD", "system", "/system");
package_extract_dir("system", "/system");
Replace them with these:
Code:
[COLOR="navy"]run_program("/sbin/busybox", "mount", "-t", "auto", "/dev/block/mmcblk0p2", "/system");
run_program("/sbin/busybox", "rm", "-rf", "/system/*");
package_extract_dir("system", "/system");[/COLOR]
That's it you've Successfully added support for the rom as primary ROM !!
Head Over here : http://forum.xda-developers.com/showthread.php?t=2409236
for flashing instructions ,dual boot app by galaxy freak and switching mechanisms
IF YOU WANT TO PLL2 OC BOTH PRIMARY AND SECONDARY ROMs GO TO THE GUIDE BY @Arslankirmani HERE : http://forum.xda-developers.com/showpost.php?p=45063954&postcount=84
Now if you are using it for adding support for ROM , please PM either me,adityalahiri13 or galaxyfreak the download link so that we can add on the dual boot thread.. IF you are a ROM developer ,i kindly request you to let us also keep the download link for the primary enable ROM.

The Yin-Yang Way!
Procedure
You MUST know how to unpack/repack kernels, and their ramdisks.
If you unpack your kernel, you would find the folder named sbin where you'd unpacked the ramdisk. Place these two files busybox.7z and bootsdcard.txt in the folder. Rename them to "busybox" and "bootsdcard.sh" respectively.
Additionally, you will need to create a folder named "tmp" where you've unpacked the ramdisk.
Now, open up init.rc and find the lines:
Code:
on fs
# mount mtd partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /system ro remount
mount yaffs2 [email protected] /data nosuid nodev
mount yaffs2 [email protected] /cache nosuid nodev
After these lines, you are most likely to find these lines (or similar lines):
Code:
# once everything is setup, no need to modify /
mount rootfs rootfs / ro remount
Add the following lines to the above:
Code:
chmod 0777 /sbin/busybox
chmod 0777 /sbin/bootsdcard.sh
exec /sbin/busybox sh /sbin/bootsdcard.sh
En total, it should look like this:
on fs
# mount mtd partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /system ro remount
mount yaffs2 [email protected] /data nosuid nodev
mount yaffs2 [email protected] /cache nosuid nodev
on post-fs
chmod 0777 /sbin/busybox
chmod 0777 /sbin/bootsdcard.sh
exec /sbin/busybox sh /sbin/bootsdcard.sh
# once everything is setup, no need to modify /
mount rootfs rootfs / ro remount
Click to expand...
Click to collapse
Now, you can repack the ramdisk, and repack the kernel. In most cases, you should be able to flash the kernel with the busybox included. If you are not able to flash the repacked boot.img, please post the boot.img along with thread from which obtained/sources.
P.S. For the curious, this is what bootsdcard.sh looks like:
Code:
#!/sbin/busybox sh
MOUNT="/sbin/busybox mount"
UMOUNT="/sbin/busybox umount"
MKDIR="/sbin/busybox mkdir"
RMDIR="/sbin/busybox rmdir"
TOUCH="/sbin/busybox touch"
$MKDIR /tmp/sdcard
$CHMOD 0770 /dev/block/mmcblk0p1
$MOUNT /dev/block/mmcblk0p1 /tmp/sdcard
if [ -f /tmp/sdcard/.bootsdcard ];
then
$TOUCH /tmp/.bootsdcard
fi
$UMOUNT /tmp/sdcard
$RMDIR /tmp/sdcard
if [ -f /tmp/.bootsdcard ];
then
$UMOUNT /data;
$CHMOD 0770 /dev/block/mmcblk0p2
$MOUNT -t ext3 -o nosuid,nodev /dev/block/mmcblk0p2 /data
$UMOUNT /system
$CHMOD 0770 /dev/block/mmcblk0p3
$MOUNT -t ext3 /dev/block/mmcblk0p3 /system
$MOUNT -t ext3 -o remount,ro /dev/block/mmcblk0p3 /system
$UMOUNT /cache
$CHMOD 0770 /dev/block/mmcblk0p4
$MOUNT -t ext3 /dev/block/mmcblk0p4 /cache
fi
Now, to switch to the other ROM, please create a file named ".bootsdcard", and to switch to primary ROM, delete the ".bootsdcard" from your sdcard.
I know this post looks wierd, and outta place. the busybox.7z and bootsdcard.sh file can be obtained from here: http://forum.xda-developers.com/showthread.php?t=2413642
until I edit this post...
P.s. @omerjerk made an app for this purpose... he'd release it shortly.

What if?
@ayushrox
U said on facebook that the sd-data is only for primary rom and the data for the secondary rom is on the NAND Partition ....
So , can't we make changes in the boot.img of Secondary Rom so that it uses the SD-DATA Partition for its data ......?
So our apps can be used in both the roms......

ayushrox atleast can you make CM10.1 as primary rom for who dont know how to compile , etc... and please make primary rom support Pll2 OC.
good work!!!!!

thelegend10 said:
@ayushrox
U said on facebook that the sd-data is only for primary rom and the data for the secondary rom is on the NAND Partition ....
So , can't we make changes in the boot.img of Secondary Rom so that it uses the SD-DATA Partition for its data ......?
So our apps can be used in both the roms......
Click to expand...
Click to collapse
I can do this.. but it may cause errors since we can dual boot even GB with 4.3 so the app's a pi level may cause conflict .. but anyways I'll try it
Boyka123 said:
ayushrox atleast can you make CM10.1 as primary rom for who dont know how to compile , etc... and please make primary rom support Pll2 OC.
good work!!!!!
Click to expand...
Click to collapse
OK I'll add cm 10.1 as primary ROM.with pll2OC ... And BTW devs : u can add pll2OC easily by using the edited acpuclock or editing the ramdisk of pll2 OC Kernels just as I indicated
..

That f*cking awesome!!!!!!!!!!! If we use pll2 oc, does we need extra partition or just partition order on dual boot thread?
Sent from my HTC Explorer A310e using XDA Premium 4 mobile app

Boyka123 said:
That f*cking awesome!!!!!!!!!!! If we use pll2 oc, does we need extra partition or just partition order on dual boot thread?
Sent from my HTC Explorer A310e using XDA Premium 4 mobile app
Click to expand...
Click to collapse
if you enable pll2 .. then only primary rom can be used as pll2 Oc .. so yes only the partition order i mentioned on dual boot thread !!!!

ayushrox said:
if you enable pll2 .. then only primary rom can be used as pll2 Oc .. so yes only the partition order i mentioned on dual boot thread !!!!
Click to expand...
Click to collapse
nice guide :good::good:
is that CONFIG_LBDAF=y enabled in sense 4.1 kernel cause it uses multiple partitions?
if not can u provide kernel with it enabled
edit : solved

Just signed in, and thought I'd check up on how far you've gotten up to on this project... I think it should be easy enough to adapt the script I made for the HD2 to automate this quicker. I'll put up a file and instructions in a day or two; all being well, if anyone wants to test...
In terms of having the same data file/folder between different ROMs - this isn't something that we managed on the HD2 as there seemed to be permissions issues caused as well as the issue of differnt api levels, it's still worth a try though.

any chance for a noob guide?????

balajithegreat said:
any chance for a noob guide?????
Click to expand...
Click to collapse
Not a guide but yes.. i'll be posting edited updater-scripts and premade kernels.. for adding support
and guys LBDAF is enabled in all pll2 OC kernels(pandora,aries,etc.) you can take their boot.img ,unpack them,edit the init.rc file as i said and repack it.. and rest the updater-script thing should be easy !!
and @HypoTurtle i thought of giving our script a try..but didn't have time for it.. you can PM me the script , i'll test it

@ayushrox
can u build a kernel that can work with the boot manager app
with it we can boot up to 5 or more roms
is it possible???....

One question. What about gapps for primary rom? If we flash gapps just like that wouldnt they go to /system..! we need then in sd-system!
UPDATE: I compiled a kernel doing the ramdisk changes, enabling lbdaf and also edited updater-script. Formatted the partitions as SD-SYSTEM(EXT4) (455mb)---- SD-DATA(EXT4) (900mb)---- SD-CACHE(eXT4) (85mb)
Rom flashes. But it kinda finishes very early. I checked the sd-system partition using mini partition tool just after flashing and it doesnt seem to have changed..I double checked updater-script. It just stays at HTC logo.

7alvi said:
One question. What about gapps for primary rom? If we flash gapps just like that wouldnt they go to /system..! we need then in sd-system!
UPDATE: I compiled a kernel doing the ramdisk changes, enabling lbdaf and also edited updater-script. Formatted the partitions as SD-SYSTEM(EXT4) (455mb)---- SD-DATA(EXT4) (900mb)---- SD-CACHE(eXT4) (85mb)
Rom flashes. But it kinda finishes very early. I checked the sd-system partition using mini partition tool just after flashing and it doesnt seem to have changed..I double checked updater-script. It just stays at HTC logo.
Click to expand...
Click to collapse
On which ROM did you try ? Did you make the kernel changes correctly ?

ayushrox said:
On which ROM did you try ? Did you make the kernel changes correctly ?
Click to expand...
Click to collapse
Im trying on my aokp 4.2 build. Yep I did make the changes correctly.. But i think its something with updater-script as it flashes and finishes too soon and i checked sd-system just after flashing rom and the 'used' field is unchanged!

7alvi said:
Im trying on my aokp 4.2 build. Yep I did make the changes correctly.. But i think its something with updater-script as it flashes and finishes too soon and i checked sd-system just after flashing rom and the 'used' field is unchanged!
Click to expand...
Click to collapse
Please upload your updater-script.. i'll try to find problems..

ayushrox said:
Please upload your updater-script.. i'll try to find problems..
Click to expand...
Click to collapse
http://pastebin.com/wqfD8Xyk

7alvi said:
http://pastebin.com/wqfD8Xyk
Click to expand...
Click to collapse
thanks for the script... but i have already made it ... so i'll put in on pastebin shortly..

ayushrox said:
thanks for the script... but i have already made it ... so i'll put in on pastebin shortly..
Click to expand...
Click to collapse
Thank you. Can you tell me if I didn't do it correctly?

7alvi said:
Thank you. Can you tell me if I didn't do it correctly?
Click to expand...
Click to collapse
I found that your updater-script was fine.. the problem must be with the kernel.. here's my kernel : http://d-h.st/q91
Download it just take out the boot.img(its named "boot3.img" --rename it to1)boot.img use in rom 2) cm.img (put it in sd-card)
Now, also take the modules part.. then i think it should work fine.. if problem still persistes.. i'll also attach the updater-script !!
And guys the kernel i have uploaded will work for all android 4.2.2 roms .. just use the modules and boot.img
*wifi may not work
and the kernel source is same as mine pandora kernel's

Related

[GUIDE]Overclocking NAND Devices with PLL2

/**** THIS GUIDE IS ONLY FOR ADVANCED USERS, WHO KNOW HOW TO COMPILE AND MAKE MODIFICATIONS TO KERNEL AND MODIFYING VARIOUS PARAMETERS IN RAMDISK ****/
Hello guys, here I am giving you a detailed tutorial for Overclocking devices that comes with NAND and having only PLL2 support.
Although this guide is written for HTC Explorer, the method can also be applied on similar devices.
So, before we begin you should understand the difference between OCing with PLL4 and OCing with PLL2.
XDA user @rootdefyxt320 has written an excellent post that tells the exact difference between PLL4 OC and PLL2 OC. I am quoting it:
PLL2 overclock can be compared to FSB overclocking in computers i.e locked multiplier overclocking in the BIOS. FSB overclocking involves overclocking of the PC buses such as the Memory Bus, PCI/ PCI-Express bus and AGP buses (older computers) and the CPU. It works out by XXXXMHz multiplied by X multiplier and that will give the CPU speed. PLL2 overclock does the same thing because PLL2 controls the bus speeds (exists in the SOC). It overclocks the memory buses, SOC clock, internal storage (database IO) speed and of course the CPU. It works out by XX multiplied by 19/2 and that gives the CPU speed. That's why PLL2 on 800MHz is faster in performance than PLL4 on 800MHz . Therefore that's the reason why people complain of burnt NANDs on HTC Explorer and Motorola Defy Mini XT320/321.
PLL4 overclock can be compared to unlocked multiplier overclocking where you adjust the multiplier in the BIOS and it will automatically adjust the clock speed depending on the multiplier of the CPU. Therefore this only overclocks the CPU. PLL4 overclock only overclocks the CPU and NOT the buses so it can go at much higher frequencies than PLL2 overclock. PLL4 overclock does NOT adjust bus speeds so therefore it is much safer to overclock and it doesn't burn out your SOC.
Click to expand...
Click to collapse
In case of HTC Explorer, it uses Qualcomm MSM7225A chipset. This chipset does not have PLL4 support. So the only way to overclock is by OC'ing PLL2. But OC'ing PLL2 causes not only the CPU but also everything connected to the board to OC as well. This includes the External Bus Interface (EBI). Our NAND is connected to EBI and when OC happens the Write access through NAND becomes so high causing every block in those partitions which are mounted as RW to become Bad. This is what we call "NAND BURN".
The partitions in NAND that are affected by OC are /data and /cache. This is because only these two partitons are mounted with RW access. As I mentioned above the increased Write access during OC is what causing the blocks to corrupt. All other partitions including /misc, /devlog, /boot, /system and /recovery are mounted as Read-Only and therefore are not affected.
The Workaround for this dilemma is to disable both /data and /cache partitions ( By disable, I mean not even mounting them ) in NAND and use a portion of your SDcard to act as /data and /cache. This is what we are going to do.
/* FOLLOWING PROCEDURE IS FOR AOSP ROMS ONLY */​
THE PROCEDURE
================
The procedure consists of four parts. They are listed below:
Preparing The SDcard
Kernel Level Changes
Setting Up RamDisk
Removing Memory Increasing Script
Detailed description of each part is given below:
PART 1 : Preparing The SDcard
==========================
********YOU MUST USE CLASS 10 OR ATLEAST CLASS 6 SDCARD WITH MINIMUM 8GB CAPACITY*******
CLASS 4 and CLASS 2 SDcards will definitely cause slow responsiveness because /data/data is on SDcard. Furthermore these SDcards can't handle OC at high frequencies and will die out quickly.
SO PROCEED ONLY IF YOU ARE HAVING CLASS 6 OR CLASS 10 SDCARD. YOU CAN TRY CLASS 4 SDCARD BUT YOU CAN'T OVERCLOCK ABOVE A CERTAIN LIMIT AND NO GUARANTEE ABOUT HOW LONG THE CARD WILL LAST.
We are going to create two EXT4 partitions ( First one for replacing /data and second one for replacing /cache in NAND ) on the SDcard, in addition to the normal FAT32 partition.
Using MiniTool Partition Wizard, create two EXT4 partitions as shown in following figure:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
For SD-DATA, you can give whatever size you want. This where the user applications are installed.
For SD-CACHE, around 65MB is enough.
You should keep the order in which partitions are created. Partition Type for both SD-DATA and SD-CACHE should be Primary.
Assuming you have successfully prepared SDcard, lets go the second part:
PART 2 : Kernel Level Changes
==========================
First, you need to replace arch/arm/mach-msm/acpuclock-7201 with this one: https://dl.dropboxusercontent.com/u/95625633/acpuclock-7201.c
This contains the overclocked frequencies and logic to dynamically calculate PLL2 values according to different frequencies.
When you look through the overclocked frequencies, you can see I have disabled 900MHz. This is because Class 4 SDcards can't handle data rate at this frequency. Those who have Class 10 SDcards can enable and try whether it is stable for them.
**** DO NOT OC GPU. ITS FAKE AND ACTUALLY DEGRADES PERFORMANCE. REVERT GPU OC IF YOU HAVE ENABLED IT ****
Next, you need to edit the configuration file ( pico_defconfig in my case ) and enable the following option. Its disabled by default so you have to enable it:
Code:
[COLOR="Blue"][B]CONFIG_LBDAF=y[/B][/COLOR]
That's all. Now compile your kernel.
PART 3 : Setting Up RamDisk
========================
Since, we are not using /data and /cache in NAND anymore, the changes must be made in RamDisk.
All modifications are performed on init.rc file.
Open init.rc and perform the following modifications:
1. Find the following line:
Code:
[B][COLOR="Red"]mount yaffs2 [email protected] /data nosuid nodev[/COLOR][/B]
Replace the above line with following:
Code:
[B][COLOR="Blue"]# Mount SD-DATA
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
mount ext4 /dev/block/mmcblk0p2 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue[/COLOR][/B]
2. Now find the following line:
Code:
[B][COLOR="Red"]mount yaffs2 [email protected] /cache nosuid nodev[/COLOR][/B]
Replace the above line with following:
Code:
[B][COLOR="Blue"]# Mount SD-CACHE
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
mount ext4 /dev/block/mmcblk0p3 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue[/COLOR][/B]
3. Since we are extensively using SDcard, we should adjust the read_ahead_kb parameter for maximum performance:
Add the following lines after the line: mount ext4 /dev/block/mmcblk0p3 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
Code:
[B][COLOR="Blue"]# SDcard read speed boost
write /sys/block/mmcblk0/bdi/read_ahead_kb 2048[/COLOR][/B]
PART 4 : Removing Memory Increasing Script
=====================================
*** This is very important. You should remove any memory increasing script that you were using. Because /data partition is now on SDcard, using memory increasing script will cause conflict and makes ROM unbootable. ***
That's all, now you can flash your favourite ROM with the new OCed boot image and enjoy overclocking.
NOTE: A new Recovery must be made to support the new /SD-CACHE partition.
/* FOLLOWING PROCEDURE IS FOR SENSE 4.1 ROM ONLY */​
THE PROCEDURE
================
The procedure consists of four parts. They are listed below:
Preparing The SDcard
Kernel Level Changes
Setting Up RamDisk
Removing Memory Increasing Script
Detailed description of each part is given below:
PART 1 : Preparing The SDcard
==========================
********YOU MUST USE CLASS 10 OR ATLEAST CLASS 6 SDCARD WITH MINIMUM 8GB CAPACITY*******
CLASS 4 and CLASS 2 SDcards will definitely cause slow responsiveness because /data/data is on SDcard. Furthermore these SDcards can't handle OC at high frequencies and will die out quickly.
SO PROCEED ONLY IF YOU ARE HAVING CLASS 6 OR CLASS 10 SDCARD. YOU CAN TRY CLASS 4 SDCARD BUT YOU CAN'T OVERCLOCK ABOVE A CERTAIN LIMIT AND NO GUARANTEE ABOUT HOW LONG THE CARD WILL LAST.
We are going to create three EXT4 partitions ( First one for /sd-ext, second one for replacing /data and third one for replacing /cache in NAND ) on the SDcard, in addition to the normal FAT32 partition.
Using MiniTool Partition Wizard, create three EXT4 partitions as shown in following figure:
For SD-EXT, around 512MB is enough. It contains only system files.
For SD-DATA, you can give whatever size you want. This where the user applications are installed.
For SD-CACHE, around 65MB is enough.
You should keep the order in which partitions are created. Partition Type for SD-EXT, SD-DATA and SD-CACHE should be Primary.
Assuming you have successfully prepared SDcard, lets go the second part:
PART 2 : Kernel Level Changes
==========================
First, you need to replace arch/arm/mach-msm/acpuclock-7201 with this one: https://dl.dropboxusercontent.com/u/95625633/acpuclock-7201.c
This contains the overclocked frequencies and logic to dynamically calculate PLL2 values according to different frequencies.
When you look through the overclocked frequencies, you can see I have disabled 900MHz. This is because Class 4 SDcards can't handle data rate at this frequency. Those who have Class 10 SDcards can enable and try whether it is stable for them.
**** DO NOT OC GPU. ITS FAKE AND ACTUALLY DEGRADES PERFORMANCE. REVERT GPU OC IF YOU HAVE ENABLED IT ****
Next, you need to edit the configuration file ( pico_defconfig in my case ) and enable the following option. Its disabled by default so you have to enable it:
Code:
[COLOR="Blue"][B]CONFIG_LBDAF=y[/B][/COLOR]
That's all. Now compile your kernel.
PART 3 : Setting Up RamDisk
========================
Since, we are not using /data and /cache in NAND anymore, the changes must be made in RamDisk.
All modifications are performed on init.rc file.
Open init.rc and perform the following modifications:
1. Find the following line:
Code:
[B][COLOR="Red"]mount yaffs2 [email protected] /data nosuid nodev[/COLOR][/B]
Replace the above line with following:
Code:
[B][COLOR="Blue"]
# Mount SD-EXT
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
mount ext4 /dev/block/mmcblk0p2 /sd-ext nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
# Mount SD-DATA
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
mount ext4 /dev/block/mmcblk0p3 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
[/COLOR][/B]
2. Now find the following line:
Code:
[B][COLOR="Red"]mount yaffs2 [email protected] /cache nosuid nodev[/COLOR][/B]
Replace the above line with following:
Code:
[B][COLOR="Blue"]# Mount SD-CACHE
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
mount ext4 /dev/block/mmcblk0p4 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue[/COLOR][/B]
3. Since we are extensively using SDcard, we should adjust the read_ahead_kb parameter for maximum performance:
Add the following lines after this line: mount yaffs2 [email protected] /persist nosuid nodev
Code:
[B][COLOR="Blue"]# SDcard read speed boost
write /sys/block/mmcblk0/bdi/read_ahead_kb 2048[/COLOR][/B]
PART 4 : Removing Memory Increasing Script
=====================================
*** This is very important. You should remove any memory increasing script that you were using. Because /data partition is now on SDcard, using memory increasing script will cause conflict and makes ROM unbootable. ***
That's all, now you can flash your favourite ROM with the new OCed boot image and enjoy overclocking.
NOTE: A new Recovery must be made to support the new /SD-DATA and /SD-CACHE partitions.
Our devices need new recovery that can make multiples partition :thumbup:
/* FOLLOWING PROCEDURE IS FOR SENSE 4.0a AND DERIVED ROMS ONLY */​
THE PROCEDURE
================
The procedure consists of four parts. They are listed below:
Preparing The SDcard
Kernel Level Changes
Setting Up RamDisk
Removing Memory Increasing Script
Detailed description of each part is given below:
PART 1 : Preparing The SDcard
==========================
********YOU MUST USE CLASS 10 OR ATLEAST CLASS 6 SDCARD WITH MINIMUM 8GB CAPACITY*******
CLASS 4 and CLASS 2 SDcards will definitely cause slow responsiveness because /data/data is on SDcard. Furthermore these SDcards can't handle OC at high frequencies and will die out quickly.
SO PROCEED ONLY IF YOU ARE HAVING CLASS 6 OR CLASS 10 SDCARD. YOU CAN TRY CLASS 4 SDCARD BUT YOU CAN'T OVERCLOCK ABOVE A CERTAIN LIMIT AND NO GUARANTEE ABOUT HOW LONG THE CARD WILL LAST.
We are going to create three ext2 partitions ( First one for /sd-ext, second one for replacing /data and third one for replacing /cache in NAND ) on the SDcard, in addition to the normal FAT32 partition.
Using MiniTool Partition Wizard, create three ext2 partitions as shown in following figure:
For SD-EXT, around 512MB is enough. It contains only system files.
For SD-DATA, you can give whatever size you want. This where the user applications are installed.
For SD-CACHE, around 65MB is enough.
You should keep the order in which partitions are created. Partition Type for SD-EXT, SD-DATA and SD-CACHE should be Primary.
Assuming you have successfully prepared SDcard, lets go the second part:
PART 2 : Kernel Level Changes
==========================
First, you need to replace arch/arm/mach-msm/acpuclock-7201 with this one: https://dl.dropboxusercontent.com/u/95625633/acpuclock-7201.c
This contains the overclocked frequencies and logic to dynamically calculate PLL2 values according to different frequencies.
When you look through the overclocked frequencies, you can see I have disabled 900MHz. This is because Class 4 SDcards can't handle data rate at this frequency. Those who have Class 10 SDcards can enable and try whether it is stable for them.
**** DO NOT OC GPU. ITS FAKE AND ACTUALLY DEGRADES PERFORMANCE. REVERT GPU OC IF YOU HAVE ENABLED IT ****
Next, you need to edit the configuration file ( pico_defconfig in my case ) and enable the following option. Its disabled by default so you have to enable it:
Code:
[COLOR="Blue"][B]CONFIG_LBDAF=y[/B][/COLOR]
That's all. Now compile your kernel.
PART 3 : Setting Up RamDisk
========================
Since, we are not using /data and /cache in NAND anymore, the changes must be made in RamDisk.
All modifications are performed on init.rc file.
Open init.rc and perform the following modifications:
1. Find the following line:
Code:
[B][COLOR="Red"]mount yaffs2 [email protected] /data nosuid nodev[/COLOR][/B]
Replace the above line with following:
Code:
[B][COLOR="Blue"]
# Mount SD-EXT
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
mount ext2 /dev/block/mmcblk0p2 /sd-ext nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
# Mount SD-DATA
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
mount ext2 /dev/block/mmcblk0p3 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
[/COLOR][/B]
2. Now find the following line:
Code:
[B][COLOR="Red"]mount yaffs2 [email protected] /cache nosuid nodev[/COLOR][/B]
Replace the above line with following:
Code:
[B][COLOR="Blue"]# Mount SD-CACHE
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
mount ext2 /dev/block/mmcblk0p4 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue[/COLOR][/B]
3. Since we are extensively using SDcard, we should adjust the read_ahead_kb parameter for maximum performance:
Add the following lines after this line: mount yaffs2 [email protected] /persist nosuid nodev
Code:
[B][COLOR="Blue"]# SDcard read speed boost
write /sys/block/mmcblk0/bdi/read_ahead_kb 2048[/COLOR][/B]
PART 4 : Removing Memory Increasing Script
=====================================
We are going to remove the memory scripts in the rom.But sense 4 roms have some of their system folder mounted to sd-ext.So to remove it we have to make some changes to the updater script
1.Find and remove all lines in the updater script with sd-ext in them.
2.Next paste the following lines just after the line "package_extract_dir("system", "/system");"
Code:
[B][COLOR="Blue"]
ui_print("Mounting sd-ext");
ui_print("------------------");
run_program("/sbin/mkdir", "/sd-ext");
run_program("/sbin/busybox", "mount", "-t", "auto", "/dev/block/mmcblk0p2", "/sd-ext");
ui_print("Preparing sd-ext for flashing");
ui_print("------------------");
run_program("/sbin/mkdir","/sd-ext/app_s");
set_progress(0.25);
ui_print("Flashing stuff to sd-ext");
ui_print("------------------");
package_extract_dir("sd-ext/app_s", "/sd-ext/app_s");
set_perm_recursive(0, 0, 0755, 0644, "/sd-ext/app_s");
ui_print("Linking /sd-ext contents to /system");
ui_print("-----------------------------------");
symlink("/sd-ext/app_s", "/system/app");[/COLOR][/B]
3.(Rom dependend):Some Sense 4 roms have more folders in sd-ext.To know that just check in the sd-ext folder of your rom.zip.Then add the required lines under right sections.
Code:
[B][COLOR="Blue"]
ui_print("Preparing sd-ext for flashing");
ui_print("------------------");
run_program("/sbin/mkdir","/sd-ext/system_s");
run_program("/sbin/mkdir","/sd-ext/usr_s");
run_program("/sbin/mkdir","/sd-ext/media_s");
ui_print("Flashing stuff to sd-ext");
ui_print("------------------");
package_extract_dir("sd-ext/media_s", "/sd-ext/media_s");
package_extract_dir("sd-ext/usr_s", "/sd-ext/usr_s");
package_extract_dir("sd-ext/system_s", "/sd-ext/system_s");
set_perm_recursive(0, 0, 0755, 0644, "/sd-ext/media_s");
set_perm_recursive(0, 0, 0755, 0644, "/sd-ext/usr_s");
set_perm_recursive(0, 0, 0755, 0644, "/sd-ext/system_s");
package_extract_dir("bootanimation", "/sd-ext/media_s");
ui_print("Linking /sd-ext contents to /system");
ui_print("-----------------------------------");
symlink("/sd-ext/usr_s", "/system/usr");
symlink("/sd-ext/system_s", "/system/app");
symlink("/sd-ext/media_s", "/system/media");[/COLOR][/B]
4.Now remove the memory script. Try to find the name of the memory script as it is different for different roms.
*** This is very important. You should remove any memory increasing script that you were using. Because /data partition is now on SDcard, using memory increasing script will cause conflict and makes ROM unbootable. ***
NOTE: A new Recovery must be made to support the new /SD-DATA and /SD-CACHE partitions.
abhinavthms said:
Trying now....
Click to expand...
Click to collapse
This method is only for Cyanogenmod ROMs. Dont try with Sense ROMs. For Sense ROMs, some modifications are required in the procedure.
cute_prince said:
This method is only for Cyanogenmod ROMs. Dont try with Sense ROMs. For Sense ROMs, some modifications are required in the procedure.
Click to expand...
Click to collapse
Wht if carbon, jellybeer etc, ??
Sent from my HTC Explorer A310e using xda app-developers app
sanpedro_bonita said:
Wht if carbon, jellybeer etc, ??
Sent from my HTC Explorer A310e using xda app-developers app
Click to expand...
Click to collapse
Should work on all aosp based ROMs
If I understand you correctly ,
Will overclocking Burn NAND if I mount /system as RW with Root explorer or adb remount ??
Thanks a ton man !!!
btw i tried it on aokp JB and it DOES WORK
i even uploaded a boot.img for the masses to try out... here : http://forum.xda-developers.com/showpost.php?p=42929950&postcount=282
but one thing i've noticed that if we mount the whole data.. but still wouldn't it affect nand some where.. ?
@cute_prince did you try dsmeg ? did it show any bad blocks ?
ayushrox said:
Thanks a ton man !!!
btw i tried it on aokp JB and it DOES WORK
i even uploaded a boot.img for the masses to try out... here : http://forum.xda-developers.com/showpost.php?p=42929950&postcount=282
but one thing i've noticed that if we mount the whole data.. but still wouldn't it affect nand some where.. ?
@cute_prince did you try dsmeg ? did it show any bad blocks ?
Click to expand...
Click to collapse
No it wont affect any Read-Only portions of NAND. I have already told the reason in OP. Seems like you didnt read it
Yes, I regularly checked dmesg and there is no Bad Block.
The partitions in NAND that are affected by OC are /data and /cache. This is because only these two partitons are mounted with RW access. As I mentioned above the increased Write access during OC is what causing the blocks to corrupt. All other partitions including /misc, /devlog, /boot, /system and /recovery are mounted as Read-Only and therefore are not affected.
Click to expand...
Click to collapse
satiz said:
If I understand you correctly ,
Will overclocking Burn NAND if I mount /system as RW with Root explorer or adb remount ??
Click to expand...
Click to collapse
It's possible. It can also burn your recovery if you try to flash it from phone using "flash_image". So DO NOT try mounting system as rw and always use fastboot for flashing recovery
satiz said:
If I understand you correctly ,
Will overclocking Burn NAND if I mount /system as RW with Root explorer or adb remount ??
Click to expand...
Click to collapse
There is a high probability. But dont worry, before mounting System as RW, set frequency to 600MHz. After System is unmounted you can restore OverClock
Can we use data and cache partions as system because They are now directed to sd card this will increase the size of system ...??
@cute_prince
Awesome job man
i was at hospital,,feeling bad bcuz injured but this great news make me happy
Thanks man
cute_prince said:
3. Since we are extensively using SDcard, we should adjust the read_ahead_kb parameter for maximum performance:
Add the following lines after this line: mount yaffs2 [email protected] /persist nosuid nodev
Code:
[B][COLOR="Blue"]# SDcard read speed boost
write /sys/block/mmcblk0/bdi/read_ahead_kb 2048[/COLOR][/B]
Click to expand...
Click to collapse
Dude i cant find the line you stated below which i have to add read_ahead line
so i randomly added that line and now am stuck at htc screen!
ateeq72 said:
Dude i cant find the line you stated below which i have to add read_ahead line
so i randomly added that line and now am stuck at htc screen!
Click to expand...
Click to collapse
Upload your init.rc
cute_prince said:
Upload your init.rc
Click to expand...
Click to collapse
here you go bro!
http://www.mediafire.com/download/hhvdsdzcesm6chi/init.rc
try fixing this or else just upload your Ramdisk! and thanks for damn fast reply!
cute_prince said:
No it wont affect any Read-Only portions of NAND. I have already told the reason in OP. Seems like you didnt read it
Yes, I regularly checked dmesg and there is no Bad Block.
Click to expand...
Click to collapse
oops sorry my bad.. :angel:
but gr8 work anyway
---------- Post added at 06:58 PM ---------- Previous post was at 06:52 PM ----------
ateeq72 said:
here you go bro!
http://www.mediafire.com/download/hhvdsdzcesm6chi/init.rc
try fixing this or else just upload your Ramdisk! and thanks for damn fast reply!
Click to expand...
Click to collapse
hey bro,you can paste that just below the cache mounting..
ayushrox said:
hey bro,you can paste that just below the cache mounting..
Click to expand...
Click to collapse
bro i just did what you said but now am kinda getting bootloops the the 'htc' splash screen shows for a while and then goes blank and then shows up again! and this process repeats!.
@cute_prince
If we are using SD card for data and cache partition wouldn't it will decrease performance as internal is faster than SD card

Journal Disabler For Pico! :D

----------------------- Journaling Disabler For Pico ----------------------
This is just a simple Zip to Disable Journaling on pico! as we use 2 or 3 extra ext4 partitions for OC!
It even clear's /sd-data,/sd-cache - for aosp
and /sd-ext,/sd-data,/sd-cache - for sense 4
Which means you need not always format your sd-card to switch between roms! .. But if you are switching from aosp rom to sense 4 you need to partition the sd-card appropriately!
Steps to USE:
******* Use this Zip Only when installing a Rom from scratch!... cause it wipes everything! ******
-- clear almost everything you can from recovery e.g factory-reset,/system,/boot,/cache etc
-- install this Zip! as like you do with any other zip (Prefered Recovery TWRP 2.4.X)
-- Flash Your Favourite Rom Now!!
I can use this even if i am not oc'ing?? Just like superwipe?
Disabling journal wont harm anything! Right?
Parth_14 said:
I can use this even if i am not oc'ing?? Just like superwipe?
Disabling journal wont harm anything! Right?
Click to expand...
Click to collapse
From the wikipedia's article:
A journaling file system is a file system that keeps track of the changes that will be made in a journal (usually a circular log in a dedicated area of the file system) before committing them to the main file system. In the event of a system crash or power failure, such file systems are quicker to bring back online and less likely to become corrupted.[1]
Click to expand...
Click to collapse
For overclocking, the SD Card is used for the /data and /cache partition. In that case, the SD Card would be read more frequently as the /data and /cache partitions are the most frequently accessed and modified partitions while running the Android system. In that case, using a Journal would slow down the memory access times if the SD Card is not fast enough. Also, as many modifications are made to the /data and /cache partition, the SD Card would be going through the read/write cycle twice the number of times, once for the journaling and once for the "commiting them to the main file system". So, it is likely that the SD Card might get corrupted faster than it normally should. That is the reason why Class 4 and below SD Cards are likely to "go dead" soon when overclocking with cute_prince's new PLL2 overclocking method. And, this is why ateeq72 has made this flashable zip to disable journaling. It would reduce the possibility/risk of losing your SD Card and at the same time allow you to OC your phone.
Using this when you are not OC'ing your phone? I wouldn't recommend that you flash this zip, but you would need a slightly modified zip. Also, journaling, I presume you want to disable in your phone's sd-ext memory. It would increase your phone's performance in case you are using any memory increasing scripts like int2ext which mount the sd-ext partition in the /data folder.
vineethraj49 said:
Using this when you are not OC'ing your phone? I wouldn't recommend that you flash this zip, but you would need a slightly modified zip. Also, journaling, I presume you want to disable in your phone's sd-ext memory. It would increase your phone's performance in case you are using any memory increasing scripts like int2ext which mount the sd-ext partition in the /data folder.
Click to expand...
Click to collapse
Thanks man!
Can you tell what is to be modified in the zip so that i can use it when i am not oc'ing?
Parth_14 said:
Thanks man!
Can you tell what is to be modified in the zip so that i can use it when i am not oc'ing?
Click to expand...
Click to collapse
No need to mod dude, u can use it if u dont OC.
Helped? Thanks maybe!
Parth_14 said:
Thanks man!
Can you tell what is to be modified in the zip so that i can use it when i am not oc'ing?
Click to expand...
Click to collapse
Edit the file named "ateeqscript" using Notepad++.
Make sure the file looks like the one below.
Code:
#!/bin/sh
echo ***************Begin Disable Journaling Partition***************
/sbin/busybox mount -t auto /dev/block/mmcblk0p2 /sd-ext
rm -rf /sd-ext/*
/sbin/busybox umount -l /sd-ext
/tmp/tune2fs -O ^has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p2
fsck.ext4 -Dfy /dev/block/mmcblk0p2
sync
echo ***************Data Partion Done***************
echo ***************Finished No Journaling Partions***************
What I have done? Simple. Removed all code related to /sd-data and sd-cache, and kept only commands necessary for the sd-ext partition.
---------------------------------------------------
@OP, I suggest a few changes in your script. First, the mounting commands are run, so, if the sd-ext is already mounted by the recovery (just in case, accidentally it happened), then, you wouldn't (or rather shouldn't) be able to mount it in another folder, namely /sd-data. I would suggest the following change in your flashable zip. Try to make it look something like the one below.
Code:
#!/bin/sh
echo "\"Disabling Journaling\" Script"
echo "Initializing script..."
/sbin/busybox umount -l /sd-ext
/sbin/busybox mkdir /sd-data
/sbin/busybox mount /dev/block/mmcblk0p2 /sd-data
/sbin/busybox mkdir /sd-cache
/sbin/busybox mount /dev/block/mmcblk0p3 /sd-cache
/sbin/busybox mkdir /sd-ext2
/sbin/busybox mount /dev/block/mmcblk0p4 /sd-ext
rm -rf /sd-cache/*
rm -rf /sd-data/*
rm -rf /sd-ext/*
/sbin/busybox umount -l /sd-data
/sbin/busybox umount -l /sd-cache
/sbin/busybox umount -l /sd-ext
echo "Disabling Journal in sd-data"
/tmp/tune2fs -O ^has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p2
fsck.ext4 -Dfy /dev/block/mmcblk0p2
echo "Disabling Journal in sd-cache"
/tmp/tune2fs -O ^has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p3
fsck.ext4 -Dfy /dev/block/mmcblk0p3
echo "Disabling Journal in sd-ext"
/tmp/tune2fs -O ^has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p4
fsck.ext4 -Dfy /dev/block/mmcblk0p4
sync
echo "Partitions Journaling Disabled..."
echo "Finished no journaling partitions"
Do we need to flash this zip for every new rom or just once is enough?
Sent from my HTC Explorer A310e using xda app-developers app
faiPICO said:
Do we need to flash this zip for every new rom or just once is enough?
Sent from my HTC Explorer A310e using xda app-developers app
Click to expand...
Click to collapse
i guess one time is enough no need to flash again and again
@ateeq72
Can you edit this script with just the wiping part? As it is not necessary to disable journal for aosp roms!
Parth_14 said:
@ateeq72
Can you edit this script with just the wiping part? As it is not necessary to disable journal for aosp roms!
Click to expand...
Click to collapse
Its already there I guess
vineethraj49 said:
Its already there I guess
Click to expand...
Click to collapse
I've read that it formats through ext2/4 ! What i want is the parition to be remain untouched..
Parth_14 said:
@ateeq72
Can you edit this script with just the wiping part? As it is not necessary to disable journal for aosp roms!
Click to expand...
Click to collapse
vineethraj49 said:
Its already there I guess
Click to expand...
Click to collapse
journal disabling is required for only ext4 partition for max performace
if u dont use ext4 use any wiping script
the script keval gave format partitions to ext2 only not ext4
sakshamx said:
journal disabling is required for only ext4 partition for max performace
if u dont use ext4 use any wiping script
the script keval gave format partitions to ext2 only not ext4
Click to expand...
Click to collapse
NOTE:------------>Do remember the script of sense will format partitions as EXT2 and script for aosp roms will format partitions as EXT4 and sense 4.1 sctript will also format as EXT4
Click to expand...
Click to collapse
vineethraj49 said:
Click to expand...
Click to collapse
u can check the script it formats as ext2 i had also checked from sd card its ext2
i also had thought that as it was given in thread but its not
is it updated script which u posted in facebook
bloodhound42 said:
is it updated script which u posted in facebook
Click to expand...
Click to collapse
yup! it is!
vineethraj49 said:
@OP, I suggest a few changes in your script. First, the mounting commands are run, so, if the sd-ext is already mounted by the recovery (just in case, accidentally it happened), then, you wouldn't (or rather shouldn't) be able to mount it in another folder, namely /sd-data. I would suggest the following change in your flashable zip. Try to make it look something like the one below.
Code:
#!/bin/sh
echo "\"Disabling Journaling\" Script"
echo "Initializing script..."
/sbin/busybox umount -l /sd-ext
/sbin/busybox mkdir /sd-data
/sbin/busybox mount /dev/block/mmcblk0p2 /sd-data
/sbin/busybox mkdir /sd-cache
/sbin/busybox mount /dev/block/mmcblk0p3 /sd-cache
/sbin/busybox mkdir /sd-ext2
/sbin/busybox mount /dev/block/mmcblk0p4 /sd-ext
rm -rf /sd-cache/*
rm -rf /sd-data/*
rm -rf /sd-ext/*
Click to expand...
Click to collapse
Bro thats why i have mounted sd-ext as "sd-ext2" ! to make sure every recovery doesnt have any issue mounting it!
what is journal?
in many posts i found this about this journal what is this actually..

[PROJECT][DIY]Dual Boot ~ the Yin-Yang way!

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??? 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:
Primary ROM: The ROM in the internal partition of your device. The name itself is pretty explanatory.
Secondary ROM: The ROM on your SD-Card, secondary, as in second or something like that.
Click to expand...
Click to collapse
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?
Code:
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:
Code:
#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.
When is bootsdcard.sh run?
After the internal /system, /data, and /cache partitions are mounted.
Click to expand...
Click to collapse
What bootsdcard.sh does?
It basically is an if/else command. If exist /sdcard/place_holder, which is /sdcard/.bootsdcard, in this case, BTW, it unmounts the /system, /data, and /cache partitions, and mounts the partitions on the sdcard in the /system, /data, and /cache folder.
Click to expand...
Click to collapse
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://forum.xda-developers.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. 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:
Code:
format("yaffs2", "MTD", "system", "0", "/system");
mount("yaffs2", "MTD", "system", "/system");
Insert these lines:
Code:
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.
Code:
fastboot flash boot <derped-boot>.img
or via Terminal Emulator
Code:
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:
Code:
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:
Code:
rm /sdcard/.bootsdcard
P.S. An application for this is being developed by @omerjerk, to make this easier.
Anything else?
Nothing for now 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
Editing the kernel
Procedure
You MUST know how to unpack/repack kernels, and their ramdisks.
If you unpack your kernel, you would find the folder named sbin where you'd unpacked the ramdisk. Place these two files View attachment busybox.7z and View attachment bootsdcard.txt in the folder. Rename them to "busybox" and "bootsdcard.sh" respectively.
Additionally, you will need to create a folder named "tmp" where you've unpacked the ramdisk.
Now, open up init.rc and find the lines:
Code:
on fs
# mount mtd partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /system ro remount
mount yaffs2 [email protected] /data nosuid nodev
mount yaffs2 [email protected] /cache nosuid nodev
After these lines, you are most likely to find these lines (or similar lines):
Code:
# once everything is setup, no need to modify /
mount rootfs rootfs / ro remount
Add the following lines to the above:
Code:
chmod 0777 /sbin/busybox
chmod 0777 /sbin/bootsdcard.sh
exec /sbin/busybox sh /sbin/bootsdcard.sh
En total, it should look like this:
on fs
# mount mtd partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /system ro remount
mount yaffs2 [email protected] /data nosuid nodev
mount yaffs2 [email protected] /cache nosuid nodev
on post-fs
chmod 0777 /sbin/busybox
chmod 0777 /sbin/bootsdcard.sh
exec /sbin/busybox sh /sbin/bootsdcard.sh
# once everything is setup, no need to modify /
mount rootfs rootfs / ro remount
Click to expand...
Click to collapse
Now, you can repack the ramdisk, and repack the kernel. In most cases, you should be able to flash the kernel with the busybox included. If you are not able to flash the repacked boot.img, please post the boot.img along with thread from which obtained/sources.
P.S. For the curious, this is what bootsdcard.sh looks like:
Code:
#!/sbin/busybox sh
MOUNT="/sbin/busybox mount"
UMOUNT="/sbin/busybox umount"
MKDIR="/sbin/busybox mkdir"
RMDIR="/sbin/busybox rmdir"
TOUCH="/sbin/busybox touch"
$MKDIR /tmp/sdcard
$CHMOD 0770 /dev/block/mmcblk0p1
$MOUNT /dev/block/mmcblk0p1 /tmp/sdcard
if [ -f /tmp/sdcard/.bootsdcard ];
then
$TOUCH /tmp/.bootsdcard
fi
$UMOUNT /tmp/sdcard
$RMDIR /tmp/sdcard
if [ -f /tmp/.bootsdcard ];
then
$UMOUNT /data;
$CHMOD 0770 /dev/block/mmcblk0p2
$MOUNT -t ext3 -o nosuid,nodev /dev/block/mmcblk0p2 /data
$UMOUNT /system
$CHMOD 0770 /dev/block/mmcblk0p3
$MOUNT -t ext3 /dev/block/mmcblk0p3 /system
$MOUNT -t ext3 -o remount,ro /dev/block/mmcblk0p3 /system
$UMOUNT /cache
$CHMOD 0770 /dev/block/mmcblk0p4
$MOUNT -t ext3 /dev/block/mmcblk0p4 /cache
fi
Downloads
CM9 Build 9's boot.img: http://www.mediafire.com/download/bn2krcdgdehpkij/boot.img
Adding support for G-Apps
You'd also need G-Apps for your secondary ROM. Here's how-to:
Open up any G-Apps zip, and extract updater-script from META-INF/com/google/android folder.
Find the following line:
Code:
run_program("/sbin/busybox", "mount", "/system");
Replace it with:
Code:
run_program("/sbin/busybox", "mount", "-t", "auto", "/dev/block/mmcblk0p3", "/system");
That's it! You can flash your modified g-apps for secondary ROM.
Reserved
In case the boot.img doesn't flash after re-packing, it is very likely that there isn't enough space in the boot partition. I will add the procedure, for that case too.
finished post, reviews welcome
another one , good work bro :good:
is it possible to dual boot Thinkingbridge and stock ??
how about memory scripts ? will it work on both primary and secondary roms !!!
legendlee said:
another one , good work bro :good:
is it possible to dual boot Thinkingbridge and stock ??
how about memory scripts ? will it work on both primary and secondary roms !!!
Click to expand...
Click to collapse
Not possible by the Yin-Yang. One prerequisite is that both the ROMs should use the same kernel.
You could try the other method by ayushrox, which involves using separate boot.img's with different mountpoints.
Memory increasing scripts? That's easy, but you'd need four ext3 partitions, and a modified int2ext. Procedure:
format sdcard in following layout:
fat32>sd-data>sd-system>sd-cache>sd-ext.
Open the memory script int2ext, or int2ext+, and change the following:
Use the search and replace function, it would be helpful.
Replace:
Code:
/dev/block/mmcblk0p2
With:
Code:
/dev/block/mmcblk0p5
Thread Closed
There is already a guide thread located HERE for dual booting multiple ROM's. No need for more guides.​

[GUIDE]How To Dual Boot Two Roms almost ANY Device

Ever wanted to try a new rom without having to waste our time on making backups then trying the rom and then again restoring it, and if another rom pleases you at the moment , you'll have to perform the same drill again and again ... Well Now NO MORE of this frustrating business.
Here i present you my very own method of Dual Booting almost ANY two roms you like on YOUR device.
But make sure to try at your risk.. as per DoomLord many devices can be hardbricked too.
Do Not use this method
on newer (post 2012) qualcomm chipsets the TA and Bootloader, reside on similar partitions... if u screw with these partitions device gets HARD BRICKED!
As the partition maps vary from device to device it may not work for you and you may get your device hard bricked!
Also your device must use older bootloader bypass based kernels i.e boot.img format and has SD-card slots for this method to work !!
Before we begin here's what Dual Booting means :
- Dual booting is the process through which you can switch between any two or more roms without the need of wiping data or making backups before flashing ,all you need to do is switch between the roms ,meanwhile all the apps you've insatlled remain intact in their specific rom.
for ex- If you are using cm10 and you have installed a lot of apps, and you want to test other rom ,but you don't want the fuss of backing up then flashing.. This dual booting method is for you !!​
So to begin with make sure you meet the following prerequisites :
Your Device which can run android
an class 6 or above SD-Card
an Os on the PC to make partitions on the SD-card
ubuntu for kernel specific changes
notepad ++
ConCentRation
If you meet all the above requirements you are good to go
Now to Before we get our hand in the filth remember : You need to have and an SD-Card that's class 6 or above because we would be using it extensively , and slow cards may not keep up
SO LET'S ROLL :
In this method [/CENTER]
Primary Rom = The rom which is modded and remains on the Sd-ext partitons
Secondary Rom = any rom you wish (any android version for ex- cm9 , cm10.1 and even stock !) [ make sure that the secondary rom doesn't use sd-ext partitions]​
I would be dividing the process in tow steps : 1) Kernel level changes and 2)SD-card and Rom level changes
1- Kernel Level Changes :
Get the source of any kernel for your device (if you don't know what's kernel compilation you can go to xda-university to learn it.)
-Now open the defconfig file (usually present in : "arch/arm/config" -folder)
-Search for LBDAF and then change the line consisting it as follows :
Code:
CONFIG_LBDAF=y
and now compile the kernel
This is done so that our Primary Rom can support multiple SD-ext partitons
-Now grab the boot.img of your Primary Rom , unpack it using any tool of your convenience(Google : chanpionwimmer's kernel tools -- i use it ) now open the ramdisk part , then open init.rc
-Search for the rom's mounting functions it will be like:
Code:
mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /system ro remount
it will vary from device to device.. proceed only if you know the correct mount points for your device.. otherwise you WILL hardbrick your device
-Now replace the following lines from the mounting functions to this Make sure you know the correct mount points of your device :
Code:
# Mount SD-SYSTEM
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
mount ext4 /dev/block/mmcblk0p2 /system
mount ext4 /dev/block/mmcblk0p2 /system ro remount
# Mount SD-DATA
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
mount ext4 /dev/block/mmcblk0p3 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
# Mount SD-CACHE
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
mount ext4 /dev/block/mmcblk0p4 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
-Now recompile the kernel and you are good to go
more in the 2nd post ..​
Here now comes the SD-Card and Rom level changes :
YOU MUST USE ATLEAST CLASS 6 OR ABOVE SDCARD WITH MINIMUM 8GB CAPACITY
First you need 3 EXT4 partitions on SD-card, using minitool partition wizard
1) around 400 MB - SD-SYSTEM (ext4)
2) around 1 GB (or can be less) - SD-DATA(ext4 format),
3)around 75MB (can be less) SD-CACHE(ext4 format) (refer to the screenshot):
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Rom level changes :
Get the updater-script of your Primary rom and find for these lines (Will differ from device to device - but basically the format is same )
Code:
format("yaffs2", "MTD", "system", "0", "/system");
mount("yaffs2", "MTD", "system", "/system");
package_extract_dir("system", "/system");
Now replace it with :
Code:
run_program("/sbin/busybox", "mount", "-t", "auto", "/dev/block/mmcblk0p2", "/system");
run_program("/sbin/busybox", "rm", "-rf", "/system/*");
package_extract_dir("system", "/system");
-what we are doing here is extracting the sustem files to the sd-ext partition we just created earlier
save it and replace this updater-script in the original Primary rom and also replace the boot.img with the one you made earlier.
That's it.If you have followed the guide correctly you can Dual boot any Rom on your device
Now flash the primary rom first.. and then any rom you choose as the secondary rom (PROVIDED IT DOESN"T USE SD-Ext partitions..) and flash it
REMEMBER DO NOT wipe data before installing the secondary rom
If you want to change your secondary rom DO NOT WIPE DATA instead goto recovery -
if in CWM or philz -go to mounts and storage and format system , data and cache
For Switching roms :
-put the boot.img of primary rom in the root of your sd-card(not in any directory) reanme it primary.img
-put the boot.img of secondary rom in the root of your sd-card(not in any directory) reanme it sec.img
-get terminal emulator app
-type
Code:
su
flash_image boot /sdcard/primary.img (or secondary.img)
But STOP here are some restrictions of this method :
You must make sure your device uses boot.img format and you know your device's correct mount points !! if you do it wrong you WILL hard brick your device !!
1. For The secondary rom you CANNOT use scripts like int2ext, etc.
2. Also you CANNOT use pll2 OC method in Secondary ROM
3. The edited cm10beta 6 (primary rom) is clocked at 600mhz, so NO chances of burnt nand.
4. You can choose ANY rom as secondary ROM provided it does not violate the first 2 clauses, that is, it should not use sd-ext partitions
5. The process is only for people having class 6 or higher sd card.
PS : This has taken a lot of effort and time so please don't go on commenting "This is useless" , "i don't like it" ,etc. If you don't like it, you are free to leave.
<JohnCarter> said:
...
-Now grab the boot.img of your Primary Rom , unpack it using any tool of your convenience(Google : chanpionwimmer's kernel tools -- i use it ) now open the ramdisk part , then open init.rc
-Search for the rom's mounting functions it will be like:
Code:
mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /system ro remount
it can vary from device to device..
-Now replace the following lines from the mounting functions to this :
Code:
# Mount SD-SYSTEM
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
mount ext4 /dev/block/mmcblk0p2 /system
mount ext4 /dev/block/mmcblk0p2 /system ro remount
# Mount SD-DATA
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
mount ext4 /dev/block/mmcblk0p3 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
# Mount SD-CACHE
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
mount ext4 /dev/block/mmcblk0p4 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
..
Click to expand...
Click to collapse
PLEASE DONT POST INCORRECT INFORMATION!
the partition maps vary from device to device!
on newer (post 2012) qualcomm chipsets the TA and Bootloader, reside on similar partitions... if u screw with these partitions device gets HARD BRICKED!
also not all devices use standard boot.img format...
if u were able to get it to work on a particular device atleast test it out on 8-10 different devices from different vendors and different platforms before posting such threads...
DooMLoRD said:
PLEASE DONT POST INCORRECT INFORMATION!
the partition maps vary from device to device!
on newer (post 2012) qualcomm chipsets the TA and Bootloader, reside on similar partitions... if u screw with these partitions device gets HARD BRICKED!
also not all devices use standard boot.img format...
if u were able to get it to work on a particular device atleast test it out on 8-10 different devices from different vendors and different platforms before posting such threads...
Click to expand...
Click to collapse
I truly second that. The information on this thread is valid only for some devices. You can seriously screw a number of devices.
DooMLoRD said:
PLEASE DONT POST INCORRECT INFORMATION!
the partition maps vary from device to device!
on newer (post 2012) qualcomm chipsets the TA and Bootloader, reside on similar partitions... if u screw with these partitions device gets HARD BRICKED!
also not all devices use standard boot.img format...
if u were able to get it to work on a particular device atleast test it out on 8-10 different devices from different vendors and different platforms before posting such threads...
Click to expand...
Click to collapse
Ok thanks for the info... i'll give a caution for not using this method on newer devices

[GUIDE][DEV] How to convert NAND ROM to SD-EXT ROM for MultiBootloader

How to convert NAND ROM to SD-EXT ROM for MultiBootloader​
Code:
After following this guide, your ROM can be use with [URL="http://forum.xda-developers.com/nokia-x2/development/sbl-multibootloader-v1-00-04-10-2015-t3217360"]MultiBootloader[/URL]
THIS GUIDE IS NOT FOR NOOBs
Requirements
Knowledge about Android Image Kitchen
Notepad ++
A nand ROM extracted
Instructions
Delete the RED COLOR
Add the BLUE COLOR
Step 1: Modifying boot.img (FOR STOCK KERNEL ONLY) - Check post #2 to download the modified boot image, you don't need to edit it yourself.
Use Android Image Kitchen's unpackimg command to unpack the boot.img file from the ROM your want to port.
Go to Android Image Kitchen\ramdisk folder, edit these files:
fstab.qcom
Change like this:
Code:
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
#TODO: Add 'check' as fs_mgr_flags with data partition.
# Currently we dont have e2fsck compiled. So fs check would failed.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
[COLOR="Red"]/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,barrier=1 wait
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard wait,check,encryptable=footer[/COLOR]
[COLOR="Blue"]/dev/block/platform/msm_sdcc.1/by-name/userdata /nanddata ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard wait,check,encryptable=footer[/COLOR]
/devices/msm_sdcc.2/mmc_host /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard:auto
#/dev/block/mmcblk0p11 /system ext4 ro,barrier=1 wait
#/dev/block/mmcblk0p12 /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc wait,check,encryptable=footer
init.rc
- Find this event:
Code:
on fs
- Change like this:
Code:
on fs
# mount mtd partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
[COLOR="Red"]mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /system ro remount
mount yaffs2 [email protected] /data nosuid nodev[/COLOR]
[COLOR="Blue"] mount ext4 /dev/block/mmcblk1p2 /system
mount ext4 /dev/block/mmcblk1p2 /system ro remount
mount ext4 /dev/block/mmcblk1p3 /data nosuid nodev[/COLOR]
mount yaffs2 [email protected] /cache nosuid nodev
[COLOR="Blue"]#mount nand data for sharing data/app
mkdir /nanddate 0771 system system
mount yaffs2 [email protected] /nanddata nosuid nodev
# mount sdcard
wait /dev/block/mmcblk1p1
wait /dev/block/mmcblk1p1
mount vfat /dev/block/mmcblk1p1 /storage/sdcard1[/COLOR]
​
init.target.rc
- Find this event:
Code:
on fs
- Change like this:
Code:
on fs
mount_all fstab.qcom
# Keeping following partitions outside fstab file. As user may not have
# these partition flashed on the device. Failure to mount any partition in fstab file
# results in failure to launch late-start class.
wait /dev/block/platform/msm_sdcc.1/by-name/cache
mount ext4 /dev/block/platform/msm_sdcc.1/by-name/cache /cache nosuid nodev barrier=1
wait /dev/block/platform/msm_sdcc.1/by-name/persist
mount ext4 /dev/block/platform/msm_sdcc.1/by-name/persist /persist nosuid nodev barrier=1
wait /dev/block/platform/msm_sdcc.1/by-name/modem
mount vfat /dev/block/platform/msm_sdcc.1/by-name/modem /firmware ro shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337
[COLOR="Red"] wait /dev/block/platform/msm_sdcc.1/by-name/custom
mount ext4 /dev/block/platform/msm_sdcc.1/by-name/custom /custom nosuid nodev barrier=1 ro[/COLOR]
[COLOR="Blue"] wait /dev/block/mmcblk1p4
mount ext4 /dev/block/mmcblk1p4 /custom nosuid nodev barrier=1 ro[/COLOR]
​
Repack boot.img and copy to the ROM folder.
Step 2: Modifying updater-script
Open ROM-name\META-INF\com\google\android\updater-script
Find:
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p19", "/system");
or
Code:
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
Add these lines above it:
Code:
[COLOR="blue"]ui_print(" Mounting Partitions ");
mount("ext4", "MMC", "/dev/block/mmcblk1p2", "/system-ext");
mount("ext4", "MMC", "/dev/block/mmcblk1p4", "/custom-ext");
mount("ext4", "EMMC", "/dev/block/mmcblk0p20", "/cache");
mount("ext4", "MMC", "/dev/block/mmcblk1p3", "/data-ext");
ui_print(" Formatting Partitions ");
delete_recursive("/system-ext");
delete_recursive("/custom-ext");
delete_recursive("/cache");
delete_recursive("/data/dalvik-cache");
delete_recursive("/data-ext");[/COLOR]
Find this line:
Code:
package_extract_file("boot.img", "/tmp/boot.img");
Change like this:
Code:
[INDENT][COLOR="Red"]package_extract_file("boot.img", "/tmp/boot.img");
run_program("/system/xbin/busybox", "dd", "if=/tmp/boot.img", "of=/dev/block/mmcblk0p10");
delete("/tmp/boot.img");[/COLOR][COLOR="Blue"]
package_extract_file("boot.img", "/emmc/kernels/[I]your_rom_name[/I].img");[/COLOR][/INDENT]
Find and change all /system/ to /system-EXT/
Find and change all /custom/ to /custom-EXT/
Save.
Step 3: Create the ZIP
Make sure you have copy the modified boot.img to the ROM folder
Select all the files and folders in the ROM folder (custom, system, META-INF, boot.img,etc..)
Compress into ZIP file.
Done.
<EDITTING>
I have modifed the boot.img to boot into sdext ROM:
For stock based ROM: stock_ext.img - thanks to @symbuzzer for adding some features and fixing the ril & sdcard bugs
modified_stock_insecure-kernel.img - (Maybe I've made some mistake in this file. I don't recommend to use this, it can cause some bugs with sdcard0. Better modify it yourself.)
For CM11 based ROM: ext_cm11.img
Great ! Im waiting for this
Bro how can intsall the rom
I m try but couldn't with me
Plz help ??
@SonnySimon this method doesnt work on Stock Kernel/Rom. I will attach stock kernel on XDA today. You can compare mine with yours and update this post. Thanks
symbuzzer said:
@SonnySimon this method doesnt work on Stock Kernel/Rom. I will attach stock kernel on XDA today. You can compare mine with yours and update this post. Thanks
Click to expand...
Click to collapse
It works. I tried and it boots successfully into ext stock ROM but have some bugs with ril and sdcard.
SonnySimon said:
It works. I tried and it boots successfully into ext stock ROM but have some bugs with ril and sdcard.
Click to expand...
Click to collapse
I meant yours have bugs Thanks anyway
[HOW TO] BOOT FROM SD CARD [SUCCESSFULLY] on QMobile Z8 with BRICKED/DEAD eMMC
SimonVN said:
How to convert NAND ROM to SD-EXT ROM for MultiBootloader
Click to expand...
Click to collapse
I have been successfully able to boot from SD card on QMobile Z8 by partitioning SD card on a Ubuntu machine using 'parted' and 'fdisk' commands, replicating eMMC partition table and then flashing factory firmware images to these newly created partitions using 'dd' command. Then I modified "fstab.qcom" & "init.tegra.rc" files in kernel (boot.img) and "recovery.fstab" and "uneventd.rc" files in twrp recovery to initiate mounting and booting from sd card instead of internal memory. It was successful after some experiments. Details can be found here:
https://forum.xda-developers.com/android/help/how-to-boot-sd-card-qmobile-z8-bricked-t3712171
But I have still a few queries to be answered. Please have a look. Any help, comments, information or suggestions will be appreciated.

Categories

Resources