]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/populate_sdk_base: enable adding custom commands to SDK install script
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Wed, 10 Sep 2014 17:19:31 +0000 (18:19 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 11 Sep 2014 16:44:40 +0000 (17:44 +0100)
Add an SDK_POST_INSTALL_COMMAND variable which allows additional
commands to be added towards the end of the SDK install script, for e.g.
additional processing that needs to be done as part of installing the
SDK.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/populate_sdk_base.bbclass
meta/files/toolchain-shar-template.sh

index abfcdc7744922c984933fd3ae53554a2e78c5f3e..946a1d479b98a14907b235efc9f63e1b755e22d9 100644 (file)
@@ -51,6 +51,7 @@ PID = "${@os.getpid()}"
 EXCLUDE_FROM_WORLD = "1"
 
 SDK_PACKAGING_FUNC ?= "create_shar"
+SDK_POST_INSTALL_COMMAND ?= ""
 
 SDK_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.manifest"
 python write_target_sdk_manifest () {
@@ -142,10 +143,16 @@ fakeroot create_shar() {
        # copy in the template shar extractor script
        cp ${COREBASE}/meta/files/toolchain-shar-template.sh ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
 
+       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
+
        # substitute variables
        sed -i -e 's#@SDK_ARCH@#${SDK_ARCH}#g' \
                -e 's#@SDKPATH@#${SDKPATH}#g' \
                -e 's#@REAL_MULTIMACH_TARGET_SYS@#${REAL_MULTIMACH_TARGET_SYS}#g' \
+               -e '/@SDK_POST_INSTALL_COMMAND@/d' \
                ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
 
        # add execution permission
index a37d6ff786f348b2601bca70706d39a9546e1d33..02035d4539af512a100638f39ff098661c4f3d15 100644 (file)
@@ -169,6 +169,8 @@ done
 
 echo done
 
+@SDK_POST_INSTALL_COMMAND@
+
 # delete the relocating script, so that user is forced to re-run the installer
 # if he/she wants another location for the sdk
 if [ $savescripts = 0 ] ; then