[Galaxy S II Android Development] Troubadour666:
Preambule and Summary of this thread

I make this thread myself to show ppl my method to port all JB SAMMY 4.1.2 ROM

(MS1, LSE, LS8, LSJ, LSD, LSN, LSS and LSW) on 2nd ROM while having an AOSP 4.2.2 ROM at 1rst position.

You're always reading that it's impossible to dualboot jb sammy 4.1.2 roms,

and in fact, yes, it's impossible if we flash this type of ROM on our 2nd

rom as we usualy do it before JB SAMMY 4.1.2 ROM are outed with a permitted

kernel to do dualboot.

Samsung provide us JB 4.1.2 BIGs versions ROMs with so many bloatwares than ICS version before,

and for that they are obliged to add an extended partition named \PRELOAD\ to put all of them in.

So, as a stock kernel doesn't manage 2nd rom, we have to find a custom kernel to do this,

and we have to manage this \PRELOAD\ partition too, to flash rom in 2nd ROM.

I give you here all my learning from over XDA threads since 4 months of dualbooting JB SAMMY 4.1.2 ROMs.

All you have to know it's that we have to extract apks app files which are in \preload\ folder of a ZIP ROM

in an another partition when we want to run a JB SAMMY 4.1.2 700Mo BIG ROM as 2nd ROM,

with DorimanX kernel, 8.xx Version ONLY ! DorimanX kernel ONLY.

In 2nd ROM usage, DorimanX says us to put \preload\ folder content of a ZIP ROM in \DATA\ partition ,

exactly in \data\sec_data\ folder !

Somes months ago, 1rst version of dualboot have used \data\app\app\ folder as a deported \preload\ folder,

but this was abandonned, by me for instance, when DorimanX says me to use \data\sec_data\ folder instead

of \data\app\app\.

Why do we must need a valid 2nd ROM running ?

AFAIK, It's interesting to have a "robust" 1st rom like a ROOTBOX ROM and having a 2nd rom

like a jb 4.1.2 rom can give us totaly managment of all we want to change in our system without flashing

anything else at all (except kernel, modem and rom), we can theme and mod as we want and just reboot to take changes on.

With the help of soft like WINSCP i will show in a post below, just make your change and reboot, and finaly enjoy change you're made :)

(as command line utility, Putty seems to be a good alternative to ADB).

To enable WINSCP communication between your PC and your TEL, I also explain here how to include somes binaries

in your future modded ZIP JB 4.1.2 ROM for 2nd ROM, before flashing it, so you'll have an another way to pass some

command lines without ADB utility , but in a Putty terminal.

The good questions are :

How can we port a BIG ROM like 600-700Mo space large systems partitions (system & preload)

in our I9100 which ROM we want to run as a 2nd ROM with \SYSTEM\ partition about only 500Mo space large?

how to bypass the use of the \PRELOAD\ partition use when we run the JB 4.1.2 ROM as 2nd ROM ?

We know that Samsung add many more bloatware than possible in the JB 4.1.2

Firmware, and because of this addition, they must have to add a new partition they named

\PRELOAD\ , Samsung has deported many system files in this partition, in the

\preload\symlink\system\app\ folder.

As kernel stock doesn't manage directly files in \PRELOAD\ partition sub-folders,

and kernel stock doesn't know there are many apks in \preload\symlink\system\app\

to manage, Samsung has symlinked these apks to \SYSTEM\ partition in \system\app\

with many LNs files in \system\app\ folder.

Some rare Kernel can dualboot, like DorimanX kernel, and it give us the capabilities to port

a JB SAMMY 4.1.2 ROM in 2nd ROM by the deporting of all APKs in the \preload\symlink\system\app\

folder (when 1rst rom installed) to a sub-folder of the 2nd ROM \DATA\ partition,

named \data\sec_data\ (when ported rom in 2nd rom)

We can do this because DorimanX kernel v8.xx permit it .

At this point of dev, you have to know that while runing your 2nd rom as i show you this way,

your BEST kernel (DorimanX now because you use it now!!) makes the \PRELOAD\ partition

mounting point as a mirror of the \SYSTEM\ partition mounting point (of 2nd ROM too),

