User Tools

Site Tools


projects:oneplus6_enchilada_lineageos_21

This is an old revision of the document!


Information

Prerequisites

Dependencies

  • :!: TODO
sudo dnf install java-1.8.0-openjdk-devel ImageMagick-devel ncurses-compat-libs schedtool libstdc++.i686 glibc.i686 m4 xz-lzma-compat gcc brotli && sync
sudo dnf install bc bison curl flex lzop gnupg2 gcc-c++ java-11-openjdk
build-essential ccache  g++-multilib gcc-multilib git git-lfs gnupg gperf imagemagick lib32readline-dev lib32z1-dev libelf-dev liblz4-tool libsdl1.2-dev libssl-dev libxml2 libxml2-utils  pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev

For Sure

python3-pip repo patch make

Prepare Build Environment

Cleanup

cd ~ && rm -Rf ~/'android/lineage-21.0/'* ~/'.ccache' ~/'.jack-server' ~/'.jack-settings' ~/'bin/bro' && sync

Configure Git

nano ~/'.gitconfig'
[user]
email = espionage724@x
name = Sean Lynn Rhone

[color]
ui = auto

Initialize Repo

mkdir -p ~/'android/lineage-21.0' && cd ~/'android/lineage-21.0' && repo init --manifest-url='https://github.com/LineageOS/android.git' --manifest-branch='lineage-21.0' --depth='1' --git-lfs && sync

LineageOS for microG GMS

mkdir -p ~/'android/lineage-21.0/.repo/local_manifests' && nano ~/'android/lineage-21.0/.repo/local_manifests/lineageos4microg-gms.xml'
<?xml version="1.0" encoding="UTF-8"?>
<manifest>

  <!-- LineageOS for microG GMS -->
  <project path="vendor/partner_gms" name="lineageos4microg/android_vendor_partner_gms" remote="github" revision="master" />

</manifest>

Sources Management

Pull-in and Update Sources

Network Sync

  • As of 2024/04/24, this downloads around 24.8 GB and 51,000 files for lineage-21.0
  • If pulling fresh sources, this command is good to leave running overnight, and then followed up with a backup
cd ~/'android/lineage-21.0' && repo sync --current-branch --network-only --jobs='4' --force-sync --verbose && sync

Complete Sync

  • Performs both Network and Local file sync
cd ~/'android/lineage-21.0' && repo sync --current-branch --network-only --jobs='4' --force-broken --force-sync --verbose && sync && repo sync --current-branch --local-only --jobs=$(nproc) && sync

Backup Sources

cd ~/'android/lineage-21.0' && tar -cvzf ~/'Downloads/lineageos-21-sources-'$(date +%Y-%m-%d)'.tar.gz' '.repo' && cd ~ && sync

Restore Sources

ls ~/'Downloads/lineageos-21-sources-'*'.tar.gz' && rm -Rf ~/'android/lineage-21.0/.repo' && sync && mkdir -p ~/'android/lineage-21.0/.repo/' && cd ~/'android/lineage-21.0' && tar -xvzf ~/'Downloads/lineageos-21-sources-'*'.tar.gz' && cd ~ && sync

Modifications

ScriptTiger Hosts File

mkdir -p ~/'android/lineage-21.0/system/core/rootdir/etc/' && wget -O ~/'android/lineage-21.0/system/core/rootdir/etc/hosts' 'https://scripttiger.github.io/alts/compressed/blacklist-fg.txt'
nano ~/'android/lineage-21.0/system/core/rootdir/etc/hosts'

Build Prep

Cleanup

cd ~/'android/lineage-21.0' && make 'clobber' && sync

Set-up Environment

cd ~/'android/lineage-21.0' && source ~/'android/lineage-21.0/build/envsetup.sh'

Breakfast!

cd ~/'android/lineage-21.0' && breakfast 'enchilada' && sync

Extract Blobs

cd ~/'android/lineage-21.0/device/oneplus/enchilada/' && ~/'android/lineage-21.0/device/oneplus/enchilada/extract-files.sh'

