summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Bourque <wbourque@gmail.com>2019-02-11 15:00:48 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-04-25 15:01:21 +0100
commite90f7a24fe2c7e2bfa6bbe34d342d53e5134cc2d (patch)
treeaac4f0effbdaaeeb5ff32060e2c22c2b6c76f4db
parent796788c025d4576c27d25ed50401c55e2e589bbb (diff)
downloadpoky-e90f7a24fe2c7e2bfa6bbe34d342d53e5134cc2d.tar.gz
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: c8331fa157b83a3ed77f77a6e884c7fbc4f1d91b) 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>
-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 951bf30717..c1270456f5 100644
--- a/scripts/lib/wic/engine.py
+++ b/scripts/lib/wic/engine.py
@@ -244,8 +244,13 @@ 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 self.paths = "/bin:/usr/bin:/usr/sbin:/sbin/" 248 # if it fails, use hardcoded paths
249 try:
250 self.paths = os.environ['PATH']
251 except KeyError:
252 self.paths = "/bin:/usr/bin:/usr/sbin:/sbin/"
253
249 if native_sysroot: 254 if native_sysroot:
250 for path in self.paths.split(':'): 255 for path in self.paths.split(':'):
251 self.paths = "%s%s:%s" % (native_sysroot, path, self.paths) 256 self.paths = "%s%s:%s" % (native_sysroot, path, self.paths)