mirror of
https://git.yoctoproject.org/poky
synced 2026-09-25 07:36:23 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
ea9016b60b
commit
417c86b42b
@@ -231,6 +231,7 @@ class Wic_PartData(Mic_PartData):
|
|||||||
image_rootfs = rootfs_dir
|
image_rootfs = rootfs_dir
|
||||||
rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label ,self.fstype)
|
rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label ,self.fstype)
|
||||||
|
|
||||||
|
os.remove(rootfs)
|
||||||
du_cmd = "du -ks %s" % image_rootfs
|
du_cmd = "du -ks %s" % image_rootfs
|
||||||
out = exec_cmd(du_cmd)
|
out = exec_cmd(du_cmd)
|
||||||
actual_rootfs_size = int(out.split()[0])
|
actual_rootfs_size = int(out.split()[0])
|
||||||
@@ -282,6 +283,7 @@ class Wic_PartData(Mic_PartData):
|
|||||||
image_rootfs = rootfs_dir
|
image_rootfs = rootfs_dir
|
||||||
rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype)
|
rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype)
|
||||||
|
|
||||||
|
os.remove(rootfs)
|
||||||
du_cmd = "du -ks %s" % image_rootfs
|
du_cmd = "du -ks %s" % image_rootfs
|
||||||
out = exec_cmd(du_cmd)
|
out = exec_cmd(du_cmd)
|
||||||
actual_rootfs_size = int(out.split()[0])
|
actual_rootfs_size = int(out.split()[0])
|
||||||
@@ -326,6 +328,7 @@ class Wic_PartData(Mic_PartData):
|
|||||||
image_rootfs = rootfs_dir
|
image_rootfs = rootfs_dir
|
||||||
rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype)
|
rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label, self.fstype)
|
||||||
|
|
||||||
|
os.remove(rootfs)
|
||||||
du_cmd = "du -bks %s" % image_rootfs
|
du_cmd = "du -bks %s" % image_rootfs
|
||||||
out = exec_cmd(du_cmd)
|
out = exec_cmd(du_cmd)
|
||||||
blocks = int(out.split()[0])
|
blocks = int(out.split()[0])
|
||||||
@@ -378,6 +381,7 @@ class Wic_PartData(Mic_PartData):
|
|||||||
image_rootfs = rootfs_dir
|
image_rootfs = rootfs_dir
|
||||||
rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label ,self.fstype)
|
rootfs = "%s/rootfs_%s.%s" % (cr_workdir, self.label ,self.fstype)
|
||||||
|
|
||||||
|
os.remove(rootfs)
|
||||||
squashfs_cmd = "mksquashfs %s %s -noappend" % \
|
squashfs_cmd = "mksquashfs %s %s -noappend" % \
|
||||||
(image_rootfs, rootfs)
|
(image_rootfs, rootfs)
|
||||||
exec_native_cmd(pseudo + squashfs_cmd, native_sysroot)
|
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)
|
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" % \
|
dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \
|
||||||
(fs, self.size)
|
(fs, self.size)
|
||||||
exec_cmd(dd_cmd)
|
exec_cmd(dd_cmd)
|
||||||
@@ -443,6 +448,7 @@ class Wic_PartData(Mic_PartData):
|
|||||||
"""
|
"""
|
||||||
fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
|
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" % \
|
dd_cmd = "dd if=/dev/zero of=%s bs=1k seek=%d count=0" % \
|
||||||
(fs, self.size)
|
(fs, self.size)
|
||||||
exec_cmd(dd_cmd)
|
exec_cmd(dd_cmd)
|
||||||
@@ -467,6 +473,7 @@ class Wic_PartData(Mic_PartData):
|
|||||||
Prepare an empty vfat partition.
|
Prepare an empty vfat partition.
|
||||||
"""
|
"""
|
||||||
fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
|
fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
|
||||||
|
os.remove(fs)
|
||||||
|
|
||||||
blocks = self.size
|
blocks = self.size
|
||||||
|
|
||||||
@@ -493,6 +500,7 @@ class Wic_PartData(Mic_PartData):
|
|||||||
"Proceeding as requested." % self.mountpoint)
|
"Proceeding as requested." % self.mountpoint)
|
||||||
|
|
||||||
fs = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
|
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,
|
# it is not possible to create a squashfs without source data,
|
||||||
# thus prepare an empty temp dir that is used as source
|
# thus prepare an empty temp dir that is used as source
|
||||||
|
|||||||
Reference in New Issue
Block a user