diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-09 22:13:36 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-10 14:50:11 +0000 |
commit | cb454d401a1e7074531b9dd5fd1719b09caf5f66 (patch) | |
tree | 823f0bb50f0cfe5df7a3298f3e9c649cf92a5239 /meta | |
parent | 39ff73152673477e499b39ee1e41eb24625f74ad (diff) | |
download | poky-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')
-rw-r--r-- | meta/files/toolchain-shar-extract.sh | 14 |
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 |
9 | export PATH=`echo "$PATH" | sed -e 's/:\.//' -e 's/::/:/'` | 9 | export PATH=`echo "$PATH" | sed -e 's/:\.//' -e 's/::/:/'` |
10 | 10 | ||
11 | tweakpath () { | ||
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 | ||
22 | tweakpath /usr/sbin | ||
23 | tweakpath /sbin | ||
24 | |||
11 | INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/") | 25 | INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/") |
12 | SDK_ARCH=$(echo @SDK_ARCH@ | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/") | 26 | SDK_ARCH=$(echo @SDK_ARCH@ | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/") |
13 | 27 | ||