summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2015-05-08 21:17:14 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-09 16:37:44 -0700
commit417c86b42bcadb16e6db4296dadcb324b13725fd (patch)
tree16982bae57ca04e1800e88470812a82f6dcba7b9
parentea9016b60b47138bc58d84a06954b44527b20a19 (diff)
downloadpoky-417c86b42bcadb16e6db4296dadcb324b13725fd.tar.gz
wic: remove intermediate partitions
Remove intermediate partitions that may have been created by a previous wic invocation. Those partitions are causing issues on some systems. In particular vfat partition creation is hanging on mcopy execution on Fedora. (From OE-Core rev: 8d2587d87601a7ff0fad840dabc07d66363b2810) (From OE-Core rev: 8bea23a89968db3d44b9fae2ceb242dfd89a4880) Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/wic/kickstart/custom_commands/partition.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py
index f3d553b885..654c38023b 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -231,6 +231,7 @@ class Wic_PartData(Mic_PartData):
231 image_rootfs = rootfs_dir 231 image_rootfs = rootfs_dir
232 rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label ,self.fstype) 232 rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label ,self.fstype)
233 233
234 os.remove(rootfs)
234 du_cmd = "du -ks %s" % image_rootfs 235 du_cmd = "du -ks %s" % image_rootfs
235 out = exec_cmd(du_cmd) 236 out = exec_cmd(du_cmd)
236 actual_rootfs_size = int(out.split()[0]) 237 actual_rootfs_size = int(out.split()[0])
@@ -282,6 +283,7 @@ class Wic_PartData(Mic_PartData):
282 image_rootfs = rootfs_dir 283 image_rootfs = rootfs_dir
283 rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype) 284 rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype)
284 285
286 os.remove(rootfs)
285 du_cmd = "du -ks %s" % image_rootfs 287 du_cmd = "du -ks %s" % image_rootfs
286 out = exec_cmd(du_cmd) 288 out = exec_cmd(du_cmd)
287 actual_rootfs_size = int(out.split()[0]) 289 actual_rootfs_size = int(out.split()[0])
@@ -326,6 +328,7 @@ class Wic_PartData(Mic_PartData):
326 image_rootfs = rootfs_dir 328 image_rootfs = rootfs_dir
327 rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype) 329 rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype)
328 330
331 os.remove(rootfs)
329 du_cmd = "du -bks %s" % image_rootfs 332 du_cmd = "du -bks %s" % image_rootfs
330 out = exec_cmd(du_cmd) 333 out = exec_cmd(du_cmd)
331 blocks = int(out.split()[0]) 334 blocks = int(out.split()[0])
@@ -378,6 +381,7 @@ class Wic_PartData(Mic_PartData):
378 image_rootfs = rootfs_dir 381 image_rootfs = rootfs_dir
379 rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label ,self.fstype) 382 rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label ,self.fstype)
380 383
384 os.remove(rootfs)
381 squashfs_cmd = "mksquashfs %s %s -noappend" % \ 385 squashfs_cmd = "mksquashfs %s %s -noappend" % \
382 (image_rootfs, rootfs) 386 (image_rootfs, rootfs)
383 exec_native_cmd(pseudo + squashfs_cmd, native_sysroot) 387 exec_native_cmd(pseudo + squashfs_cmd, native_sysroot)
@@ -416,6 +420,7 @@ class Wic_PartData(Mic_PartData):
416 """ 420 """
417 fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype) 421 fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
418 422
423 os.remove(fs)
419 dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \ 424 dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \
420 (fs, self.size) 425 (fs, self.size)
421 exec_cmd(dd_cmd) 426 exec_cmd(dd_cmd)
@@ -443,6 +448,7 @@ class Wic_PartData(Mic_PartData):
443 """ 448 """
444 fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype) 449 fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
445 450
451 os.remove(fs)
446 dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \ 452 dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \
447 (fs, self.size) 453 (fs, self.size)
448 exec_cmd(dd_cmd) 454 exec_cmd(dd_cmd)
@@ -467,6 +473,7 @@ class Wic_PartData(Mic_PartData):
467 Prepare an empty vfat partition. 473 Prepare an empty vfat partition.
468 """ 474 """
469 fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype) 475 fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
476 os.remove(fs)
470 477
471 blocks = self.size 478 blocks = self.size
472 479
@@ -493,6 +500,7 @@ class Wic_PartData(Mic_PartData):
493 "Proceeding as requested." % self.mountpoint) 500 "Proceeding as requested." % self.mountpoint)
494 501
495 fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype) 502 fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
503 os.remove(fs)
496 504
497 # it is not possible to create a squashfs without source data, 505 # it is not possible to create a squashfs without source data,
498 # thus prepare an empty temp dir that is used as source 506 # thus prepare an empty temp dir that is used as source