]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: added 'fstypes' parameter to Disk.__init__
authorEd Bartosh <ed.bartosh@linux.intel.com>
Fri, 25 Aug 2017 20:12:25 +0000 (23:12 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 27 Aug 2017 21:29:46 +0000 (22:29 +0100)
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>
scripts/lib/wic/engine.py

index e169147aba8006a69c3451c5746ccd8da75eb024..9f2e87f88b61ed73016d72ef9db93742186f26c5 100644 (file)
@@ -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")