diff options
-rw-r--r-- | meta/lib/oeqa/selftest/wic.py | 3 | ||||
-rw-r--r-- | 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 c160f5f62d..df5e060fb0 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 | |||
729 | 'part emptyvfat --fstype vfat --size 1M\n', | 729 | 'part emptyvfat --fstype vfat --size 1M\n', |
730 | 'part emptymsdos --fstype msdos --size 1M\n', | 730 | 'part emptymsdos --fstype msdos --size 1M\n', |
731 | 'part emptyext2 --fstype ext2 --size 1M\n', | 731 | 'part emptyext2 --fstype ext2 --size 1M\n', |
732 | 'part emptybtrfs --fstype btrfs --size 100M\n', | 732 | 'part emptybtrfs --fstype btrfs --size 100M\n']) |
733 | 'part emptysquash --fstype squashfs --size 1M\n']) | ||
734 | wks.flush() | 733 | wks.flush() |
735 | cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir) | 734 | cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir) |
736 | self.assertEqual(0, runCmd(cmd).status) | 735 | self.assertEqual(0, runCmd(cmd).status) |
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py index 6f324ad5b3..5edb340c3a 100644 --- a/scripts/lib/wic/partition.py +++ b/scripts/lib/wic/partition.py | |||
@@ -141,6 +141,10 @@ class Partition(): | |||
141 | native_sysroot) | 141 | native_sysroot) |
142 | self.source_file = "%s/fs.%s" % (cr_workdir, self.fstype) | 142 | self.source_file = "%s/fs.%s" % (cr_workdir, self.fstype) |
143 | else: | 143 | else: |
144 | if self.fstype == 'squashfs': | ||
145 | raise WicError("It's not possible to create empty squashfs " | ||
146 | "partition '%s'" % (self.mountpoint)) | ||
147 | |||
144 | rootfs = "%s/fs_%s.%s.%s" % (cr_workdir, self.label, | 148 | rootfs = "%s/fs_%s.%s.%s" % (cr_workdir, self.label, |
145 | self.lineno, self.fstype) | 149 | self.lineno, self.fstype) |
146 | if os.path.isfile(rootfs): | 150 | if os.path.isfile(rootfs): |
@@ -390,35 +394,6 @@ class Partition(): | |||
390 | 394 | ||
391 | prepare_empty_partition_vfat = prepare_empty_partition_msdos | 395 | prepare_empty_partition_vfat = prepare_empty_partition_msdos |
392 | 396 | ||
393 | def prepare_empty_partition_squashfs(self, cr_workdir, oe_builddir, | ||
394 | native_sysroot): | ||
395 | """ | ||
396 | Prepare an empty squashfs partition. | ||
397 | """ | ||
398 | logger.warning("Creating of an empty squashfs %s partition was attempted. " | ||
399 | "Proceeding as requested.", self.mountpoint) | ||
400 | |||
401 | path = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype) | ||
402 | if os.path.isfile(path): | ||
403 | os.remove(path) | ||
404 | |||
405 | # it is not possible to create a squashfs without source data, | ||
406 | # thus prepare an empty temp dir that is used as source | ||
407 | tmpdir = tempfile.mkdtemp() | ||
408 | |||
409 | squashfs_cmd = "mksquashfs %s %s -noappend" % \ | ||
410 | (tmpdir, path) | ||
411 | exec_native_cmd(squashfs_cmd, native_sysroot) | ||
412 | |||
413 | os.rmdir(tmpdir) | ||
414 | |||
415 | # get the rootfs size in the right units for kickstart (kB) | ||
416 | du_cmd = "du -Lbks %s" % path | ||
417 | out = exec_cmd(du_cmd) | ||
418 | fs_size = out.split()[0] | ||
419 | |||
420 | self.size = int(fs_size) | ||
421 | |||
422 | def prepare_swap_partition(self, cr_workdir, oe_builddir, native_sysroot): | 397 | def prepare_swap_partition(self, cr_workdir, oe_builddir, native_sysroot): |
423 | """ | 398 | """ |
424 | Prepare a swap partition. | 399 | Prepare a swap partition. |