From 0764c21e4372d4417c41bdc1740f9321281555dd Mon Sep 17 00:00:00 2001 From: Florian Boor Date: Tue, 14 Aug 2018 01:15:18 +0200 Subject: [PATCH] meta-environment: Add bbappend to supply BSP specific settings (i.e. prompt with target architecture) and additinal files (setup-environment link) --- recipes-core/meta/meta-environment.bbappend | 33 +++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 recipes-core/meta/meta-environment.bbappend diff --git a/recipes-core/meta/meta-environment.bbappend b/recipes-core/meta/meta-environment.bbappend new file mode 100644 index 0000000..cfb6ba0 --- /dev/null +++ b/recipes-core/meta/meta-environment.bbappend @@ -0,0 +1,33 @@ +# Create custom settings script to become included by environment script + +fakeroot do_create_kc_sdk_file() { + mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d + script=${D}${SDKPATHNATIVE}/environment-setup.d/kcbsp.sh + + echo 'basename -- "$0$ZSH_VERSION" | grep -q "^environment-setup$" && echo "$SHELL" | grep -q "/\(\([bd]ash\)\|\([k]sh\)\)$" && ENV=$0 POSIXLY_CORRECT=1 exec $SHELL -i' >> $script + echo 'basename -- "$0$ZSH_VERSION" | grep -q "^environment-setup$" && echo "Usage: . $0" && exit 1' >> $script + echo 'echo "Applying environment settings..."' >> $script + echo 'echo "Version ${DISTRO_VERSION}-${DISTRO_BUILD}"' >> $script + echo 'export PS1="[$ARCH] $PS1"' >> $script + + echo 'SDK_PATH=$OECORE_NATIVE_SYSROOT/usr' >> $script + echo 'alias opkg-target="LD_LIBRARY_PATH=$SDK_PATH/lib $SDK_PATH/bin/opkg-cl -f $SDKTARGETSYSROOT/etc/opkg.conf -o $SDKTARGETSYSROOT"' >> $script + + sed -i -e 's:${SDKPATHNATIVE}:$OECORE_NATIVE_SYSROOT:g' ${script} +} + +# Deploy generic link for environment setup + +do_install_append () { + mkdir -p ${D}/${SDKPATH}/ + cd ${D}/${SDKPATH}/ + ln -sf environment-setup-${REAL_MULTIMACH_TARGET_SYS} environment-setup + cd - +} + +FILES_${PN} += " \ + ${SDKPATH}/environment-setup \ + " + +addtask create_kc_sdk_file after do_install before do_package + -- 2.39.5