Help Needed - Halium 9 building - Xperia XZ1c (lilac)
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)
- Previously - Built AOSP 11 using sony guide - learned how basic tools and repo work
- Previously - Building crDroid based on android 10 - learned what are manifest, device tree, kernel, vendor etc.
- Now - Building Halium 9 - learned what is project treble, GSI
- Step 1 -
repo init -u https://github.com/Halium/android -b halium-9.0note that
--depth=1didn't work for me
- Step 2 -
- Step 3 - added local manifest in
~/.repo/local_manifests/roomservice.xmland repo sync
<manifest> <!-- 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"/> </manifest>
- Step 4 - Applied patches by running
. apply-patches.shoutput here with one warning
- Step 5 - Here I stopped...
Make your device tree inherit from halium.mk (...):
Ok , I understood that I need to change my
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk) # Inherit device configuration $(call inherit-product, device/sony/lilac/device.mk) ### LINEAGE $(call inherit-product, vendor/lineage/config/common_full_phone.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) # $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/halium.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk) # Inherit device configuration $(call inherit-product, device/sony/lilac/device.mk) ### LINEAGE # $(call inherit-product, vendor/lineage/config/common_full_phone.mk)
Changes: commented full_base_telephony.mk and lineageOS stuff added halium.mk 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
device.mk, no in your vendor tree's /lilac-vendor.mk, 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.
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/sonyin 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: https://github.com/ubports/porting-notes/wiki/Generic-system-image-(GSI)#how-to-build-patched-kernel-or-halium-boot . (also per sideload I guess)
Then only wipe the data partition, from within twrp (there should be a menu format->data).
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.
saveurlinux last edited by
Have you progress in porting this device ?
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.
Thank you I'll try, when I have some time!
Tbh, I started working on postmarketOS build as documentation is more clear for me (new to porting), but I'll watch both guides and maybe I'll finally manage to do at least one of linux for lilac.
(I prepared device APKBUILD, sucessfully compiled kernel and flashed it to device but I don't know what actually happened. Only thing that tells device is on is slightly glowing sony logo like on calculator. I have to try connecting to device by ssh or telnet. However maybe someone could help me proceed by preparing kernel path that adds blobs to kernel. Something like this was done for older kernel, diffrent commit, which breaks on newer build, so maybe it can be corrected?)
I asked on pmOS buliding group for help. I got extra information about this device. Something like "It has really broken UFS that want's to delete itself so be carefull while minelining it"
Any way for an XZ1 (poplar) owner to help with this? Or are the two device versions too different?