wic: Fix and update rootfs-pcbios-ext plugin
PATCH 1/1 wic: Fix and update rootfs-pcbios-ext plugin
Resolves #11003
Adds oe-selftest for rootfs-pcbios-ext plugin
--- .../recipes-test/images/wic-image-single-ext.bb | 13 ++ .../recipes-test/images/wic-image-single-ext.wks | 6 + meta/lib/oeqa/selftest/wic.py | 21 ++++ .../lib/wic/plugins/source/rootfs_pcbios_ext.py | 137 +++++++++------------ 4 files changed, 99 insertions(+), 78 deletions(-) create mode 100644 meta-selftest/recipes-test/images/wic-image-single-ext.bb create mode 100644 meta-selftest/recipes-test/images/wic-image-single-ext.wks
meta-selftest/recipes-test/images/wic-image-single-ext.bb new file +13 -0
@@ -0,0 +1,13 @@ +SUMMARY = "An example of partitioned image." + +SRC_URI = "file://${FILE_DIRNAME}/${BPN}.wks" + +IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP}" + +IMAGE_FSTYPES = "wic" + +DEPENDS = "syslinux syslinux-native e2fsprogs-native" + +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +inherit image
meta-selftest/recipes-test/images/wic-image-single-ext.wks new file +6 -0
@@ -0,0 +1,6 @@ +# short-description: Example of single ext4 partition +# long-description: This image contains one singel ext4 partition. +# created from core-image-minimal and wic-image-single-ext image recipes. + +part / --source rootfs-pcbios-ext --ondisk vda --fstype=ext4 --active --label rootfs --align 4096 --size 20 +bootloader --source rootfs-pcbios-ext --timeout=0 --append="rootwait console=tty0 rootfstype=ext4"
meta/lib/oeqa/selftest/wic.py +21 -0
@@ -561,3 +561,24 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r status, output = qemu.run_serial(cmd) self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) self.assertEqual(output, '3') + + def test_single_ext_qemu(self): + """Test wic-image-single-ext under qemu""" + config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-single-ext"\n' + self.append_config(config) + self.assertEqual(0, bitbake('wic-image-single-ext').status) + self.remove_config(config) + + with runqemu('wic-image-single-ext', ssh=False) as qemu: + cmd = "grep '/dev/root / ext4' /proc/mounts" + status, output = qemu.run_serial(cmd) + self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) + self.assertRegex(output, '^/dev/root +/ +ext4.*') + + cmd = "ls /boot" + status, output = qemu.run_serial(cmd) + self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) + self.assertRegex(output, '.*ldlinux.c32.*') + self.assertRegex(output, '.*ldlinux.sys.*') + self.assertRegex(output, '.*syslinux.cfg.*') + self.assertRegex(output, '.*vmlinuz.*')
scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py +59 -78
199 lines not on this page · raw message
Signature · 1 line
2.9.3
Quoted 1 line · Adrian Freihofer
Resolves #11003
please sign-off and use the correct format for including the bugzilla entry.