Skip to content

Instantly share code, notes, and snippets.

@BedrockDigger
Last active January 3, 2021 16:39
Show Gist options
  • Save BedrockDigger/aee89d32cc18ace0608381c8804c5223 to your computer and use it in GitHub Desktop.
Save BedrockDigger/aee89d32cc18ace0608381c8804c5223 to your computer and use it in GitHub Desktop.
Script for building Evolution-X for Xiaomi MI 6.
#!/usr/bin/env bash
# RUN THIS SCRIPT WITH screen -d -m -S evox sudo bash <(curl -s blablabla)
# firstly, cheer up with some colors
RED='\033[0;31m'
CYAN='\033[1;36m'
NC='\033[0m'
# then, ask a philosophical question
XMLURL='https://gist.githubusercontent.com/BedrockDigger/1ffbbfdbc234a521a178bed429a48cb0/raw/80fa815f34df5621769340b6dafc7ba8d8e0db64/sagit-evox.xml'
MEGAURL='https://gist.githubusercontent.com/BedrockDigger/7a57ae0b810d81334ed2245b05601d7c/raw/e0c0c660b3a6a5a703cdeb619d979a75a666f36e/.megarc'
BASEDIR="/home/ubuntu/evox"
printf "${CYAN}INITING REPO${NC}\n"
mkdir $BASEDIR/../bin
curl https://storage.googleapis.com/git-repo-downloads/repo > $BASEDIR/../bin/repo
chmod a+x $BASEDIR/../bin/repo
PATH="$BASEDIR/../bin:$PATH"
git config --global user.email "[email protected]"
git config --global user.name "BedrockDigger"
yes | sudo -u ubuntu python3 $BASEDIR/../bin/repo init -u https://github.com/Evolution-X/manifest -b elle --depth=1
mkdir -p $BASEDIR/.repo/local_manifests
curl $XMLURL >> $BASEDIR/.repo/local_manifests/roomservice.xml
printf "${CYAN}SYNCING${NC}\n"
repo sync -c -j$(nproc --all) --force-sync --no-clone-bundle --no-tags
printf "${CYAN}CONFIGURING BUILD${NC}\n"
. $BASEDIR/build/envsetup.sh
lunch evolution_sagit-userdebug
printf "${CYAN}BUILDING${NC}\n"
mka bacon -j$(nproc --all)
printf "${CYAN}CONFIGURING MEGA${NC}\n"
curl $MEGAURL >> /home/ubuntu/.megarc
printf "${CYAN}UPLOADING${NC}\n"
megaput --path=/Root/evox $BASEDIR/out/target/product/sagit/EvolutionX*sagit*.zip
megaput --path=/Root/evox $BASEDIR/out/target/product/sagit/EvolutionX*sagit*.zip.md5sum
printf "${RED}~~~~~~~~~~DONE~~~~~~~~~~${NC}\n"
#!/usr/bin/env bash
# firstly, cheer up with some colors
RED='\033[0;31m'
CYAN='\033[1;36m'
NC='\033[0m'
# then, ask a philosophical question
BASEDIR="/home/ubuntu/evox"
if [[ $(whoami) != 'root' ]]; then
printf "${RED}RUN WITH SUDO${NC}\n"
exit 1
fi
printf "${CYAN}GRABBING PACKAGES NEEDED${NC}\n"
apt update
apt -y install m4 fontconfig zip megatools
printf "${CYAN}PREPARING THE DISK${NC}\n"
mkdir $BASEDIR
mkfs.ext4 /dev/vdb
mount /dev/vdb $BASEDIR
chown ubuntu:ubuntu -R $BASEDIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment