Both sides previous revisionPrevious revisionNext revision | Previous revision |
projects:bullhead-lineageos-lineage-15.0 [2017/12/07 18:00] – Sean Rhone | projects:bullhead-lineageos-lineage-15.0 [2017/12/07 23:04] (current) – Sean Rhone |
---|
| ====== Information ====== |
| |
| * Custom builds of LineageOS for the Nexus 5X |
| * lineage-15.0 branch |
| * A lot of this is TODO |
| |
| ===== Prerequisites ===== |
| |
| * [[distros:fedora_workstation_gnome | Fedora Workstation]] |
| |
| ====== xda-developers ====== |
| |
| * TODO |
| |
| ====== Dependencies ====== |
| |
| **** |
| |
| sudo dnf install java-1.8.0-openjdk-devel ImageMagick-devel patch ncurses-compat-libs schedtool libstdc++.i686 glibc.i686 m4 xz-lzma-compat gcc && sync |
| |
| ====== Prepare Build Environment ====== |
| |
| ===== Cleanup ===== |
| |
| **** |
| |
| cd ~ && sudo rm -Rf ~/'android/lineage-15.0/'* ~/'.ccache' ~/'.jack-server' ~/'.jack-settings' && sync |
| |
| ===== Install git-repo ===== |
| |
| * https://code.google.com/archive/p/git-repo |
| |
| mkdir -p ~/'bin' && wget -O ~/'bin/repo' 'https://storage.googleapis.com/git-repo-downloads/repo' && chmod +x ~/'bin/repo' |
| |
| ===== Configure Git ===== |
| |
| nano ~/'.gitconfig' |
| |
| [user] |
| email = espionage724@x |
| name = Sean Lynn Rhone |
| |
| [color] |
| ui = auto |
| |
| ===== Initialize Repo ===== |
| |
| **** |
| |
| mkdir -p ~/'android/lineage-15.0' && cd ~/'android/lineage-15.0' && repo init --manifest-url='https://github.com/LineageOS/android.git' --manifest-branch='lineage-15.0' --depth=1 && sync |
| |
| ===== LGE Manifest ===== |
| |
| * If pulling in fresh sources, do not add this until the sources are backed-up ((that way the backup can be a clean-slate and be used for other non-LGE devices)) |
| |
| ==== lineage-15.0 ==== |
| |
| mkdir -p ~/'android/lineage-15.0/.repo/local_manifests' && nano ~/'android/lineage-15.0/.repo/local_manifests/lge.xml' |
| |
| <code> |
| <?xml version="1.0" encoding="UTF-8"?> |
| <manifest> |
| |
| <!-- Motorola --> |
| <project path="vendor/lge" name="TheMuppets/proprietary_vendor_lge" remote="github" revision="lineage-15.0" /> |
| |
| </manifest></code> |
| |
| ===== Sources Management ===== |
| |
| ==== Pull-in and Update Sources ==== |
| |
| === Network Sync === |
| |
| * As of 2017/10/29, this downloads 11.3GB for ''lineage-15.0'' |
| * If pulling fresh sources, this command is good to leave running overnight, and then followed up with a [[#backup_sources | backup]] |
| |
| cd ~/'android/lineage-15.0' && repo sync --current-branch --network-only --jobs='4' --force-broken --force-sync && sync |
| |
| === Complete Sync === |
| |
| * Performs both Network and Local file sync |
| |
| cd ~/'android/lineage-15.0' && repo sync --current-branch --network-only --jobs='4' --force-broken --force-sync && sync && repo sync --current-branch --local-only --jobs='16' && sync |
| |
| ==== Backup Sources ==== |
| |
| **** |
| |
| cd ~/'android/lineage-15.0' && tar -cvzf ~/'Downloads/lineageos-lineage-15.0-'$(date +%Y-%m-%d)'.tar.gz' '.repo' && cd ~ && sync |
| |
| ==== Restore Sources ==== |
| |
| **** |
| |
| mkdir -p ~/'android/lineage-15.0' && cd ~/'android/lineage-15.0' && tar -xvzf ~/'Downloads/lineageos-lineage-15.0-'*'.tar.gz' '.repo' && sync |
| |
| ====== Modifications ====== |
| |
| ===== Allow Signature Spoofing ===== |
| |
| * This allows **microG Services Core** and **FakeStore** to fake GApps properly |
| |
| * https://github.com/FreeMobileOS/android_packages_apps_GmsCore/blob/20c65a1fc33ee28ae0d12a927bd243d4ee2e3abc/patches/android_frameworks_base-O.patch |
| * Keep eyes on https://github.com/microg/android_packages_apps_GmsCore/pull/418 for when this is officially merged |
| |
| wget -O ~/'Downloads/GmsCore-android_frameworks_base-O.patch' 'https://raw.githubusercontent.com/FreeMobileOS/android_packages_apps_GmsCore/20c65a1fc33ee28ae0d12a927bd243d4ee2e3abc/patches/android_frameworks_base-O.patch' && cd ~/'android/lineage-15.0' && patch --no-backup-if-mismatch --strip='1' --directory='frameworks/base' < ~/'Downloads/GmsCore-android_frameworks_base-O.patch' && rm -f ~/'Downloads/GmsCore-android_frameworks_base-O.patch' && sync |
| |
| ===== Allow Location Providers Outside /system ===== |
| |
| * https://github.com/microg/android_packages_apps_UnifiedNlp/blob/master/patches/android_frameworks_base-N.patch |
| |
| * This allows ** microG Services Core** to provide **UnifiedNlp** without having to be installed to ''/system/priv-app'' or having to have an outdated ''NetworkLocation.apk'' there |
| |
| wget -O ~/'Downloads/UnifiedNlp-android_frameworks_base-N.patch' 'https://raw.githubusercontent.com/microg/android_packages_apps_UnifiedNlp/master/patches/android_frameworks_base-N.patch' && cd ~/'android/lineage-15.0' && patch --no-backup-if-mismatch --strip='1' --directory='frameworks/base' < ~/'Downloads/UnifiedNlp-android_frameworks_base-N.patch' && rm -f ~/'Downloads/UnifiedNlp-android_frameworks_base-N.patch' && sync |
| |
| ===== Steven Black's Unified Hosts File ===== |
| |
| * https://github.com/StevenBlack/hosts |
| |
| * Includes ''fakenews'' and ''gambling'' extensions |
| |
| rm -Rf '/tmp/master.zip' '/tmp/hosts-master' && wget 'https://github.com/StevenBlack/hosts/archive/master.zip' -O '/tmp/master.zip' && unzip '/tmp/master.zip' -d '/tmp' && python3 '/tmp/hosts-master/updateHostsFile.py' --auto --extensions 'fakenews' 'gambling' --output ~/'android/lineage-15.0/system/core/rootdir/etc' && rm -Rf '/tmp/master.zip' '/tmp/hosts-master' && sync |
| |
| ===== Don't Check Device in TWRP ===== |
| |
| * https://review.lineageos.org/#/c/186687/ |
| * TODO: See if needed |
| |
| repopick '186687' |
| |
| ====== Build Prep ====== |
| |
| ===== Cleanup ===== |
| |
| **** |
| |
| cd ~/'android/lineage-15.0' && make 'clobber' && sync |
| |
| ===== Set-up Environment ===== |
| |
| **** |
| |
| |
| cd ~/'android/lineage-15.0' && source ~/'android/lineage-15.0/build/envsetup.sh' |
| |
| ===== Breakfast! ===== |
| |
| * Be sure to run [[#tweaks | Tweaks]] after serving ''breakfast'' if using fresh sources |
| |
| cd ~/'android/lineage-15.0' && breakfast 'bullhead' && 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'' 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 ~/'.android-certs' && for x in releasekey platform shared media; do ~/'android/lineage-15.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 approximately 1 hour and 25 minutes 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-15.0' && mka target-files-package dist && sync |
| |
| ===== Sign Build ===== |
| |
| **** |
| |
| croot && ~/'android/lineage-15.0/build/tools/releasetools/sign_target_files_apks' -o -d ~/'.android-certs' ~/'android/lineage-15.0/out/dist/'*'-target_files-'*'.zip' ~/'android/lineage-15.0/signed-target_files.zip' && sync |
| |
| ===== Generate Zip ===== |
| |
| **** |
| |
| ~/'android/lineage-15.0/build/tools/releasetools/ota_from_target_files' -k ~/'.android-certs/releasekey' --block --backup='true' ~/'android/lineage-15.0/signed-target_files.zip' ~/'Downloads/'$(date +%m-%d)'-oreo-los15.0-N5X-esp724.zip' && sync |
| |
| ===== Install Zip ===== |
| |
| * Flash ''~/Downloads/(date)-oreo-los15.0-N5X-esp724.zip'' |
| |
| ====== Unsigned Build ====== |
| |
| ===== Build and Generate Zip ===== |
| |
| * This takes approximately 1 hour to complete |
| |
| cd ~/'android/lineage-15.0' && croot && brunch 'bullhead' && sync |
| |
| ===== Install Zip ===== |
| |
| * Flash the 400MB+ zip found in ''~/'android/lineage-15.0/out/target/product/bullhead'' |
| |
| ====== Nexus 5X Configuration ====== |
| |
| * [[devices:bullhead | Proceed here]] |
| |
| ====== Changelog ====== |
| |
| ===== Notes ===== |
| |
| * Unless otherwise specified, all uploaded builds are updated from the source (resync) prior to building |
| |
| ===== Changelog ===== |
| |
| * 2017/12/07: Initial build |