FORUMS
Remove All Ads from XDA

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

642 posts
Thanks Meter: 786
 
By c1cl0n, Senior Member on 23rd September 2012, 08:36 PM
Post Reply Email Thread
HOWTO port NAND ROM to NATIVESD
STEP-BY-STEP
Quote:

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:
    Quote:

    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
    Quote:

    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:
    Quote:

    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
    Quote:

    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
    Quote:

    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
    Quote:

    C:\myport\kernel\boot\zImage
    C:\myport\kernel\bootsd\zImage

  • Extract module files (.ko)
    Quote:

    From: HyperDroid-CM7-v6.0.1_NativeSD modules folder:
    HyperDroid-CM7-v6.0.1_NativeSD.zip\system\lib\modules\

    Quote:

    To: C:\myport\system\lib\modules\

    It should be like this:
    Quote:

    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):
    Quote:

    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):
    Quote:

    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:
    Quote:

    # Set the ROM name
    ROM_NAME=EXAMPLE

    And chenge (red selected: EXAMPLE) to your likly port name:
    Quote:

    # Set the ROM name
    ROM_NAME=NexusCM7

    P.S. This is example. Do not use spaces!!
  • Remeber this name, save changes and exit Nottepad++
The Following 33 Users Say Thank You to c1cl0n For This Useful Post: [ View ] Gift c1cl0n Ad-Free
 
 
23rd September 2012, 08:37 PM |#2  
c1cl0n's Avatar
OP Senior Member
Thanks Meter: 786
 
More
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
    Quote:

    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:
    Quote:

    c1cl0n@ubuntu:~$ _

  • Now you must be in your home folder, but you can check it by command:
    Quote:

    c1cl0n@ubuntu:~$ ls ./

    If you see root folder or some other forlder, not username@servername:~$ you can change it by this command:
    Quote:

    c1cl0n@ubuntu:~$ cd /username/home

  • Now create temporary work folder, if it wasn't exist by command:
    Quote:

    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:
    Quote:

    /c1cl0n/home/myport/work/

  • Now extract your initrd.gz file to change init file for your port
    Quote:

    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:
    Quote:

    /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)
    Quote:

    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:
    Quote:

    rom_name="NexusHD2"

    and change it to your name, what you did in Nottepad++ with install.sh file
    Quote:

    rom_name="NexusCM7"

  • 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:
    Quote:

    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
    Quote:

    c1cl0n@ubuntu:~/myport/work$ rm -rf initrd

  • Putnig new init file in our work folder:
    P.S. No req. original permission to it!
    Quote:

    c1cl0n@ubuntu:~/myport/work$ cp ../initrd ./

  • Repacking your old initrd.gz
    Quote:

    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:
    Quote:

    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:
    Quote:

    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
The Following 11 Users Say Thank You to c1cl0n For This Useful Post: [ View ] Gift c1cl0n Ad-Free
23rd September 2012, 08:40 PM |#3  
c1cl0n's Avatar
OP Senior Member
Thanks Meter: 786
 
More
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:
    Quote:

    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:
    Quote:

    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:
    Quote:

    set_perm(0, 0, 06755, "/system/xbin/busybox");
    set_perm(0, 0, 06755, "/system/xbin/su");

    It is must be like this:
    Quote:

    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:
    Quote:

    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.
    Quote:

    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");

    Quote:

    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:
    Quote:

    \kernel\
    \META-INF\
    \sdcard\
    \system\
    \install.sh

    and install it via 4EXT Recovery for NativeSD port
The Following 11 Users Say Thank You to c1cl0n For This Useful Post: [ View ] Gift c1cl0n Ad-Free
23rd September 2012, 08:55 PM |#4  
c1cl0n's Avatar
OP Senior Member
Thanks Meter: 786
 
More
Step7. (Optional) Sign created NativeSD zip-archive
This step is optional and I don't know about request of it. I'm just signed my port in UpdatezipCreator

Thats all pplz
My thanks to all who helped me with this, to all xda developers who made this possible and all@xda-developers who I forgot to thanks

Regard, c1cl0n
The Following 3 Users Say Thank You to c1cl0n For This Useful Post: [ View ] Gift c1cl0n Ad-Free
23rd September 2012, 09:21 PM |#5  
seaman2k's Avatar
Senior Member
Flag suez
Thanks Meter: 970
 
More
u did great help here man thx
23rd September 2012, 10:14 PM |#6  
c1cl0n's Avatar
OP Senior Member
Thanks Meter: 786
 
More
Quote:
Originally Posted by seaman2k

u did great help here man thx

Thanks, hope my work will help other beginners to learn better the NativeSD technology and make our HD2 more greater and useble

If this guide is too hard and not intuitive, tomorrow I can record all steps to video
In fact, everything just seems complicated, yet you can not tell the exact purpose of each file future NativeSD port
23rd September 2012, 11:43 PM |#7  
Szczepanik's Avatar
Senior Member
Thanks Meter: 587
 
More
Location Get permission before publishing
Advice: before publishing any ROM that you port to NativeSD, check with the original ROM developer and get their permission. See Forum Rule 12
Quote:

12. Using the work of others.
If you are developing something that is based on the work of another Member, you MUST first seek their permission, and you must give credit to the member whose work you used.

Cheers
Tom
24th September 2012, 11:38 AM |#8  
c1cl0n's Avatar
OP Senior Member
Thanks Meter: 786
 
More
All links removed
Sorry
The Following 2 Users Say Thank You to c1cl0n For This Useful Post: [ View ] Gift c1cl0n Ad-Free
24th September 2012, 11:50 AM |#9  
Senior Member
Thanks Meter: 1,270
 
More
Quote:
Originally Posted by c1cl0n

All links removed
Sorry

Would this be better / of additional benefit as a wiki, would allow people to tidy it up a bit, and add in other variations (using the dxixda kitchen on windows, or editing initrd.gz on device (move initrd.gz to /INITRD/ ; make a folder /INITRD/work/ ; cd to /INITRD/work ; then run #gunzip -c ../initrd.gz | cpio -i)?

Would also allow us to have all the NativeSD guides in one place (porting, installation, WP7 installation etc.)
The Following 2 Users Say Thank You to HypoTurtle For This Useful Post: [ View ] Gift HypoTurtle Ad-Free
24th September 2012, 12:15 PM |#10  
seaman2k's Avatar
Senior Member
Flag suez
Thanks Meter: 970
 
More
Quote:
Originally Posted by HypoTurtle

Would this be better / of additional benefit as a wiki, would allow people to tidy it up a bit, and add in other variations (using the kitchen on windows, editing initrd.gz on device (need to confirm if can be done properly)?

Would also allow us to have all the NativeSD guides in one place (porting, installation, WP7 installation etc.)

i used above steps on ubuntu and i can say it help me too much and i success to convert and modded nand rom to nativesd rom with all update i needed for me ..yes the guide is very good with the video i think it will be excellent
24th September 2012, 12:18 PM |#11  
Senior Member
Flag Shanghai
Thanks Meter: 2,766
 
Donate to Me
More
thanks. looks perfect and very easy to reproduce by starters.

I will add a link to my thread

Sent from my NexusHD2 using xda premium
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes