diff options
-rw-r--r-- | 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 f0e88fb4e8..28ad3e6473 100644 --- a/scripts/lib/wic/partition.py +++ b/scripts/lib/wic/partition.py | |||
@@ -145,13 +145,11 @@ class Partition(): | |||
145 | self.lineno, self.fstype) | 145 | self.lineno, self.fstype) |
146 | if os.path.isfile(rootfs): | 146 | if os.path.isfile(rootfs): |
147 | os.remove(rootfs) | 147 | os.remove(rootfs) |
148 | for prefix in ("ext", "btrfs", "vfat", "squashfs"): | 148 | |
149 | if self.fstype.startswith(prefix): | 149 | prefix = "ext" if self.fstype.startswith("ext") else self.fstype |
150 | method = getattr(self, | 150 | method = getattr(self, "prepare_empty_partition_" + prefix) |
151 | "prepare_empty_partition_" + prefix) | 151 | method(rootfs, oe_builddir, native_sysroot) |
152 | method(rootfs, oe_builddir, native_sysroot) | 152 | self.source_file = rootfs |
153 | self.source_file = rootfs | ||
154 | break | ||
155 | return | 153 | return |
156 | 154 | ||
157 | plugins = PluginMgr.get_plugins('source') | 155 | plugins = PluginMgr.get_plugins('source') |
@@ -231,19 +229,15 @@ class Partition(): | |||
231 | '--overhead-factor will be applied') | 229 | '--overhead-factor will be applied') |
232 | self.size = int(round(float(rsize_bb))) | 230 | self.size = int(round(float(rsize_bb))) |
233 | 231 | ||
234 | for prefix in ("ext", "btrfs", "vfat", "squashfs"): | 232 | prefix = "ext" if self.fstype.startswith("ext") else self.fstype |
235 | if self.fstype.startswith(prefix): | 233 | method = getattr(self, "prepare_rootfs_" + prefix) |
236 | method = getattr(self, "prepare_rootfs_" + prefix) | 234 | method(rootfs, oe_builddir, rootfs_dir, native_sysroot, pseudo) |
237 | method(rootfs, oe_builddir, rootfs_dir, native_sysroot, pseudo) | 235 | self.source_file = rootfs |
238 | |||
239 | self.source_file = rootfs | ||
240 | 236 | ||
241 | # get the rootfs size in the right units for kickstart (kB) | 237 | # get the rootfs size in the right units for kickstart (kB) |
242 | du_cmd = "du -Lbks %s" % rootfs | 238 | du_cmd = "du -Lbks %s" % rootfs |
243 | out = exec_cmd(du_cmd) | 239 | out = exec_cmd(du_cmd) |
244 | self.size = int(out.split()[0]) | 240 | self.size = int(out.split()[0]) |
245 | |||
246 | break | ||
247 | 241 | ||
248 | def prepare_rootfs_ext(self, rootfs, oe_builddir, rootfs_dir, | 242 | def prepare_rootfs_ext(self, rootfs, oe_builddir, rootfs_dir, |
249 | native_sysroot, pseudo): | 243 | native_sysroot, pseudo): |