[HD2 Android Q&A, Help & Troubleshooting and Genera] ictimai:
I've just tried to dumbly follow your instructions (but still in exact manner) and the efect is really absurd:

NativeSD # ./nativesd.sh
mkdir: cannot create directory '/tmp': File exists
cp: cannot stat 'install.sh': No such file or directory
sed: can't read /tmp/install.sh: No such file or directory
mkdir: cannot create directory '/tmp/ns2': File exists
mkdir: cannot create directory '/tmp/ns3': File exists
cp: cannot stat 'initrd.gz': No such file or directory
cp: cannot stat 'initrd.gz': No such file or directory
gzip: ../initrd2.gz: No such file or directory
cpio: premature end of archive
mkdir: cannot create directory 'bin': File exists
cp: cannot stat 'busybox': No such file or directory
cp: cannot stat 'e2fsck': No such file or directory
cp: cannot stat 'busybox': No such file or directory
cp: cannot stat 'e2fsck': No such file or directory
chmod: cannot access 'ns2/bin/busybox': No such file or directory
chmod: cannot access 'ns2/bin/e2fsck': No such file or directory
sed: can't read ns2/ueventd.htcleo.rc: No such file or directory
cp: cannot stat 'mountfs.sh': No such file or directory
sed: can't read ns2/init.rc: No such file or directory
sed: can't read ns2/mountfs.sh: No such file or directory
sed: can't read ns2/mountfs.sh: No such file or directory
chmod: cannot access 'ns2/mountfs.sh': No such file or directory
chmod: cannot access 'ns2/init.rc': No such file or directory
chmod: cannot access 'ns2/ueventd.htcleo.rc': No such file or directory
chmod: cannot access 'ns2/mountfs.sh': No such file or directory
1 block
cp: cannot create regular file '/boot_dir/initrd-nilfs2-sc.gz': No such file or directory
gzip: ../initrd3.gz: No such file or directory
cpio: premature end of archive
mkdir: cannot create directory 'bin': File exists
cp: cannot stat 'busybox': No such file or directory
cp: cannot stat 'e2fsck': No such file or directory
chmod: cannot access 'ns3/bin/busybox': No such file or directory
chmod: cannot access 'ns3/bin/e2fsck': No such file or directory
sed: can't read ns3/ueventd.htcleo.rc: No such file or directory
sed: can't read ns3/init.rc: No such file or directory
sed: can't read ns3/init.rc: No such file or directory
sed: can't read ns3/init.rc: No such file or directory
chmod: cannot access 'ns3/init.rc': No such file or directory
chmod: cannot access 'ns3/ueventd.htcleo.rc': No such file or directory
1 block
cp: cannot create regular file '/boot_dir/initrd-nilfs2-v.gz': No such file or directory
cp: writing '/boot/tmp/y/Cache/E/0E/67CD9d11': No space left on device
cp: failed to extend '/boot/tmp/y/Cache/E/0E/67CD9d11': No space left on device
cp: cannot create directory '/boot/tmp/the/Cache/E/CB': No space left on device
cp: cannot create directory '/boot/tmp/the/Cache/E/67': No space left on device
cp: cannot create directory '/boot/tmp/the/Cache/E/26': No space left on device
cp: cannot create directory '/boot/tmp/the/Cache/E/21': No space left on device
cp: cannot create directory '/boot/tmp/the/Cache/E/39': No space left on device
cp: cannot create directory '/boot/tmp/the/Cache/E/FA': No space left on device
cp: cannot create directory '/boot/tmp/the/Cache/F': No space left on device
cp: writing '/boot/tmp/the/Cache/_CACHE_001_': No space left on device
cp: failed to extend '/boot/tmp/the/Cache/_CACHE_001_': No space left on device
cp: writing '/boot/tmp/the/Cache/_CACHE_002_': No space left on device
cp: failed to extend '/boot/tmp/the/Cache/_CACHE_002_': No space left on device
cp: writing '/boot/tmp/the/Cache/_CACHE_003_': No space left on device
cp: failed to extend '/boot/tmp/the/Cache/_CACHE_003_': No space left on device
cp: cannot create directory '/boot/tmp/the/chromium': No space left on device

