Build /e/ for Sony Xperia XZ1 Compact (lilac - not 'lily'!)

I have a Sony Xperia XZ1 Compact on its way from Ebay, so I thought I might try building an unoffical /e/ ROM for it. The device isn’t officially supported by LOS, but there is an unofficial LOS 17.1 build available on XDA

The source is available at https://github.com/cryptomilk/android_device_sony_lilac/tree/lineage-17.1

According to the README.md file, the local manifest needs to contain the following

<?xml version="1.0" encoding="UTF-8"?>
  <manifest>
      <!-- SONY -->
      <project name="cryptomilk/android_kernel_sony_msm8998" path="kernel/sony/msm8998" remote="github" revision="lineage-17.1" />
      <project name="cryptomilk/android_device_sony_common-treble" path="device/sony/common-treble" remote="github" revision="lineage-17.1" />
      <project name="cryptomilk/android_device_sony_yoshino" path="device/sony/yoshino" remote="github" revision="lineage-17.1" />
      <project name="cryptomilk/android_device_sony_lilac" path="device/sony/lilac" remote="github" revision="lineage-17.1" />

      <!-- Pinned blobs for lilac -->
      <project name="cryptomilk/android_vendor_sony_lilac" path="vendor/sony/lilac" remote="github" revision="lineage-17.1" />
  </manifest>

So if I create a manifest with that content in the /srv/e/manifests directory will docker pick up the correct files if I run the recommended command?

 docker run \
-v "/srv/e/src:/srv/src" \
-v "/srv/e/zips:/srv/zips" \
-v "/srv/e/logs:/srv/logs" \
-v "/srv/e/manifests:/srv/local_manifests" \
-v "/srv/e/ccache:/srv/ccache" \
-e "CCACHE_SIZE=100G" \
-e "BRANCH_NAME=v0.9-pie" \
-e "DEVICE_LIST=lily" \
-e "REPO=https://gitlab.e.foundation/e/os/releases.git" \
registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community

Is there anything else I need to add?

Thanks

You can’t use LOS17.1 sources because eOS is only in pie LOS16 available.

You have to search fir the right sources

Sorry, my mistake. The LOS 16.0 Unofficial build is at https://forum.xda-developers.com/xperia-xz1-compact/development/rom-lineageos-16-0-unofficial-todo-t3925675 and the source is at https://github.com/cryptomilk/android_device_sony_lilac/

The content of the roomservice.xml file looks similar


  <?xml version="1.0" encoding="UTF-8"?>
  <manifest>
      <!-- SONY -->
      <project name="cryptomilk/android_kernel_sony_msm8998" path="kernel/sony/msm8998" remote="github" />
      <project name="cryptomilk/android_device_sony_common-treble" path="device/sony/common-treble" remote="github" />
      <project name="cryptomilk/android_device_sony_yoshino" path="device/sony/yoshino" remote="github" />
      <project name="cryptomilk/android_device_sony_lilac" path="device/sony/lilac" remote="github" />

      <!-- Pinned blobs for lilac -->
      <project name="cryptomilk/android_vendor_sony_lilac" path="vendor/sony/lilac" remote="github" />
  </manifest>

So is a docker build likely to succeed with that is a local manifest? Or is there more, different magic that I will need to do?

(I know I can just try and build it, but I thought it was worth asking before firing up a cloud instance to do the build.)

I’m not a docker builder. But it looks good an should work

Build is failing, I think because docker is not findng the cryptomilk repo
This is my roomservice.xml

~$ cat /srv/e/src/PIE/.repo/local_manifests/roomservice.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
    <!-- SONY -->
    <project name="cryptomilk/android_kernel_sony_msm8998" path="kernel/sony/msm8998" remote="github" />
    <project name="cryptomilk/android_device_sony_common-treble" path="device/sony/common-treble" remote="github" />
    <project name="cryptomilk/android_device_sony_yoshino" path="device/sony/yoshino" remote="github" />
    <project name="cryptomilk/android_device_sony_lilac" path="device/sony/lilac" remote="github" />

    <!-- Pinned blobs for lilac -->
    <project name="cryptomilk/android_vendor_sony_lilac" path="vendor/sony/lilac" remote="github" />
</manifest>

The error I am getting is

build/make/core/product_config.mk:234: error: Can not locate config makefile for product "lineage_lily".
08:47:50 dumpvars failed with: exit status 1
Device lily not found. Attempting to retrieve device repository from LineageOS Github (http://github.com/LineageOS).
Repository for lily not found in the LineageOS Github repository list. If this is in error, you may need to manually add it to your local_manifests/roomservice.xml.
build/make/core/product_config.mk:234: error: Can not locate config makefile for product "lineage_lily".

My docker command is

sudo docker run \
-v "/srv/e/src:/srv/src" \
-v "/srv/e/zips:/srv/zips" \
-v "/srv/e/logs:/srv/logs" \
-v "/srv/e/manifests:/srv/local_manifests" \
-v "/srv/e/ccache:/srv/ccache" \
-e "INCLUDE_PROPRIETARY=false" \
-e "CCACHE_SIZE=100G" \
-e "BRANCH_NAME=v0.9-pie" \
-e "DEVICE_LIST=lily" \
-e "REPO=https://gitlab.e.foundation/e/os/releases.git" \
registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community

I’ve tried with and without the INCLUDE_PROPRIETARY line - same result.
Any ideas?

As I have written, I’m not the docker guy. But I would try with changing ‘DEVICE_LIST’ to only ‘DEVICE’

Try ‘lilac’, not ‘lily’ ?

1 Like

That would probably work :wink:
Thank you - I’ll try again this evening.

Oh yes … good find !!!

So close - build got to 99%, then
[ 99% 1249/1250] glob vendor/qcom/opensource/interfaces/wifi/supplicant/2.0/src ninja: error: 'vendor/sony/lilac/proprietary/framework/WfdCommon.jar', needed by '/srv/src/PIE/out/target/common/obj/JAVA_LIBRARIES/WfdCommon_intermediates/javalib.jar', missing and no known rule to make it

That file exists in the lineage-17.1 branch of the cryptomilk repo but not in the lineage-16.0 branch
Any ideas how to get round that?

Oh yes, a good known error :pensive:

I’m allways remiving the call of this file. But if you have the file on LOS17, use it

What would be the best way to use it?

  1. Just copy the file to the correct directory in the build source tree
  2. Fork the repo, add the file to the 16.0 branch, and point the roomservice.xml at my fork
  3. Point the roomservice.xml at the 17.1 branch of the cryptomilk repo (which would pick up a lot more files which aren’t in the 16.0 branch)

Quickest would be 1, but 2 would be better if I want to make more builds in the future. 3 would be easy but might not work because, as @harvey186 said

You can’t use LOS17.1 sources because eOS is only in pie LOS16 available

I would first try point 1. But you build with docker and as far as I know, docker will overwrite your changes.
But you can stop internet connection, so docker can’t sync and overwrite.

If it will work, than you fork the sources and put it in your manifest.

Thanks. It would be hard to stop the internet connection as I’m building on a remote cloud instance :slight_smile: But I can copy the file after the repo sync has completed if I’m paying attention.

I’ll aim to do that eventually, and maybe submit a pull request to get the file into the cryptomik repo.

You can copy the file using a script called pre-build.sh in /srv/userscripts add this to docker command.

That’s great to know - thanks. Any special syntax or will
sudo cp WfdCommon.jar /srv/src/PIE/....
be OK?

No special syntax, just Linux script. Yes that command should do the trick.

I know this is some really basic error with my script, but it is failing with
cp: cannot stat 'WfdCommon.jar': No such file or directory
Tried both with

  • WfdCommon.jar in home directory and cp /home/ubuntu/WfdCommon.jar /srv/e/src/PIE/vendor/sony/lilac/proprietary/
  • 'WfdCommon.jar in same directory as the script and cp /home/ubuntu/WfdCommon.jar /srv/e/src/PIE/vendor/sony/lilac/proprietary/

(I haven’t ever really worked with shell scripts)

I quess docker cant find it. Put it in /srv/userscripts and then in script copy from /srv/e/userscripts/WfdCommon.jar to destination.

Thanks. The working line is
cp /srv/userscripts/WfdCommon.jar /srv/e/src/PIE/vendor/sony/lilac/proprietary/framework/

And the build is progressing nicely :slight_smile:

More news later…