[Motorola Atrix 2] deveshmanish:
How to create the flashable zip:

You will need the following:

Android SDK, ADB & Fastboot set up for your handset.

Notepad++

7Zip

Setting up your zip directories:

you will need to create the following folder structure (these are case sensitive):

All flash-able zips include this file structure, the final folder 'android' will contain two files:

update-binary: I have been unable to find much information on the update-binary file other than they seem to be chip set specific (if anyone can shed further light on these I will include it here). For the sake of compatibility I have attached the update binary from the latest CyanogenMod Nightlies for the Atrix 2 at the bottom of this thread - You can of course download the latest nightly and extract the update-binary file yourself as the attached one will obviously begin to date.

For anybody having problems flashing it is worth ensuring you have an up to date version of the update-binary (obviously the one attached to this thread will gradually become out of date).

updater-script: This we can create ourselves, to ensure it works properly we will use Notepad++.

Open Notepad++ and start a new file, with the following settings:

Save this file as:

You can now begin writing your edify script in this file.

I'm explaining a simple example script for your better understanding.

assert(getprop("ro.product.board") == "edison");
ui_print(" ");
ui_print("confirming device edison");
ui_print(" ");
ui_print("success");
ui_print(" ");
show_progress(0.200000, 5);
ui_print("Mounting your system...");
mount("ext3", "EMMC", "/dev/block/mmcblk1p21", "/system");
ui_print(" ");
show_progress(0.200000, 5);
ui_print("updating system files");
package_extract_dir("system", "/system");
ui_print(" ");
show_progress(0.200000, 5);
ui_print("unmounting system");
unmount("/system");
ui_print(" ");
show_progress(0.200000, 5);
ui_print("by your name");
show_progress(0.200000, 5);
ui_print(" ");
***EMPTY LINE***

This is checking you are flashing the correct handset, this is not a requirement, but is best practice. Just insert another device name in the place of "edison" if you so wish, or remove the command all together.

This is the specific mount point for the edison system partition, if you wish to flash a different partition, data for instance you can get the mount points for your device by entering the following code over ADB:

adb shell "mount > /sdcard/PHONENAME_mountinfo.txt"

This will place a text file on your sdcard with the mount points for your specific device (remember to swap 'PHONENAME' with your device name e.g. 'edison').

Additionaly here are the mount points for data and cache for A2

Cache:

Data:

This command extracts the files you wish to flash from the zip and flashes them to the phone, it is formatted as follows ("package-path", "/destination-path"). So for this example you are telling it to flash everything from the 'system' folder in your zip to the /system partition of your handset. You can obviously change these values for different partitions.

This simply unmounts whatever partition you previously mounted.

Shows text in the recovery whilst the flash is ongoing, you can put whatever you please between the double quotes, you must leave a space if you wish to have a blank line.

Controls what the progress bar in the background is displaying, it is formatted as follows (fragment, seconds).

This is not actually text, you simply need to leave a blank line at the end of your script before you save it for it to work.

FYI, this means in fact your script could look like this and still work:

ui_print(" ");
show_progress(1.000000, 30);
mount("ext3", "EMMC", "/dev/block/mmcblk1p21", "/system");
package_extract_dir("system", "/system");
unmount("/system");
ui_print(" ");
***EMPTY LINE***

But that just isn't that pretty, or as deceptively complicated lol!

Make sure you save your edify script.

Files to flash:

You now need to create a further folder, this needs to be named based on where within the system you are flashing, for the sake of this example we are flashing to the system partition, so create this folder path(of course the structure depends on what are files you need to flash and their location):

Place whatever files you wish to flash within this file e.g:

Creating your .zip file:

Select both of your top directories and their contents 'META-INF' and 'system' and package them into a .zip file with 7zip using the following settings:

And there you have it, your very own flash-able .zip file.

How to sign your update.zip:

You don't actually need to sign your zip file for it to work as most custom recoveries now support unsigned zips, for aspiring developers and the more cautious among us though the how to will be updated later.

For now you can use the META-INF folder from the attached zip as is just modify the updater-script according to your requirments.

How to create your own private signing key & certificate:

You will need the following download:

Open SSL

If you want to create your own private keys for signing, here's what you need to do.

As before extract the OpenSSL files to a folder in the root of your c:\ drive, preferably named 'openssl' for ease of cmd line navigation. Then input the following:

cd\openssl\
openssl genrsa -out key.pem 1024
openssl req -new -key key.pem -out request.pem
openssl x509 -req -days 9999 -in request.pem -signkey key.pem -out certificate.pem
openssl pkcs8 -topk8 -outform DER -in key.pem -inform PEM -out key.pk8 -nocrypt

You can then replace 'key.pk8' & 'certificate.pem' with your own files.

I have attached an example flashable .zip file that includes a updater-script and the update-binary.Use that as a base or example to set your zip up.

I really hope this has helped folks out, if so please consider hitting the 'Thanks' button!

Happy flashing!

May the -Mass times Acceleration-be with you...