The all files you mentioned put into /tmp/NativeSD folder on my linux PC, including intird.gz from kernel_tytung/boot_NAND, changed +x permissions for all *.sh and binary executables, and then executed ./nativesd.sh

Have you meant to execute it on phone's Android or something?

EDIT:

I'hve only now read about your ramdisk patch. Appologies about this.

So, now I guess you probably meant this:

So, I've commented the lines in the nativesd.sh file:

#!/bin/sh

mkdir /tmp
cd /tmp
cp install.sh /tmp/
sed -n '/ROM_NAME=/w romname.txt' /tmp/install.sh
sed -i 's/ROM_NAME=//' romname.txt
export ROM_NAME=`cat romname.txt`
#ROM_NAME=RomNameHere

mkdir /tmp/ns2
mkdir /tmp/ns3
cp initrd.gz /tmp/initrd2.gz
cp initrd.gz /tmp/initrd3.gz
cd /tmp/ns2

# unzipping nand kernel and applying modifications

gzip -d -c ../initrd2.gz | cpio -i -d

mkdir bin
cp busybox /tmp
cp e2fsck /tmp
cd /tmp

cp busybox ns2/bin/busybox
cp e2fsck ns2/bin/e2fsck

chmod 0777 ns2/bin/busybox
chmod 0777 ns2/bin/e2fsck

sed -i '/mtd@misc/s/^/#/' ns2/ueventd.htcleo.rc

cp mountfs.sh ns2/mountfs.sh
sed -i '/mount yaffs2/s/^/#/
/on fs/ a exec /mountfs.sh
s/# #/# /g' ns2/init.rc
sed -i "s/rOm/${ROM_NAME}/g" ns2/mountfs.sh
sed -i 's/auto/nilfs2/g
/(NativeSD)/a \mkdir /nilfs\
mount nilfs2 /dev/block/mmcblk0p2 /nilfs' ns2/mountfs.sh
chmod 0777 ns2/mountfs.sh

# fixing permissions
chmod 0666 ns2/init.rc
chmod 0666 ns2/ueventd.htcleo.rc
chmod 0777 ns2/mountfs.sh

# making new ramdisk and copying over old
cd ns2
find .| cpio -o -H newc | gzip -9 > ../initrd-nilfs2-sc.gz
cd /tmp

chmod 0777 initrd-nilfs2-sc.gz
###cp initrd-nilfs2-sc.gz /boot/initrd-nilfs2-sc.gz
###cp initrd-nilfs2-sc.gz /boot_dir/initrd-nilfs2-sc.gz

cd /tmp/ns3
gzip -d -c ../initrd3.gz | cpio -i -d
mkdir bin
cd /tmp

cp busybox ns3/bin/busybox
cp e2fsck ns3/bin/e2fsck

chmod 0777 ns3/bin/busybox
chmod 0777 ns3/bin/e2fsck

sed -i '/mtd@misc/s/^/#/' ns3/ueventd.htcleo.rc

sed -i '/mount yaffs2/s/^/#/
s/# #/# /g
/on fs/ r initrcmod' ns3/init.rc
sed -i "s/rOm/${ROM_NAME}/g" ns3/init.rc
sed -i 's/auto/nilfs2/g
/optional/a \mkdir /nilfs\
mount nilfs2 /dev/block/mmcblk0p2 /nilfs' ns3/init.rc

chmod 0666 ns3/init.rc
chmod 0666 ns3/ueventd.htcleo.rc
cd ns3
find .| cpio -o -H newc | gzip -9 > ../initrd-nilfs2-v.gz
cd /tmp

chmod 0777 initrd-nilfs2-v.gz
###cp initrd-nilfs2-v.gz /boot/initrd-nilfs2-v.gz
###cp initrd-nilfs2-v.gz /boot_dir/initrd-nilfs2-v.gz

###mkdir /boot/tmp
###cp -r /tmp/* /boot/tmp/

and run it on my linux box (instead on Android). Then I've found the both files *initrd-nilfs2-sc.gz and *initrd-nilfs2-v.gz in /tmp

Thus, now should one of them be renamed into initrd.gz and together with zImage flashed into i.e. sboot?