[HD2 Android SD Development] HypoTurtle:
[Disclamer: Use the following at your own risk, I take no responsibility for the unrecoverable loss of any data as a direct consequence of using anything attached]

The following patcher(s) will modify the nand ramdisk for various functions, primarily enabling NativeSD support:​

--------------------------------------------------------------------

#1 NativeSD SD ramdisk to NativeSD nand ramdisk patch

#2 NAND (Non NativeSD) to NativeSD patch

#3 Boot.img (/also clk) patcher

#4 other devices ???

#5 FAQ

---------------------------------------------------------------------
​

NativeSD SD ramdisk to NativeSD NAND ramdisk

Things resolved by using nand ramdisk over sd ramdisk

Bluetooth issues

Changing rom name to whatever you want prior to install i.e for testing purposes (just need to change rom_name in install.sh and the one in the ramdisk will mirror it)

...

...

Instructions.

Removed the old zips, have attached just one, should run on linux, on device and during installation, needs a install.sh file with at least ROM_NAME=rom_name in it, and a copy of the nand ramdisk to be added into NativeSD folder or copied to /tmp (i.e during ROM _installation ) and to execute nativesd.sh (a copy of which is currently attached as well as being in the zip). Should work with nilfs2 and ext4 and should allow for easy adjustments and modifications to be made to the mount commands carried out in init.rc and/or mountfs.sh

Add a copy of nativesd.sh.txt saved as nativesd.sh to the downloaded and unzipped NativeSD folder and add to rom zip.

During ROM installation the NativeSD folder needs to be emptied to /tmp along with a nand ramdisk and /tmp/nativesd.sh needs to be run.

package_extract_dir("NativeSD", "/tmp");

set_perm(0, 0, 0777, "/tmp/nativesd.sh");

run_program("/tmp/nativesd.sh");​

and either send nand ramdisk to /tmp/ or add a copy to the NativeSD folder before installation.

The set up at the moment will leave the default NativeSD in tact and add two others, just rename them (or edit nativesd.sh to do so).

If using nilfs2 again two addition ramdisks will be added, the two created ones which will boot to nilfs2 and the original which won't boot as it's set to ext4, you may also need to edit install.sh (or mount_NativeSD.sh) so that it reads "mount auto" or "mount nilfs2" rather than "mount ext4".

Legacy Instructions:

NANDtoNativeSD.zip (will add another version)
[INDENT]This is a CWM(/recovery) zip, instructions are similar to Combi:
need to change install.sh to have the right rom_name at the top, and add the nand ramdisk to the NativeSD folder and install via recovery[/INDENT]

Combi
[INDENT]The zips marked ext4 and nilfs2 should make both sc and v versions and should work during installation and from running build (although that may need one line change). They should create initrd-nilfs-sc.gz and initrd-nilfs-v.gz or initrd-ext4-sc.gz and initrd-ext4-v.gz accordingly and thus can't be booted from until you rename them to initrd.gz.

[B]During ROM installation:[/B]
[INDENT]Copy the nand ramdisk (it should be ~200kb) into the NativeSD folder and copy NativeSD into the ROM zip
Edit the updater script by adding:
[B]package_extract_dir("NativeSD", "/tmp");
set_perm(0, 0, 0777, "/tmp/nativesd.sh");
run_program("/tmp/nativesd.sh");[/B][/INDENT]
before [B]package_extract_dir("system", "/system");[/B]
no other change needed so this should be universal

