Flashing Ubuntu Touch to ZUK Z1

  • Hi, I am now back at the state where I can successfully compile UT. All .img files are generated.
    Now i am using fastboot to flash boot and recovery and everything seems to be fine.
    Recovery boots without errors (The keys are weird, i have no button to 'select' an entry, only up/down are working, but thats another topic)

    Ok, then i am trying to flash the system with:
    ./rootstock-touch-install Downloads/debug/vivid-preinstalled-touch-armhf.tar.gz phablet/out/target/product/ham/system.img

    After that, i can't boot it because i am stuck at the vendor-logo.
    Back in recovery i have no last_kmsg file.

    I took a look at the directory structure using adb shell while the phone is in recovery and i noticed the following:
    I have the folder /data, but it is empty, besides a 'media' folder (which is empty).

    Do you have any idea what is wrong here?

  • The problem seems to be, that recovery isn't mounting

    /dev/block/platform/msm_sdcc.1/by-name/userdata as /data

    I mounted it manually now, then flashed the system.img but it still doesn't boot.
    Maybe that is also because it doesnt mout userdata correctyl.

    Can someone please help me? Where can i adjust those mountpoints?

  • Dont use ubuntu's recovery. It sucks way too much. Use TWRP. Ubuntu's recovery is very unstable. Use it only to check if your kernel build is fine. If your data is empty then ubuntu's system.img is not getting created. Also you need 70-device.rules file where you specify all the udev rules for ubuntu's init to mount dev folder properly. And also adbd.conf to configure adbd on preboot so you get logcats. Check here how they have done.


  • Thanks for the hint.
    I assume i have to modify the content of the config files to match my productID and vendorID?
    But where can i get the udev file for my device? I read the UT porting guide and it says:

    You can create the udev rules file by invoking the following command while Ubuntu is booted:
    adb shell cat /var/lib/lxc/android/rootfs/ueventd*.rc|grep ^/dev|sed -e 's/^/dev///'|awk '{printf "ACTION=="add", KERNEL=="%s", OWNER="%s", GROUP="%s", MODE="%s"\n",$1,$3,$4,$2}' | sed -e 's/\r//'

    BUT i cant boot ubuntu yet... So where to get the udev rules? do i have to create them manually?
    I tried to use mariogrip's udev rules for his oneplus one (same system on chip) but it still doesn't boot 😞

  • No you You have to use your phone's current udev rules file to port udev rules to Ubuntu readble format. More specifically all /dev rules in your Android udev files need to be copied to Ubuntu udev. You can check Mako's udev to get the ideas how to copy Android udev rules to Ubuntu readable one.

  • Part of my problem was, that the BoardConfig.mk form cyanogenmod declares the variables

    BOARD_RAMDISK_OFFSET := 0x02000000

    Those variables are not used by the ubuntu makefiles, so i changed those two lines to:

    BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x02000000 --tags_offset 0x01E00000

    Sadly, it still doesn't boot.

  • can u send me link to last_kmsg? I am getting them now. When your device bootloops reboot back to bootloader directly and then boot (not flash) recovery.img from ubuntu build. Then get the last_kmsg and dmesg with following command:

    adb shell cat /proc/last_kmsg > last_kmsg

    And then pastebin it and send me link. I'll see if i can help.

  • This post is deleted!

  • I have no bootloop. The phone just gets stuck, showing me the vendor-logo (no lsusb entry and no adb).
    I can user power+volup+voldown to get into recovery but i never had the /proc/last_kmsg file.

    What i did so far:
    I unpacked my boot.img and double checked that all parameters (pagesize, base, ramdisk-offset, tags-offset) are exactly the same as in the boot.img from a recent cyanogenmod nightly.
    I also made sure that the dt.img is exactly the same by repacking my boot.img with the dt.img from cyanogenmod.

  • @ChrisLuck Dont worry about lsusb. Even i am not getting that right now. Give me your github sources link. Let me look at that. I am getting recovery logs now. Thankfully. But unfortunately there's not much support out there so progress is very slow.

  • @ChrisLuck can you publish sources? i am porting CM to lenovo vibe z2 pro and i'd like to port ubuntu to it. thank you

  • @frantisheq That looks like a nice phone to me, never heard about it before. You might have more luck than me with this one as it is running KitKat 🙂
    I got the Z1 booting into adb but that is all i achieved. Everything that relies on the vendor-blobs (like graphics, network ...) is not working. The reason for this is most likely the fact, that I only have vendor blobs for android 5.1.1 which don't match the Kitkat Android that is used in Ubuntu Touch.

    I will not upload my sources as i don't know how to do that in a clean way but i would love to help you in getting your port booting to adb.

    Since your phone is not supported by Cyanogenmod (that's where I got the kernel and device sources for mine) your best bet might be to use the device/kernel from the oneplus one. The SOC is the same, so booting (without graphics and so on) might work with those sources.

    One problem you will have is, that you can't get the device tree sources for your device. One way to get around this is to dump your Android boot.img and extract the dt.img from there with the unpackbootimg tool.
    Note: There is a difference between the 'device' folder in your build directory and the device-tree i am talking about right now. That is something that confused me in the beginning.
    You can get an introduction to device trees here.

    I am also a beginner at all of this but I would love to help, so let me know if you need help 🙂

  • thanks, i have kernel sources for 4.4 nad 5.0 and already working CM12.1 here http://forum.xda-developers.com/t/k920
    i'll just try to port cm11 first and then we'll see

  • Hi, I'd really love to have Ubuntu touch on my zuk but I know barely anything.
    Can someone help me? Thanks

  • Hi Frano212,
    I stopped working on the port. It does boot up into adb but graphics and so on are not working. It is very hard to get help, so i will just buy the new meizu pro 5 ....

Log in to reply