projects:oneplus6_enchilada_lineageos_21
This is an old revision of the document!
Table of Contents
Information
- Custom builds of LineageOS for OnePlus 6
enchilada
lineage-21.0
branch
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
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
- Unified hosts + fakenews + gambling (Compressed)
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
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
inemailAddress=
- 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 ~/'.android-certs' && for x in releasekey platform shared media; do ~/'android/lineage-21.0/development/tools/make_key' ~/'.android-certs'/$x "$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
- On 2018/02/26, LineageOS's
common.py
script expects thebro_cmd
to call an executable calledbro
, which doesn't exist since Fedora uses the fullbrotli
name for the executable - The following
cat
command checks whether or not the above is true still - This copies the
brotli
executable from/usr/bin/brotli
to the~/bin
directory - Be aware of https://github.com/CopperheadOS/platform_build/commit/5c09ccfcd149784f92719fb32890b284164c427e in-case
brotli
still doesn't work
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
- This takes approximately 2 hours to complete
cd ~/'android/lineage-21.0' && croot && brunch 'bullhead' && sync
Install Zip
- Flash the 400MB+ zip found in
~/'android/lineage-21.0/out/target/product/bullhead
OnePlus 6 Configuration
/var/www/wiki/data/attic/projects/oneplus6_enchilada_lineageos_21.1714195016.txt.gz · Last modified: 2024/04/27 01:16 by Sean Rhone