From 309e8f4e536148056223f50637ed291c48d148ca Mon Sep 17 00:00:00 2001 From: Randy Witt Date: Thu, 16 Jul 2015 13:34:21 -0700 Subject: extensible sdk: Error when trying to install as root. Since the extensible sdk uses bitbake, which can't run as root, the sdk shouldn't be installed as root. Previously it would error out late into setup when bitbake errored saying not to run bitbake as root. Now the script errors with a message saying the extensible sdk can't be installed as root. [Yocto #7545] Signed-off-by: Randy Witt Signed-off-by: Ross Burton --- meta/files/toolchain-shar-extract.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'meta/files/toolchain-shar-extract.sh') diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh index 8cb8783f97..0a33ee8f5d 100644 --- a/meta/files/toolchain-shar-extract.sh +++ b/meta/files/toolchain-shar-extract.sh @@ -71,6 +71,8 @@ if [ $verbose = 1 ] ; then set -x fi +@SDK_PRE_INSTALL_COMMAND@ + if [ "$target_sdk_dir" = "" ]; then read -e -p "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): " target_sdk_dir [ "$target_sdk_dir" = "" ] && target_sdk_dir=$DEFAULT_INSTALL_DIR @@ -116,6 +118,11 @@ mkdir -p $target_sdk_dir >/dev/null 2>&1 # if don't have the right to access dir, gain by sudo if [ ! -x $target_sdk_dir -o ! -w $target_sdk_dir -o ! -r $target_sdk_dir ]; then + if [ "$SDK_EXTENSIBLE" = "1" ]; then + echo "Unable to access \"$target_sdk_dir\"." + exit 1 + fi + SUDO_EXEC=$(which "sudo") if [ -z $SUDO_EXEC ]; then echo "No command 'sudo' found, please install sudo first. Abort!" -- cgit v1.2.3