[B]During running ROM:[/B]
[INDENT]Copy NativeSD folder to sdcard, copy in nand ramdisk and create a text file called [B]install.sh[/B] with the words [B]ROM_NAME=writeROMname[/B] writing the rom name after =.
Open terminal cd into NativeSD folder and run script:
[B]su
chmod 777 nativesd.sh
./nativesd.sh[/B][/INDENT]
Let me know if there is a problem as I might need to change a few lines to get it to run on device - This is completely untested
(will also run on linux after a few minor changes i.e changing sbin to bin on first line and removing/changing the [B]cp initrd*.gz /boot*[/B] lines, will properly comment this in next version if/when the current ones need fixing
[/INDENT]

Modifying during Installation
[INDENT]1. Download the attached NativeSD.zip or NativeSD-sc.zip and have original NativeSD-ROM.zip to be modified
2. Unzip it and open nativesd.sh
3. Add the romname to the start of the script (the same romname that's in install.sh)
3. Add the NativeSD folder to a current NativeSD-ROM.zip
4. Edit the updater-script, by changing the following:
[B]ui_print("@ Installing System");
package_extract_dir("kernel/bootsd", "/boot");
package_extract_dir("kernel/kernel", "/boot");
package_extract_dir("kernel/bootsd", "/boot_dir");
package_extract_dir("kernel/kernel", "/boot_dir");
package_extract_dir("sdcard", "/sdcard");
package_extract_dir("system", "/system");[/B]
to
[B]ui_print("@ Installing System");
package_extract_dir("kernel/boot", "/boot");
package_extract_dir("kernel/kernel", "/boot");
package_extract_dir("kernel/kernel", "/boot_dir");
package_extract_dir("NativeSD", "/tmp");
set_perm(0, 0, 0777, "/tmp/nativesd.sh");
run_program("/tmp/nativesd.sh");
package_extract_dir("sdcard", "/sdcard");
package_extract_dir("system", "/system");[/B]
[I][SIZE="1"](this will vary slightly by rom)[/SIZE][/I]
5. Copy rom to sdcard and install via recovery[/INDENT]
Modifying during running NativeSD ROM
[INDENT]1. Download nativesd.sh.txt and nativeSDv1.1 attached
2. Obtain nand ramdisk from the NativeSD-ROM.zip (kernel/boot/initrd.gz for example)
3. Unzip NativeSDv1.1.zip
4. Rename nativesd.sh.txt to nativesd.sh and copy over the one in the NativeSD folder
5. Copy the nand ramdisk (initrd.gz) into the NativeSD folder
6. Copy NativeSD folder to device for example to /sdcard/Downloads/
7. Open terminal and run the following
[B]su
cd /sdcard/Downloads/NativeSD
ROM_NAME=AddRomNameHere
chmod 777 nativesd.sh
./nativesd.sh
exit
exit[/B]
This should modify the ramdisk and copy it to /sdcard/NativeSD and will leave the one in the romfolder as is, if it works great if not, replace the initrd.gz in /sdcard/NativeSD with the one in /sdcard/NativeSD/ROMNAME/

[/INDENT]

(If using nilfs2, you will also need to look in install.sh and change ext4 to auto)

Details

Confirmed working:

Booting to ext4

Booting to nilfs2 (using nilfs2 zips)

Untested:

Modifying from running build

Tested Working ROMs:

NexusHD2-ICS

PACman

MIUIJB

PA-HD2

sundawg

CM9ite 1.1 (QMA version won't work)

Versions

Releases with v will be based on marco.palumbi's method - adding mounts to init.rc

Releases with sc will be based on securecrt's method - using an additional script

Changelog

-beta 1

nilfs2 and ext4 tested with same rom, nativesd.sh file removed from zip (as the other files with remain unchanged for the time being)

-------------------------------------

-nilfs-ext4-sc-v

Stripped down andcombined to the one zip

-------------------------------------

-ext4(4) and -nilfs2(4)

sc fixed

-------------------------------------

-ext4(3) and -nilfs2(3)

Bug fixes

-------------------------------------

-ext4(2) and -nilfs2(2)

Fix initrd.gz names with ext4 version,

tmp file copied into NativeSD (hopefully) for debugging purposes

------------------------------------

-ext4 and -nilfs2 versions

Seperate zips for the two file systems for now

Hopefully removed the need to have to manually change the rom_name by reading from install.sh (confirmed)

Completely untested

-------------------------------------

sc1.2

Should now be fixed and work with ext4 (and nilfs2 after removing some lines)

--------------------------------------

sc1.1

Tidy up and fixing issue reported here

--------------------------------------

v1.1

Tidy up

--------------------------------------

sc1 (NativeSD-sc1) :

Based on securecrt's code

EXT4 support

--------------------------------------

v1 (NativeSD.zip) :

Based on marco.palumbi's code

EXT4 and (untested) basic NILFS2 support​

Credits: securecrt, Xylograph, marco.palumbi, ph03n!x, Kokotas,

Testers: Robbie P and jerrysue (for testing the alpha builds)