[gnome-continuous-yocto/gnomeostree-3.28-rocko: 5439/8267] wic: remove prepare_empty_partition_squashfs
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 5439/8267] wic: remove prepare_empty_partition_squashfs
- Date: Sun, 17 Dec 2017 03:26:30 +0000 (UTC)
commit 67ec097bc3d1734dc5a1c7162a7c99b57d45afe8
Author: Ed Bartosh <ed bartosh linux intel com>
Date: Thu Mar 30 21:17:20 2017 +0300
wic: remove prepare_empty_partition_squashfs
There is not much sense in creation of empty squashfs
partition. It's also not possible to create empty squashfs
partition of specified size.
Even more, prepare_empty_partition_squashfs method is
absolutely broken. It raises exception when called and
even its signature differs from the rest of of similar
methods. It means that nobody uses it and it's safe
to remove it.
Removed prepare_empty_partition_squashfs method and
testing of empty squashfs partition.
(From OE-Core rev: 9152960f250cb4df1e559d747fb09005675a0d75)
Signed-off-by: Ed Bartosh <ed bartosh linux intel com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
meta/lib/oeqa/selftest/wic.py | 3 +--
scripts/lib/wic/partition.py | 33 ++++-----------------------------
2 files changed, 5 insertions(+), 31 deletions(-)
---
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
index c160f5f..df5e060 100644
--- a/meta/lib/oeqa/selftest/wic.py
+++ b/meta/lib/oeqa/selftest/wic.py
@@ -729,8 +729,7 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r
'part emptyvfat --fstype vfat --size 1M\n',
'part emptymsdos --fstype msdos --size 1M\n',
'part emptyext2 --fstype ext2 --size 1M\n',
- 'part emptybtrfs --fstype btrfs --size 100M\n',
- 'part emptysquash --fstype squashfs --size 1M\n'])
+ 'part emptybtrfs --fstype btrfs --size 100M\n'])
wks.flush()
cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
self.assertEqual(0, runCmd(cmd).status)
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index 6f324ad..5edb340 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -141,6 +141,10 @@ class Partition():
native_sysroot)
self.source_file = "%s/fs.%s" % (cr_workdir, self.fstype)
else:
+ if self.fstype == 'squashfs':
+ raise WicError("It's not possible to create empty squashfs "
+ "partition '%s'" % (self.mountpoint))
+
rootfs = "%s/fs_%s.%s.%s" % (cr_workdir, self.label,
self.lineno, self.fstype)
if os.path.isfile(rootfs):
@@ -390,35 +394,6 @@ class Partition():
prepare_empty_partition_vfat = prepare_empty_partition_msdos
- def prepare_empty_partition_squashfs(self, cr_workdir, oe_builddir,
- native_sysroot):
- """
- Prepare an empty squashfs partition.
- """
- logger.warning("Creating of an empty squashfs %s partition was attempted. "
- "Proceeding as requested.", self.mountpoint)
-
- path = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype)
- if os.path.isfile(path):
- os.remove(path)
-
- # it is not possible to create a squashfs without source data,
- # thus prepare an empty temp dir that is used as source
- tmpdir = tempfile.mkdtemp()
-
- squashfs_cmd = "mksquashfs %s %s -noappend" % \
- (tmpdir, path)
- exec_native_cmd(squashfs_cmd, native_sysroot)
-
- os.rmdir(tmpdir)
-
- # get the rootfs size in the right units for kickstart (kB)
- du_cmd = "du -Lbks %s" % path
- out = exec_cmd(du_cmd)
- fs_size = out.split()[0]
-
- self.size = int(fs_size)
-
def prepare_swap_partition(self, cr_workdir, oe_builddir, native_sysroot):
"""
Prepare a swap partition.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]