and now, you went to understand that you can easilly, completely, port your BEST JB SAMMY 4.1.2 ROM

in 2nd position ROM :)

When DorimanX boots our 2nd ROM, it do it as if \PRELOAD\ partition doesn't exist, i like to imagine that :)

An another way of a understanding this is :

with DorimanX kernel, when we have two roms like i have, and when you run your 4.2.2 1rst ROM like mine

(or a rootbox rom for sample), you can see your 1rst ROM \SYSTEM\ partition in the folder named \system\,

but we can see a named \preload\ folder, and you have to know that it's the \SYSTEM\ partition of your 2nd !

And so, after you have enable and well runing your 2nd ROM, you will be able to make all manipulations you want

on your system phone as you will never believe and dream it like that.

Plus, lastest DorimanX V8.xx kernel give us total mounted of 2nd ROM \DATA\ partition while

we are runing our 4.2.2 1rst rom, in a named \data_sec_rom\ folder ;

and when we run our new flsehly modded JB 4.1.2 2nd ROM, we can see 1rst ROM \DATA\ partition

in a named \data_pri_rom\ folder, so, again, imagine all advantages with that, you can manage

all apks and all folders of the two ROMs installed in your tel.

You have to know too that when you'are runing 1rst ROM, folder \data_sec_rom\ is the mounted

point of \sdcard\.secondrom\DATA.IMG file, corresponding of 2nd ROM \DATA\ partition, with

total access in it.

This image below shows us what we can do with all folders and partitions of 2nd ROM mounted while

we were runing our 1rst 4.2.2 ROM.

And i need between 1 and 5-6 steps to explain here all you have to do to accomplish this :

You will find in this thread all the needed steps and all the tools for you to put your BEST JB SAMMY 4.1.2

ROM in 2nd ROM, with DorimanX kernel V8.xx installed.

NEXT POST TO MAKE :

1 - HOW TO ENABLE WINSCP AND PUTTY COMMUNICATIONS BETWEEN PC and TEL

2 - WHY I ONLY USE DORIMANX KERNEL V8.xx.

3 - What is doing, line by line, an UPDATER-SCRIPT from a JB SAMMY 4.1.2 ROM flashed as 1rst ROM (BIFTOR ROM inside demonstration)

4 - HOW TO MOD UPDATER-SCRIPT with \PRELOAD\ partition managment folder pushed in \DATA\ partition of a 2nd ROM,(on \data\sec_data\ folder) with two detailled ROMs such as :

- Biftor ROM and its last addon. (biftor_preload_symlink)

- NeatROM FULL & LITE portage to 2nd ROM

5 - Attachments

6 - How to theme and mod our new BEST 2nd ROM freshly flashed.

- vrtheme cwm flasher

- normal cwm mods

Requirements :

Tools you will use on your PC :

- WINRAR (to open, add, suppress all you want in the ZIP)

some advise with it : please you must let winrar working & repacking well before closing it, if not,

you can have 'big surprise' with broken zip and remember you have to never create or rename

a folder in the opened ZIP in winrar, by winrar menu choice, you must have just to delete a

folder instead of renaming it, and just re-drag it from you PC. be carrefull of this)

- Notepad ++ (you can use this simply guide i made to perform your use)

- WINSCP software (instead of ADB command lines, i use WINSCP to access my

tel folders and partitions by WIFI, i use droidsshd.apk app in tel to enable telnet access

(in WINSCP STAGE we can see all detail to enable this way of access )

- Initial JB SAMMY 4.1.2 ROM from DEV you want to use in 2nd ROM

- in this repos of samples i make : https://mega.co.nz/#F!6tQRBZCY!Fg0i0WNN00s4DznvVOuP5g, one of my

updater-script i modded for some lastest lsw 4.1.2 roms i found on i9100'xda thread.

(i expect after reading this thread, you can mod youself your BEST ROM for 2nd ROM)

- if you want to VRTHEME or MOD your new freshly 2nd ROM, take my toolpack here

On your TEL, runing a custom rom AOSP, AOKP CM in 1rst rom, in an external SD folder, you have put :

- Dorimanx V8.xx lastest kernel ZIP

- The ROM with my updater-script added as replacement of original

- insure you have a space for the 2nd rom created as the method below in the KERNEL step.