diff options
-rw-r--r-- | meta/lib/oeqa/selftest/cases/wic.py | 33 | ||||
-rw-r--r-- | scripts/lib/wic/partition.py | 2 |
2 files changed, 34 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 59fd99a788..d98af8713a 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py | |||
@@ -535,6 +535,39 @@ part /mnt --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/whoa | |||
535 | finally: | 535 | finally: |
536 | os.environ['PATH'] = oldpath | 536 | os.environ['PATH'] = oldpath |
537 | 537 | ||
538 | def test_exclude_path_with_extra_space(self): | ||
539 | """Test having --exclude-path with IMAGE_ROOTFS_EXTRA_SPACE. [Yocto #15555]""" | ||
540 | |||
541 | with NamedTemporaryFile("w", suffix=".wks") as wks: | ||
542 | wks.writelines( | ||
543 | ['bootloader --ptable gpt\n', | ||
544 | 'part /boot --size=100M --active --fstype=ext4 --label boot\n', | ||
545 | 'part / --source rootfs --fstype=ext4 --label root --exclude-path boot/\n']) | ||
546 | wks.flush() | ||
547 | config = 'IMAGE_ROOTFS_EXTRA_SPACE = "500000"\n'\ | ||
548 | 'DEPENDS:pn-core-image-minimal += "wic-tools"\n'\ | ||
549 | 'IMAGE_FSTYPES += "wic"\n'\ | ||
550 | 'WKS_FILE = "%s"\n' % wks.name | ||
551 | self.append_config(config) | ||
552 | bitbake('core-image-minimal') | ||
553 | |||
554 | """ | ||
555 | the output of "wic ls <image>.wic" will look something like: | ||
556 | Num Start End Size Fstype | ||
557 | 1 17408 136332287 136314880 ext4 | ||
558 | 2 136332288 171464703 35132416 ext4 | ||
559 | we are looking for the size of partition 2 | ||
560 | i.e. in this case the number 35,132,416 | ||
561 | without the fix the size will be around 85,403,648 | ||
562 | with the fix the size should be around 799,960,064 | ||
563 | """ | ||
564 | bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE'], 'core-image-minimal') | ||
565 | deploy_dir = bb_vars['DEPLOY_DIR_IMAGE'] | ||
566 | machine = bb_vars['MACHINE'] | ||
567 | wicout = glob(os.path.join(deploy_dir, "core-image-minimal-%s.rootfs-*.wic" % machine))[0] | ||
568 | size_of_root_partition = int(runCmd("wic ls %s" % wicout).output.split('\n')[2].split()[3]) | ||
569 | self.assertGreater(size_of_root_partition, 500000000) | ||
570 | |||
538 | def test_include_path(self): | 571 | def test_include_path(self): |
539 | """Test --include-path wks option.""" | 572 | """Test --include-path wks option.""" |
540 | 573 | ||
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py index bf2c34d594..b18431d8fb 100644 --- a/scripts/lib/wic/partition.py +++ b/scripts/lib/wic/partition.py | |||
@@ -244,7 +244,7 @@ class Partition(): | |||
244 | # from bitbake variable | 244 | # from bitbake variable |
245 | rsize_bb = get_bitbake_var('ROOTFS_SIZE') | 245 | rsize_bb = get_bitbake_var('ROOTFS_SIZE') |
246 | rdir = get_bitbake_var('IMAGE_ROOTFS') | 246 | rdir = get_bitbake_var('IMAGE_ROOTFS') |
247 | if rsize_bb and rdir == rootfs_dir: | 247 | if rsize_bb and (rdir == rootfs_dir or (rootfs_dir.split('/')[-2] == "tmp-wic" and rootfs_dir.split('/')[-1][:6] == "rootfs")): |
248 | # Bitbake variable ROOTFS_SIZE is calculated in | 248 | # Bitbake variable ROOTFS_SIZE is calculated in |
249 | # Image._get_rootfs_size method from meta/lib/oe/image.py | 249 | # Image._get_rootfs_size method from meta/lib/oe/image.py |
250 | # using IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT, | 250 | # using IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT, |