[HTC One X] teemo:
Please welcome HTC Sense to the New Layout.

Converting Sense5 4.2.2 to the New Layout

Note: If you have no experience with the tools below used in this Sense-kitchen, please get familiar with the tools before starting. I will not explain usage of these.

Here is the recipe for cooking:

1. [URL="https://www.google.com/search?biw=1738&bih=1168&tbm=isch&sa=1&q=%22rom%22+%22sense%22+%224.2.2%22+%22One+X%22&oq=%22rom%22+%22sense%22+%224.2.2%22+%22One+X%22&gs_l=img.3...5327.20386.0.21299.21.21.0.0.0.0.162.2230.8j13.21.0.msedr...0...1c.1.62.img..16.5.558.jJPai_hXmeM"]ROM[/URL]
2. [URL="http://ibotpeaches.github.io/Apktool/"]apktool[/URL]
3. for linux: [URL="https://www.google.com/search?num=100&q=mkbootimage+split_boot+repack_ramdisk&oq=mkbootimage+split_boot+repack_ramdisk&gs_l=serp.3..30i10.1279477.1286274.0.1286536.7.7.0.0.0.0.393.1044.1j4j0j1.6.0.msedr...0...1c.1.62.serp..2.5.944.-8VGBiQkl8c"]mkbootimage + split_boot + repack_ramdisk[/URL]
alternatively for windows: [URL="https://www.google.com/search?site=&source=hp&q=bootimg_tools_windows&oq=bootimg_tools_windows&gs_l=hp.3..0i13i30.8539.8539.0.8711.2.2.0.0.0.0.166.311.0j2.2.0.msedr...0...1c.1.62.hp..1.1.143.0.SW4IYGUKG_A&gws_rd=cr&ei=hav9VJm6FqjQ7AbyjYCICQ"]bootimg_tools_windows[/URL]
4. Apply The "patch"

Short instructions:

1. Edit the storage_list in the ROMs framework. Just change parameters for the sdcard.

2. Remove sdcard from vold.fstab, we fuse it in the ramdisk.

3. Update the ROMs updater-script. Pay special attention to any mmcblk0p15 entries. Change it to mmcblk0p14. Some scripts want to wipe Data (if asked), comment it away (or it will wipe data and sdcard).

4. The RAM Disk. One important point here: Use the old command for the sdcard service.

Additionally: Be aware of scripts adding "UMS features/helpers/whatever". I have currently a windows popup asking me to format "F:". This came from converting the lONElyX kernel.

The "patch":

ROM
1.
/system/frameworks/framework-res.apk
apktool d framework-res.apk
frameworks-res/res/xml/storage-list.xml
- <storage android:mountPoint="/storage/sdcard0" whatever .... />
+ <storage android:mountPoint="/storage/sdcard0" android:storageDescription="@string/storage_internal" android:primary="true" android:emulated="true" android:mtpReserve="100" />
apktool b framework-res
new framework will be in frameworks-res/dist
open new framework-res.apk and
add original META-INF and
replace AndroidManifest.xml with the original
2.
system/etc/vold.fstab
- dev_mount sdcard /storage/sdcard0 emmc /devices/platform/sdhci-tegra.3/mmc_host/mmc0
+ #dev_mount sdcard /storage/sdcard0 emmc /devices/platform/sdhci-tegra.3/mmc_host/mmc0
3.
META-INF/com/google/android/updater-script
- mount("ext4", "EMMC", "/dev/block/mmcblk0p15", "/data");
+ mount("ext4", "EMMC", "/dev/block/mmcblk0p14", "/data");
4.
boot.img
split_boot boot.img
boot/ramdisk/init.endeavoru.common.rc
- # for backwards compatibility
- export EXTERNAL_STORAGE /storage/sdcard0
- mkdir /storage 0050 system sdcard_r
- mkdir /storage/sdcard0 0000 system system
- symlink /storage/sdcard0 /sdcard
- symlink /storage/sdcard0 /mnt/sdcard
+ on init
+ # See storage config details at http://source.android.com/tech/storage/
+ mkdir /mnt/shell/emulated 0700 shell shell
+ mkdir /storage/emulated 0555 root root
+
+ export EXTERNAL_STORAGE /storage/emulated/legacy
+ export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
+ export EMULATED_STORAGE_TARGET /storage/emulated
+
+ # Support legacy paths
+ symlink /storage/emulated/legacy /sdcard
+ symlink /storage/emulated/legacy /mnt/sdcard
+ symlink /storage/emulated/legacy /storage/sdcard0
+ symlink /mnt/shell/emulated/0 /storage/emulated/legacy
+ # Our old /data partition
+ mkdir /xtradata
on fs

+ setprop ro.crypto.umount_sd false
+ setprop ro.crypto.fuse_sdcard true
+
on post-fs-data
+ mkdir /data/media 0770 media_rw media_rw

- /dev/block/platform/sdhci-tegra.3/by-name/UDA \
+ /dev/block/platform/sdhci-tegra.3/by-name/ISD \

+ # virtual sdcard daemon running as media_rw (1023)
+ service sdcard /system/bin/sdcard /data/media /mnt/shell/emulated 1023 1023
+ class late_start
#eof

boot/ramdisk/init.rc
mkdir /cache 0770 system cache
mkdir /config 0500 root root

+ # See storage config details at http://source.android.com/tech/storage/
+ mkdir /mnt/shell 0700 shell shell
+ mkdir /mnt/media_rw 0700 media_rw media_rw
+ mkdir /storage 0751 root sdcard_r

# Directory for putting things only root should see.

boot/ramdisk/fstab.endeavoru
- /dev/block/platform/sdhci-tegra.3/by-name/APP /system ext4 ro wait
- /dev/block/platform/sdhci-tegra.3/by-name/UDA /data ext4 noatime,nosuid,nodev,noauto_da_alloc wait,encryptable=/dev/block/platform/sdhci-tegra.3/by-name/DUM
- /dev/block/platform/sdhci-tegra.3/by-name/CAC /cache ext4 noatime,nosuid,nodev,noauto_da_alloc wait
- /dev/block/platform/sdhci-tegra.3/by-name/RCA /rca ext4 noatime,ro wait
- /dev/block/platform/sdhci-tegra.3/by-name/RFS /rfs ext4 noatime,rw wait
- /dev/block/platform/sdhci-tegra.3/by-name/DLG /devlog ext4 nosuid,nodev defaults
+ # New Layout #
+ /dev/block/platform/sdhci-tegra.3/by-name/APP /system ext4 ro,barrier=0 wait
+ /dev/block/platform/sdhci-tegra.3/by-name/CAC /cache ext4 noatime,nosuid,nodev,noauto_da_alloc,barrier=0 wait,check
+ /dev/block/platform/sdhci-tegra.3/by-name/RCA /rca ext4 noatime,rw,barrier=0 wait
+ /dev/block/platform/sdhci-tegra.3/by-name/RFS /rfs ext4 noatime,rw,barrier=0 wait
+ /dev/block/platform/sdhci-tegra.3/by-name/DLG /devlog ext4 nosuid,nodev,barrier=0 defaults
+ /dev/block/platform/sdhci-tegra.3/by-name/UDA /xtradata ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait
+ /dev/block/platform/sdhci-tegra.3/by-name/ISD /data ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,encryptable=/dev/block/platform/sdhci-tegra.3/by-name/DUM

cd boot
repack_ramdisk ramdisk
mkbootimg --kernel boot.img-kernel --ramdisk new-ramdisk.cpio.gz -o boot-newlayout.img
boot-newlayout -> rom.zip/boot.img

NOTE: The "patch" below is not automatic. It must be "applied" by hand :)