[HD2 Android Q&A, Help & Troubleshooting and Genera] HypoTurtle:
Was working with RobbieP on this (as I can't test on device) - essentially aroma config for 3.0.x kernel with initrd.gz made on the fly.

Initrd mods carried out include applying: data on ext, nativesd, directsd(w/ ext4 or f2fs) to nand initrd.gz.

Decided to come at this from a different direction (after managing to botch together a device to test on) - as I can't get the aroma prop files to play nice.

So lets start with the minor modifications needed by in the ROM

Updater script modifications (based on SlimKat - but should be universal'ish'):

...
...
...
###############
# Cleaning up #
###############

set_progress(0.95);
delete_recursive("/tmp/*");
if file_getprop("/tmp/aroma/mods.prop", "selected.4") == "2" then
ui_print("@ Cleaning up...");
ui_print(" Unmounting...");
unmount("/boot");
unmount("/boot_dir");
unmount("/system");
unmount("/data");
unmount("/DirectSD");
unmount("/DirectSystem");
unmount("/NativeSD");
ui_print(" Done.");
else
package_extract_file("kernel/initrd.gz[COLOR="red"](NAND initrd)[/COLOR]", "/boot_dir/initrd.gz");
package_extract_file("kernel/zImage", "/boot_dir/zImage");
endif;
set_progress(1.0);
ui_print("@ Installation Complete");

Edit. Going to need: delete_recursive("/tmp/*"); outside of the if;endif;

And also /boot_dir won't be made if using NAND/DataOnExt; will need to rework this and #2 to extract to /tmp after it's wiped.

And change every reference to an initrd.gz other than the NAND one to the NAND one (just to avoid confusion)

Which obviously requires an additional group in mods in aroma-config:

...
...
...
#-- Group 3
"Wipe","",2,
"Wipe Dalvik-Cache",
"Select it to wipe Dalvik-Cache.",	1,
"Wipe Data/Factory Reset",
"Select it to wipe data/factory reset.",	0,
"No Wipe",
"Select it to keep everything.",	0,

#-- Group 4
"Installing a second zip","",2,
"Installing a second zip",
"Select it if you are installing a second zip - NativeSD/DirectSD or gapps for example",	1,
"Not installing a second zip",
"Select it if installing to NAND only",	0

);
...
...

Additionally the set_build_prop_*.sh's should be replaced (or redirected in updater script) by the following:

Set_Build_Prop.sh

#!/sbin/sh
# Append " [$install_type] and [$ROM_NAME]" to the ROM name for HD2
# Modify /system/build.prop and append "[] hooks" to the end of the line of ro.build.display.id
# Created by hypoturtle
ROM_NAME=`cat '/tmp/aroma/ROM_NAME.prop' | sed 's/ROM_NAME=//g'`
install_type=` cat '/tmp/aroma/installtype.prop' | sed 's/selected.1=//g' `
type=(NAND DataOnExt NativeSD DirectSD)
install=${type[$install_type-1]}
output=`grep -i "^ro\.build\.display\.id.*\[${install}\]$" /system/build.prop`
if [ -z "$output" ]; then
sed -i '/ro\.build\.display\.id/s/$/ \['${ROM_NAME}'] ['${install}'\]/' /system/build.prop
fi

And modify DirectSD_mounter.sh so that if it doesn't mount p3 as ext4 it tries with f2fs

#!/sbin/sh
#
# DirectSD SD-EXT Mounter v1.0
# Author: tytung - xda-developers

if [ ! -d "/DirectSystem" ]; then
mkdir "/DirectSystem"
fi

if [ ! -d "/DirectData" ]; then
mkdir "/DirectData"
fi

if [ -f "/tmp/mount.prop" ]; then
rm "/tmp/mount.prop"
fi

# Mount the SD-EXT partition
mounted=`mount | grep '/dev/block/mmcblk0p2 on /DirectSystem'`
if [ "$mounted" = "" ]; then
mount -t ext4 /dev/block/mmcblk0p2 /DirectSystem
fi

# Mount the SD-EXT partition
mounted=`mount | grep '/dev/block/mmcblk0p3 on /DirectData'`
if [ "$mounted" = "" ]; then
mount -t ext4 /dev/block/mmcblk0p3 /DirectData
fi

# Mount F2FS partition
mounted=`mount | grep '/dev/block/mmcblk0p3 on /DirectData'`
if [ "$mounted" = "" ]; then
mount -t f2fs /dev/block/mmcblk0p3 /DirectData
fi

mounted=`mount | grep '/dev/block/mmcblk0p3 on /DirectData'`
# `echo $?` will return 0 if mount is executed successfully
if [ `echo $?` = 0 ]; then
echo 'status=mounted' > "/tmp/mount.prop"
#else
# redirect mount failed messages to aroma-config
fi

And that's it on this side. Now read #2

legacy:

Managed to fix the nativesd.sh - it was riddled with errors:

#!/sbin/sh

export ROM_NAME=` cat 'ROM_NAME.prop' | sed 's/ROM_NAME=//g' `
export install_type=` cat 'installtype.prop' | sed 's/selected.1=//g' `
export bootloader=` cat 'nfo.prop' | sed 's/bootloader=//g' `

cd /tmp/aroma
mkdir /tmp/aroma/work
cp initrd.gz initrd-test.gz
cd /tmp/aroma/work

# unzipping nand kernel and applying modifications
gzip -d -c ../initrd-test.gz | cpio -i -d
mkdir bin
cd ..
cp busybox work/bin/busybox
cp e2fsck work/bin/e2fsck
chmod 0777 work/bin/busybox
chmod 0777 work/bin/e2fsck

if [ "${install_type}" -gt 2 ]; then
sed -i '/mtd@misc/s/^/#/' work/ueventd.htcleo.rc
sed -i '/mount yaffs2/s/^/#/
s/# #/# /g' work/init.rc
sed -i 's/auto/ext4/g' work/mountfs${install_type}.sh

fi
if [ "${install_type}" -gt 1 ]; then
sed -i '/on fs/ a exec /mountfs'${install_type}'.sh' work2/init.rc
cp mountfs${install_type}.sh work/mountfs${install_type}.sh
sed -i "s/rOm/$ROM_NAME/g" work/mountfs${install_type}.sh
chmod 0777 work/mountfs${install_type}.sh
chmod 0750 work/init.rc
chmod 0644 work/ueventd.htcleo.rc
fi
# making new ramdisk and copying to sd card
cd work2
find .| cpio -o -H newc | gzip -9 > ../initrd-done.gz
cd ..

if [ "${bootloader}" != "cLK" ]; then
cat initrd-done.gz >> 6MB
cp 6MB initrd6MB.gz
else
cp done2/initrd-done.gz /tmp/initrd.gz
fi

chmod 0777 initrd.gz
if [ "${install_type}" -lt 3 ]; then
cp initrd6MB.gz tmp/initrd.gz
else
cp initrd6MB.gz boot/initrd.gz
cp initrd6MB.gz boot_dir/initrd.gz
fi

# Copying tmp and open ramdisk folders to sdcard (NativeSD folder)

mkdir -p boot/tmp

Also this way if you want to add another way of booting all you need to do is create a mountfs.sh file and edit aroma-config.

aroma-config

### LICENSE:
#
# Copyright (C) 2011-2012 Ahmad Amarullah ( http://amarullz.com/ )
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
### FILE INFO:
#
# AROMA Installer from NexusHD2 tytung was modded by
# macs18max to include haret detection (hacked way) and
# clk nativesd sboot2. If using this please credit macs18max
#
###

##
# Forcing Device Pixelate Size
# defaut: floor( min( width, height ) / 160 )
#
ini_set("dp","3"); #-- HDPI ( 480x800 / WVGA )

##
# Initializing Rom Information
##
ini_set("rom_name", "ChauTien Slimroms 4.4.2");
ini_set("rom_version", "Build 4");
ini_set("rom_author", "Chau Truong Thinh");
ini_set("rom_device", "HTC HD2");
ini_set("rom_date", "APR. 01, 2014");

##
# Show Simple Splash
# splash(	2000,	"slim");

##
# Set Small Font to Support all fonts
#
fontresload( "0", "ttf/Roboto-Regular.ttf;ttf/DroidSansArabic.ttf;ttf/DroidSansFallback.ttf;", "12" ); #-- Use sets of font (Font Family)

##
# Set Language & Font Family
#
loadlang("langs/en.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" ); #-- "0" = Small Font
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" ); #-- "1" = Big Font

###################################################################################################################
#
# STEP 1 - SELECT THEME
#
theme("ics");

###################################################################################################################
#
# STEP 2 - SHOW ROM INFORMATION
#

# Extract ROM_NAME.prop to /tmp/aroma/ROM_NAME.prop
ziptotmp("kernel/ROM_NAME.prop", "ROM_NAME.prop");
ziptotmp("kernel/initrd.gz", "initrd.gz");
ziptotmp("kernel/busybox", "busybox");
ziptotmp("kernel/e2fsck", "e2fsck");
ziptotmp("kernel/zImage", "zImage");
ziptotmp("kernel/mkbootimg", "mkbootimg");
ziptotmp("kernel/mkbootimg.sh", "mkbootimg.sh");
ziptotmp("kernel/mountfs2.sh", "mountfs2.sh");
ziptotmp("kernel/mountfs3.sh", "mountfs3.sh");
ziptotmp("kernel/mountfs4.sh", "mountfs4.sh");
ziptotmp("kernel/mountfs5.sh", "mountfs5.sh");
ziptotmp("kernel/6MB", "6MB");
zipexec("kernel/checksys.sh");
setvar("bootloader", file_getprop("/tmp/nfo.prop", "bootloader"));

viewbox(
#-- Title
"Welcome!",

#-- Text
"You are about to install the below ROM for <b>"+ini_get("rom_device")+"</b>.\n\n"+

" ROM Name\t: <b><#selectbg_g>"+ini_get("rom_name")+"</#></b>\n"+
" Version\t: <b><#selectbg_g>"+ini_get("rom_version")+"</#></b>\n"+
" Author\t: <b><#selectbg_g>"+ini_get("rom_author")+"</#></b>\n"+
" Update\t: <b><#selectbg_g>"+ini_get("rom_date")+"</#></b>\n\n\n"+

"Bootloader\t: "+getvar("bootloader")+"\n\n"+

"System NAND\t: "+getdisksize("/system","m")+" MB\n"+
"\t Free\t: "+ getdiskfree("/system","m")+" MB\n\n"+

"Data NAND\t: "+getdisksize("/data","m")+" MB\n"+
"\t Free\t: "+ getdiskfree("/data","m")+" MB\n\n"+

"SD Card Size\t: "+getdisksize("/sdcard","m")+" MB\n"+
"\t Free\t: "+ getdiskfree("/sdcard","m")+" MB\n\n"+

" SD-EXT Size\t: "+getdisksize("/sd-ext","m")+" MB\n"+
"\t Free\t: "+ getdiskfree("/sd-ext","m")+" MB\n\n"+

"SD-EXT2 Size\t: "+getdisksize("/sd-ext2","m")+" MB\n"+
"\t Free\t: "+ getdiskfree("/sd-ext2","m")+" MB\n\n\n"+

"Press Next to Continue the Installation...",

#-- Icon
"icons/welcome"
);

###################################################################################################################
#
# STEP 3 - SHOW SELECTBOX - Install Type
#
selectbox(
#-- Title
"Install Type",

#-- Sub Title
"Please Select the install type:",

#-- Icon
"icons/apps",

#-- Will be saved in /tmp/aroma/installtype.prop
"installtype.prop",

#-- Group 1
"Install Location", "", 2, #-- Group 1. key = "selected.1"

"NAND",
"system@NAND, data@NAND, boot@NAND\nFor T-Mobile USA HD2 (LEO 1024)", 0, #-- selected.1 = 1

"NAND with DataOnEXT",
"system@NAND, data@EXT4, boot@NAND\nFor EU/International HD2 (LEO 512)", 0, #-- selected.1 = 2

"NativeSD (Everything on the SD card)",
"system@EXT4, data@EXT4, boot@FAT32\nFor high speed read/write SD Card", 0, #-- selected.1 = 3

"DirectSD (Everything on the SD card)",
"system@EXT4, data@EXT4, boot@FAT32\nFor high speed read/write SD Card", 1, #-- selected.1 = 4
"DirectSD (Everything on the SD card)",
"system@EXT4, data@f2fs, boot@FAT32\nFor high speed read/write SD Card", 0 #-- selected.1 = 5
);

if (prop("installtype.prop", "selected.1") == "1" ||
prop("installtype.prop", "selected.1") == "2") then
writetmpfile("kernel.prop", "NAND=yes");
zipexec("kernel/nativesd.sh");
else
writetmpfile("kernel.prop", "NAND=no");
endif;

