8 echo "please set git user and email. e.g."
9 echo git config --global user.email "you@example.com"
10 echo git config --global user.name "Your Name"
11 echo "make use both termial and git could accesss google.com, press enter to continue"
15 echo "prepare environment"
16 sudo sed -i "s/# deb-src/ deb-src/g" /etc/apt/sources.list
18 sudo apt install -y openjdk-8-jdk
19 sudo apt install -y libx11-dev libreadline6-dev libgl1-mesa-dev g++-multilib
20 sudo apt install -y git flex bison gperf build-essential libncurses5-dev
21 sudo apt install -y tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev
22 sudo apt install -y dpkg-dev libsdl1.2-dev
23 sudo apt install -y git-core gnupg flex bison gperf build-essential
24 sudo apt install -y zip curl zlib1g-dev gcc-multilib g++-multilib
25 sudo apt install -y libc6-dev
26 sudo apt install -y lib32ncurses5-dev x11proto-core-dev libx11-dev
27 sudo apt install -y libgl1-mesa-dev libxml2-utils xsltproc unzip m4
28 sudo apt install -y lib32z-dev ccache
29 sudo apt install -y bc python flex bison gperf libsdl-dev build-essential zip curl
31 if [ ! -d robox ]; then
33 git clone https://github.com/kunpengcompute/robox.git
35 echo "robox directory exist, skip, clone robox"
38 echo "try to clone Android"
39 if [ ! -x /usr/bin/repo ]; then
40 sudo apt install -y repo
41 #do not use the official repo because it it too new.
42 #if [ ! -x ~/bin/repo ]; then
46 #curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
48 #echo "replace with python3"
49 #sed -i "s/#\!\/usr\/bin\/env python$/#\!\/usr\/bin\/env python3/g" ~/bin/repo
51 echo "repo exist, skip"
54 if [ ! -d anbox-work ]; then
55 echo "clone anbox android code"
58 repo init -u https://github.com/anbox/platform_manifests.git -b anbox
59 # total disk size is about 160G
61 echo "fallback the code"
62 cp -p robox/binaryFiles/snapshot20191206.xml anbox-work/.repo/manifests/
64 repo init -m snapshot20191206.xml
65 repo sync --force-sync frameworks/opt/net/wifi
69 echo "anbox-work exist, skip to clone anbox android code"
70 echo "fallback the code locally"
71 cp -p robox/binaryFiles/snapshot20191206.xml anbox-work/.repo/manifests/
73 repo init -m snapshot20191206.xml
74 repo sync --force-sync frameworks/opt/net/wifi
75 repo sync -d -j16 --local-only
79 echo "replace anbox code"
80 rm -rf $ANDROID/vendor/anbox
81 cp -rp $ROBOX $ANDROID/vendor/anbox
82 #fi # if [ 0 -gt 1 ]; then
85 cp -p $EXAGEAR/android/android-7.1.1_r13.patch $ANDROID
86 cp -pr $EXAGEAR/android/vendor $ANDROID
89 cp -pr $ROBOX/patch/android-7.1.1_r13-V1.0/* $ANDROID
90 status=`cat script/status`
91 if [ ! "PATCH_ANDROID_DONE" == $status ]; then
92 echo "Patching Android"
93 cp -pr $ROBOX/patch/patch.sh $ANDROID
96 echo PATCH_ANDROID_DONE > script/status
99 echo "Patch has already finished, skip patch"
104 #setup build environment
105 source build/envsetup.sh
107 lunch anbox_arm64-userdebug
108 export JACK_EXTRA_CURL_OPTIONS=-k
112 echo "generate the android.img"
113 cd vendor/anbox && ./scripts/create-package.sh $PWD/../../out/target/product/arm64/ramdisk.img $PWD/../../out/target/product/arm64/system.img