summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2018-02-12 10:52:07 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-02-16 18:05:38 +0000
commitcf85c5a490b7044f2a5291c7df646248e81770f7 (patch)
treef505ed79bf872b358f29e563199fb723e7d7b977 /meta
parentf51f28b7b927fde9489e244cb812b562f28bbafa (diff)
downloadpoky-cf85c5a490b7044f2a5291c7df646248e81770f7.tar.gz
toolchain-shar-extract: Add post-relocate scripts
Recipes can now install post-relocation scripts which will be run when the SDK is installed. (From OE-Core rev: 93ec145f421a45077b40ae99ee6a96bc11f91f18) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/toolchain-scripts.bbclass15
-rw-r--r--meta/files/toolchain-shar-extract.sh8
-rw-r--r--meta/recipes-core/meta/meta-environment.bb2
3 files changed, 25 insertions, 0 deletions
diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index 9bcfe708c7..eeb320d15a 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -116,6 +116,21 @@ fi
116EOF 116EOF
117} 117}
118 118
119toolchain_create_post_relocate_script() {
120 script=$1
121 rm -f $script
122 touch $script
123
124 cat >> $script <<EOF
125if [ -d "${SDKPATHNATIVE}/post-relocate-setup.d/" ]; then
126 for s in ${SDKPATHNATIVE}/post-relocate-setup.d/*.sh; do
127 \$s "\$1"
128 done
129 rm -rf "${SDKPATHNATIVE}/post-relocate-setup.d"
130fi
131EOF
132}
133
119#we get the cached site config in the runtime 134#we get the cached site config in the runtime
120TOOLCHAIN_CONFIGSITE_NOCACHE = "${@siteinfo_get_files(d)}" 135TOOLCHAIN_CONFIGSITE_NOCACHE = "${@siteinfo_get_files(d)}"
121TOOLCHAIN_CONFIGSITE_SYSROOTCACHE = "${STAGING_DIR}/${MLPREFIX}${MACHINE}/${target_datadir}/${TARGET_SYS}_config_site.d" 136TOOLCHAIN_CONFIGSITE_SYSROOTCACHE = "${STAGING_DIR}/${MLPREFIX}${MACHINE}/${target_datadir}/${TARGET_SYS}_config_site.d"
diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh
index 91804ec281..f7ab43066f 100644
--- a/meta/files/toolchain-shar-extract.sh
+++ b/meta/files/toolchain-shar-extract.sh
@@ -259,6 +259,14 @@ if [ $savescripts = 0 ] ; then
259 $SUDO_EXEC rm -f ${env_setup_script%/*}/relocate_sdk.py ${env_setup_script%/*}/relocate_sdk.sh 259 $SUDO_EXEC rm -f ${env_setup_script%/*}/relocate_sdk.py ${env_setup_script%/*}/relocate_sdk.sh
260fi 260fi
261 261
262# Execute post-relocation script
263post_relocate="$target_sdk_dir/post-relocate-setup.sh"
264if [ -e "$post_relocate" ]; then
265 $SUDO_EXEC sed -e "s:@SDKPATH@:$target_sdk_dir:g" -i $post_relocate
266 $SUDO_EXEC /bin/sh $post_relocate "$target_sdk_dir" "@SDKPATH@"
267 $SUDO_EXEC rm -f $post_relocate
268fi
269
262echo "SDK has been successfully set up and is ready to be used." 270echo "SDK has been successfully set up and is ready to be used."
263echo "Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g." 271echo "Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g."
264for env_setup_script in `ls $target_sdk_dir/environment-setup-*`; do 272for env_setup_script in `ls $target_sdk_dir/environment-setup-*`; do
diff --git a/meta/recipes-core/meta/meta-environment.bb b/meta/recipes-core/meta/meta-environment.bb
index 29da121a3a..09f757a087 100644
--- a/meta/recipes-core/meta/meta-environment.bb
+++ b/meta/recipes-core/meta/meta-environment.bb
@@ -55,6 +55,8 @@ create_sdk_files() {
55 55
56 # Add version information 56 # Add version information
57 toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${REAL_MULTIMACH_TARGET_SYS} 57 toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${REAL_MULTIMACH_TARGET_SYS}
58
59 toolchain_create_post_relocate_script ${SDK_OUTPUT}/${SDKPATH}/post-relocate-setup.sh
58} 60}
59 61
60do_install() { 62do_install() {