[Blade Android Development] Jinxxed:
The script is now completely rewritten and a lot easier to use.

This is the general walkthrough for this script, if you have more questions than this answers please ask in this thread.

Download and unpack the script to the root of your sdcard, the easiest way to do this is to download it to the root of the sdcard and do the following:

1. start terminal session

2. cd /sdcard

3. tar xvf MakeLoopROM-Android-V11.tar

===============================================================================================================================

NEW! READ THIS! - The original ROMs and Packages are now stored in /sdcard/MakeLoopROM/original-roms and /sdcard/MakeLoopROM/original-packages. Copy the ROMs and packages

that you want to convert into those folders!

===============================================================================================================================

Ok, once you're done there you're ready to start the script, it's now completely menu driven.

1. start terminal session

2. cd /sdcard/MakeLoopROM

3. sh startup

That will start up the menu, for a new ROM work your way from 1 - 4 to make your first loop ROM, at the end of 4 it will be ready for installation, for upgrades that install into

existing loop files (that you have made once with step 1) start at step 2.

The menu options and how they work:

1. Make system, data or both loop files

This option will allow you to do just what it says, make the system and data images you'll install your ROM into, it's very

straightforward but i'll give a brief summary of how

it works.

"Do you want to make an image file to hold the system for this ROM? (not neccessary if it's an upgrade from a previous ROM) Y

for yes N for no."

Pretty straightforward, if you don't have a system loop file enter y for yes, if you're going to upgrade then running this

step is completely unneccessary but since you have

chosen to run it, press no.

"What do you want to call your system image? (give it a name you'll remember, like cm-7-system for a cm-7 loop install)"

Name the system loop file, call it whatever you want but make it something relevant to the ROM or you'll end up wondering what

that file is for when you stumble upon it at a

later time. it'll be stored under /multiboot/system-loop-files when it's done.

"What size do you want your system image to be (in MB's)? (WARNING: if you make it too small your ROM +other packages like

gapps might not fit, make it 250)"

The size of /system for the loop ROM, read the thread you downloaded the ROM from to find out what size is ok, i just use 250

for everything in case i want to reuse it with full

at a later time.

"Do you want to make an image file to hold the data for this ROM? (not neccessary if it's an upgrade from a previous ROM or

you want to share a data image with another ROM)

Y for yes N for no."

Same as with the system loop file, if you don't have one, you'll want one, if you're upgrading you shouldn't be running this

step but there is another time when you want to say

no to this, when you want to share a loop file with another installation (not with NAND ROMS). Like for example if you want to

share the data partition between CM-10 and PA-JB.

"What do you want to call your data image? (give it a name you'll remember like cm-7-data for a cm-7 loopinstall)"

Same as for the system loop file, just name it something relevant, the name is of no importance to it's function.

"What size do you want your data image to be (in MB's)? (This file will hold all of your data, don't skimp on the size)"

How many apps do you plan to install? 10 - 50 - 500?

Make it a size that you can live with and that will fit on your sdcard, it really depends on how many apps you'll install.

2. Make a Loop ROM

It's exactly what it says, this will make your loop ROM ready for installation.

"Available ROMs:"

just enter the number that's next to the ROM you want to convert, if it's not there it's because you didn't copy it to /sdcard

/MakeLoopROM/original-roms, you can do so now and

hit r to refresh the list.

"You previously created the system loop file [nameofyourfile], do you want to use it for this ROM? (y/n)"

You'll only get this question if you created a system loop file by going through step 1. If you did so and that's the file you

want to use (check the [nameofyourfile]) then

answer y for yes, otherwise you answer n for no and the following question comes up.

"Available system loop files:"

This choice will only come up if you answered no to the previous question or didn't make your system loop file with the script

in step 1 during this session. Anyways, just enter

the number next to the file you want to use as a system loop file.

"You previously created the data loop file [nameofyourfile], do you want to use it for this ROM? (y/n)"

See the system loop file above, this is the same but for the data loop file

"Available data loop files:"

See the system loop file above, this is the same but for the data loop files

Do you want this installation to format the data image used with this ROM?

Answer Y for yes if it's a new installation and N for no if you are upgrading

and want to keep the data on the data image. (Say yes if you would run wipe

data/factory reset in recovery if this was a normal install)

Y if this is a new install or you're reusing an old data loop file that you want to wipe.

when done hit enter to get back to the menu.

3. Make a loop package (such as gapps)

This, like it says, is for converting non-rom packages (not kernel packages though) such as gapps or bravia or what have you.

"Available packages:"

type the number that is next to the package you want to convert, if the package isn't there you didn't copy it to /sdcard

/MakeLoopROM/original-packages

"You previously created the system loop file [nameofyourfile], do you want to use it for this ROM? (y/n)"

You'll only get this question if you created a system loop file by going through step 1. If you did so and that's the file you

want to use (check the [nameofyourfile]) then

answer y for yes, otherwise you answer n for no and the following question comes up.

"Available system loop files:"

This choice will only come up if you answered no to the previous question or didn't make your system loop file with the script

in step 1 during this session. Anyways, just enter

the number next to the file you want to use as a system loop file.

Repeat No. 3 for all your packages

4. Make (or update) NAND boot image.

This will read the information in your boot partition and store it as boot.img under /sdcard/multiboot so you can boot back to

your NAND installed ROM by running step 6 or

flashing nandboot.zip (also stored under /sdcard/multiboot) from cwm.

Run this every time you update your NAND ROM so the boot.img is fresh.

"This script will update your nand boot.img in the multiboot folder to the version of boot.img you're currently running, make

sure you're running the updated ROM and not

a loop ROM before hitting Y for yes here. If you're not sure type N for no."

If you updated your NAND ROM or haven't run this option before you have to say y for yes here, you have to run this option at

least once or you can't boot back to NAND. Just

make sure you've got your NAND ROM booted and not a loop rom because this will take the boot partition content of your

currently running ROM.

5. Remove a loop installation

If you've come this far you know what you're doing in this option. I'm not going to go through all combinations but they are

self-explanatory.

6. Boot an installed ROM.

Exactly what it says, just remember that even non-installed ROMs may be listed here, if you happen to try to boot to one of

those it will hang at boot, in that case, pull the

battery, reboot to recovery (press and hold vol down while you press power) and use the boot zips that have been created for

your roms.

the Boot zips are located in /sdcard/multiboot/nandboot.zip for the NAND and /sdcard/multiboot/loop-roms

/[namofyoursystemloopfile]/[nameofyourROM]boot.zips

I think that's all, if there is any questions, feel free to ask.

Android version: MakeLoopROM-Android-V11.tar

MD5: 1b33ad6c3078711444c01867e436b65a

===============================================DEPRECATED==============================================================

It took a while but i managed to sort out how to boot to loop filesystems stored on the SD-card.

This means that you don't have to partition anything and you can have as many ROMs installed as you can fit on your SD-card.

You don't have to worry about a2sd/S2E/mounts2sd or anything like that (just make your data partition large enough to hold your apps, you can share the data partition between as many loop ROMs as you like) but this doesn't prevent it either, your sd-ext partition will be untouched and mountable by any ROM you install into a loop file (if the ROM supports sd-ext, that is). Swap will work just fine too.

The script is self explanatory but there are a few things it doesn't explain so i'll explain it here.

Here we go:

1a. Download the MakeLoopROM(version).zip and unpack it to any directory of your choice, just remember where you put it, if you're going to do this under cygwin i suggest you put it in a directory that is easily accessible from the cygwin terminal (IE cygwin/home/"yourusername") and if you're using Linux, just unzip it to your home directory.

1b. Download the MakeLoopROM-Android.tar and unpack it to the root of your sdcard or copy the file to the root directory of your sdcard, open up a terminal session and run tar -xvf MakeLoopROM-Android.tar.

2. Copy the rom and gapps and whatever other package you want to convert to the MakeLoopROM directory that was created during the unzipping above.

3a. In Linux, open up a terminal, cd to the MakeLoopROM directory and type sudo ./makelooprom (losetup requires root permissions).

3b. In windows, open up the cygwin terminal, cd to the MakeLoopROM directory and type ./makelooprom-cygwin

3c. On Android, open up a terminal session, type su and hit enter, type cd /sdcard/MakeLoopROM and hit enter and then sh mkrom and hit enter.

4. Follow the instructions, it should be easy enough to understand.

5. If you want to convert a gapps package and/or other packages you repeat step 3 but type ./makeloopgapps instead of ./makelooprom it'll work for any package you want to install into your loop files, root is not needed for this step.

5a. For android you type sh mkgapps to make gapps and other packages.

6. To be able to reboot back to NAND (the ROM on your phones internal storage) you need to copy the boot.img of your current ROM into the multiboot directory.

6a. The android version now copies the running boot.img if you answer yes when you get the question if you want it to so there is no need to copy it in another way.

After you're done converting your ROM and the packages you'll find all important stuff in the multiboot folder within the MakeLoopROM directory, just copy the whole folder to the root of your SD-card (if you are running on android this step is unneccessary, the script will copy the files for you). You'll find your image files under multiboot (if you created them) along with the "nameofyourrom"boot.img and boot"namofyourrom".sh that you'll need to boot into the ROM from another ROM and finally under loop-roms/[nameofyoursysimage] you'll find all your converted ROMs and packages, ready for installation.

Now you're ready to install the loop ROM and the loop packages, it installs like any other ROM/package via your recovery of choice (I recommend my CWM Touch 6.0.1.1, it's what this is tested on but it should work fine on any recovery).

To switch between ROMs you open up a terminal window, type su to get root permissions, cd to the multiboot folder (cd /sdcard/multiboot) and type sh bootnand.sh to switch to your internal ROM or boot"nameofrom".sh (bootcm-7.2.0-blade.sh if you installed cm-7.2.0-blade for example) for any of the loop roms. You can also install script manager and script manager widgets and make widgets for those scripts on your homescreen, that way rebooting to another rom is as easy as pressing the icon on your homescreen. :)

I'm sure there'll be a lot of questions about things i haven't thought of, but if you should fail or do something wrong then just hit ctrl-c and start over, the script cleans up and restarts the build.

Thanks to:

android@sam for some ideas.

championswimmer for some scripts from his Kernel Kitchen.

Tilal for suggestions that helped fix running this script on the phone itself as well as the app he's making to make reboots between the different installs much easier and better.

De@n for being a very patient tester.

Files:

Linux version: MakeLoopROM-Linux.tar

MD5: 8907e2519276f4abcbb5bab0de168ae5

Windows Cygwin version: MakeLoopROM-Windows.zip

MD5: 096921e7a08eba98329bb7ec486068f0

Android version: MakeLoopROM-Android-V8.tar

MD5: f4ee326faf65bd032a95a1e2b4e8bc9f