Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 3/9] wic: don't silently skip unknown fstypes
Date: Thu, 30 Mar 2017 21:43:45 +0300	[thread overview]
Message-ID: <db68f23066569fa07a40927620ac22261ceadd33.1490898545.git.ed.bartosh@linux.intel.com> (raw)
In-Reply-To: <cover.1490898545.git.ed.bartosh@linux.intel.com>

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.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 scripts/lib/wic/partition.py | 32 +++++++++++++-------------------
 1 file 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):
-- 
2.1.4



  parent reply	other threads:[~2017-03-30 18:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30 18:43 [PATCH 0/9] wic: Fix fstype handling Ed Bartosh
2017-03-30 18:43 ` [PATCH 1/9] oe-selftest: fix incorrect fstype Ed Bartosh
2017-03-30 18:43 ` [PATCH 2/9] wic: allow only supported fstypes Ed Bartosh
2017-03-30 18:43 ` Ed Bartosh [this message]
2017-03-30 18:43 ` [PATCH 4/9] wic: support 'msdos' fstype Ed Bartosh
2017-03-30 18:43 ` [PATCH 5/9] wic: set FAT 16 for msdos partitions Ed Bartosh
2017-03-30 18:43 ` [PATCH 6/9] wic: set correct system id " Ed Bartosh
2017-03-30 18:43 ` [PATCH 7/9] wic: fix list of supported fstypes in help content Ed Bartosh
2017-03-30 18:43 ` [PATCH 8/9] oe-selftest: test creation of msdos partition Ed Bartosh
2017-03-30 18:43 ` [PATCH 9/9] wic: remove prepare_empty_partition_squashfs Ed Bartosh
2017-03-30 19:02 ` ✗ patchtest: failure for wic: Fix fstype handling Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=db68f23066569fa07a40927620ac22261ceadd33.1490898545.git.ed.bartosh@linux.intel.com \
    --to=ed.bartosh@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox