[REF] Howto port NAND to NativeSD | Step-by-Step

Search This thread

securecrt

Senior Member
Aug 4, 2010
763
2,762
Shanghai
@c1cl0n
you should use root user to make the new initrd.gz otherwise some weird problem will happen.
and change the Nand ROM to NativeSD if you based on the Nand ROM's init.rc
some contents in the file should be commented. (mount xxx )
 

c1cl0n

Senior Member
Jan 30, 2010
642
805
@c1cl0n
you should use root user to make the new initrd.gz otherwise some weird problem will happen.
and change the Nand ROM to NativeSD if you based on the Nand ROM's init.rc
some contents in the file should be commented. (mount xxx )
:eek:
Of course, if linux request root access, to make it, need to do it
I'm pointed this in guide:
If Linux talks about permissions, like Access Denied!, change your username to root by command:
c1cl0n@ubuntu:~$ sudo su
c1cl0n@root:~$ _[/COLOR][/B]
 

datagr

Senior Member
Sep 30, 2009
219
585
glad to see you dimdimdim & datagr :good:

i edited initrd.gz for "Sense" now working Native SD but with old kernel Ty14 ... market & download FAST no more lag for market ...

i try again for kernel marc .... need some magic :D

Thank you for your great work boxmax!
Could you please share the tytung 14 version to try it?
I am trying the last 2 days to convert a sense rom in nativeSD with no success. :(
 

c1cl0n

Senior Member
Jan 30, 2010
642
805
This is simple script to autoconvert initrd.gz in linux
- Put it some foler your initrd.gz file and this script
- Run terminal & execute commands:
~$ sudo su
~$ chmod +x ./repack
~$ gedit ./repack
- Change name of your port folder in this line:
cat ./init | sed s/ROMFOLDER/MYPORT/ > ../init
example:
cat ./init | sed s/ROMFOLDER/CM9/ > ../init
- Save changes & execute script:
:eek:
 

Attachments

  • repack.txt
    578 bytes · Views: 47
  • Like
Reactions: Szczepanik

pvkanjiyani

Senior Member
Apr 10, 2010
59
7
Ahmedabad
hi c1cl0n
i am converted ics nand rom to native sd rom boot perfect
one problem no network
i have attached logcat
any idea
thanks
 

Attachments

  • logcat.txt
    15.9 KB · Views: 21

c1cl0n

Senior Member
Jan 30, 2010
642
805
Hi pvkanjiyani
I don't understand too many logcat errors, but some one, like "Unknown permission" may point to your META-INF\com\google\android\updater-script
Verify original permissions (from NAND updater-script) with your
About network, I think you forgot to change kernel files (zImage and/or system\lib\modules)
:)
 

vivebatu

Senior Member
Dec 19, 2009
543
147
HTC Leo
Moto Z2 Force
Hi pvkanjiyani
I don't understand too many logcat errors, but some one, like "Unknown permission" may point to your META-INF\com\google\android\updater-script
Verify original permissions (from NAND updater-script) with your
About network, I think you forgot to change kernel files (zImage and/or system\lib\modules)
:)

Hi guys... Just trying to port a nand rom
Query - is it required that the zImage and kernel modules be used from the NativeSD rom? Is there any change in the zImage / kernel for NATIVESD roms compared to nand roms?

Thanks in advance for your answer

Sent from my HTC HD2 using Tapatalk 2
 

Dhruna

Senior Member
Jan 7, 2012
206
19
Pune
Does any one has made the initrd.tz and install.sh script for PA1.5b by Xolygraph ?

If YES, could you please share ?

Thanks.
 

peibolvig

New member
Apr 17, 2010
4
1
Hi, thanks for your work (I already clicked the thanks button ;) )

There is a typo in the STEP 3
Where it says:
Now create temporary work folder, if it wasn't exist by command:
Quote:
c1cl0n@ubuntu:~$ md myport

Should be:
Now create temporary work folder, if it wasn't exist by command:
Quote:
c1cl0n@ubuntu:~$ mkdir myport

