[gnome-continuous-yocto/gnomeostree-3.28-rocko: 5433/8267] wic: don't silently skip unknown fstypes



commit b4d15e071399dbadf2a9334cc5d49f0a406ac160
Author: Ed Bartosh <ed bartosh linux intel com>
Date:   Thu Mar 30 14:05:52 2017 +0300

    wic: don't silently skip unknown fstypes
    
    Fixed wic code that loops through hard-coded list of known fstypes
    to find prepare_rootfs_<fstype> or prepare_empty_partition_<fstype>
    methods and silently skipping unknown fstypes.
    
    (From OE-Core rev: ebb8fb5f81f473156c9aa4bf1965e538492a851b)
    
    Signed-off-by: Ed Bartosh <ed bartosh linux intel com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 scripts/lib/wic/partition.py |   32 +++++++++++++-------------------
 1 files changed, 13 insertions(+), 19 deletions(-)
---
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index f0e88fb..28ad3e6 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -145,13 +145,11 @@ class Partition():
                                              self.lineno, self.fstype)
                 if os.path.isfile(rootfs):
                     os.remove(rootfs)
-                for prefix in ("ext", "btrfs", "vfat", "squashfs"):
-                    if self.fstype.startswith(prefix):
-                        method = getattr(self,
-                                         "prepare_empty_partition_" + prefix)
-                        method(rootfs, oe_builddir, native_sysroot)
-                        self.source_file = rootfs
-                        break
+
+                prefix = "ext" if self.fstype.startswith("ext") else self.fstype
+                method = getattr(self, "prepare_empty_partition_" + prefix)
+                method(rootfs, oe_builddir, native_sysroot)
+                self.source_file = rootfs
             return
 
         plugins = PluginMgr.get_plugins('source')
@@ -231,19 +229,15 @@ class Partition():
                                '--overhead-factor will be applied')
                 self.size = int(round(float(rsize_bb)))
 
-        for prefix in ("ext", "btrfs", "vfat", "squashfs"):
-            if self.fstype.startswith(prefix):
-                method = getattr(self, "prepare_rootfs_" + prefix)
-                method(rootfs, oe_builddir, rootfs_dir, native_sysroot, pseudo)
-
-                self.source_file = rootfs
+        prefix = "ext" if self.fstype.startswith("ext") else self.fstype
+        method = getattr(self, "prepare_rootfs_" + prefix)
+        method(rootfs, oe_builddir, rootfs_dir, native_sysroot, pseudo)
+        self.source_file = rootfs
 
-                # get the rootfs size in the right units for kickstart (kB)
-                du_cmd = "du -Lbks %s" % rootfs
-                out = exec_cmd(du_cmd)
-                self.size = int(out.split()[0])
-
-                break
+        # get the rootfs size in the right units for kickstart (kB)
+        du_cmd = "du -Lbks %s" % rootfs
+        out = exec_cmd(du_cmd)
+        self.size = int(out.split()[0])
 
     def prepare_rootfs_ext(self, rootfs, oe_builddir, rootfs_dir,
                            native_sysroot, pseudo):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]