summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorWilliam Bourque <wbourque@gmail.com>2019-02-11 15:00:48 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-25 22:27:40 +0000
commitb55c0d0a173b2495d11c273203f0ee3a0cae1cb1 (patch)
tree1b293166de61018c6165638dba2ebc51e09dd85c /scripts
parent11e09611df3dcd4968ea7d84cf2929ac33ebdf26 (diff)
downloadpoky-b55c0d0a173b2495d11c273203f0ee3a0cae1cb1.tar.gz
poky-b55c0d0a173b2495d11c273203f0ee3a0cae1cb1.tar.bz2
poky-b55c0d0a173b2495d11c273203f0ee3a0cae1cb1.zip
wic/engine.py: Load paths from PATH environment variable
Load self.paths from environment variable and if it fails, fall back to hardcoded list. This is required for users that would need to load different e2fsprogs binaries if their system's ones are not recent enought (From OE-Core rev: a88bcbae850a2e6d182291d3f8e167aabdbe4842) (From OE-Core rev: 319ee1bb146b91f78d7a141def2b1cf92cf88887) Signed-off-by: William Bourque <wbourque@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/engine.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
index 97f5e848cc..880e464036 100644
--- a/scripts/lib/wic/engine.py
+++ b/scripts/lib/wic/engine.py
@@ -244,8 +244,13 @@ class Disk:
self._psector_size = None
self._ptable_format = None
- # find parted
- self.paths = "/bin:/usr/bin:/usr/sbin:/sbin/"
+ # read paths from $PATH environment variable
+ # if it fails, use hardcoded paths
+ try:
+ self.paths = os.environ['PATH']
+ except KeyError:
+ self.paths = "/bin:/usr/bin:/usr/sbin:/sbin/"
+
if native_sysroot:
for path in self.paths.split(':'):
self.paths = "%s%s:%s" % (native_sysroot, path, self.paths)