Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- clear
- while true; do
- read -p "When you flash the ROM be aware that lock screen and fingerprint can be removed easily, to prevent this encrypt your phone. Check community.e.foundation if your model supports encryption. I understand this message and want to coninue:(y/n)" yn
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer yes or no.";;
- esac
- done
- << COMMENTBLOCK
- # Install build dependencies
- ############################
- apt -qq update
- apt -qqy upgrade
- apt install -y imagemagick libwxgtk3.0-dev openjdk-8-jdk
- apt install -y openjdk-7-jdk
- apt install -y bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick libncurses5 lib32ncurses5-dev lib32readline-dev lib32z1-dev libtinfo5 liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev python python3 software-properties-common git
- #install google repo
- ####################
- apt install -y repo
- COMMENTBLOCK
- # Environment variables
- #######################
- # User identity
- export USER_NAME='Pete Fotheringham'
- # Defaults
- export USE_CCACHE=1
- export MINIMAL_APPS=false
- export CLEAN_AFTER_BUILD=false
- export CLEAN_OUTDIR=false
- # My variables
- # ccache maximum size. It should be a number followed by an optional suffix: k,
- # M, G, T (decimal), Ki, Mi, Gi or Ti (binary). The default suffix is G. Use 0
- # for no limit.
- export CCACHE_SIZE=300G
- #export BRANCH_NAME='lineage-18.1'
- export BRANCH_NAME='lineage-17.1'
- #export DEVICE_LIST='suzuran'
- export DEVICE_LIST='lilac,suzuran'
- export INCLUDE_PROPRIETARY=false
- export LOCAL_MIRROR=false
- export WITH_GMS=true
- ## Sony nougat devices
- #export BRANCH_NAME='v0.14.1-nougat'
- #export DEVICE_LIST='taoshan,nicki,ivy,karin,karin-windy'
- # Fixed
- export TMP_DIR=/home/pete/srv/los/tmp
- export SRC_DIR=/home/pete/srv/los/src
- export CCACHE_DIR=/home/pete/srv/los/ccache
- export ZIP_DIR=/home/pete/srv/los/zips
- export LMANIFEST_DIR=/home/pete/srv/los/local_manifests
- export DELTA_DIR=/home/pete/srv/los/delta
- export KEYS_DIR=/home/pete/srv/los/keys
- export LOGS_DIR=/home/pete/srv/los/logs
- export USERSCRIPTS_DIR=/home/pete/srv/userscripts
- export DEBIAN_FRONTEND=noninteractive
- export USER=root
- export RELEASE_TYPE='UNOFFICIAL'
- export SIGNATURE_SPOOFING=restricted
- export CUSTOM_PACKAGES=''
- # Repo use for build
- export MIRROR=''
- # OTA URL that will be used inside CMUpdater
- # Use this in combination with LineageOTA to make sure your device can auto-update itself from this buildbot
- export OTA_URL=''
- # Change this cron rule to what fits best for you
- # Use 'now' to start the build immediately
- # For example, '0 10 * * *' means 'Every day at 10:00 UTC'
- export CRONTAB_TIME='now'
- # Provide a default JACK configuration in order to avoid out-of-memory issues
- export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
- # Sign the builds with the keys in $KEYS_DIR
- export SIGN_BUILDS=true
- # When SIGN_BUILDS = true but no keys have been provided, generate a new set with this subject
- export KEYS_SUBJECT='/C=US/ST=California/L=Mountain View/O=Android/OU=Android/CN=Android/[email protected]'
- # Move the resulting zips to $ZIP_DIR/$codename instead of $ZIP_DIR/
- export ZIP_SUBDIR=true
- # Write the verbose logs to $LOGS_DIR/$codename instead of $LOGS_DIR/
- export LOGS_SUBDIR=true
- # Generate delta files
- export BUILD_DELTA=false
- # Backup the .img in addition to zips
- export BACKUP_IMG=true
- # Delete old zips in $ZIP_DIR, keep only the N latest one (0 to disable)
- export DELETE_OLD_ZIPS=0
- # Delete old deltas in $DELTA_DIR, keep only the N latest one (0 to disable)
- export DELETE_OLD_DELTAS=0
- # Delete old logs in $LOGS_DIR, keep only the N latest one (0 to disable)
- export DELETE_OLD_LOGS=0
- # Create a JSON file that indexes the build zips at the end of the build process
- # (for the updates in OpenDelta). The file will be created in $ZIP_DIR with the
- # specified name; leave empty to skip it.
- # Requires ZIP_SUBDIR.
- export OPENDELTA_BUILDS_JSON=''
- export BUILD_OVERLAY=false
- # You can optionally specify a USERSCRIPTS_DIR volume containing these scripts:
- # * begin.sh, run at the very beginning
- # * before.sh, run after the syncing and patching, before starting the builds
- # * pre-build.sh, run before the build of every device
- # * post-build.sh, run after the build of every device
- # * end.sh, run at the very end
- # Each script will be run in $SRC_DIR and must be owned and writeable only by
- # root
- # Create missing directories
- ############################
- mkdir -p $TMP_DIR
- mkdir -p $SRC_DIR
- mkdir -p $CCACHE_DIR
- mkdir -p $ZIP_DIR
- mkdir -p $LMANIFEST_DIR
- mkdir -p $DELTA_DIR
- mkdir -p $KEYS_DIR
- mkdir -p $LOGS_DIR
- mkdir -p $USERSCRIPTS_DIR
- # Copy build files to /root/
- ############################
- rm -rf $TMP_DIR/buildscripts
- git clone https://github.com/lineageos4microg/docker-lineage-cicd.git $TMP_DIR/buildscripts
- # Use my fork for now, until the pythin2 2/3 fix gets into lineageos4microg
- # git clone https://github.com/petefoth/docker-lineage-cicd.git -b work-with-python-3 $TMP_DIR/buildscripts
- rm -rf /root/*
- cp -rf $TMP_DIR/buildscripts/src/* /root/
- # cp -rf $TMP_DIR/buildscripts/build-community.sh /root/build.sh
- # Install build dependencies
- ############################
- #cp $TMP_DIR/buildscripts/apt_preferences /etc/apt/preferences
- << COMMENTBLOCK
- # Download and build delta tools
- ################################
- cd /root/ && \
- mkdir delta && \
- echo "cloning"
- git clone --depth=1 https://gitlab.e.foundation/e/os/android_packages_apps_OpenDelta.git OpenDelta && \
- gcc -o delta/zipadjust OpenDelta/jni/zipadjust.c OpenDelta/jni/zipadjust_run.c -lz && \
- cp OpenDelta/server/minsignapk.jar OpenDelta/server/opendelta.sh delta/ && \
- chmod +x delta/opendelta.sh && \
- rm -rf OpenDelta/ && \
- sed -i -e "s|^\s*HOME=.*|HOME=/root|; \
- s|^\s*BIN_XDELTA=.*|BIN_XDELTA=xdelta3|; \
- s|^\s*FILE_MATCH=.*|FILE_MATCH=lineage-\*.zip|; \
- s|^\s*PATH_CURRENT=.*|PATH_CURRENT=$SRC_DIR/out/target/product/$DEVICE|; \
- s|^\s*PATH_LAST=.*|PATH_LAST=$SRC_DIR/delta_last/$DEVICE|; \
- s|^\s*KEY_X509=.*|KEY_X509=$KEYS_DIR/releasekey.x509.pem|; \
- s|^\s*KEY_PK8=.*|KEY_PK8=$KEYS_DIR/releasekey.pk8|; \
- s|publish|$DELTA_DIR|g" /root/delta/opendelta.sh
- COMMENTBLOCK
- # Set the work directory
- ########################
- cd $SRC_DIR
- # Allow redirection of stdout to docker logs
- ############################################
- #ln -sf /proc/1/fd/1 /var/log/docker.log
- # Set the entry point to init.sh
- ################################
- /root/init.sh
- #end script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement