need help to port ubuntu touch on Xiaomi MI2s


tomheng

Members
5 Jun 2014
6
13
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.

Code:
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.
 
I don't understand why... Roms don't need (and have) knowledge about TDB, or do they ...
they have to. Try booting any n4 rom on your mi2, it won't boot, why? partitions aren't mounted in the right way because of tdb

Sent from my nexus 7
 
@linuxx stop talking s**t :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.
 
@linuxx stop talking s**t :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.

Then how is possible that Mako build is based on CM11?
 
@linuxx stop talking s**t :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

https://lists.launchpad.net/ubuntu-phone/msg06352.html

2.AOSP-based 4.4.2 Phablet repositories are now available

https://lists.launchpad.net/ubuntu-phone/msg06378.html

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

https://lists.launchpad.net/ubuntu-phone/msg06531.html

Besides above, in the new tutorial(indeed not newest) https://wiki.ubuntu.com/Touch/Porting.

Code:
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.
 
That's weird because the "Enabling a new device" section still uses cm-10.2
 
That's weird because the "Enabling a new device" section still uses cm-10.2

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.
 
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
 
I'd rather start from scratch using n4 sources because mokee and Ivan made many changes to aosp sources

Sent from my MI 2 using Tapatalk
 
  • Like
Reactions: MSephiroth
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 device.mk and BoardConfig.mk to aries dir, then modify something to suit mi2s.

2. modify TARGET_KERNEL_UBUNTU_META in BoardConfig.mk 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.
 
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
 
Last edited: