[Galaxy S II Themes and Apps] Troubadour666:
Please , if you want to know the dualboot 4.1.2/4.4.2 method, go directly here , check post relative to ERROR STATUS 7....

ALL USE OF THIS IS AT YOUR OWN RISK

NO TROUBLE TO BACKUP PRELOAD PARTITION readHERE,

BACKUP/RESTORE IN RECOVERY MOD ARE REALY SAFE WITH THIS METHOD OF USING ROM BECAUSE ONLY SYSTEM AND DATA PARTITION ARE USE BY DORIMANX V8.XX and CWM doesnt know PRELOAD partition.

Hi to all.

You know i want to run all JB 4.1.2 ROM i found in 2nd ROM and for that i only use [MENTION=2376110]dorimanx[/MENTION] any version 8.XX kernel.

The only way i found for that is to bypass the use of PRELOAD partition in ZIP of ROMs i test and fortunaly V8.xx permit that sort of managment rom.

I want to give here all necessary tweaks for ppl who want to test that if interested.

I see now that we can have multiple combinations with any ROM in Dual-Boot ppl signature .

1rst rom : NeatROM, Biftor, VIVEK and many other JB SAMMY 4.1.2

2nd rom : Rootbox or Resurrection Remix or CM10.X

1rst rom : Rootbox or Resurrection Remix or CM10.X

2nd rom : NeatROM, Biftor, VIVEK and many other JB SAMMY 4.1.2

1rst rom : Rootbox or Resurrection Remix or CM10.X

2rst rom : Rootbox or Resurrection Remix or CM10.X

1rs rom : NeatROM, Biftor, VIVEK and many other JB SAMMY 4.1.2

2nd rom : NeatROM, Biftor, VIVEK and many other JB SAMMY 4.1.2

prerequis tools :

WINRAR to manipulate ZIP ROM and other ZIP

DORIMANX KERNEL any V8.XX downloaded here to replace kernel if you want to DualBoot

Notepad ++ to edit script files

In all case of flashing a 2nd rom, if it's your 1rst use, you have to flash DorimanX kernel V8.xx 1rst stage before continuing. i cant explain here all the steps to change your kernel in I9100, and how to use recovery mode to initiate 2nd ROM space for your DualBoot, many threads for that. thanks.

So, when you flash a ZIP ROM in 2nd position, you have to reflash DorimanX kernel immedialty after to validate run of new 2nd rom you went to flash.

This take many manipulation and the day i began to "thread" for 2nd ROM use on XDA forum, i decided to provide updater-script for 2nd ROM without keeping lines relevant to kernel and modem flash.

Today, as i want to make an universal I9100 updater-script for 1rst rom and 2nd rom without the use of PRELOAD partition with DorimanX V8.xx, and without modify the structure of the ZIP ROM,

i decided to keep the relevant lines to kernel flash, and change kernel image in ZIP ROM by zImage (renamed boot.img sometimes) extrated from DorimanX kernel ZIP, before my flash, in 1rst rom or 2nd rom, even in a ROOTBOX ZIP, CM10.1 ...

For this universal updater-script, i have to make the choise about the modem too, but i think relevante lines to modem can be deleted or kept, depend of user :)

You can delete relevant lines to Modem because you already have a rom in use which have a modem, in 1rst rom or 2nd rom.

I repeat, only if you plan to flash on 1rst position, you have to keep the relevant lines to kernel but not necessary those concern by Modem flash (red lines)

if you plan to flash in 2nd rom, relevant lines to kernel and modem can be deleted.

Sometimes, you find rom that doesnt flash any modem because DEV provider supose you already have one and doesnt impose one during flash, and he gives you the choise of modem to flash in its thread.

With the tweaks i give here, anybody can keep or delete the relevant lines to modem (and kernel, why not, only if flash will concern 2nd rom)

generaly, this kernel and modem relevant lines are located the end of updater-script, see some sample :

Base on ROOTBOX ROM No MODEM

[COLOR="Green"][B]package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
set_perm(0, 0, 0644, "/tmp/backuptool.functions");
run_program("/tmp/backuptool.sh", "restore");
delete("/system/bin/backuptool.sh");
delete("/system/bin/backuptool.functions");[/B][/COLOR]
show_progress(0.200000, 10);
[COLOR="Red"][B]assert(package_extract_file("boot.img", "/tmp/boot.img"),
write_raw_image("/tmp/boot.img", "/dev/block/mmcblk0p5"),
delete("/tmp/boot.img"));[/B][/COLOR]

RESURRECTION REMIX ROM No MODEM

[COLOR="Red"][B]assert(package_extract_file("boot.img", "/tmp/boot.img"),
write_raw_image("/tmp/boot.img", "/dev/block/mmcblk0p5"),
delete("/tmp/boot.img"));[/B][/COLOR]

Base on CM10.2 ROM (10.1 too) No MODEM

[COLOR="Green"][B]package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
set_perm(0, 0, 0644, "/tmp/backuptool.functions");
run_program("/tmp/backuptool.sh", "restore");
delete("/system/bin/backuptool.sh");
delete("/system/bin/backuptool.functions");[/B][/COLOR]
show_progress(0.200000, 10);
[COLOR="Red"][B]assert(package_extract_file("boot.img", "/tmp/boot.img"),
write_raw_image("/tmp/boot.img", "/dev/block/mmcblk0p5"),
delete("/tmp/boot.img"));[/B][/COLOR]

NeatRom Lite V4.8

[COLOR="Green"][B]ui_print("Backing up EFS");
package_extract_file("Sale/efs_backup.sh", "/tmp/efs_backup.sh");
set_perm(0, 0, 0755, "/tmp/efs_backup.sh");
run_program("/tmp/efs_backup.sh");[/B][/COLOR]
[COLOR="Red"][B]ui_print("Flashing kernel ...");
package_extract_file("Sale/flash_image", "/tmp/flash_image");
set_perm(0, 0, 0777, "/tmp/flash_image");
assert(package_extract_file("Sale/zImage", "/tmp/zImage"),
run_program("/tmp/flash_image", "/dev/block/mmcblk0p5", "/tmp/zImage"),
delete("/tmp/zImage"));[/B][/COLOR]
[COLOR="Blue"][B]ui_print("Flashing modem ...");
assert(package_extract_file("Sale/modem.bin", "/tmp/modem.bin"),
run_program("/tmp/flash_image", "/dev/block/mmcblk0p8", "/tmp/modem.bin"),
delete("/tmp/modem.bin"));[/COLOR]
[COLOR="Red"]delete("/tmp/flash_image");[/B][/COLOR]
delete("/tmp/symlink_preload");
[COLOR="Green"][B]delete("/tmp/efs_backup.sh");[/B][/COLOR]

BIFTOR V11 ROM

[COLOR="Green"][B]ui_print("Backing up EFS");
package_extract_file("Biftor/efs_backup.sh", "/tmp/efs_backup.sh");
set_perm(0, 0, 0755, "/tmp/efs_backup.sh");
run_program("/tmp/efs_backup.sh");[/B][/COLOR]
[COLOR="Red"][B]ui_print("Flashing kernel ...");
package_extract_file("Biftor/flash_image", "/tmp/flash_image");
set_perm(0, 0, 0777, "/tmp/flash_image");
assert(package_extract_file("Biftor/zImage", "/tmp/zImage"),
run_program("/tmp/flash_image", "/dev/block/mmcblk0p5", "/tmp/zImage"),
delete("/tmp/zImage"));[/B][/COLOR]
[COLOR="Blue"][B]ui_print("Flashing modem ...");
assert(package_extract_file("Biftor/modem.bin", "/tmp/modem.bin"),
run_program("/tmp/flash_image", "/dev/block/mmcblk0p8", "/tmp/modem.bin"),
delete("/tmp/modem.bin"));[/B][/COLOR]
delete("/tmp/symlink_preload");
[COLOR="Red"][B]delete("/tmp/flash_image");[/B][/COLOR]
[COLOR="Green"][B]delete("/tmp/efs_backup.sh");[/B][/COLOR]

when you edit updater-script you can remove the red or blue colored block lines as you want accordingly the flash you plan, 1rst rom or 2nd rom position.

And what you plan , always keep the colored green block of lines that concern Backing up EFS or backuptool.sh script.

I DONT TALK HERE ABOUT LINE BEFORE OR AFTER.

KEEP IN MIND THAT IF YOU FLASH IN 1RST ROM, YOU HAVE TO KEEP LINES RELATIVE TO KERNEL FLASH ON YOUR MODDED UPDATER-SCRIPT.

depend of your choice, you can have to replace kernel image in ZIP ROM, how to do that ?

how to change kernel image in ZIP ROM with another image extracted from CWM kernel flasher :

- for DualBoot, exclusive use of DorimanX any V8.xx only. (i never have trouble with this method and have never use ODIN)

