diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-15 07:57:25 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-15 08:17:49 +0000 |
commit | 7e52e59222d39dbb9c1c30a8e33d839db752a386 (patch) | |
tree | 7058cd84e6af51a4f68ebd1eb4a2b09b96f8ed36 /scripts/lib/wic | |
parent | 8d47356ad263fee8566c561cb509905e6e19ed59 (diff) | |
download | poky-7e52e59222d39dbb9c1c30a8e33d839db752a386.tar.gz |
wic/engine: Fix missing parted autobuilder failures
OE-Core rev: a88bcbae850a2e6d182291d3f8e167aabdbe4842 broke the ability
to find parted as it may be in sbin which is not in PATH for some users
on some distros.
Iterate on the original patch to fix this and also fix the original problem.
(From OE-Core rev: af3803e5189d7814f9dbd238fb6dab200f351e1a)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic')
-rw-r--r-- | scripts/lib/wic/engine.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py index 880e464036..ea600d2854 100644 --- a/scripts/lib/wic/engine.py +++ b/scripts/lib/wic/engine.py | |||
@@ -244,15 +244,17 @@ class Disk: | |||
244 | self._psector_size = None | 244 | self._psector_size = None |
245 | self._ptable_format = None | 245 | self._ptable_format = None |
246 | 246 | ||
247 | # find parted | ||
247 | # read paths from $PATH environment variable | 248 | # read paths from $PATH environment variable |
248 | # if it fails, use hardcoded paths | 249 | # if it fails, use hardcoded paths |
250 | pathlist = "/bin:/usr/bin:/usr/sbin:/sbin/" | ||
249 | try: | 251 | try: |
250 | self.paths = os.environ['PATH'] | 252 | self.paths = os.environ['PATH'] + ":" + pathlist |
251 | except KeyError: | 253 | except KeyError: |
252 | self.paths = "/bin:/usr/bin:/usr/sbin:/sbin/" | 254 | self.paths = pathlist |
253 | 255 | ||
254 | if native_sysroot: | 256 | if native_sysroot: |
255 | for path in self.paths.split(':'): | 257 | for path in pathlist.split(':'): |
256 | self.paths = "%s%s:%s" % (native_sysroot, path, self.paths) | 258 | self.paths = "%s%s:%s" % (native_sysroot, path, self.paths) |
257 | 259 | ||
258 | self.parted = find_executable("parted", self.paths) | 260 | self.parted = find_executable("parted", self.paths) |