[Galaxy S III Android Development] Darkened_Sky:
Second ROM Recovery script

hello everyone,

do you remember my second rom backup script

well I have highly improved it in the past days and now it is also able to copy your first rom to your second ROM slot and to restore a nandroid backup as your new second rom

also there is now a nice progress indication which shows you the current size of your backuped/restored data

installation

now you can simply flash the zip through recovery. it will add my script and an addon.d backup script which keeps my script and the onandroid script while ROM flash. but you still have to flash onandroid script if you want to use the f2s command. (not needed anymore

usage:

open a terminal and type in su. then execute my script by typing secrec (if you have forgotten to type su before a error message will prompt and exit the script)

then simply tye one of the commands and enter

you have the following commands:

dir.....for setting a new permanent backup location

bac...for backup second ROM. after that you can choose which parts should be backed up. also if an existing backup is detected in the backup directory a prompt will come if it should be deleted.

res...for resore second ROM. after that you can choose which parts should be restored

f2s.....for copying the first ROM to the second ROM slot (this needs the onandroid script)

nan.....for extracting an existing primary ROM nandroid backup to the second ROM slot (if you have a splittet nandroid backup, which is the normal case if it is made by e.g. philz touch, then this will take some time as the script has to join the splittet tars together and then restore them) (edit: spped much improved for splitted backup :good: )

cdc......for clearing second ROMS dalvik-cache

rm2....for deleting the complete second ROM

if you should encounter messages with "removing leading "/"... " or "sockets ignored" just ignore them ;)

how to have a stock/aroma based ROM as second ROM:

if you currently already have a second ROM: flash my secrec zip, open a terminal - type su - enter - type secrec -enter and then delete your second rom with the rm2 command

go to recovery and make a nandroid backup of your current primary ROM

choose a ROM which you want to have later as second ROM

flash it normally as primary ROM first

boot it and look if everything works

now go again to recovery and make again nandroid backup

restore your older nandroid backup of your initial primary ROM

flash my secrec.zip

flash multi-boot.zip in order to get the correct second ROM slots

boot your primary ROM

open a terminal and type:

su

secrec

nan

choose the correct nandroid backup of the rom you want to have as second ROM​

finished now you can boot your new second rom through aswitch app

note: I know this procedure is quite annoying but if you use a ROM as second ROM which is not frequently updated like for example stock ROMs then it is not hat worse..

I tested it at moment only with aosp roms but in ti should work with all ROMs. (edit: works for all roms that are supported by this kernel) With these options it should finally also be possible to have an aroma based ROM as second ROM by first installing it as primary ROM and then copying it to the second ROM slot. (edit: tested it with a nandoid backup of an aroma based stock jb 4.3 ROM (archidroid 1.7.16) --> works like a charm now as second rom :cool: )

so I hope you like it. IMO with this script dualboot with [MENTION=4898097]arter97[/MENTION] 's kernel becomes easier :angel:

progress:

edit: success, onandroid script no longer needed for copying first rom to second rom, also it is now way faster. also I simplified the script code.

also i decided to rename the script to secrec as IMO it is now a recovery tool for the second ROM.

edit: improved nandroid to second rom method for splitted nandroid backups --> now much faster

edit: new command structure (see usage), improved backup command with a warning if a backup already exists, vibration feedback at the successful end of each task. I see this script now as finalized, there is nothing anymore which comes to my mind, how to improve it

edit: last bugfix (thanks [MENTION=5060769]Mostafa Wael[/MENTION] ): second rom slot directories are created now if they are not available

edit: ok i can't stop :D status of the second rom can now be displayed with the stt command. it should show the android version, what rom etc. of your second rom.

edit: script uses now universal external sd card mount point - so no error more in sammy roms