[oe-commits] [openembedded-core] 25/29: toolchain-shar-extract.sh: Ensure sbin directories are in PATH in clean environment
git at git.openembedded.org
git at git.openembedded.org
Thu Mar 9 22:18:36 UTC 2017
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit eec155dbaaea6a74140c22bea14cb9006674c629
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Thu Mar 9 22:13:36 2017 +0000
toolchain-shar-extract.sh: Ensure sbin directories are in PATH in clean environment
For the PATH host tool whitelisting to work, the sbin directories need to be
in PATH. In the cleaned SDK environment on some distros, this isn't the case
and the SDK would then fail to setup there. This adds code to add such paths
if they do happen to be missing, ugly, but unblocks the PATH whitelisting
which I believe to be important.
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/files/toolchain-shar-extract.sh | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh
index 3f54c96..91804ec 100644
--- a/meta/files/toolchain-shar-extract.sh
+++ b/meta/files/toolchain-shar-extract.sh
@@ -8,6 +8,20 @@
[ -f /etc/environment ] && . /etc/environment
export PATH=`echo "$PATH" | sed -e 's/:\.//' -e 's/::/:/'`
+tweakpath () {
+ case ":${PATH}:" in
+ *:"$1":*)
+ ;;
+ *)
+ PATH=$PATH:$1
+ esac
+}
+
+# Some systems don't have /usr/sbin or /sbin in the cleaned environment PATH but we make need it
+# for the system's host tooling checks
+tweakpath /usr/sbin
+tweakpath /sbin
+
INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
SDK_ARCH=$(echo @SDK_ARCH@ | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list