Last active
June 7, 2020 13:20
-
-
Save danpawlik/163d61ff99c82ed3523c9049d4aa682a to your computer and use it in GitHub Desktop.
Build Pixel Experience rom for Pocophone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USE_FEDORA=${USE_FEDORA:-''} | |
if [ ! -f "/swapfile" ]; then | |
sudo fallocate -l 10G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
fi | |
mkdir -p PixelExperience | |
mkdir -p ccache | |
# From https://github.com/PixelExperience/manifest | |
if [ -z "${USE_FEDORA}" ]; then | |
podman run -it \ | |
--name pixelexperience \ | |
--volume $(pwd)/PixelExperience:/root/PixelExperience:Z \ | |
--volume $(pwd)/ccache:/root/ccache:Z \ | |
ubuntu:xenial \ | |
/bin/bash | |
# Now all command execute in container | |
apt-get update | |
apt-get install -y git vim curl wget python-dev python3-dev ccache m4 unzip | |
apt-get install -y openjdk-8-jdk android-tools-adb bc bison build-essential \ | |
curl flex g++-multilib gcc-multilib gnupg gperf imagemagick \ | |
lib32ncurses5-dev lib32readline-dev lib32z1-dev libesd0-dev \ | |
liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev \ | |
libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync \ | |
schedtool squashfs-tools xsltproc yasm zip zlib1g-dev | |
else | |
podman run -it \ | |
--name pixelexperience \ | |
--volume $(pwd)/PixelExperience:/root/PixelExperience:Z \ | |
--volume $(pwd)/ccache:/root/ccache:Z \ | |
fedora:31 \ | |
/bin/bash | |
dnf update -y | |
dnf install -y @development-tools android-tools automake bc bison bzip2 \ | |
bzip2-libs ccache curl dpkg-dev gcc-c++ git gperf hostname \ | |
ImageMagick-devel.x86_64 ImageMagick-c++-devel.x86_64 java-1.8.0-openjdk \ | |
libstdc++.i686 libxml2-devel lz4-libs lzop make maven ncurses-compat-libs \ | |
optipng pngcrush python python3 python3-mako python-mako python-networkx \ | |
rsync schedtool squashfs-tools syslinux-devel zip zlib-devel zlib-devel.i686 | |
fi | |
git config --global user.name "Mr Example" | |
git config --global user.email "example@examle.com" | |
curl https://storage.googleapis.com/git-repo-downloads/repo > /bin/repo | |
chmod 755 /bin/repo | |
mkdir -p $HOME/ccache | |
cd $HOME/PixelExperience | |
repo init -u https://github.com/PixelExperience/manifest -b ten-plus | |
repo sync --force-sync --current-branch --no-tags --no-clone-bundle --optimized-fetch --prune -j$(nproc --all) | |
. build/envsetup.sh | |
export USER=$(whoami) | |
export USE_CCACHE=1 | |
export CCACHE_DIR=../ccache | |
ccache -M10G | |
lunch aosp_beryllium-userdebug | |
mka bacon -j8 | |
exit 0 | |
sudo swapoff -v /swapfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment