summaryrefslogtreecommitdiffstats
path: root/scripts
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-05-16 22:37:25 +0100
commitc2bb6022fe5e9f6fe15d67ec03a7073b0f99bc61 (patch)
tree8fb80efd612391ca7239eb4c5c0f7df2492b1312 /scripts
parent71626c1b94b87d0f3996efedb5735d80d157adde (diff)
downloadpoky-c2bb6022fe5e9f6fe15d67ec03a7073b0f99bc61.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) Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-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 ff906010b8..e864076c99 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -230,6 +230,7 @@ class Wic_PartData(Mic_PartData):
230 image_rootfs = rootfs_dir 230 image_rootfs = rootfs_dir
231 rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label ,self.fstype) 231 rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label ,self.fstype)
232 232
233 os.remove(rootfs)
233 du_cmd = "du -ks %s" % image_rootfs 234 du_cmd = "du -ks %s" % image_rootfs
234 out = exec_cmd(du_cmd) 235 out = exec_cmd(du_cmd)
235 actual_rootfs_size = int(out.split()[0]) 236 actual_rootfs_size = int(out.split()[0])
@@ -281,6 +282,7 @@ class Wic_PartData(Mic_PartData):
281 image_rootfs = rootfs_dir 282 image_rootfs = rootfs_dir
282 rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype) 283 rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype)
283 284
285 os.remove(rootfs)
284 du_cmd = "du -ks %s" % image_rootfs 286 du_cmd = "du -ks %s" % image_rootfs
285 out = exec_cmd(du_cmd) 287 out = exec_cmd(du_cmd)
286 actual_rootfs_size = int(out.split()[0]) 288 actual_rootfs_size = int(out.split()[0])
@@ -325,6 +327,7 @@ class Wic_PartData(Mic_PartData):
325 image_rootfs = rootfs_dir 327 image_rootfs = rootfs_dir
326 rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype) 328 rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype)
327 329
330 os.remove(rootfs)
328 du_cmd = "du -bks %s" % image_rootfs 331 du_cmd = "du -bks %s" % image_rootfs
329 out = exec_cmd(du_cmd) 332 out = exec_cmd(du_cmd)
330 blocks = int(out.split()[0]) 333 blocks = int(out.split()[0])
@@ -377,6 +380,7 @@ class Wic_PartData(Mic_PartData):
377 image_rootfs = rootfs_dir 380 image_rootfs = rootfs_dir
378 rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label ,self.fstype) 381 rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label ,self.fstype)
379 382
383 os.remove(rootfs)
380 squashfs_cmd = "mksquashfs %s %s -noappend" % \ 384 squashfs_cmd = "mksquashfs %s %s -noappend" % \
381 (image_rootfs, rootfs) 385 (image_rootfs, rootfs)
382 exec_native_cmd(pseudo + squashfs_cmd, native_sysroot) 386 exec_native_cmd(pseudo + squashfs_cmd, native_sysroot)
@@ -415,6 +419,7 @@ class Wic_PartData(Mic_PartData):
415 """ 419 """
416 fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype) 420 fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
417 421
422 os.remove(fs)
418 dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \ 423 dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \
419 (fs, self.size) 424 (fs, self.size)
420 exec_cmd(dd_cmd) 425 exec_cmd(dd_cmd)
@@ -442,6 +447,7 @@ class Wic_PartData(Mic_PartData):
442 """ 447 """
443 fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype) 448 fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
444 449
450 os.remove(fs)
445 dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \ 451 dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \
446 (fs, self.size) 452 (fs, self.size)
447 exec_cmd(dd_cmd) 453 exec_cmd(dd_cmd)
@@ -466,6 +472,7 @@ class Wic_PartData(Mic_PartData):
466 Prepare an empty vfat partition. 472 Prepare an empty vfat partition.
467 """ 473 """
468 fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype) 474 fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
475 os.remove(fs)
469 476
470 blocks = self.size 477 blocks = self.size
471 478
@@ -492,6 +499,7 @@ class Wic_PartData(Mic_PartData):
492 "Proceeding as requested." % self.mountpoint) 499 "Proceeding as requested." % self.mountpoint)
493 500
494 fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype) 501 fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
502 os.remove(fs)
495 503
496 # it is not possible to create a squashfs without source data, 504 # it is not possible to create a squashfs without source data,
497 # thus prepare an empty temp dir that is used as source 505 # thus prepare an empty temp dir that is used as source