##############################
# Mount the SD-EXT partition #
##############################

if (prop("installtype.prop", "selected.1") == "2" ||
prop("installtype.prop", "selected.1") == "3") then

pleasewait("Mounting the SD-EXT Partition...");
zipexec("kernel/SD-EXT_mounter.sh");
setvar("mount_result", getvar("exec_buffer"));
zipexec("kernel/nativesd.sh");

if file_getprop("/tmp/mount.prop", "status") != "mounted" then

#######################
# No SD-EXT Partition #
#######################

# Set Next Text to 'Exit'
ini_set("text_next", "Exit");

textbox(
"Mounting SD-EXT failed!",
"Please create an EXT4 partition (mmcblk0p2) on the SD Card first.",
"icons/alert",
"Error messages:\n\n"+getvar("mount_result")
);

#-- Back to Menu
back("1");

endif;

endif;

if (prop("installtype.prop", "selected.1") == "4" ||
prop("installtype.prop", "selected.1") == "5") then

pleasewait("Mounting the SD-EXT Partition...");
zipexec("kernel/DirectSD_mounter.sh");
setvar("mount_result", getvar("exec_buffer"));
zipexec("kernel/nativesd.sh");

if file_getprop("/tmp/mount.prop", "status") != "mounted" then

#######################
# No SD-EXT Partition #
#######################

# Set Next Text to 'Exit'
ini_set("text_next", "Exit");

textbox(
"Mounting SD-EXT failed!",
"Please create an EXT4 partition (mmcblk0p2) on the SD Card first.",
"icons/alert",
"Error messages:\n\n"+getvar("mount_result")
);

#-- Back to Menu
back("1");

endif;

endif;

# Swap partition activation - run the check for sdcard swap partition
pleasewait("Checking SDCard for Swap Partition.");
zipexec("mods/swap-partition-activator/install/checkforswap.sh");
###################################################################################################################
#
# STEP 4 - SHOW SELECTBOX - ROM Mods
#
selectbox(
#-- Title
"ROM Mods",

#-- Sub Title
"Please Select the ROM Mods:",

#-- Icon
"icons/personalize",

#-- Will be saved in /tmp/aroma/mods.prop
"mods.prop",

#-- Group 1
"Default Connection Type","",2,
"RMNET Connection",
"Please Choose RMNET for MAGLDR bootloader.",	iif((file_getprop("/tmp/nfo.prop", "bootloader") == "MAGLDR"), 1, 0),
"PPP Connection",
"All bootloaders support PPP.",	iif((file_getprop("/tmp/nfo.prop", "bootloader") == "MAGLDR"), 0, 1),

# Group 2
"Activate RAM Pages Swapping","",2,
"Yes",
"You must have a pre-made swap partition on your SDcard!", iif((file_getprop("/tmp/checkforswap.prop", "swap.present") == "yes"), 1, 0),
"No",
"Swapping will be deactivated.\n\n", iif((file_getprop("/tmp/checkforswap.prop", "swap.present") == "no"), 1, 0),

#-- Group 3
"Wipe","",2,
"Wipe Dalvik-Cache",
"Select it to wipe Dalvik-Cache.",	1,
"Wipe Data/Factory Reset",
"Select it to wipe data/factory reset.",	0,
"No Wipe",
"Select it to keep everything.",	0

);

####################
# Installation Ready
####################
ini_set("text_next", "Install Now");
viewbox(
"Installation Ready",
"The wizard is ready to begin installation.\n\n"+
"Press <b>Install Now</b> to begin the installation.\n\n"+
"If you want to review or change any of your installation settings, press <b>Back</b> or Press Menu Key -> Quit Installation to exit the wizard.",
"@install"
);

#####################
# Start Install
#####################
ini_set("text_next", "Finish");
install(
"Installing",
"<b>"+ini_get("rom_name")+"</b> is being installed.\n\n"+
"Please wait while installation wizard installs <b>"+ini_get("rom_name")+
"</b>. This may take several minutes.",
"@install",
"The installation wizard has successfully installed <b>"+ini_get("rom_name")
);

# Set Next Text fo Exit
ini_set("text_next", "Exit");