Environment Variables

Disable ccache

unset 'CCACHE_DISABLE' && export 'CCACHE_DISABLE=1'

Jack

unset 'ANDROID_JACK_VM_ARGS' && export 'ANDROID_JACK_VM_ARGS=-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx8G'

Signed Build

Key Management

Generate

  • :!: Change the x in emailAddress=
  • If a backup exists and is being restored, don't run this
subject='/C=US/ST=Pennsylvania/L=Charleroi/O=Realm of Espionage/OU=Android/CN=Sean Lynn Rhone/emailAddress=espionage724@x' && mkdir -p ~/'.android-certs' && for x in releasekey platform shared media; do ~/'android/lineage-21.0/development/tools/make_key' ~/'.android-certs'/$x "$subject"; done

for cert in bluetooth cyngn-app media networkstack platform releasekey sdk_sandbox shared testcert testkey verity; do \

  ./development/tools/make_key ~/.android-certs/$cert "$subject"; \

done

Backup

cd ~ && tar -cvzf ~/'Downloads/android-certs-'$(date +%Y-%m-%d)'.tar.gz' '.android-certs' && sync

Restore

cd ~ && tar -xvzf ~/'Downloads/android-certs-'*'.tar.gz' '.android-certs' && rm -f ~/'Downloads/android-certs-'*'.tar.gz' && sync

Build

  • This takes around 2 hours to complete
  • If mka can't be found, make sure this is being ran from the Terminal window where previous commands took place
cd ~/'android/lineage-21.0' && mka target-files-package dist && sync && jack-admin kill-server

Sign Build

croot && ~/'android/lineage-21.0/build/tools/releasetools/sign_target_files_apks' -o -d ~/'.android-certs' ~/'android/lineage-21.0/out/dist/'*'-target_files-'*'.zip' ~/'android/lineage-21.0/signed-target_files.zip' && sync

Generate Zip

~/'android/lineage-21.0/build/tools/releasetools/ota_from_target_files' -k ~/'.android-certs/releasekey' --block --backup='true' ~/'android/lineage-21.0/signed-target_files.zip' ~/'Downloads/'$(date +%m-%d)'-oreo-los21.0-N5X-esp724.zip' && sync

brotli Fix

cat ~/'android/lineage-21.0/build/make/tools/releasetools/common.py' | grep 'bro_cmd'
cp '/usr/bin/brotli' ~/'bin/bro'

All-in-one

  • Builds the ROM, signs it, and generates a flashable zip
  • Includes the above brotli fix
cd ~/'android/lineage-21.0' && mka target-files-package dist && sync && jack-admin kill-server && croot && ~/'android/lineage-21.0/build/tools/releasetools/sign_target_files_apks' -o -d ~/'.android-certs' ~/'android/lineage-21.0/out/dist/'*'-target_files-'*'.zip' ~/'android/lineage-21.0/signed-target_files.zip' && sync && cp '/usr/bin/brotli' ~/'bin/bro' && ~/'android/lineage-21.0/build/tools/releasetools/ota_from_target_files' -k ~/'.android-certs/releasekey' --block --backup='true' ~/'android/lineage-21.0/signed-target_files.zip' ~/'Downloads/'$(date +%m-%d)'-oreo-los21.0-N5X-esp724.zip' && sync

Install Zip

  • Flash ~/Downloads/(date)-oreo-los21.0-N5X-esp724.zip

Unsigned Build

Build and Generate Zip

  • 2024/04/27: Takes about TODO 1) minutes on i5-8400H and 16 GB RAM
cd ~/'android/lineage-21.0' && croot && brunch 'enchilada' && sync

Install Zip

  • Flash the 400MB+ zip found in ~/'android/lineage-21.0/out/target/product/enchilada

OnePlus 6 Configuration

1)
1:35 AM
/var/www/wiki/data/attic/projects/oneplus6_enchilada_lineageos_21.1714196234.txt.gz · Last modified: 2024/04/27 01:37 by Sean Rhone