From: Ash Charles <ashcharles@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [fido][PATCH 1/2] wic: remove intermediate partitions
Date: Thu, 23 Jul 2015 14:44:14 -0700 [thread overview]
Message-ID: <1437687855-6499-2-git-send-email-ashcharles@gmail.com> (raw)
In-Reply-To: <1437687855-6499-1-git-send-email-ashcharles@gmail.com>
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
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>
---
scripts/lib/wic/kickstart/custom_commands/partition.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py
index f3d553b..654c380 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):
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])
@@ -282,6 +283,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])
@@ -326,6 +328,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])
@@ -378,6 +381,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)
@@ -416,6 +420,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)
@@ -443,6 +448,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)
@@ -467,6 +473,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
@@ -493,6 +500,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
--
2.1.4
next prev parent reply other threads:[~2015-07-23 21:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-23 21:44 [fido][PATCH 0/2] Backports for WIC Ash Charles
2015-07-23 21:44 ` Ash Charles [this message]
2015-07-23 21:44 ` [fido][PATCH 2/2] wic: Make sure file exists before removing it Ash Charles
2015-07-23 21:57 ` [fido][PATCH 0/2] Backports for WIC Philip Balister
2015-07-30 16:22 ` Joshua Lock
2015-07-30 17:11 ` Ash Charles
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=1437687855-6499-2-git-send-email-ashcharles@gmail.com \
--to=ashcharles@gmail.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