This is written assuming you are using the newest Linux Mint Cinnamon.
(which doesn’t have nsjail errors unlike ubuntu.)
Open your terminal in Mint and issue:
sudo apt-get update && sudo apt-get upgrade
after the upgrade completes, now we need to get the dependencies needed to build from source:
sudo apt-get install git ccache automake lzop gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 g+±multilib python3 libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng maven
Next we need to pick up Openjdk 11:
sudo apt-get install openjdk-11-jdk
Now to install repo and git.
sudo apt-get install repo
sudo apt-get install git
sudo apt-get install git-lfs
With this, finally create a folder for eOS, call it Lineage21.
Open terminal inside of it, issue:
repo init -u e / os / android · GitLab -b v1-u --git-lfs
then issue:
git clone GitHub - AndyCGYan/lineage_build_unified: Unified script for building GSI and device-specific LineageOS lineage_build_unified -b lineage-21-light
Replace the buildbot_unified.sh file’s contents with the following:
#!/bin/bash
echo “”
echo “/e/OS Unified Buildbot”
echo “Executing in 2 seconds - CTRL-C to exit”
echo “”
sleep 2if [ $# -lt 2 ]
then
echo “Not enough arguments - exiting”
echo “”
exit 1
fiMODE=${1}
if [ ${MODE} != “device” ] && [ ${MODE} != “treble” ]
then
echo “Invalid mode - exiting”
echo “”
exit 1
fiNOSYNC=false
PERSONAL=false
SIGNABLE=true
for var in “${@:2}”
do
if [ ${var} == “nosync” ]
then
NOSYNC=true
fi
if [ ${var} == “personal” ]
then
PERSONAL=true
SIGNABLE=false
fi
done
if [ ! -d “$HOME/.android-certs” ]; then
read -n1 -r -p $“$HOME/.android-certs not found - CTRL-C to exit, or any other key to continue”
echo “”
SIGNABLE=false
fiAbort early on error
set -eE
trap ‘(
echo;
echo !!! An error happened during script execution;
echo !!! Please check console output for bad sync,;
echo !!! failed patch application, etc.;
echo
)’ ERRSTART=
date +%s
BUILD_DATE=“$(date -u +%Y%m%d)”prep_build() {
echo “Preparing local manifests”
mkdir -p .repo/local_manifests
cp ./lineage_build_unified/local_manifests_${MODE}/*.xml .repo/local_manifests
echo “”echo "Syncing repos" repo sync -c --force-sync --no-clone-bundle --no-tags -j$(nproc --all) echo "" echo "Pull /e/OS prebuilts" repo forall -c 'git lfs pull' echo "" echo "Setting up build environment" source build/envsetup.sh &> /dev/null source vendor/lineage/vars/aosp_target_release mkdir -p ~/build-output echo ""
}
prep_device() {
:
}prep_treble() {
:
}finalize_device() {
:
}finalize_treble() {
:
}build_device() {
brunch ${1}
mv $OUT/lineage-*.zip ~/build-output/lineage-21.0-$BUILD_DATE-UNOFFICIAL-${1}$($PERSONAL && echo “-personal” || echo “”).zip
}build_treble() {
case “${1}” in
(“64VN”) TARGET=gsi_arm64_vN;;
(“64VS”) TARGET=gsi_arm64_vS;;
(“64GN”) TARGET=gsi_arm64_gN;;
(*) echo “Invalid target - exiting”; exit 1;;
esac
lunch lineage_${TARGET}-${aosp_target_release}-userdebug
make installclean
WITH_ADB_INSECURE=true make -j$(lscpu -b -p=Core,Socket | grep -v ‘^#’ | sort -u | wc -l) systemimage
SIGNED=false
if [ ${SIGNABLE} = true ] && [[ ${TARGET} == *_g? ]]
then
make -j$(lscpu -b -p=Core,Socket | grep -v ‘^#’ | sort -u | wc -l) target-files-package otatools
bash ./lineage_build_unified/sign_target_files.sh $OUT/signed-target_files.zip
unzip -joq $OUT/signed-target_files.zip IMAGES/system.img -d $OUT
SIGNED=true
echo “”
fi
mv $OUT/system.img ~/build-output/lineage-21.0-$BUILD_DATE-UNOFFICIAL-${TARGET}$(${PERSONAL} && echo “-personal” || echo “”)$(${SIGNED} && echo “-signed” || echo “”).img
}if ${NOSYNC}
then
echo “ATTENTION: syncing/patching skipped!”
echo “”
echo “Setting up build environment”
source build/envsetup.sh &> /dev/null
source vendor/lineage/vars/aosp_target_release
echo “”
else
prep_build
echo “Applying patches”
prep_${MODE}
apply_patches patches_platform
apply_patches patches_${MODE}
if ${PERSONAL}
then
apply_patches patches_platform_personal
apply_patches patches_${MODE}personal
fi
finalize${MODE}
echo “”
fifor var in “${@:2}”
do
if [ ${var} == “nosync” ] || [ ${var} == “personal” ]
then
continue
fi
echo "Starting $(${PERSONAL} && echo “personal " || echo “”)build for ${MODE} ${var}”
build_${MODE} ${var}
done
ls ~/build-output | grep ‘lineage’ || trueEND=
date +%s
ELAPSEDM=$(($(($END-$START))/60))
ELAPSEDS=$(($(($END-$START))-$ELAPSEDM*60))
echo “Buildbot completed in $ELAPSEDM minutes and $ELAPSEDS seconds”
echo “”
Finally, go to your terminal in the Lineage21 folder and issue the following command:
bash lineage_build_unified/buildbot_unified.sh treble 64VN 64VS 64GN
It will begin repo syncing and adding GSI manifests, repo sync may fail on the first attempt so run it until it fails patching.
Once repo is sync’d, and patching fails we’re done using the build bot.
Now to begin building, in terminal issue the following:
. build/envsetup.sh &> /dev/null
. vendor/lineage/vars/aosp_target_release
**breakfast gsi_arm64_vS **
brunch gsi_arm64_vS
After a really long time (if you are building using inferior HW) it will produce a system.img
This system.img may be flashed as a GSI.
Resolved Issues:
- Duplicate sensor IDs
Current Issue:
01-03 15:46:30.666 3427 3427 I PermissionManager: Permission ownership changed. Updating all permissions.
01-03 15:46:30.668 3427 3427 W PermissionManager: Privileged permission android.permission.INSTALL_PACKAGES for package me.phh.treble.app (/system/priv-app/TrebleApp) not in privapp-permissions allowlist
01-03 15:46:30.668 3427 3427 W PermissionManager: Privileged permission android.permission.INTERACT_ACROSS_USERS for package me.phh.treble.app (/system/priv-app/TrebleApp) not in privapp-permissions allowlist
01-03 15:46:30.676 3427 3427 E System : ******************************************
01-03 15:46:30.676 3427 3427 E System : ************ Failure starting system services
01-03 15:46:30.676 3427 3427 E System : java.lang.IllegalStateException: Signature|privileged permissions not in privapp-permissions allowlist: {me.phh.treble.app (/system/priv-app/TrebleApp): android.permission.INSTALL_PACKAGES, me.phh.treble.app (/system/priv-app/TrebleApp): android.permission.INTERACT_ACROSS_USERS}
01-03 15:46:30.676 3427 3427 E System : at com.android.server.pm.permission.PermissionManagerServiceImpl.onSystemReady(PermissionManagerServiceImpl.java:4401)
01-03 15:46:30.676 3427 3427 E System : at com.android.server.pm.permission.PermissionManagerService$PermissionManagerServiceInternalImpl.onSystemReady(PermissionManagerService.java:817)
01-03 15:46:30.676 3427 3427 E System : at com.android.server.pm.PackageManagerService.systemReady(PackageManagerService.java:4302)
01-03 15:46:30.676 3427 3427 E System : at com.android.server.SystemServer.startOtherServices(SystemServer.java:2964)
01-03 15:46:30.676 3427 3427 E System : at com.android.server.SystemServer.run(SystemServer.java:980)
01-03 15:46:30.676 3427 3427 E System : at com.android.server.SystemServer.main(SystemServer.java:701)
01-03 15:46:30.676 3427 3427 E System : at java.lang.reflect.Method.invoke(Native Method)
01-03 15:46:30.676 3427 3427 E System : at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
01-03 15:46:30.676 3427 3427 E System : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:856)
01-03 15:46:30.676 3427 3427 V SystemServerTiming: MakePackageManagerServiceReady took to complete: 12ms
01-03 15:46:30.676 3427 3427 E Zygote : System zygote died with fatal exception
01-03 15:46:30.676 3427 3427 E Zygote : java.lang.IllegalStateException: Signature|privileged permissions not in privapp-permissions allowlist: {me.phh.treble.app (/system/priv-app/TrebleApp): android.permission.INSTALL_PACKAGES, me.phh.treble.app (/system/priv-app/TrebleApp): android.permission.INTERACT_ACROSS_USERS}
01-03 15:46:30.676 3427 3427 E Zygote : at com.android.server.pm.permission.PermissionManagerServiceImpl.onSystemReady(PermissionManagerServiceImpl.java:4401)
01-03 15:46:30.676 3427 3427 E Zygote : at com.android.server.pm.permission.PermissionManagerService$PermissionManagerServiceInternalImpl.onSystemReady(PermissionManagerService.java:817)
01-03 15:46:30.676 3427 3427 E Zygote : at com.android.server.pm.PackageManagerService.systemReady(PackageManagerService.java:4302)
01-03 15:46:30.676 3427 3427 E Zygote : at com.android.server.SystemServer.startOtherServices(SystemServer.java:2964)
01-03 15:46:30.676 3427 3427 E Zygote : at com.android.server.SystemServer.run(SystemServer.java:980)
01-03 15:46:30.676 3427 3427 E Zygote : at com.android.server.SystemServer.main(SystemServer.java:701)
01-03 15:46:30.676 3427 3427 E Zygote : at java.lang.reflect.Method.invoke(Native Method)
01-03 15:46:30.676 3427 3427 E Zygote : at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
01-03 15:46:30.676 3427 3427 E Zygote : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:856)
01-03 15:46:30.676 3427 3427 D AndroidRuntime: Shutting down VM
01-03 15:46:30.676 3427 3427 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: main
01-03 15:46:30.676 3427 3427 E AndroidRuntime: java.lang.IllegalStateException: Signature|privileged permissions not in privapp-permissions allowlist: {me.phh.treble.app (/system/priv-app/TrebleApp): android.permission.INSTALL_PACKAGES, me.phh.treble.app (/system/priv-app/TrebleApp): android.permission.INTERACT_ACROSS_USERS}
01-03 15:46:30.676 3427 3427 E AndroidRuntime: at com.android.server.pm.permission.PermissionManagerServiceImpl.onSystemReady(PermissionManagerServiceImpl.java:4401)
01-03 15:46:30.676 3427 3427 E AndroidRuntime: at com.android.server.pm.permission.PermissionManagerService$PermissionManagerServiceInternalImpl.onSystemReady(PermissionManagerService.java:817)
01-03 15:46:30.676 3427 3427 E AndroidRuntime: at com.android.server.pm.PackageManagerService.systemReady(PackageManagerService.java:4302)
01-03 15:46:30.676 3427 3427 E AndroidRuntime: at com.android.server.SystemServer.startOtherServices(SystemServer.java:2964)
01-03 15:46:30.676 3427 3427 E AndroidRuntime: at com.android.server.SystemServer.run(SystemServer.java:980)
01-03 15:46:30.676 3427 3427 E AndroidRuntime: at com.android.server.SystemServer.main(SystemServer.java:701)
01-03 15:46:30.676 3427 3427 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
01-03 15:46:30.676 3427 3427 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
01-03 15:46:30.676 3427 3427 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:856)
Error relating to the privapp-permissions allowlist for the app me.phh.treble.app.
This is caused by the GSI system image lacking proper permissions configuration.
I will update this topic as I make progress, as issues arise in source I will do my best to patch them to bring up a GSI codebase for /e/OS.