need help to port ubuntu touch on Xiaomi MI2s

Jun 5, 2014
I am trying to port ubuntu touch to Xiaomi MI2s with m1cha repo code (cm 11.0)for MI2s, but some errors happened when compliling.

hardware/qcom/display/msm8960/libgralloc/gpu.cpp: In constructor 'gralloc::gpu_context_t::gpu_context_t(const private_module_t*, gralloc::IAllocController*)':
hardware/qcom/display/msm8960/libgralloc/gpu.cpp:49:5: error: 'allocSize' was not declared in this scope
make: *** [/home/tom/git/ubuntu_touch/out/target/product/aries/obj/SHARED_LIBRARIES/gralloc.msm8960_intermediates/gpu.o] Error 1
any help will be apprecited.
Jun 5, 2014
@linuxx stop talking **** :D
TDB only is a problem if you install the ROM to system2.

Anyway the problem with UbuntuTouch is that they use cm-10.2 as base and we don't have working sources for that.
@M1cha I think that Ubuntu touch is Base on Aosp 4.4.2, so may be we can try to build it for mi2s.

below is something info about that.

1.Call for testing: experimental 4.4.2 based images

2.AOSP-based 4.4.2 Phablet repositories are now available

3.AOSP 4.4.2 based images are finally available via the trusty-proposed channel

Besides above, in the new tutorial(indeed not newest)

phablet-dev-bootstrap --sources aosp --repo-branch phablet-4.4.2_r1 -c [target_directory]
phablet-4.4.2_r1 may be referered to AOSP 4.4.2。

Though i am newbie to ROM build(actually i am a php engineer), I will try to recompile it again.
May 29, 2011
But it sounds like they use AOSP now but mi2 doesn't work with AOSP.
I hope we can merge their code into CM11.
Jul 6, 2013
Maybe they have no time to update the wiki fully or something else.

but according to their mail list archives, they actually move to 4.4.2 .
But it sounds like they use AOSP now but mi2 doesn't work with AOSP.
I hope we can merge their code into CM11.
Yes they do, I asked to one of the dev of core apps, they use aosp and or cm11 as base for builds. So there are a lot of things to fix but it's easier

Sent from my nexus 7
Jun 5, 2014
Likes: MSephiroth
Jun 5, 2014
I had built it and installed it on mi2s last night, but it failed to boot.

It is a more smooth progress than i thought originally, what i do is list below.

1. copy mako and to aries dir, then modify something to suit mi2s.

2. modify TARGET_KERNEL_UBUNTU_META in to use mako kernel.

i dont know how to build kernel for ubuntu touch. finally, i got recovery.img, boot.img, system.img.

3. use rootstock-touch-install tool to flash it(some fixed, but succeed finally).

it went to black screen, after flash new recovery image, but adb can connect with the device.

The screen is black when booting to the normal mode. i found ubuntu touch rootfs is not mounted correctly by adb shell.

so, i guess the kernel or rootstock install step make some errors.
May 9, 2014
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 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 and
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 .
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/ , 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 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: (lines 72 and 105 are the lines in question). This is the mkbootimg command I used:
Kernel seems to boot well, except for one thing 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
Last edited: