summaryrefslogtreecommitdiffstats
path: root/meta/files
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-09 22:13:36 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-10 14:50:11 +0000
commitcb454d401a1e7074531b9dd5fd1719b09caf5f66 (patch)
tree823f0bb50f0cfe5df7a3298f3e9c649cf92a5239 /meta/files
parent39ff73152673477e499b39ee1e41eb24625f74ad (diff)
downloadpoky-cb454d401a1e7074531b9dd5fd1719b09caf5f66.tar.gz
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. (From OE-Core rev: 8c49ab40c2ff2e60b717f479822d1a0021735429) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/files')
-rw-r--r--meta/files/toolchain-shar-extract.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh
index 3f54c96cc0..91804ec281 100644
--- a/meta/files/toolchain-shar-extract.sh
+++ b/meta/files/toolchain-shar-extract.sh
@@ -8,6 +8,20 @@
8[ -f /etc/environment ] && . /etc/environment 8[ -f /etc/environment ] && . /etc/environment
9export PATH=`echo "$PATH" | sed -e 's/:\.//' -e 's/::/:/'` 9export PATH=`echo "$PATH" | sed -e 's/:\.//' -e 's/::/:/'`
10 10
11tweakpath () {
12 case ":${PATH}:" in
13 *:"$1":*)
14 ;;
15 *)
16 PATH=$PATH:$1
17 esac
18}
19
20# Some systems don't have /usr/sbin or /sbin in the cleaned environment PATH but we make need it
21# for the system's host tooling checks
22tweakpath /usr/sbin
23tweakpath /sbin
24
11INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/") 25INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
12SDK_ARCH=$(echo @SDK_ARCH@ | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/") 26SDK_ARCH=$(echo @SDK_ARCH@ | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
13 27