1 - extract zImage from ZIP of DorimanX V8.xx kernel you want for your dual-boot.

2 - open ZIP ROM with WINRAR

2 - find kernel image in ROM ZIP opened where is located, sometimes it's named boot.img instead of zImage.

3 - if kernel in ROM ZIP is named boot.img, rename zImage file you have extracted in step1 to boot.img

4 - finaly WINRAR open at place where is kernel image DEV, drag and drop in your new renamed (or not) kernel image (zImage or boot.img depends of rom)

At this step, if you never plan to flash JB SAMMY 4.1.2 stock or custom ROM on 2nd ROM, you can stop here.

- For many jb sammy 4.1.2 rom, there is an symlink_preload file in structure of ZIP ROM (i wont explain here the reason of PRELOAD partition added by SAMSUNG).

Originaly, this script is use during flash to simlink APKs system files from /preload/symlink/system/app folder in PRELOAD partition to /system/app/ in SYSTEM partition.

you have to modify this file too , like i preconise because all files which are in preload folder of ZIP ROM will be installed in /data/sec_data/ folder of you rom after flash.

BEFORE

#!/system/bin/mksh
mount -o remount rw /system
cd /preload/symlink/system/app
# Can't create array with /sbin/sh, hence we use mksh
apk_list=( `ls | grep .apk` )
odex_list=( `ls | grep .odex` )
items=${apk_list[*]}" "${odex_list[*]}
for item in ${items[@]}
do
ln -s /preload/symlink/system/app/$item /system/app/$item
done

AFTER

#!/system/bin/mksh
mount -o remount rw /system
cd /data/sec_data
# Can't create array with /sbin/sh, hence we use mksh
apk_list=( `ls | grep .apk` )
odex_list=( `ls | grep .odex` )
items=${apk_list[*]}" "${odex_list[*]}
for item in ${items[@]}
do
ln -s /data/sec_data/$item /system/app/$item
done

STAGE CONCERNING KERNEL AND MODEM AND SYMLINK_PRELOAD SCRIPT DONE and now, you know why there are some obligations in this concept.

Have a look on some updater-script of <> type of CM10.x or 4.2.2 ROM :

SLIM-i9100-UNOFFICIAL-SaberMod-4.9-20130720

mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
package_extract_dir("system/addon.d", "/system/addon.d");
package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
set_perm(0, 0, 0644, "/tmp/backuptool.functions");
run_program("/tmp/backuptool.sh", "backup");
unmount("/system");
show_progress(0.500000, 0);
ui_print("");
ui_print("");
ui_print("Slim Roms");
ui_print("");
ui_print(" www.slimroms.net ");
ui_print("");
ui_print("");
ui_print("Format and Mount System, Mount Data...");
unmount("/system");
format("ext4", "EMMC", "/dev/block/mmcblk0p9", "0", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p10", "/data");
package_extract_dir("recovery", "/system");
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");

Base CM 10.x ROM

assert(getprop("ro.product.device") == "galaxys2" || getprop("ro.build.product") == "galaxys2" ||
getprop("ro.product.device") == "i9100" || getprop("ro.build.product") == "i9100" ||
getprop("ro.product.device") == "GT-I9100" || getprop("ro.build.product") == "GT-I9100" ||
getprop("ro.product.device") == "GT-I9100M" || getprop("ro.build.product") == "GT-I9100M" ||
getprop("ro.product.device") == "GT-I9100P" || getprop("ro.build.product") == "GT-I9100P" ||
getprop("ro.product.device") == "GT-I9100T" || getprop("ro.build.product") == "GT-I9100T");
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
set_perm(0, 0, 0644, "/tmp/backuptool.functions");
run_program("/tmp/backuptool.sh", "backup");
unmount("/system");
show_progress(0.500000, 0);
unmount("/system");
format("ext4", "EMMC", "/dev/block/mmcblk0p9", "0", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
package_extract_dir("recovery", "/system");
package_extract_dir("system", "/system");

Base RootBox ROM

assert(getprop("ro.product.device") == "galaxys2" || getprop("ro.build.product") == "galaxys2" ||
getprop("ro.product.device") == "i9100" || getprop("ro.build.product") == "i9100" ||
getprop("ro.product.device") == "GT-I9100" || getprop("ro.build.product") == "GT-I9100" ||
getprop("ro.product.device") == "GT-I9100M" || getprop("ro.build.product") == "GT-I9100M" ||
getprop("ro.product.device") == "GT-I9100P" || getprop("ro.build.product") == "GT-I9100P" ||
getprop("ro.product.device") == "GT-I9100T" || getprop("ro.build.product") == "GT-I9100T");
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
set_perm(0, 0, 0644, "/tmp/backuptool.functions");
run_program("/tmp/backuptool.sh", "backup");
unmount("/system");
show_progress(0.500000, 0);
unmount("/system");
format("ext4", "EMMC", "/dev/block/mmcblk0p9", "0", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
package_extract_dir("recovery", "/system");
package_extract_dir("system", "/system");

RESURRECTION REMIX

assert(getprop("ro.product.device") == "galaxys2" || getprop("ro.build.product") == "galaxys2" ||
getprop("ro.product.device") == "i9100" || getprop("ro.build.product") == "i9100" ||
getprop("ro.product.device") == "GT-I9100" || getprop("ro.build.product") == "GT-I9100" ||
getprop("ro.product.device") == "GT-I9100M" || getprop("ro.build.product") == "GT-I9100M" ||
getprop("ro.product.device") == "GT-I9100P" || getprop("ro.build.product") == "GT-I9100P" ||
getprop("ro.product.device") == "GT-I9100T" || getprop("ro.build.product") == "GT-I9100T");
show_progress(0.500000, 0);
unmount("/system");
format("ext4", "EMMC", "/dev/block/mmcblk0p9", "0", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
package_extract_dir("recovery", "/system");
package_extract_dir("system", "/system");

As you can see, these type of ROMs dont manage PRELOAD partition but all FORMAT SYSTEM PARTITION BEFORE FLASH, it's mostly the case on Nighty ROMs , so, nothing to modify for them, change image kernel inside ZIP ROM by DorimanX V8.xx as i explain and flash, in 1rst rom or 2nd ROM if it exist. Dont forget to wipe data if necessary, depends which rom you come from.

Let's see updater-script from 4.1.2 JB SAMMY ROM :

NEATROM LITE 4.8

unmount("/system");
unmount("/cache");
[COLOR="Red"][B]unmount("/preload");[/B][/COLOR]
run_program("/sbin/mount", "/dev/block/mmcblk0p9", "/system");
run_program("/sbin/mount", "/dev/block/mmcblk0p10", "/data");
run_program("/sbin/mount", "/dev/block/mmcblk0p7", "/cache");
[COLOR="Red"][B]run_program("/sbin/mount", "/dev/block/mmcblk0p12", "/preload");[/B][/COLOR]
delete_recursive("/system");
delete_recursive("/cache");
delete_recursive("/data/dalvik-cache");
[COLOR="Red"][B]delete_recursive("/preload");[/B][/COLOR]
delete("/data/system/batterystats.bin");
package_extract_dir("data", "/data");
set_perm(2000, 2000, 0771, "/data/local");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
ui_print("Installing system ...");
show_progress(0.500000, 80);
package_extract_dir("system", "/system");
[COLOR="Red"][B]package_extract_dir("preload", "/preload");[/B][/COLOR]

Biftor V11

unmount("/system");
unmount("/cache");
[COLOR="Red"][B]unmount("/preload");[/B][/COLOR]
ui_print("mounting...");
ui_print("mount System");
run_program("/sbin/mount", "/dev/block/mmcblk0p9", "/system");
ui_print("mount data");
run_program("/sbin/mount", "/dev/block/mmcblk0p10", "/data");
ui_print("mount cache");
run_program("/sbin/mount", "/dev/block/mmcblk0p7", "/cache");
[COLOR="Red"][B]ui_print("mount preload");
run_program("/sbin/mount", "/dev/block/mmcblk0p12", "/preload");[/B][/COLOR]
delete_recursive("/system");
delete_recursive("/cache");
delete_recursive("/data/dalvik-cache");
[COLOR="Red"][B]delete_recursive("/preload");[/B][/COLOR]
[COLOR="Green"][B]delete_recursive("/data/data/com.android.providers.settings");
delete_recursive("/data/data/com.android.settings");
delete_recursive("/data/data/com.android.SystemUI");[/B][/COLOR]
delete("/data/system/batterystats.bin");
package_extract_dir("data", "/data");
set_perm(2000, 2000, 0771, "/data/local");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
ui_print("Installing system ...");
show_progress(0.500000, 80);
package_extract_dir("system", "/system");
[COLOR="Red"][B]package_extract_dir("preload", "/preload");[/B][/COLOR]

In this type of ROMs, no format of system, simply some delete_recursive and extract command .

because we are in recovery during flash and we have DorimanX kernel installed,

- we can delete relevant lines to mount and unmount preload partition. (in red)

- as we plan to switch preload extracted folder destination to /data/sec_data/ folder in rom. (in red)

we have to change red lines like that :

if we came from another JB 4.1.2 2nd ROM, without wipping data, if not, write it anyway, you can have to reflash rom

.

delete_recursive("/preload"); must be replaced by delete_recursive("/data/sec_data");

and in all cases

package_extract_dir("preload", "/preload"); must be replaced by package_extract_dir("preload/symlink/system/app", "/data/sec_data");

the green lines are relevant from DEV, sometimes more but can be useful and you can add some more.

delete_recursive("/data/data/com.android.providers.settings");

delete_recursive("/data/data/com.android.settings");

delete_recursive("/data/data/com.android.SystemUI");

personaly i add this block of lines to flash my Best Biftor 2nd ROM :

delete_recursive("/data/data/com.android.vending");

delete_recursive("/data/data/com.android.providers.downloads");

delete_recursive("/data/data/com.google.android.gsf");

delete_recursive("/data/data/com.Biftor.Biftorteam");

delete_recursive("/data/data/com.Biftor.Biftorteam.NavBar");

delete_recursive("/data/data/com.Biftor.BiftorTeamAppRestart");

delete_recursive("/data/data/com.Biftor.Biftorteamstatusbar");

Finaly, the two sample modified here, personaly mine :

NEATROM LITE 4.8 ROM

unmount("/system");
unmount("/cache");
run_program("/sbin/mount", "/dev/block/mmcblk0p9", "/system");
run_program("/sbin/mount", "/dev/block/mmcblk0p10", "/data");
run_program("/sbin/mount", "/dev/block/mmcblk0p7", "/cache");
delete_recursive("/system");
delete_recursive("/cache");
delete_recursive("/data/dalvik-cache");
delete_recursive("/data/sec_data");
delete_recursive("/data/data/com.android.providers.settings");
delete_recursive("/data/data/com.android.settings");
delete_recursive("/data/data/com.android.SystemUI");
delete_recursive("/data/data/com.android.vending");
delete_recursive("/data/data/com.android.providers.downloads");
delete_recursive("/data/data/com.google.android.gsf");
delete_recursive("/data/data/com.Biftor.Biftorteam");
delete_recursive("/data/data/com.Biftor.Biftorteam.NavBar");
delete_recursive("/data/data/com.Biftor.BiftorTeamAppRestart");
delete_recursive("/data/data/com.Biftor.Biftorteamstatusbar");
delete("/data/system/batterystats.bin");
package_extract_dir("data", "/data");
set_perm(2000, 2000, 0771, "/data/local");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
ui_print("Installing system ...");
show_progress(0.500000, 80);
package_extract_dir("system", "/system");
package_extract_dir("preload/symlink/system/app", "/data/sec_data");

Biftor V11 ROM

unmount("/system");
unmount("/cache");
ui_print("mounting...");
ui_print("mount System");
run_program("/sbin/mount", "/dev/block/mmcblk0p9", "/system");
ui_print("mount data");
run_program("/sbin/mount", "/dev/block/mmcblk0p10", "/data");
ui_print("mount cache");
run_program("/sbin/mount", "/dev/block/mmcblk0p7", "/cache");
delete_recursive("/system");
delete_recursive("/cache");
delete_recursive("/data/dalvik-cache");
delete_recursive("/data/sec_data");
delete_recursive("/data/data/com.android.providers.settings");
delete_recursive("/data/data/com.android.settings");
delete_recursive("/data/data/com.android.SystemUI");
delete_recursive("/data/data/com.android.vending");
delete_recursive("/data/data/com.android.providers.downloads");
delete_recursive("/data/data/com.google.android.gsf");
delete_recursive("/data/data/com.Biftor.Biftorteam");
delete_recursive("/data/data/com.Biftor.Biftorteam.NavBar");
delete_recursive("/data/data/com.Biftor.BiftorTeamAppRestart");
delete_recursive("/data/data/com.Biftor.Biftorteamstatusbar");
delete("/data/system/batterystats.bin");
package_extract_dir("data", "/data");
set_perm(2000, 2000, 0771, "/data/local");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
ui_print("Installing system ...");
show_progress(0.500000, 80);
package_extract_dir("system", "/system");
package_extract_dir("preload/symlink/system/app", "/data/sec_data");