This is my little contribution ;)
 
  • Like
Reactions: c1cl0n

essamfahim

Member
Jan 20, 2010
21
0
NativeSD to SD

I am searching for a utility like the portadroid which we were using to port the NAND ROMs to SD ROM
is it possible to fined one to do so from NativeSD to SD
 

Johrans

Senior Member
Jul 14, 2012
71
19
Zeeland
I was trying to change the init in the initrd.gz file but its encrypted how could i change it sow i can change the rom name? Or must i change the locations in the init.rz? sow the rom will boot the correct one.
 

Robbie P

Senior Member
Feb 8, 2011
5,116
4,017
London
No Linux needed

I was trying to change the init in the initrd.gz file but its encrypted how could i change it sow i can change the rom name? Or must i change the locations in the init.rz? sow the rom will boot the correct one.

Get the v2 template (example.zip) from here http://xdaforums.com/showpost.php?p=31110719&postcount=2

And HypoTurtle's Patcher (and nativesd.sh.txt) from here http://xdaforums.com/showthread.php?t=1953428 and put the extracted NativeSD folder into the extracted template folder (alongside other folders). Edit; rename nativesd.sh.txt to nativesd.sh and put in nativesd folder.

Put your nand ROM's (nand) zImage and initrd.gz in template's kernel/boot and kernel/bootSD (you will overwrite the initrd.gz later), put both in both.

Edit; Put the cert and manifest files from ROM's META_INF folder to the same directory in template's META_INF folder, and also any other folders (eg META_INF/com/android folder) if present should be copied over too.

When editing scripts, use Notepad++

Put the lines
Code:
package_extract_dir("NativeSD", "/tmp");
set_perm(0, 0, 0777, "/tmp/nativesd.sh");
run_program("/tmp/nativesd.sh");
in template's (meta-inf/com/google/android) updater script before package_extract_dir("system", "/system"); in the SD-Ext install section.

And copy symlinks and permissions from your new ROMs updater script to template's updater script in the relevant section below SD-Ext install.

Edit template's aroma config with details of the ROM you are porting.

And put the nand initrd.gz in NativeSD folder

And put correct unique ROM_NAME in install.sh

Put the system folder from new ROM to template folder (delete any apps2SD APK from system/apps and from system/etc/init.d scripts)

Edit; At this point, if your rom does not support ppp (ie a magldr rom), then put the files from here into their respective folders in system. (When installing, the aroma option to chose rmnet or ppp depends on the ppp files being present ie if ppp is chosen-nothing happens, if rmnet is chosen-the ppp files are deleted)

Re-zip template contents and rename the zip to whatever

Flash using your favourite sd recovery

After flashing, you should have 2 extra .gz files in NativeSD folder, rename one of them to initrd.gz (overwrite) and see if it boots. if not, then try the other.

If it boots copy the initrd.gz from NativeSD to NativeSD/whetever-rom_name-you-chose and overwrite the one there, so that you can boot it after trying another ROM.

If you are posting the ROM, delete NativeSD folder from your template folder and remember to put a copy of your edited initrd.gz in kernel/bootSD.

Hope I haven't missed anything:)
Thanks to HypoTurtle, Xylograph, Securecrt, marco.palumbi, aroma ppl and others.

Edit; Different nand ROMs use aroma installer to install apps and options, you may have to play around with the aroma scripts to get these to work. Also, some ROMs have a data folder, you can add a line in updater script to install it.
Code:
package_extract_dir("data", "/data");
after "package_extract_dir("system", "/system");"
 
Last edited:

Johrans

Senior Member
Jul 14, 2012
71
19
Zeeland
Get the v2 template (example.zip) from here http://xdaforums.com/showpost.php?p=31110719&postcount=2

And HypoTurtle's Patcher (and nativesd.sh.txt) from here http://xdaforums.com/showthread.php?t=1953428 and put the extracted NativeSD folder into the extracted template folder (alongside other folders)

Put your nand ROM's (nand) zImage and initrd.gz in template's kernel/boot and kernel/bootSD (you will overwrite it later), put both in both.

When editing scripts, use Notepad++

Put the lines
Code:
package_extract_dir("NativeSD", "/tmp");
set_perm(0, 0, 0777, "/tmp/nativesd.sh");
run_program("/tmp/nativesd.sh");
in template's (meta-inf/com/google/android) updater script before package_extract_dir("system", "/system"); in the SD-Ext install section.

And copy symlinks and permissions from your new ROMs updater script to template's updater script in the relevant section below SD-Ext install.

Edit template's aroma config with details of the ROM you are porting.

And put the nand initrd.gz in NativeSD folder

And put the nativesd.sh.txt saved as nativesd.sh in NativeSD folder.

And put correct unique ROM_NAME in install.sh

Put the system folder from new ROM to template folder (delete any apps2SD APK from system/apps and sytem/etc/init.d scripts)

Re-zip template contents and rename the zip to whatever

Flash using your favourite sd recovery

After flashing, you should have 2 extra .gz files in NativeSD folder, rename one of them to initrd.gz (overwrite) and see if it boots. if not, then try the other.

If it boots copy the initrd.gz from NativeSD to NativeSD/whetever-rom_name-you-chose and overwrite the one there, so that you can boot it after trying another ROM.

If you are posting the ROM, delete NativeSD folder from your template folder and remember to put a copy of your edited initrd.gz in kernel/bootSD.

Hope I haven't missed anything:)
Thanks to HypoTurtle, Xylograph, Securecrt, marco.palumbi, aroma ppl and others.

Edit; Different nand ROMs use aroma installer to install apps and options, you may have to play around with the aroma scripts to get these to work. Also, some ROMs have a data folder, you can add a line in updater script to install it.
Code:
package_extract_dir("data", "/data");
after "package_extract_dir("system", "/system");"

Thanks this is helpfull mate,
the next thing where i walk to a front is how to do it with clk, when you dont have any initrd.gz but the boot.img? Maybe to much questions i dont know.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 33
    HOWTO port NAND ROM to NATIVESD
    STEP-BY-STEP​
    This method based on SecureCRT with my modifications and comments[/COLOR]
    PC Requiments:
    • PC with installed MS Windows XP/Vista/Se7en and VirtualMachine with Linux based OS (I'm used Ubuntu 11.10 OEM at VMware 8)
    • Installed Nottepad++

    Mobile Requiments:
    • NAND ROM ported to HTC LEO HD2 (In my example, I used NexusHD2-Gingerbread V3.2a (GWK74)(Android 2.3.7)[tytung_r13] this rom is based)
    • Blank template file BareBoneCM7_NativeSD_installer_Diff_Nand.zip
    • Some NativeSD ROM with compatible kernel files what you want to use in your NativeSD port (In my example, I used HyperDroid-CM7-v6.0.1_NativeSD e.g. my port is CM7 based so I used powerful GB kernel files fro this rom)

    Step1. Prepare port files
    • Create any folder on your PC (example: C:\myport\) and extract in the blank template file
      You should have this:
      C:\myport\kernel\boot\place kernel + nand ramdisk here
      C:\myport\kernel\bootsd\place kernel + sd-ext ramdisk here
      C:\myport\kernel\checksys.sh
      C:\myport\kernel\mkbootimg
      C:\myport\kernel\mkbootimg
      C:\myport\META-INF\com\google\android\aroma\ etc... etc... etc...
      C:\myport\META-INF\com\google\android\aroma-config
      C:\myport\META-INF\com\google\android\update-binary
      C:\myport\META-INF\com\google\android\update-binary-installer
      C:\myport\META-INF\com\google\android\updater-script
      C:\myport\sdcard\NativeSD\clrcad.exe
      C:\myport\sdcard\NativeSD\haret.exe
      C:\myport\sdcard\NativeSD\startup.txt
      C:\myport\system\place the rom system folder contents in here
      C:\myport\install.sh
    • Delete 3 blanked information files:
      This files is only for you know where need to put kernel files and system folder of base
      C:\myport\kernel\boot\place kernel + nand ramdisk here
      C:\myport\kernel\bootsd\place kernel + sd-ext ramdisk here
      C:\myport\system\place the rom system folder contents in here
    • Extract /system folder from (NAND ROM) in C:\myport\:
      You should have this:
      C:\myport\system\app\ ... include files, folders & subfolders
      C:\myport\system\bin\ ... include files, folders & subfolders
      C:\myport\system\etc\ ... include files, folders & subfolders
      C:\myport\system\fonts\ ... include files, folders & subfolders
      C:\myport\system\framework\ ... include files, folders & subfolders
      C:\myport\system\lib\ ... include files, folders & subfolders
      C:\myport\system\media\ ... include files, folders & subfolders
      C:\myport\system\tts\ ... include files, folders & subfolders
      C:\myport\system\usr\ ... include files, folders & subfolders
      C:\myport\system\vendor\ ... include files, folders & subfolders
      C:\myport\system\xbin\ ... include files, folders & subfolders
      C:\myport\system\build.prop
    • Delete all kernel module files:
      This step req. because, In my example, I used kernel files from HyperDroid-CM7-v6.0.1_NativeSD
      C:\myport\system\lib\modules\alsa-mix-htc-leo.ko
      C:\myport\system\lib\modules\alsa-pcm-htc-leo.ko
      C:\myport\system\lib\modules\bcm4329.ko
      C:\myport\system\lib\modules\cifs.ko
      C:\myport\system\lib\modules\fuse.ko
      C:\myport\system\lib\modules\kineto_gan.ko
      C:\myport\system\lib\modules\msm_rmnet.ko
      C:\myport\system\lib\modules\tun.ko
      P.S. Your module files may be diffirents, just delete it all
      C:\myport\system\lib\modules\ no one files exist
    • Extract zImage file from HyperDroid-CM7-v6.0.1_NativeSD rom in two folders:
      Duplicate it for boot as NAND and boot as SD
      C:\myport\kernel\boot\zImage
      C:\myport\kernel\bootsd\zImage
    • Extract module files (.ko)
      From: HyperDroid-CM7-v6.0.1_NativeSD modules folder:
      HyperDroid-CM7-v6.0.1_NativeSD.zip\system\lib\modules\
      To: C:\myport\system\lib\modules\
      It should be like this:
      C:\myport\system\lib\modules\bcm4329.ko
      C:\myport\system\lib\modules\cifs.ko
      C:\myport\system\lib\modules\fuse.ko
      C:\myport\system\lib\modules\kineto_gan.ko
      C:\myport\system\lib\modules\msm_rmnet.ko
      C:\myport\system\lib\modules\reiserfs.ko
      C:\myport\system\lib\modules\tun.ko
      C:\myport\system\lib\modules\zram.ko
    • Extract initrd.gz from HyperDroid-CM7-v6.0.1_NativeSD (smaller file ~143 Kb):
      From: HyperDroid-CM7-v6.0.1_NativeSD.zip\kernel\boot\initrd.gz
      To: C:\myport\kernel\boot\initrd.gz
    • Extract initrd.gz from HyperDroid-CM7-v6.0.1_NativeSD (bigger file ~893 Kb):
      From: HyperDroid-CM7-v6.0.1_NativeSD.zip\kernel\bootsd\initrd.gz
      To: C:\myport\kernel\bootsd\initrd.gz

    Step2. [Windows] Change port name & port folder name
    • Open in Nottepad++ file C:\myport\install.sh
    • Find ths string:
      # Set the ROM name
      ROM_NAME=EXAMPLE
      And chenge (red selected: EXAMPLE) to your likly port name:
      # Set the ROM name
      ROM_NAME=NexusCM7
      P.S. This is example. Do not use spaces!!
    • Remeber this name, save changes and exit Nottepad++
    11
    Step3. [Linux] Change port name & port folder name
    I'm used Ubuntu Linux v11.10 OEM & WinHHTP FileServer to exchange files from my Windows to Linux (at VMware)
    • Copy your initrd.gz (bigger file) to your Linux
      From: C:\myport\kernel\bootsd\initrd.gz
      To: \username\home\myport\initrd.gz
      Where \username\home\ is your own home folder in Linux, and \myport\ is temprary folder to this step. Create it if don't exists
    • Execute Linux terminal application (window based) by Ctrl+Alt+T
      It is should by like this:
    • Now you must be in your home folder, but you can check it by command:
      c1cl0n@ubuntu:~$ ls ./
      If you see root folder or some other forlder, not username@servername:~$ you can change it by this command:
      c1cl0n@ubuntu:~$ cd /username/home
    • Now create temporary work folder, if it wasn't exist by command:
      c1cl0n@ubuntu:~$ mkdir myport
    • Copy to /username/home/myport/ your initrd.gz (bigger file) as you want
      I'm used WinHTTP FileServer for this
    • Create in your work folder new folder named as "works"
      It is should be like this:
      /c1cl0n/home/myport/work/
    • Now extract your initrd.gz file to change init file for your port
      c1cl0n@ubuntu:~/myport$ cp ./initrd.gz ./work
      c1cl0n@ubuntu:~/myport$ cd ./work
      c1cl0n@ubuntu:~/myport/work$ gunzip initrd.gz
      c1cl0n@ubuntu:~/myport/work$ cpio -i < initrd
      3261 Blocks
    • Done! Now in /username/home/myport/work/ folder you must have this files and folders:
      /bin /data /dev /proc /sbin /system
      default.prop init init.android init.htcleo.rc init.htcleo.usb.rc init.rc initrd.gz
      logo.rle ueventd.htcleo.rc ueventd.rc
    • Done! initrd.gz now is extracted
    • Now moveing init file to /username/home/myport/ folder and changing permissions to it (to do it editable)
      c1cl0n@ubuntu:~/myport/work$ cp ./init ../
      c1cl0n@ubuntu:~/myport/work$ chmod 777 ../init
    • Now you must edit this file to change a name of your port, what you did in Nottepad++ with install.sh file
    • Run GEdit and open /username/home/myport/init file
    • Find this string:
      and change it to your name, what you did in Nottepad++ with install.sh file
    • Save all changes and exit GEdit
    • Return to terminal window
    • Now you must replace this file to older and repack initrd.gz
      Deleting old file:
      c1cl0n@ubuntu:~/myport/work$ rm -rf ./init
      Deleting old initrd.gz it is very important becase we will save all changes in old initrd.gz file in /username/home/myport/initrd.gz
      c1cl0n@ubuntu:~/myport/work$ rm -rf initrd
    • Putnig new init file in our work folder:
      P.S. No req. original permission to it!
      c1cl0n@ubuntu:~/myport/work$ cp ../initrd ./
    • Repacking your old initrd.gz
      c1cl0n@ubuntu:~/myport/work$ find . | cpio -o -H newc | gzip > ../initrd.gz
      3261 Blocks
    • Done! In the Linux our work is finished
    • Upload/Copy your changed /username/home/myport/initrd.gz file to your Windows
    • And trash files and folders of this step:
      c1cl0n@ubuntu:~/myport/work$ cd ../..
      c1cl0n@ubuntu:~$ chmod 777 ./myport
      If Linux talks about permissions, like Access Denied!, change your username to root by command:
      c1cl0n@ubuntu:~$ sudo su
      c1cl0n@root:~$ _
      c1cl0n@root:~$ rm -rf ./myport
    • This step is done! Turn off Linux (if you are used it on VirtualMachine and return to Windows
    11
    Step4. Replace changed initrd.gz
    • Put your changed (in Linux OS) initrd.gz file to C:\myport\kernel\bootsd\initrd.gz
    • Done!

    Step5. Change updater-script
    • Run Nottepad++ and open for edit a file C:\myport\META-INF\com\google\android\updater-script
    • Find this lines:
      run_program("/tmp/install.sh");

      if file_getprop("/tmp/nfo.prop","NativeSD") == "true"

      then
    • In new tab of Nottepad++ open for edit updater-script file of ported NAND rom:
      In my example it is NexusHD2-Gingerbread_V3.2a_NAND_(Android-2.3.7).zip\META-INF\com\google\android\updater-script
    • Copy into the buffer all text from line:
      symlink("busybox", "/system/xbin/[", "/system/xbin/[[",
      "/system/xbin/arp", "/system/xbin/ash", "/system/xbin/awk",
      "/system/xbin/basename", "/system/xbin/bbconfig", "/system/xbin/brctl",
      To:
      set_perm(0, 0, 06755, "/system/xbin/busybox");
      set_perm(0, 0, 06755, "/system/xbin/su");
      It is must be like this:
      symlink("busybox", "/system/xbin/[", "/system/xbin/[[",
      "/system/xbin/arp", "/system/xbin/ash", "/system/xbin/awk",
      "/system/xbin/basename", "/system/xbin/bbconfig", "/system/xbin/brctl",
      "/system/xbin/bunzip2", "/system/xbin/bzcat", "/system/xbin/bzip2",
      "/system/xbin/cal", "/system/xbin/cat", "/system/xbin/catv",
      "/system/xbin/chgrp", "/system/xbin/chmod", "/system/xbin/chown",
      "/system/xbin/chroot", "/system/xbin/cksum", "/system/xbin/clear",
      "/system/xbin/cmp", "/system/xbin/cp", "/system/xbin/cpio",
      "/system/xbin/cut", "/system/xbin/date", "/system/xbin/dc",
      .........
      .........
      .........
      .........
      .........
      set_perm(0, 0, 06755, "/system/xbin/hcitool");
      set_perm(0, 0, 06755, "/system/xbin/librank");
      set_perm(0, 0, 06755, "/system/xbin/procmem");
      set_perm(0, 0, 06755, "/system/xbin/procrank");
      set_perm(0, 0, 06755, "/system/xbin/tcpdump");
      set_perm(0, 0, 06755, "/system/xbin/busybox");
      set_perm(0, 0, 06755, "/system/xbin/su");
    • Goto first tab of Nottepad++ (it is tab with ported updater-script) and paste coped data after red marked "then "
      It is must be like this:
      if file_getprop("/tmp/nfo.prop","NativeSD") == "true"

      then

      symlink("busybox", "/system/xbin/[", "/system/xbin/[[",
      "/system/xbin/arp", "/system/xbin/ash", "/system/xbin/awk",
      "/system/xbin/basename", "/system/xbin/bbconfig", "/system/xbin/brctl",
      "/system/xbin/bunzip2", "/system/xbin/bzcat", "/system/xbin/bzip2",
      "/system/xbin/cal", "/system/xbin/cat", "/system/xbin/catv",
      "/system/xbin/chgrp", "/system/xbin/chmod", "/system/xbin/chown",
      "/system/xbin/chroot", "/system/xbin/cksum", "/system/xbin/clear",
      ..........
      ..........
      ..........
      ..........
      set_perm(0, 0, 06755, "/system/xbin/procrank");
      set_perm(0, 0, 06755, "/system/xbin/tcpdump");
      set_perm(0, 0, 06755, "/system/xbin/busybox");
      set_perm(0, 0, 06755, "/system/xbin/su");
      symlink("/system/xbin/su", "/system/bin/su");

      package_extract_dir("kernel/bootsd", "/boot");
      package_extract_dir("kernel/bootsd", "/boot_dir");
      package_extract_dir("sdcard", "/sdcard");
      package_extract_dir("system", "/system");

      else

      ui_print("can't find ext4 partition on your SDcard");
      ui_print("install failed");

      endif;

      endif;

      ##
      # ROM SYMLINKS AND PERMISSONS
      ##
    • Save all changes and close both tabs
    • Done! updater-script is ready to use

    Step6. Prepare AROMA script
    • Run Nottepad++ (if it is was closed be step5) and open for edit C:\myport\META-INF\com\google\android\aroma-config file
    • Now change default strings to your likely port name, author, build date etc.
      Find this:
      ini_set("rom_name", "EXAMPLE");
      ini_set("rom_version", "v2");
      ini_set("rom_author", "DEVELOPER");
      ini_set("rom_device", "HTC HD2");
      ini_set("rom_date", "TODAY");
      Change to this:
      ini_set("rom_name", "NexusCM7");
      ini_set("rom_version", "v2");
      ini_set("rom_author", "YourNickName");
      ini_set("rom_device", "HTC HD2");
      ini_set("rom_date", "CurrentDate");
    • Save all changes and exit from Nottepad++
    • Done! Aroma config file is ready to use
    • This 3 steps is done!
      Now yo can create zip archive with your folders & subfolders:
      \kernel\
      \META-INF\
      \sdcard\
      \system\
      \install.sh
      and install it via 4EXT Recovery for NativeSD port
    8
    as I understand, it is not possible to use nativesd script with sense3.5 roms?

    it working boot now :eek:


    under more dev & fix
    6
    No Linux needed

    I was trying to change the init in the initrd.gz file but its encrypted how could i change it sow i can change the rom name? Or must i change the locations in the init.rz? sow the rom will boot the correct one.

    Get the v2 template (example.zip) from here http://xdaforums.com/showpost.php?p=31110719&postcount=2

    And HypoTurtle's Patcher (and nativesd.sh.txt) from here http://xdaforums.com/showthread.php?t=1953428 and put the extracted NativeSD folder into the extracted template folder (alongside other folders). Edit; rename nativesd.sh.txt to nativesd.sh and put in nativesd folder.

    Put your nand ROM's (nand) zImage and initrd.gz in template's kernel/boot and kernel/bootSD (you will overwrite the initrd.gz later), put both in both.

    Edit; Put the cert and manifest files from ROM's META_INF folder to the same directory in template's META_INF folder, and also any other folders (eg META_INF/com/android folder) if present should be copied over too.

    When editing scripts, use Notepad++

    Put the lines
    Code:
    package_extract_dir("NativeSD", "/tmp");
    set_perm(0, 0, 0777, "/tmp/nativesd.sh");
    run_program("/tmp/nativesd.sh");
    in template's (meta-inf/com/google/android) updater script before package_extract_dir("system", "/system"); in the SD-Ext install section.

    And copy symlinks and permissions from your new ROMs updater script to template's updater script in the relevant section below SD-Ext install.

    Edit template's aroma config with details of the ROM you are porting.

    And put the nand initrd.gz in NativeSD folder

    And put correct unique ROM_NAME in install.sh

    Put the system folder from new ROM to template folder (delete any apps2SD APK from system/apps and from system/etc/init.d scripts)

    Edit; At this point, if your rom does not support ppp (ie a magldr rom), then put the files from here into their respective folders in system. (When installing, the aroma option to chose rmnet or ppp depends on the ppp files being present ie if ppp is chosen-nothing happens, if rmnet is chosen-the ppp files are deleted)

    Re-zip template contents and rename the zip to whatever

    Flash using your favourite sd recovery

    After flashing, you should have 2 extra .gz files in NativeSD folder, rename one of them to initrd.gz (overwrite) and see if it boots. if not, then try the other.

    If it boots copy the initrd.gz from NativeSD to NativeSD/whetever-rom_name-you-chose and overwrite the one there, so that you can boot it after trying another ROM.

    If you are posting the ROM, delete NativeSD folder from your template folder and remember to put a copy of your edited initrd.gz in kernel/bootSD.

    Hope I haven't missed anything:)
    Thanks to HypoTurtle, Xylograph, Securecrt, marco.palumbi, aroma ppl and others.

    Edit; Different nand ROMs use aroma installer to install apps and options, you may have to play around with the aroma scripts to get these to work. Also, some ROMs have a data folder, you can add a line in updater script to install it.
    Code:
    package_extract_dir("data", "/data");
    after "package_extract_dir("system", "/system");"