I made progress with porting ubuntu touch utopic based on the latest porting guide. I got the FS to mount properly, but wcnss_8960 module is causing a kernel panic. (I will try with MoKee's kernel later)
How I set up my build directory: I followed
https://wiki.ubuntu.com/Touch/Porting#Enabling_a_new_device and added kernel, device, and vendor trees from M1cha's github repository, CM11 branch (Their wiki is outdated, obviously CM11 corresponds to 4.4.2 and above) I didn't edit device.mk and BoardConfig.mk.
I'm not sure how to go about porting apparmor; but I imagine we could take the mako-aa3-backport branch and look at the changes to the defconfig and follow
https://wiki.ubuntu.com/SecurityTeam/AppArmorForPhabletKernels .
rootstock_touch_install is just a shell-script that copies things around when in adb recovery. I'm using M1cha's CWM TDB recovery and there were no issues there. If you notice, on line 49 prepare_ubuntu_system() just creates the FS .img at /data. To get it to work with TDB on my second partition, I booted into recovery, selected System 2, selected Mounts and Storage, wiped /system and /data then mounted /system, /cache, and /data, then I ran ./rootstock-touch-install ./utopic-preinstalled-touch-armhf.tar.gz ../system.img . My System 1 is untouched.
I encountered tomheng's error at the top of this thread; I edited /hardware/qcom/display/msm8960/common.mk , line 17 to become " common_flags += -Werror -Wno-error=narrowing "
The rootfs not being mounted correctly is because the initrd attempts to mount /dev/mmcblk0p26 at /tmpmnt ; follow
http://forum.xda-developers.com/showthread.php?t=1413308 this guide to take apart boot.img and look in /initrd/scripts/touch . I'm not sure if it's due to TDB or if the same situation happens without TDB enabled, but look at how CWM recovery and other ROMs mount a specific data partition; they mount /dev/mmcblk0p26 to /data_root and then they mount -o bind /data_root/systemX /data (where X is your 0th or 1st partition.) . So edit and repack the boot.img after editing the touch script:
http://pastebin.com/3LnMvWFZ (lines 72 and 105 are the lines in question). This is the mkbootimg command I used:
http://pastebin.com/Te7ekAxD
Kernel seems to boot well, except for one thing
http://pastebin.com/EA7jNTK3 Why does wcnss_8960 crash (I think it's the networking driver?)
BTW, is there an IRC channel where you guys hang out in... I'm interested in CM dev and idle on IRC 24/7, i heard in #miuiandroid on freenode that most dev goes on in G+ hangouts