summaryrefslogtreecommitdiff
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:35:16 +0100
commit8d2587d87601a7ff0fad840dabc07d66363b2810 (patch)
tree45a970cb6975e1c29219cd20310cfd5f4551a104 /scripts
parenta68a797c7aec607a0720ec5421baf6be821803b8 (diff)
downloadopenembedded-core-8d2587d87601a7ff0fad840dabc07d66363b2810.tar.gz
openembedded-core-8d2587d87601a7ff0fad840dabc07d66363b2810.tar.bz2
openembedded-core-8d2587d87601a7ff0fad840dabc07d66363b2810.zip
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. 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):
image_rootfs = rootfs_dir
rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label ,self.fstype)
+ os.remove(rootfs)
du_cmd = "du -ks %s" % image_rootfs
out = exec_cmd(du_cmd)
actual_rootfs_size = int(out.split()[0])
@@ -281,6 +282,7 @@ class Wic_PartData(Mic_PartData):
image_rootfs = rootfs_dir
rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype)
+ os.remove(rootfs)
du_cmd = "du -ks %s" % image_rootfs
out = exec_cmd(du_cmd)
actual_rootfs_size = int(out.split()[0])
@@ -325,6 +327,7 @@ class Wic_PartData(Mic_PartData):
image_rootfs = rootfs_dir
rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype)
+ os.remove(rootfs)
du_cmd = "du -bks %s" % image_rootfs
out = exec_cmd(du_cmd)
blocks = int(out.split()[0])
@@ -377,6 +380,7 @@ class Wic_PartData(Mic_PartData):
image_rootfs = rootfs_dir
rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label ,self.fstype)
+ os.remove(rootfs)
squashfs_cmd = "mksquashfs %s %s -noappend" % \
(image_rootfs, rootfs)
exec_native_cmd(pseudo + squashfs_cmd, native_sysroot)
@@ -415,6 +419,7 @@ class Wic_PartData(Mic_PartData):
"""
fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
+ os.remove(fs)
dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \
(fs, self.size)
exec_cmd(dd_cmd)
@@ -442,6 +447,7 @@ class Wic_PartData(Mic_PartData):
"""
fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
+ os.remove(fs)
dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \
(fs, self.size)
exec_cmd(dd_cmd)
@@ -466,6 +472,7 @@ class Wic_PartData(Mic_PartData):
Prepare an empty vfat partition.
"""
fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
+ os.remove(fs)
blocks = self.size
@@ -492,6 +499,7 @@ class Wic_PartData(Mic_PartData):
"Proceeding as requested." % self.mountpoint)
fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
+ os.remove(fs)
# it is not possible to create a squashfs without source data,
# thus prepare an empty temp dir that is used as source