aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/populate_sdk_ext.bbclass
diff options
context:
space:
mode:
authorRandy Witt <randy.e.witt@linux.intel.com>2015-07-16 13:34:21 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-20 10:39:00 +0100
commit309e8f4e536148056223f50637ed291c48d148ca (patch)
tree495fed394f4e35faf64892e8155df3e7d993c835 /meta/classes/populate_sdk_ext.bbclass
parent7785c496df839bd811cb33aef4b54158e81aa2c5 (diff)
downloadopenembedded-core-contrib-309e8f4e536148056223f50637ed291c48d148ca.tar.gz
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 <randy.e.witt@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes/populate_sdk_ext.bbclass')
-rw-r--r--meta/classes/populate_sdk_ext.bbclass11
1 files changed, 11 insertions, 0 deletions
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"