Make sure Android package is constructed from top build dir

This commit is contained in:
Simon Fels 2016-07-11 18:33:42 +02:00
commit 709807984f

View file

@ -1,8 +1,9 @@
#!/bin/bash
TOPDIR=`pwd`
TOPDIR=`echo $ANDROID_BUILD_TOP`
PRODUCT_NAME=generic_arm64
OUTDIR=out/target/product/$PRODUCT_NAME
CURDIR=`pwd`
if [ -d rootfs ] ; then
rm -rf rootfs
@ -23,6 +24,12 @@ if [ ! -e rootfs/filesystem_config.txt ] ; then
exit 1
fi
if [ -z "$TOPDIR" ] || [ "$CURDIR" != "$TOPDIR" ] ; then
echo "ERROR: You have to execute this script from the ANDROID_BUILD_TOP"
echo "ERROR: directory."
exit 1
fi
cp anbox-init.sh rootfs/
chmod +x rootfs/anbox-init.sh