Skip to content

Instantly share code, notes, and snippets.

@nickwph
Last active October 13, 2021 02:42
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save nickwph/0ec5e7fa1c3c79ba259f to your computer and use it in GitHub Desktop.
Save nickwph/0ec5e7fa1c3c79ba259f to your computer and use it in GitHub Desktop.
CentOS 7 AOSP Building Guide

CentOS 7 AOSP Building Guide

install libraries

# fetch source
sudo yum install git
sudo yum install wget
# to compile
sudo yum install java-1.7.0-openjdk
sudo yum install java-1.7.0-openjdk-devel
sudo yum install glibc.i686
sudo yum install libstdc++.i686
sudo yum install bison
sudo yum install zip
sudo yum install unzip

install repo

mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

fetch source

pick the branch you want

mkdir ~/aosp
cd ~/aosp
repo init -u https://android.googlesource.com/platform/manifest -b android-6.0.0_r1
repo sync

fetch and extract binaries for hammerhead

https://developers.google.com/android/nexus/drivers#hammerheadmra58k

cd ~/aosp
wget https://dl.google.com/dl/android/hammerhead/qcom-hammerhead-mra58k-ff98ab07.tgz
wget https://dl.google.com/dl/android/hammerhead/lge-hammerhead-mra58k-25d00e3d.tgz
wget https://dl.google.com/dl/android/hammerhead/broadcom-hammerhead-mra58k-bed5b700.tgz
ls *.tgz |xargs -n1 tar -zxvf
for i in extract*; do sed -n '/tail/p' $i | sed "s/\$0/$i/" | sh; done

fetch and extract binaries for fugu

https://developers.google.com/android/nexus/drivers#fugumra58k

cd ~/aosp
wget https://dl.google.com/dl/android/aosp/asus-fugu-mra58k-d95031a4.tgz
wget https://dl.google.com/dl/android/aosp/broadcom-fugu-mra58k-47a937a0.tgz
wget https://dl.google.com/dl/android/aosp/google-fugu-mra58k-97e3d519.tgz
wget https://dl.google.com/dl/android/aosp/intel-fugu-mra58k-3a7b47c4.tgz
wget https://dl.google.com/dl/android/aosp/widevine-fugu-mra58k-34f49f9a.tgz
ls *.tgz |xargs -n1 tar -zxvf 
rm *.tgz
for i in extract*.sh; do sed -n '/tail/p' $i | sed "s/\$0/$i/" | sh; done
rm extract*.sh

setup envornment for hammerhead

cd ~/aosp
. build/envsetup.sh
lunch 17

setup envornment for fugu

cd ~/aosp
. build/envsetup.sh
lunch 10

run

cd ~/aosp
export USE_CCACHE=1
export CCACHE_DIR=~/.ccache
prebuilts/misc/linux-x86/ccache/ccache -M 50G
make -j16

download images for hammerhead

REMOTE_PATH="<ip-address>:~/aosp/out/target/product/hammerhead/"
scp ${REMOTE_PATH}\{android-info.txt,boot.img,recovery.img,cache.img,userdata.img,system.img\} .

download images for fugu

REMOTE_PATH="<ip-address>:~/aosp/out/target/product/fugu/"
scp ${REMOTE_PATH}\{android-info.txt,boot.img,recovery.img,cache.img,userdata.img,system.img\} .

flash images

fastboot flash boot boot.img 
fastboot flash cache cache.img 
fastboot flash recovery recovery.img 
fastboot flash system system.img 
fastboot flash userdata userdata.img 
fastboot reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment