Help Needed - Halium 9 building - Xperia XZ1c (lilac)

  • Hi,

    I try to build halium 9 for Sony xperia xz1 compact codname "lilac".
    It was shipped with android 8 then updated to 9. It has quiet good support on XDA I mean repositories, device tree, vendor.

    I'm just passionate not experienced dev, but I'm determined and I like learning :).

    My building machine is (fortunately, only for some time) xubuntu 18.04 12GB ram, 12GB SWAP HDD 1tb, intel i5-5200u 4 threads. then something 2 times better when I'll finish my PC.

    I visited XDA for custom roms building guides, Lineage site and the halium, ubports porting guide but then redirected here and here

    Here are needed device configuration, branch lineage-16 (Note that the manifest is slightly different, but it's explained in only one issue in this repository)

    My steps:

    1. Previously - Built AOSP 11 using sony guide - learned how basic tools and repo work
    2. Previously - Building crDroid based on android 10 - learned what are manifest, device tree, kernel, vendor etc.
    3. Now - Building Halium 9 - learned what is project treble, GSI
    • Step 1 - repo init -u -b halium-9.0 note that --depth=1 didn't work for me
    • Step 2 - repo sync
    • Step 3 - added local manifest in ~/.repo/local_manifests/roomservice.xml and repo sync
    <!-- SONY -->
    <project name="whatawurst/android_kernel_sony_msm8998" path="kernel/sony/msm8998" remote="github"/>
    <project name="whatawurst/android_device_sony_common-treble" path="device/sony/common-treble" remote="github"/>
    <project name="whatawurst/android_device_sony_yoshino" path="device/sony/yoshino" remote="github"/>
    <project name="whatawurst/android_device_sony_lilac" path="device/sony/lilac" remote="github"/>
    <!-- Pinned blobs for lilac -->
    <project name="whatawurst/android_vendor_sony_lilac" path="vendor/sony/lilac" remote="github"/>
    • Step 4 - Applied patches by running cd ~/hybris-patches then . output here with one warning
    • Step 5 - Here I stopped...
      Make your device tree inherit from (...):
      Ok , I understood that I need to change my ~/device/sony/lilac/
    $(call inherit-product, $(SRC_TARGET_DIR)/product/
    $(call inherit-product, $(SRC_TARGET_DIR)/product/
    $(call inherit-product, $(SRC_TARGET_DIR)/product/
    # Inherit device configuration
    $(call inherit-product, device/sony/lilac/
    ### LINEAGE
    $(call inherit-product, vendor/lineage/config/


    $(call inherit-product, $(SRC_TARGET_DIR)/product/
    # $(call inherit-product, $(SRC_TARGET_DIR)/product/
    $(call inherit-product, $(SRC_TARGET_DIR)/product/
    $(call inherit-product, $(SRC_TARGET_DIR)/product/
    # Inherit device configuration
    $(call inherit-product, device/sony/lilac/
    ### LINEAGE
    # $(call inherit-product, vendor/lineage/config/

    Changes: commented and lineageOS stuff added instead

    Unfortunately I have no idea what to do with: "remove Java-dependent parts" what is that file, where is it located?

    I know I need to learn muuuch more, could you help my find some guides, documentation related to this. What statement should I search for?

    Thanks in advance! 🙂

  • @BigB For example in, no in your vendor tree's /, there may be Categories like PRODUCT_BOOT_JARS, where you would have to remove or comment out the packages, which are listed under these categories. (JARs are Java binaries).
    There may be other places with Java-packages, but I would recommend to focus on the mk-Files in the device root directory first, and then see if it compiles.
    I believe, that the hybris-patch is trying to find and remove most of that java-dependencies already.

  • @Luksus

    Thank you for replying! I almost understood 🙂

    I'm still, not sure only where I should search mentioned .mk files - what is exactly device root directory you mentioned? Is it~/device/sony in my case?

    However I tired to make halium-boot hoped that hybris-patches did all job and build complied successfully.

    Then I got my device with stock firmware and TWRP, then wiped data, flashed halium-boot as boot and GSI zip.

    Device didn't booted in UT and didn't returned to recovery so I went to TWRP by pressing buttons, wiped all partitions and re-flashed both files and nothing happened.

    I tired same thing with lineage as system befor UT, with no change.

  • I also struggled at this Java dependencies, it's a bit different for every phone and I just looked at the commits of other ports to find out, what needs to be done... but if it builds I would not think further about it. Perhaps it is mainly important for building the system image, what you are not doing anyway.

    If you are using the GSI zip, you should have a working (original) vendor partition. So I would recommend to flash an android 9 stock rom again and then flash boot again.
    Then you need to apply the GSI via twrp sideload.
    If you did not modify the kernel, it is necessary to also apply the apparmor_enapler patch and the halium_ramdisk as described here: . (also per sideload I guess)

    Then only wipe the data partition, from within twrp (there should be a menu format->data).

    Then reboot.

  • @Luksus

    Thanks for reply and spending your time helping me understand 🙂

    Unfortunately there's still no success.

    I think I just missed something important before. I'll start from beginning. I'll Read everything once again. And than try, not to consume more time. I'll try then to make step list. Eventually I'll wait for Halium 9 full documentation.

  • Have you progress in porting this device ?

  • @saveurlinux

    Thanks for interesting 🙂 I really wish I coud do that asap. I decided to read some books about linux in general because I feel that I need to understand much more to proceed... However I really want to do it especially because postmarketOS has problems with booting on this device. I'll write here about progress.

Log in to reply