summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic
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:30:07 +0100
commitbb1f418a618c3ef483495b9418e5b1fbcf92061e (patch)
tree53ee18a8ed42f4d8a05f4a739a87a100ac39c4e2 /scripts/lib/wic
parent0ad7e3d1eaaa16f53a275e70b8adbc0a83f4efc4 (diff)
downloadpoky-bb1f418a618c3ef483495b9418e5b1fbcf92061e.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'. (From OE-Core rev: 7cffcdcfdf4f8934d212740a6d7cf136911ebdac) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic')
-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):
232 232
233 233
234class Disk: 234class Disk:
235 def __init__(self, imagepath, native_sysroot): 235 def __init__(self, imagepath, native_sysroot, fstypes=('fat',)):
236 self.imagepath = imagepath 236 self.imagepath = imagepath
237 self.native_sysroot = native_sysroot 237 self.native_sysroot = native_sysroot
238 self.fstypes = fstypes
238 self._partitions = None 239 self._partitions = None
239 self._partimages = {} 240 self._partimages = {}
240 self._lsector_size = None 241 self._lsector_size = None
@@ -288,7 +289,11 @@ class Disk:
288 if pnum not in self.partitions: 289 if pnum not in self.partitions:
289 raise WicError("Partition %s is not in the image") 290 raise WicError("Partition %s is not in the image")
290 part = self.partitions[pnum] 291 part = self.partitions[pnum]
291 if not part.fstype.startswith("fat"): 292 # check if fstype is supported
293 for fstype in self.fstypes:
294 if part.fstype.startswith(fstype):
295 break
296 else:
292 raise WicError("Not supported fstype: {}".format(part.fstype)) 297 raise WicError("Not supported fstype: {}".format(part.fstype))
293 if pnum not in self._partimages: 298 if pnum not in self._partimages:
294 tmpf = tempfile.NamedTemporaryFile(prefix="wic-part") 299 tmpf = tempfile.NamedTemporaryFile(prefix="wic-part")