aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/populate_sdk_base.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:40:40 +0100
commit2563aa55281c60c877d8a298b6884ee7da550234 (patch)
tree46b239e6fac44e050c7741db7c871ffb5c95b169 /meta/classes/populate_sdk_base.bbclass
parent873b8edd4100aa6a0d21e2bea20fbe7539de041a (diff)
downloadopenembedded-core-contrib-2563aa55281c60c877d8a298b6884ee7da550234.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] (From OE-Core rev: 309e8f4e536148056223f50637ed291c48d148ca) Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/populate_sdk_base.bbclass')
-rw-r--r--meta/classes/populate_sdk_base.bbclass12
1 files changed, 10 insertions, 2 deletions
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 398e943a46..a9e9bd71d2 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -51,6 +51,7 @@ PID = "${@os.getpid()}"
EXCLUDE_FROM_WORLD = "1"
SDK_PACKAGING_FUNC ?= "create_shar"
+SDK_PRE_INSTALL_COMMAND ?= ""
SDK_POST_INSTALL_COMMAND ?= ""
SDK_RELOCATE_AFTER_INSTALL ?= "1"
@@ -134,15 +135,21 @@ fakeroot create_shar() {
# copy in the template shar extractor script
cp ${COREBASE}/meta/files/toolchain-shar-extract.sh ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
- rm -f ${T}/post_install_command
+ rm -f ${T}/pre_install_command ${T}/post_install_command
if [ ${SDK_RELOCATE_AFTER_INSTALL} -eq 1 ] ; then
cp ${COREBASE}/meta/files/toolchain-shar-relocate.sh ${T}/post_install_command
fi
+ cat << "EOF" >> ${T}/pre_install_command
+${SDK_PRE_INSTALL_COMMAND}
+EOF
+
cat << "EOF" >> ${T}/post_install_command
${SDK_POST_INSTALL_COMMAND}
EOF
- sed -i -e '/@SDK_POST_INSTALL_COMMAND@/r ${T}/post_install_command' ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
+ sed -i -e '/@SDK_PRE_INSTALL_COMMAND@/r ${T}/pre_install_command' \
+ -e '/@SDK_POST_INSTALL_COMMAND@/r ${T}/post_install_command' \
+ ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
# substitute variables
sed -i -e 's#@SDK_ARCH@#${SDK_ARCH}#g' \
@@ -151,6 +158,7 @@ EOF
-e 's#@REAL_MULTIMACH_TARGET_SYS@#${REAL_MULTIMACH_TARGET_SYS}#g' \
-e 's#@SDK_TITLE@#${SDK_TITLE}#g' \
-e 's#@SDK_VERSION@#${SDK_VERSION}#g' \
+ -e '/@SDK_PRE_INSTALL_COMMAND@/d' \
-e '/@SDK_POST_INSTALL_COMMAND@/d' \
${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh