From 2563aa55281c60c877d8a298b6884ee7da550234 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] (From OE-Core rev: 309e8f4e536148056223f50637ed291c48d148ca) Signed-off-by: Randy Witt Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/classes/populate_sdk_ext.bbclass | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'meta/classes/populate_sdk_ext.bbclass') diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass index 8a80a563f0..b28413b8f5 100644 --- a/meta/classes/populate_sdk_ext.bbclass +++ b/meta/classes/populate_sdk_ext.bbclass @@ -173,6 +173,17 @@ install_tools() { install ${SDK_DEPLOY}/${BUILD_ARCH}-nativesdk-libc.tar.bz2 ${SDK_OUTPUT}/${SDKPATH} } +# Since bitbake won't run as root it doesn't make sense to try and install +# the extensible sdk as root. +sdk_ext_preinst() { + if [ "`id -u`" = "0" ]; then + echo "ERROR: The extensible sdk cannot be installed as root." + exit 1 + fi + SDK_EXTENSIBLE="1" +} +SDK_PRE_INSTALL_COMMAND_task-populate-sdk-ext = "${sdk_ext_preinst}" + # FIXME this preparation should be done as part of the SDK construction sdk_ext_postinst() { printf "\nExtracting buildtools...\n" -- cgit v1.2.3-54-g00ecf