aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-08-25 23:12:25 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-27 22:29:46 +0100
commit7cffcdcfdf4f8934d212740a6d7cf136911ebdac (patch)
tree9de4c380b58eb7a1d7cb09ecc68441f155aea0aa
parentf901f23eb05cd6b86a49ef1b6ec7efaf72f6d685 (diff)
downloadopenembedded-core-contrib-7cffcdcfdf4f8934d212740a6d7cf136911ebdac.tar.gz
wic: added 'fstypes' parameter to Disk.__init__
This parameter specifies list of supported filesystems. So far only 'fat' is supported, but 'wic write' is going to support at least 'fat', 'ext' and 'swap'. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.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 e169147aba..9f2e87f88b 100644
--- a/scripts/lib/wic/engine.py
+++ b/scripts/lib/wic/engine.py
@@ -232,9 +232,10 @@ def wic_list(args, scripts_path):
class Disk:
- def __init__(self, imagepath, native_sysroot):
+ def __init__(self, imagepath, native_sysroot, fstypes=('fat',)):
self.imagepath = imagepath
self.native_sysroot = native_sysroot
+ self.fstypes = fstypes
self._partitions = None
self._partimages = {}
self._lsector_size = None
@@ -288,7 +289,11 @@ class Disk:
if pnum not in self.partitions:
raise WicError("Partition %s is not in the image")
part = self.partitions[pnum]
- if not part.fstype.startswith("fat"):
+ # check if fstype is supported
+ for fstype in self.fstypes:
+ if part.fstype.startswith(fstype):
+ break
+ else:
raise WicError("Not supported fstype: {}".format(part.fstype))
if pnum not in self._partimages:
tmpf = tempfile.NamedTemporaryFile(prefix="wic-part")