From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 02/11] toolchain-shar-extract.sh: better default install path for extensible SDK
Date: Mon, 7 Sep 2015 13:42:18 +0100 [thread overview]
Message-ID: <9f2d826750fa29287d8b8a6936fff200c366dc45.1441629547.git.paul.eggleton@linux.intel.com> (raw)
In-Reply-To: <cover.1441629547.git.paul.eggleton@linux.intel.com>
In-Reply-To: <cover.1441629547.git.paul.eggleton@linux.intel.com>
From: Brendan Le Foll <brendan.le.foll@intel.com>
Extensible SDK cannot be installed as root so by default offer to install it in
user's home directory under distro/distro_version replacing the normal SDK
version '+' char with a '_' as that's a restricted character for bitbake
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/classes/populate_sdk_base.bbclass | 2 ++
| 16 ++++++++++++----
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index a9e9bd7..b015bf0 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -55,6 +55,7 @@ SDK_PRE_INSTALL_COMMAND ?= ""
SDK_POST_INSTALL_COMMAND ?= ""
SDK_RELOCATE_AFTER_INSTALL ?= "1"
+SDKEXTPATH ?= "~/${@d.getVar('DISTRO', True)}_sdk"
SDK_TITLE ?= "${@d.getVar('DISTRO_NAME', True) or d.getVar('DISTRO', True)} SDK"
SDK_TARGET_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.target.manifest"
@@ -154,6 +155,7 @@ EOF
# substitute variables
sed -i -e 's#@SDK_ARCH@#${SDK_ARCH}#g' \
-e 's#@SDKPATH@#${SDKPATH}#g' \
+ -e 's#@SDKEXTPATH@#${SDKEXTPATH}#g' \
-e 's#@OLDEST_KERNEL@#${OLDEST_KERNEL}#g' \
-e 's#@REAL_MULTIMACH_TARGET_SYS@#${REAL_MULTIMACH_TARGET_SYS}#g' \
-e 's#@SDK_TITLE@#${SDK_TITLE}#g' \
--git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh
index 85719fa..27a1607 100644
--- a/meta/files/toolchain-shar-extract.sh
+++ b/meta/files/toolchain-shar-extract.sh
@@ -36,7 +36,6 @@ while getopts ":yd:DRS" OPT; do
case $OPT in
y)
answer="Y"
- [ "$target_sdk_dir" = "" ] && target_sdk_dir=$DEFAULT_INSTALL_DIR
;;
d)
target_sdk_dir=$OPTARG
@@ -73,9 +72,18 @@ fi
@SDK_PRE_INSTALL_COMMAND@
+# SDK_EXTENSIBLE is exposed from the SDK_PRE_INSTALL_COMMAND above
+if [ "$SDK_EXTENSIBLE" = "1" ]; then
+ DEFAULT_INSTALL_DIR="@SDKEXTPATH@"
+fi
+
if [ "$target_sdk_dir" = "" ]; then
- read -e -p "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): " target_sdk_dir
- [ "$target_sdk_dir" = "" ] && target_sdk_dir=$DEFAULT_INSTALL_DIR
+ if [ "$answer" = "Y" ]; then
+ target_sdk_dir="$DEFAULT_INSTALL_DIR"
+ else
+ read -e -p "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): " target_sdk_dir
+ [ "$target_sdk_dir" = "" ] && target_sdk_dir=$DEFAULT_INSTALL_DIR
+ fi
fi
eval target_sdk_dir=$(echo "$target_sdk_dir"|sed 's/ /\\ /g')
@@ -155,7 +163,7 @@ echo "done"
printf "Setting it up..."
# fix environment paths
for env_setup_script in `ls $target_sdk_dir/environment-setup-*`; do
- $SUDO_EXEC sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g" -i $env_setup_script
+ $SUDO_EXEC sed -e "s:@SDKPATH@:$target_sdk_dir:g" -i $env_setup_script
done
@SDK_POST_INSTALL_COMMAND@
--
2.1.0
next prev parent reply other threads:[~2015-09-07 12:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-07 12:42 [PATCH 00/11] Extensible SDK fixes Paul Eggleton
2015-09-07 12:42 ` [PATCH 01/11] toolchain-shar-extract.sh: ensure extensible SDK install path obeys restrictions Paul Eggleton
2015-09-07 12:42 ` Paul Eggleton [this message]
2015-09-07 12:42 ` [PATCH 03/11] toolchain-shar-extract.sh: explain why we cannot use sudo in extensible SDK Paul Eggleton
2015-09-07 12:42 ` [PATCH 04/11] classes/populate_sdk_ext: avoid poky-specific buildtools naming Paul Eggleton
2015-09-07 12:42 ` [PATCH 05/11] populate_sdk_ext: install the latest buildtools-tarball Paul Eggleton
2015-09-07 12:42 ` [PATCH 06/11] copy_buildsystem: make sure bitbake directory is copied Paul Eggleton
2015-09-07 12:42 ` [PATCH 07/11] populate_sdk_ext: consider custom configuration in local.conf Paul Eggleton
2015-09-07 12:42 ` [PATCH 08/11] populate_sdk_ext: don't remove the native qemu dependencies Paul Eggleton
2015-09-07 12:42 ` [PATCH 09/11] Extensible SDK: allow for installation without preparing build system Paul Eggleton
2015-09-07 12:42 ` [PATCH 10/11] oe-publish-sdk: add script Paul Eggleton
2015-09-07 12:42 ` [PATCH 11/11] devtool: add mechanism for updating extensible SDK Paul Eggleton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9f2d826750fa29287d8b8a6936fff200c366dc45.1441629547.git.paul.eggleton@linux.intel.com \
--to=paul.eggleton@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox