diff --git a/scripts/create-package.sh b/scripts/create-package.sh index ca7cc21..6ffc55d 100755 --- a/scripts/create-package.sh +++ b/scripts/create-package.sh @@ -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