diff options
-rwxr-xr-x | a80build.sh | 102 |
1 files changed, 101 insertions, 1 deletions
diff --git a/a80build.sh b/a80build.sh index 5d9ae7f..996b380 100755 --- a/a80build.sh +++ b/a80build.sh @@ -1,3 +1,103 @@ #!/bin/bash +set +x -echo "first!" +# get and sync android sources +if [ ! -d android-a80 ]; then + mkdir android-a80 +fi +pushd android-a80 + +if [ ! -d android ]; then + mkdir android +fi +pushd android + +if [ ! -d .repo ]; then + repo init -u https://android.googlesource.com/platform/manifest -b android-4.4.2_r2 +fi +repo sync +popd +popd + +# get tarballs +if [ ! -f a80_release_2_android.tar.bz2 ]; then + wget -O a80_release_2_android.tar.bz2 https://fileserver.linaro.org/ajaxplorer/data/public/f0344e.php?dl=true +fi +if [ ! -f a80_release_2_lichee.tar.bz2 ]; then + wget -O a80_release_2_lichee.tar.bz2 https://fileserver.linaro.org/ajaxplorer/data/public/e90a43.php?dl=true +fi +if [ ! -f gcc-linaro.tar.bz2 ]; then + wget -O gcc-linaro.tar.bz2 https://fileserver.linaro.org/ajaxplorer/data/public/5e63ac.php?dl=true +fi + +# unpack tarballs +mkdir -p unpack/a80_release_2_android unpack/a80_release_2_lichee +if [ ! -d unpack/a80_release_2_android/android ]; then + rm -fr unpack/a80_release_2_android + mkdir unpack/a80_release_2_android + pushd unpack/a80_release_2_android + bzip2 -d < ../../a80_release_2_android.tar.bz2 | tar xfv - + popd + cp -a unpack/a80_release_2_android/android/* android-a80/android +fi +if [ ! -d unpack/a80_release_2_lichee ]; then + rm -fr unpack/a80_release_2_lichee + mkdir unpack/a80_release_2_lichee + pushd unpack/a80_release_2_lichee + bzip2 -d < ../../a80_release_2_lichee.tar.bz2 | tar xfv - + popd + cp -a unpack/a80_release_2_lichee/lichee android-a80/ +fi + +# grab a80 linux kernel +pushd android-a80/lichee +if [ ! -d linux-3.10 ]; then + git clone ssh://linaro-private.git.linaro.org/srv/linaro-private.git.linaro.org/lhg/allwinner/linux-lsk-alw.git linux-3.10 + pushd linux-3.10 + git checkout a80_porting + popd +fi +pushd linux-3.10 +git pull +popd +popd + +if [ ! -f .001-wifi.patch.done ]; then + patch -p1 < 001-wifi.patch + touch .001-wifi.patch.done +fi +if [ ! -f .002-wifi.patch.done ]; then + patch -p1 < 002-wifi.patch + touch .002-wifi.patch.done +fi + +# build linux kernel +if [ ! -f android-a80/lichee/buildroot/dl/gcc-linaro.tar.bz2 ]; then + mkdir android-a80/lichee/buildroot/dl + cp gcc-linaro.tar.bz2 android-a80/lichee/buildroot/dl +fi +if [ ! -f android-a80/lichee/.buildconfig ]; then + cp dot.buildconfig android-a80/lichee/.buildconfig +fi +if [ ! -f android-a80/lichee/build.sh ]; then + pushd android-a80/lichee + cp buildroot/scripts/top_build.sh build.sh + popd +fi +pushd android-a80/lichee +./build.sh +if [ $? -ne 0 ]; then + exit 1 +fi +popd + +# build android +pushd android-a80/android +source build/envsetup.sh +lunch kylin_optimus-eng +extract-bsp +make -j16 +if [ $? -ne 0 ]; then + exit 1 +fi +popd |