[Samsung Galaxy S9 & S9+ Cross Device Development] ElPakoTech:
Hi,

Sure I can share what I did.

1. Prepare directories and get Lineage sources (https://wiki.lineageos.org/devices/starlte/build)

# Create directories

mkdir -p ~/bin
mkdir -p ~/android/build
mkdir -p ~/android/build/src
mkdir -p ~/android/build/ccache
mkdir -p ~/android/build/keys
mkdir -p ~/android/build/logs
mkdir -p ~/android/build/zips
mkdir -p ~/android/build/manifests

# Get repo tools

curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

# Create a "~/.profile" file and paste this into:

“if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi”

# Prepare git

cd ~/android/build/src
git config --global user.email "you@example.com"
git config --global user.name "Your Name"

# Init repo

source ~/.profile
repo init -u https://github.com/LineageOS/android.git -b lineage-18.1

# Time to sync (it can take a very long time, so be patient).

repo sync

2. At this point, I forked all Synt4x.93 related repositories on my Github. But, you don’t really need to do that if you just want to build.

For OTA, the only repo you will need to fork is android_device_samsung_starlte.

3. Create an other repository named OTA.

4. From your forked android_device_samsung_starlte repository, modify the file lineage_starlte.mk

Change the last line with your GitHub username:

PRODUCT_PROPERTY_OVERRIDES += \
lineage.updater.uri=https://raw.githubusercontent.com/<Your_username>/OTA/lineage-18.1/starlte.json

5. Then you need to add the roomservice.xml file to add the device and kernel sources.

You can use the resources from Synt4x.93, mine or from Neurotical (He’s maintaining a more recent version of the kernel, you should have a look: https://xdaforums.com/t/rom-s9-s9-unofficial-lineageos-18-1-weekly.4302901/ )

Get one of the manifests:

-Synt4x.93: https://github.com/synt4x93/local_manifests

-pakaoraki: https://github.com/pakaoraki/local_manifests

-Neurotical: https://github.com/Geoknyda/local_manifests

Then modify the file roomservice.xml: change "project name" with your GitHub username to match your repository:

...
<project name="synt4x93/android_device_samsung_starlte" path="device/samsung/starlte" remote="github" revision="lineage-18.1" />
...

Copy your version of roomservice.xml into ~/android/build/manifests directory.

# Update source again

repo sync

6. Generate your own keys (https://wiki.lineageos.org/signing_builds.html)

From the root of your Android tree, run these commands, altering the subject line to reflect your information:

subject='/C=US/ST=California/L=Mountain View/O=Android/OU=Android/CN=Android/emailAddress=android@android.com'

cd ~/android/build/src
for x in releasekey platform shared media networkstack testkey; do \
./development/tools/make_key ~/android/build/keys/$x "$subject"; \
done
make a copy of the “keys” directory and keep it safe.

7. Install docker and get docker-lineage-cicd image:

You can use lineaos4microg : https://hub.docker.com/r/lineageos4microg/docker-lineage-cicd/Dockerfile

docker pull lineageos4microg/docker-lineage-cicd

Or

I also re-write my own docker image to add some options. You can try: https://hub.docker.com/r/pakaoraki/docker-lineage-cicd

docker pull pakaoraki/docker-lineage-cicd

8. Then you are ready to build:

Execute this command (change pakaoraki/docker-lineage-cicd with lineaos4microg/docker-lineage-cicd if needed)

docker run \
-e "BRANCH_NAME=lineage-18.1" \
-e "DEVICE_LIST=starlte" \
-e "INCLUDE_PROPRIETARY=false" \
-e "SIGN_BUILDS=true" \
-v "~/android/build/src:/srv/src" \
-v "~/android/build/zips:/srv/zips" \
-v "~/android/build/logs:/srv/logs" \
-v "~/android/build/ccache:/srv/ccache" \
-v "~/android/build/keys:/srv/keys" \
-v "~/android/build/manifests:/srv/local_manifests" \
pakaoraki/docker-lineage-cicd

9. When build is done, create a new release on your OTA repo: choose a tag and upload recovery.img and zips file.

you will need to create a starlte.json that match to your build and release information:

{
"response": [
{
"datetime": 1627204505,
"filename": "lineage-18.1-20210725-UNOFFICIAL-starlte.zip",
"id": "39b85208c5c30edfafd983673a703d60",
"romtype": "UNOFFICIAL",
"size": 608774193,
"url": "https://github.com/<username>/OTA/releases/download/<tag>/lineage-18.1-20210725-UNOFFICIAL-starlte.zip",
"version": "18.1"
}
]
}

<tag>: the tag you use when creating the release on Github.

<username>: your username.

Then, upload starlte.json to your OTA repository.

It's possible that I forget something but you get the global idea.