viewbox(
"Installation Completed",
"<#080>Congratulation</#>\n\n"+
"Please press Exit and Reboot your HD2",
"icons/info"
);

Detailed rundown of process.

Aroma config copies all pertinent files to /aroma config.

Choices are made by user in aroma installer, specified mount script is run and nativesd.sh is executed as long as an install type is chosen.

Nativesd.sh reads the install type and bootloader and modifies the nand ramdisk accordingly, mkbootimg.sh is run if using clk.

Updater-script then runs - it has been stripped down so all it should do is the copying of all the other ROM stuff from the zip (system, sdcard, etc.), runs a script to copy initrd and zImage to /boot (if using magldr). Should theoretically be able to strip updater-script down further...

Attached is the modification for SlimKat - (all credits to ROM dev.)

kernel folder fully replaces the one in the ROM zip. META-INF and system are merged.

All essentially untested - will post the recovery needed for f2fs install in due course.

Edit. new zip - moved around a few things.

Edit. modified nativesd.sh on the assumption that the aroma folder can only be written to be aroma.

#!/bin/sh

export ROM_NAME=` cat 'ROM_NAME.prop' | sed 's/ROM_NAME=//g' `
export install_type=` cat 'installtype.prop' | sed 's/selected.1=//g' `
export bootloader=` cat 'nfo.prop' | sed 's/bootloader=//g' `

cp /tmp/aroma/zImage /tmp/zImage
mkdir -p /tmp/work/ing
cp /tmp/aroma/initrd.gz /tmp/initrd-test.gz
cd /tmp/work/ing
# unzipping nand kernel
gzip -d -c ../initrd-test.gz | cpio -i -d
mkdir bin
cd ..
cp /tmp/aroma/busybox ing/bin/busybox
cp /tmp/aroma/e2fsck ing/bin/e2fsck
chmod 0777 ing/bin/busybox
chmod 0777 ing/bin/e2fsck
# Modifying ramdisk to not use yaffs, and use sd partitions instead.
if [ "${install_type}" -gt 2 ]; then
sed -i '/mtd@misc/s/^/#/' ing/ueventd.htcleo.rc
sed -i '/mount yaffs2/s/^/#/
s/# #/# /g' ing/init.rc
sed -i "s/rOm/$ROM_NAME/g" ing/mountfs${install_type}.sh
sed -i 's/auto/ext4/g' ing/mountfs${install_type}.sh
fi
# Checking if anything other than nand is to be installed
if [ "${install_type}" -gt 1 ]; then
sed -i '/on fs/ a exec /mountfs'${install_type}'.sh' ing/init.rc
cp /tmp/aroma/mountfs${install_type}.sh ing/mountfs${install_type}.sh
sed -i "s/rOm/$ROM_NAME/g" ing/mountfs${install_type}.sh
chmod 0777 ing/mountfs${install_type}.sh
chmod 0750 ing/init.rc
chmod 0644 ing/ueventd.htcleo.rc
fi
# Building new ramdisk
cd ing
find .| cpio -o -H newc | gzip -9 > ../initrd-done.gz
cd ..
# Checking bootloader
if [ "${bootloader}" != "cLK" ]; then
cp /tmp/aroma/6MB /tmp/work/6MB
cat initrd-done.gz >> 6MB
cp 6MB initrd6MB.gz
else
cp initrd-done.gz /tmp/initrd.gz
cp /tmp/aroma/mkbootimg /tmp/mkbootimg
cp /tmp/aroma/mkbootimg.sh /tmp/mkbootimg.sh
chmod 0755 /tmp/mkbootimg
chmod 0755 /tmp/mkbootimg.sh
exec /tmp/mkbootimg.sh
fi
#Checking if nand install
if [ "${install_type}" -lt 3 ]; then
cp initrd6MB.gz tmp/initrd.gz
else
cp initrd6MB.gz boot/initrd.gz
cp initrd6MB.gz boot_dir/initrd.gz
cp /tmp/zImage boot/zImage
cp /tmp/zImage boot_dir/zImage
fi
# Copying tmp and open ramdisk folders to sdcard (NativeSD folder)
mkdir -p boot/tmp
cp -r /tmp/* /boot/tmp/

Edit - f2fs arm binaries (v.1.2) I build are found here => http://ubuntuone.com/3EuJUW5lV9MMj1WJzhzFYo for those that know what to do with them. New zip added.