[Sony Xperia Miro, Tipo (Dual), J, E] kurotsugi:
as I've promised I'll tell you how to build your own rom. however, I made this thread for someone who started to build his own rom. I want to made this post understandable even for a newb in android world. this guide doesn't recover stuffs like how to customize the theme or add more feature into your your rom. that one require a lot of resources and you need to learn it by yourself.

the first thing you need is the system files. you can get it by dumping your system partition, modify an existed rom of even build it from scratch by yourself. assume if you already have one, the next thing you should learn is the updater script.

basic rom installer structure will be something like this.

1. meta-inf folder : contain updater script and updater binary to install your rom

2. system folder : contain your system files

3. additional files and script.

for a start, you can get meta-inf folder from here http://www.mediafire.com/?nxgiz0993brp9re

it contain a basic updater script to install a rom. it designed to install a rom for another device. you need to modify it if you want to use it.

if you open the updater script, you'll see this

ui_print("Installing ...");
ui_print(" ");
unmount("/system");
mount("ext3", "EMMC", "/dev/block/mmcblk0p2", "/system");
show_progress(0.100000, 0);
delete_recursive("/system");
show_progress(0.100000, 0);
show_progress(0.500000, 40);
ui_print("Installing System...");
package_extract_dir("system", "/system");
symlink("toolbox", "/system/bin/schedtop");
symlink("toolbox", "/system/bin/df");
symlink("toolbox", "/system/bin/insmod");
symlink("toolbox", "/system/bin/top");
symlink("toolbox", "/system/bin/iftop");
symlink("toolbox", "/system/bin/getevent");
symlink("toolbox", "/system/bin/rm");
symlink("toolbox", "/system/bin/rmmod");
symlink("toolbox", "/system/bin/printenv");
symlink("toolbox", "/system/bin/start");
symlink("toolbox", "/system/bin/kill");
symlink("toolbox", "/system/bin/vmstat");
symlink("toolbox", "/system/bin/stop");
symlink("toolbox", "/system/bin/ioctl");
symlink("toolbox", "/system/bin/cmp");
symlink("toolbox", "/system/bin/ps");
symlink("toolbox", "/system/bin/chmod");
symlink("toolbox", "/system/bin/sendevent");
symlink("toolbox", "/system/bin/netstat");
symlink("toolbox", "/system/bin/setconsole");
symlink("toolbox", "/system/bin/cat");
symlink("toolbox", "/system/bin/mount");
symlink("toolbox", "/system/bin/ln");
symlink("toolbox", "/system/bin/log");
symlink("toolbox", "/system/bin/reboot");
symlink("toolbox", "/system/bin/dd");
symlink("toolbox", "/system/bin/id");
symlink("toolbox", "/system/bin/getprop");
symlink("toolbox", "/system/bin/lsmod");
symlink("toolbox", "/system/bin/ionice");
symlink("toolbox", "/system/bin/newfs_msdos");
symlink("toolbox", "/system/bin/setprop");
symlink("toolbox", "/system/bin/sync");
symlink("toolbox", "/system/bin/umount");
symlink("toolbox", "/system/bin/watchprops");
symlink("toolbox", "/system/bin/route");
symlink("toolbox", "/system/bin/notify");
symlink("toolbox", "/system/bin/uptime");
symlink("toolbox", "/system/bin/wipe");
symlink("toolbox", "/system/bin/nandread");
symlink("toolbox", "/system/bin/lsof");
symlink("toolbox", "/system/bin/mkdir");
symlink("toolbox", "/system/bin/rmdir");
symlink("toolbox", "/system/bin/hd");
symlink("toolbox", "/system/bin/ls");
symlink("toolbox", "/system/bin/chown");
symlink("toolbox", "/system/bin/dmesg");
symlink("toolbox", "/system/bin/sleep");
symlink("toolbox", "/system/bin/renice");
symlink("toolbox", "/system/bin/ifconfig");
symlink("toolbox", "/system/bin/mv");
symlink("toolbox", "/system/bin/date");
symlink("toolbox", "/system/bin/smd");
symlink("dumpstate", "/system/bin/dumpmesg");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 0, 0777, 0777, "/system/etc/init.d");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 3003, 06755, "/system/bin/ip");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");
set_perm(0, 0, 0755, "/system/etc/bluetooth");
set_perm(1000, 1000, 0640, "/system/etc/bluetooth/auto_pairing.conf");
set_perm(3002, 3002, 0444, "/system/etc/bluetooth/blacklist.conf");
set_perm(1002, 1002, 0755, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0755, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
set_perm(0, 0, 04755, "/system/bin/bash");
symlink("/system/bin/bash", "/system/bin/sh");
set_perm(0, 0, 0777, "/system/bin/a2sd");
set_perm(0, 0, 0777, "/system/rtc/init.d/S95allinone");
set_perm(0, 0, 0777, "/system/etc/init.d/00banner");
set_perm(0, 0, 0777, "/system/etc/init.d/01sysctl");
set_perm(0, 0, 0777, "/system/etc/init.d/02firstboot");
set_perm(0, 0, 0777, "/system/etc/init.d/03mountsd");
set_perm(0, 0, 0777, "/system/etc/init.d/04apps2sd");
set_perm(0, 0, 0777, "/system/etc/init.d/99complete");
set_perm(0, 0, 0777, "/system/bin/launcha2sd");
set_perm(0, 0, 0777, "/system/bin/starta2sd");
set_perm(0, 0, 0777, "/system/bin/jita2sd");
set_perm(0, 0, 0777, "/system/bin/chka2sd");
set_perm(0, 0, 0777, "/system/bin/zipalign");
set_perm(0, 0, 0777, "/system/bin/sysinit");
set_perm(0, 0, 0777, "/system/bin/busybox.a2sd");
set_perm(0, 0, 0644, "/system/bin/apps2sd.hlp");
set_perm(0, 0, 0777, "/system/xbin/a2sd");
set_perm(0, 0, 0777, "/system/bin/dtinstall");
set_perm(0, 0, 06755, "/system/bin/su");
symlink("/system/bin/su", "/system/xbin/su");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
show_progress(0.1, 10);
show_progress(0.2, 0);
set_perm(0, 1000, 0755, "/system/xbin/busybox");
package_extract_file("installbusybox", "/tmp/installbusybox");
set_perm(0, 0, 0777, "/tmp/installbusybox");
run_program("/tmp/installbusybox");
ui_print("Installing Boot...");
show_progress(0.2, 10);
show_progress(0.100000, 0);
ui_print(" ");
ui_print("Installation Completed!!!!");
ui_print(" ");
ui_print("Enjoy...");
ui_print(" ");
unmount("/system");
ui_print("Welcome to MySs Rom ");

lets breakdown the updater script. basic updater script contain several parts. from above script, we can divide it into these parts:

1. UI SCRIPT

it will give you information about your rom installation.

it consist of two part. the first one is the ui_print, it used to show some text when you install the rom. for an example, ui_print("Welcome to MySs Rom "); it will print Welcome to MySs Rom on your screen. the form is

ui_print("<your text>")

the second one is the show progress stuff. for an example show_progress(0.5, 20);.the form is

show_progress(<the progress part 0 to 1>, <time needed to reach progress part>);

if you look into the example, it means that the installation progress bar will reach 50% in 20 second.

2. INSTALLER SCRIPT

the most crucial part. it install the files into your system partition.

it consist of three part. the first one is the mounter script. it used to mount a certain partition when you install the rom. this is one of the example mount("ext3", "EMMC", "/dev/block/mmcblk0p2", "/system");. the basic form is

mount("<partition file>", "<partition type>", "<partition location>", "<place where it mounted>");

the second part is formater script. you can do it by format the entire partition or simply delete all the files in the partition. I always choose the second one to avoid getting a corrupted partition. the basic form is

delete_recursive("<folder address>")
# or in an example
delete_recursive("/system");

the last part is the one used to copy the files into your system. you can do it in two ways. the first one you copy the files one by one. you'll use something like this.package_extract_file("installbusybox", "/tmp/installbusybox");. the form is package_extract_file("<file name and address>", "<where you want to copy it>");. the second one is you copy the entire folder. you'll use package_extract_dir("system", "/system");. the form is package_extract_dir("<folder name inside your zip file>", "<where to copy it>");

3. MODIFIER SCRIPT

to change the permission you'll use

set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
# if you want to change it based on the folder
# basic form
set_perm_recursive(<1st owner>, <2nd owner>, <folder permission>, <file permission>, "/system/bin")

set_perm(0, 3003, 06755, "/system/bin/ip");
# if you want to change it file by file
# basic form
set_perm(<1st owner>, <2nd owner>, <permission>, "/system/bin/ip")

to create symlink

symlink("toolbox", "/system/bin/ls");
# basic form
symlink("<the file name>", "<the link name>");

4. ADDITIONAL SCRIPT

it mainly use to run certain script. for an example

package_extract_file("installbusybox", "/tmp/installbusybox");
set_perm(0, 0, 0777, "/tmp/installbusybox");
run_program("/tmp/installbusybox");	[code] first thing you should remember is that you need to extract the script first. in this case, is the installbusybox file to /tmp. to run the script you'll need to change the permission and run it with run_program. the basic form is [b]run_program("<the file>")[/b]
[/hide]

now, after you know about the updater script, you need to create the proper updater script for your rom. the basic script will be.
1. mount all needed partition. some rom installation need to mount /data, /cache, etc. make sure you already mount all of them
2. delete all the old system files.
3. copy all new system files into your system.
4. change the owner and the permission of certain files and folders. make sure you have the exact owner and permission setting of all the files copied into /system. the default is owner: root. permission: rw-r-r.
5. create symlinks.
6. run the additional script.

the last step, pack all the files into a single zip file and install your rom. enjoy your rom.

ADDITIONAL RESOURCE
1. introduction for edify updater script [url]http://xdaforums.com/showthread.php?t=1669489[/url]
2. dsixda's kitchen [url]http://xdaforums.com/showthread.php?t=633246[/url]
3. kernel kitchen [url]http://xdaforums.com/showthread.php?t=1659584[/url]