Skip to contentSkip to conversation

wic: Further enhance UUID / fstab support

PATCH Superseded Tom Rini 4 participants 14 messages Nov 17, 2017 – Jan 23, 2018

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

v2 cover wic: Further enhance UUID / fstab support

Hey all,

So, per Ed's feedback on my first series, I went and spent some time trying to figure out how to have wic know what the UUID would be when updating the fstab. It turns out the easiest answer here is to have WIC make the UUID. Per Otavio's concern last time, I also make sure that the filesystem UUID can be passed in, for reproducibility. One thing to keep in mind here is that FAT filesystem UUIDs are a bit funny to deal with as mkfs.vfat / mkdosfs / etc want to be given a 32bit hexadecimal value. But when we talk mount, it must be split and it must be in uppercase. To make the rest of the code easier I'm encoding the '0x' portion into part.fsuuid rather than doing "-i 0x%s" in a bunch of places.

While preparing all of this, I found a few minor things such as we did not test for squashfs and --use-uuid (not supported) and an incorrect comment around the btrfs support.

Since v1, I've added a testcase into wic.Wic.test_qemu for a UUID mount and the UUID that we've given. I think this is cleaner than adding a python function to make a wks file just for this task.

--
Tom

author
#1 lore raw

PATCH v2 1/4 wic: kparser.py: Check for SquashFS and use-uuid

The SquashFS filesystem does not support UUIDs so make this combination be an error.

---
 scripts/lib/wic/ksparser.py | 5 +++++
 1 file changed, 5 insertions(+)
scripts/lib/wic/ksparser.py +5 -0
index 7850e81d2f37..4fb6868531df 100644
@@ -195,6 +195,11 @@ class KickStart():
                         raise KickStartError('%s:%d: %s' % \
                                              (confpath, lineno, err))
                     if line.startswith('part'):
+                        # SquashFS does not support UUID
+                        if parsed.fstype == 'squashfs' and parsed.use_uuid:
+                            err = "%s:%d: SquashFS does not support UUID" \
+                                  % (confpath, lineno)
+                            raise KickStartError(err)
                         # using ArgumentParser one cannot easily tell if option
                         # was passed as argument, if said option has a default
                         # value; --overhead-factor/--extra-space cannot be used
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH v2 2/4 wic: partition.py: Update comments slightly

In reply to Tom Rini

First, we support squashfs as root, so mention that. Second, the btrfs rootfs creation function had a copy/paste of the previous function comment, remove the irrelevant line.

---
 scripts/lib/wic/partition.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
scripts/lib/wic/partition.py +1 -3
index 66e61ba70c93..87312383378a 100644
@@ -202,7 +202,7 @@ class Partition():
         Prepare content for a rootfs partition i.e. create a partition
         and fill it from a /rootfs dir.
 
-        Currently handles ext2/3/4, btrfs and vfat.
+        Currently handles ext2/3/4, btrfs, vfat and squashfs.
         """
         p_prefix = os.environ.get("PSEUDO_PREFIX", "%s/usr" % native_sysroot)
         p_localstatedir = os.environ.get("PSEUDO_LOCALSTATEDIR",
@@ -275,8 +275,6 @@ class Partition():
                              native_sysroot, pseudo):
         """
         Prepare content for a btrfs rootfs partition.
-
-        Currently handles ext2/3/4 and btrfs.
         """
         du_cmd = "du -ks %s" % rootfs_dir
         out = exec_cmd(du_cmd)
Signature · 1 line
2.7.4
author
#3 lore raw

PATCH v2 3/4 wic: Introduce --fsuuid and have --use-uuid make use of UUID too

In reply to Tom Rini

First, allow for wic to be given a filesystem UUID to be used when creating a filesystem. When not provided, wic will generate the UUID to be used. Next, when --use-uuid is passed, we update the fstab to mount things via UUID (and if not found, then use PARTUUID) as UUID is more portable.

---
 scripts/lib/wic/help.py                          | 10 +++++++-
 scripts/lib/wic/ksparser.py                      |  1 +
 scripts/lib/wic/partition.py                     | 32 +++++++++++++-----------
 scripts/lib/wic/plugins/imager/direct.py         | 17 +++++++++++--
 scripts/lib/wic/plugins/source/bootimg-efi.py    |  3 ++-
 scripts/lib/wic/plugins/source/bootimg-pcbios.py |  3 ++-
 6 files changed, 47 insertions(+), 19 deletions(-)
scripts/lib/wic/help.py +9 -1
index 2ac45e052ebe..bf658b94e34f 100644
@@ -863,7 +863,10 @@ DESCRIPTION
        This is achieved by wic adding entries to the fstab during image
        generation. In order for a valid fstab to be generated one of the
        --ondrive, --ondisk or --use-uuid partition options must be used for
-       each partition that specifies a mountpoint.
+       each partition that specifies a mountpoint.  Note that with --use-uuid
+       and non-root <mountpoint>, including swap, the mount program must
+       understand the PARTUUID syntax.  This currently excludes the busybox
+       versions of these applications.
 
 
        The following are supported 'part' options:
@@ -986,6 +989,11 @@ DESCRIPTION
                  in bootloader configuration before running wic. In this case .wks file can
                  be generated or modified to set preconfigured parition UUID using this option.
 
+         --fsuuid: This option is specific to wic. It specifies filesystem UUID.
+                   It's useful if preconfigured filesystem UUID is added to kernel command line
+                   in bootloader configuration before running wic. In this case .wks file can
+                   be generated or modified to set preconfigured filesystem UUID using this option.
+
          --system-id: This option is specific to wic. It specifies partition system id. It's useful
                       for the harware that requires non-default partition system ids. The parameter
                       in one byte long hex number either with 0x prefix or without it.
scripts/lib/wic/ksparser.py +1 -0
index 4fb6868531df..e590b2fe3c0d 100644
@@ -161,6 +161,7 @@ class KickStart():
         part.add_argument('--system-id', type=systemidtype)
         part.add_argument('--use-uuid', action='store_true')
         part.add_argument('--uuid')
+        part.add_argument('--fsuuid')
 
         bootloader = subparsers.add_parser('bootloader')
         bootloader.add_argument('--append')
scripts/lib/wic/partition.py +18 -14
index 87312383378a..c0b67d829f80 100644
@@ -26,6 +26,7 @@
 
 import logging
 import os
+import uuid
 
 from wic import WicError
 from wic.misc import exec_cmd, exec_native_cmd, get_bitbake_var
@@ -61,6 +62,7 @@ class Partition():
         self.system_id = args.system_id
         self.use_uuid = args.use_uuid
         self.uuid = args.uuid
+        self.fsuuid = args.fsuuid
 
         self.lineno = lineno
         self.source_file = ""
@@ -264,8 +266,8 @@ class Partition():
         if self.label:
             label_str = "-L %s" % self.label
 
-        mkfs_cmd = "mkfs.%s %s %s %s -d %s" % \
-            (self.fstype, extraopts, rootfs, label_str, rootfs_dir)
+        mkfs_cmd = "mkfs.%s %s %s %s -U %s -d %s" % \
+            (self.fstype, extraopts, rootfs, label_str, self.fsuuid, rootfs_dir)
         exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo)
 
         mkfs_cmd = "fsck.%s -pvfD %s" % (self.fstype, rootfs)
@@ -289,9 +291,9 @@ class Partition():
         if self.label:
             label_str = "-L %s" % self.label
 
-        mkfs_cmd = "mkfs.%s -b %d -r %s %s %s %s" % \
+        mkfs_cmd = "mkfs.%s -b %d -r %s %s %s -U %s %s" % \
             (self.fstype, rootfs_size * 1024, rootfs_dir, label_str,
-             self.mkfs_extraopts, rootfs)
+             self.mkfs_extraopts, self.fsuuid, rootfs)
         exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo)
 
     def prepare_rootfs_msdos(self, rootfs, oe_builddir, rootfs_dir,
@@ -315,8 +317,9 @@ class Partition():
 
         extraopts = self.mkfs_extraopts or '-S 512'
 
-        dosfs_cmd = "mkdosfs %s %s %s -C %s %d" % \
-                    (label_str, size_str, extraopts, rootfs, rootfs_size)
+        dosfs_cmd = "mkdosfs %s -i %s %s %s -C %s %d" % \
+                    (label_str, self.fsuuid, size_str, extraopts, rootfs,
+                     rootfs_size)
         exec_native_cmd(dosfs_cmd, native_sysroot)
 
         mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, rootfs_dir)
@@ -352,8 +355,8 @@ class Partition():
         if self.label:
             label_str = "-L %s" % self.label
 
-        mkfs_cmd = "mkfs.%s -F %s %s %s" % \
-            (self.fstype, extraopts, label_str, rootfs)
+        mkfs_cmd = "mkfs.%s -F %s %s -U %s %s" % \
+            (self.fstype, extraopts, label_str, self.fsuuid, rootfs)
         exec_native_cmd(mkfs_cmd, native_sysroot)
 
     def prepare_empty_partition_btrfs(self, rootfs, oe_builddir,
@@ -369,8 +372,8 @@ class Partition():
         if self.label:
             label_str = "-L %s" % self.label
 
-        mkfs_cmd = "mkfs.%s -b %d %s %s %s" % \
-                   (self.fstype, self.size * 1024, label_str,
+        mkfs_cmd = "mkfs.%s -b %d %s -U %s %s %s" % \
+                   (self.fstype, self.size * 1024, label_str, self.fsuuid,
                     self.mkfs_extraopts, rootfs)
         exec_native_cmd(mkfs_cmd, native_sysroot)
 
@@ -391,8 +394,9 @@ class Partition():
 
         extraopts = self.mkfs_extraopts or '-S 512'
 
-        dosfs_cmd = "mkdosfs %s %s %s -C %s %d" % \
-                    (label_str, extraopts, size_str, rootfs, blocks)
+        dosfs_cmd = "mkdosfs %s -i %s %s %s -C %s %d" % \
+                    (label_str, self.fsuuid, extraopts, size_str, rootfs,
+                     blocks)
 
         exec_native_cmd(dosfs_cmd, native_sysroot)
 
@@ -410,9 +414,9 @@ class Partition():
         with open(path, 'w') as sparse:
             os.ftruncate(sparse.fileno(), self.size * 1024)
 
-        import uuid
         label_str = ""
         if self.label:
             label_str = "-L %s" % self.label
-        mkswap_cmd = "mkswap %s -U %s %s" % (label_str, str(uuid.uuid1()), path)
+
+        mkswap_cmd = "mkswap %s -U %s %s" % (label_str, self.fsuuid, path)
         exec_native_cmd(mkswap_cmd, native_sysroot)
scripts/lib/wic/plugins/imager/direct.py +15 -2
index da1c061063d2..71c0b1c82bf3 100644
@@ -141,7 +141,15 @@ class DirectPlugin(ImagerPlugin):
                 continue
 
             if part.use_uuid:
-                device_name = "PARTUUID=%s" % part.uuid
+                if part.fsuuid:
+                    # FAT UUID is different from others
+                    if len(part.fsuuid) == 10:
+                        device_name = "UUID=%s-%s" % \
+                                       (part.fsuuid[2:6], part.fsuuid[6:])
+                    else:
+                        device_name = "UUID=%s" % part.fsuuid
+                else:
+                    device_name = "PARTUUID=%s" % part.uuid
             else:
                 # mmc device partitions are named mmcblk0p1, mmcblk0p2..
                 prefix = 'p' if  part.disk.startswith('mmcblk') else ''
@@ -334,13 +342,18 @@ class PartitionedImage():
                     continue
                 part.realnum = realnum
 
-        # generate parition UUIDs
+        # generate parition and filesystem UUIDs
         for part in self.partitions:
             if not part.uuid and part.use_uuid:
                 if self.ptable_format == 'gpt':
                     part.uuid = str(uuid.uuid4())
                 else: # msdos partition table
                     part.uuid = '%08x-%02d' % (self.identifier, part.realnum)
+            if not part.fsuuid:
+                if part.fstype == 'vfat' or part.fstype == 'msdos':
+                    part.fsuuid = '0x' + str(uuid.uuid4())[:8].upper()
+                else:
+                    part.fsuuid = str(uuid.uuid4())
 
     def prepare(self, imager):
         """Prepare an image. Call prepare method of all image partitions."""
scripts/lib/wic/plugins/source/bootimg-efi.py +2 -1
index 4c4f36a32f56..beb74d7a7121 100644
@@ -240,7 +240,8 @@ class BootimgEFIPlugin(SourcePlugin):
         # dosfs image, created by mkdosfs
         bootimg = "%s/boot.img" % cr_workdir
 
-        dosfs_cmd = "mkdosfs -n efi -C %s %d" % (bootimg, blocks)
+        dosfs_cmd = "mkdosfs -n efi -i %s -C %s %d" % \
+                    (part.fsuuid, bootimg, blocks)
         exec_native_cmd(dosfs_cmd, native_sysroot)
 
         mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (bootimg, hdddir)
scripts/lib/wic/plugins/source/bootimg-pcbios.py +2 -1
index 56da468fb5cd..d599112dd759 100644
@@ -186,7 +186,8 @@ class BootimgPcbiosPlugin(SourcePlugin):
         # dosfs image, created by mkdosfs
         bootimg = "%s/boot%s.img" % (cr_workdir, part.lineno)
 
-        dosfs_cmd = "mkdosfs -n boot -S 512 -C %s %d" % (bootimg, blocks)
+        dosfs_cmd = "mkdosfs -n boot -i %s -S 512 -C %s %d" % \
+                    (part.fsuuid, bootimg, blocks)
         exec_native_cmd(dosfs_cmd, native_sysroot)
 
         mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (bootimg, hdddir)
Signature · 1 line
2.7.4
author
#4 lore raw

PATCH v2 4/4 meta-selftest: wic: Add test for --use-uuid / --fsuuid

In reply to Tom Rini

- Add a '/uuid' partition to wic-image-minimal.wks with a known UUID.
- In test_qemu, sort our output from checking the output of 'mount' as it may not be stable. Also, do not check the exit code as passing any output to cut ensures a 0 exit code.
- Check for a 'UUID=' line in /etc/fstab with out expected output.

---
 meta-selftest/recipes-test/images/wic-image-minimal.wks | 1 +
 meta/lib/oeqa/selftest/cases/wic.py                     | 9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)
meta-selftest/recipes-test/images/wic-image-minimal.wks +1 -0
index 9410b684bed8..2fb34c4ef40a 100644
@@ -5,5 +5,6 @@
 part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
 part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
 part /mnt --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda --fstype=ext4 --label core --align 1024
+part /uuid --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda --fstype=ext4 --label uuid-test --align 1024 --use-uuid --fsuuid 2c71ef06-a81d-4735-9d3a-379b69c6bdba
 
 bootloader --ptable gpt --timeout=0  --append="rootwait console=tty0"
meta/lib/oeqa/selftest/cases/wic.py +6 -3
index 651d575dc3b2..969ee1054d8b 100644
@@ -633,11 +633,14 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r
         self.assertEqual(0, bitbake('wic-image-minimal').status)
         self.remove_config(config)
 
-        with runqemu('wic-image-minimal', ssh=False) as qemu:
-            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' '"
+        with runqemu('wic-image-minimal', ssh=False, runqemuparams="nographic") as qemu:
+            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' ' | sort"
+            status, output = qemu.run_serial(cmd)
+            self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2 /\r\n/dev/sda3 /mnt\r\n/dev/sda4 /uuid')
+            cmd = "grep UUID= /etc/fstab"
             status, output = qemu.run_serial(cmd)
             self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
-            self.assertEqual(output, '/dev/root /\r\n/dev/sda1 /boot\r\n/dev/sda3 /mnt')
+            self.assertEqual(output, 'UUID=2c71ef06-a81d-4735-9d3a-379b69c6bdba\t/uuid\text4\tdefaults\t0\t0')
 
     @only_for_arch(['i586', 'i686', 'x86_64'])
     @OETestID(1852)
Signature · 1 line
2.7.4
#5 lore raw

Re: [PATCHv2 4/4] meta-selftest: wic: Add test for --use-uuid / --fsuuid

Still fails on the autobuilder though:

2017-11-24 03:33:51,694 - oe-selftest - INFO - FAIL: test_qemu (wic.Wic)
2017-11-24 03:33:51,694 - oe-selftest - INFO -
----------------------------------------------------------------------
2017-11-24 03:33:51,694 - oe-selftest - INFO - Traceback (most recent call

last):
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f
return func(*args, **kwargs)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py", line 58, in wrapped_f
return func(*args, **kwargs)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py", line 639, in test_qemu

    self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2 /\r\n/dev/sda3

/mnt\r\n/dev/sda4 /uuid')
AssertionError: '/dev/root /\r\n/dev/sda1 /boot\r\n/dev/sda3 /mnt' != '/dev/sda1 /boot\r\n/dev/sda2 /\r\n/dev/sda3 /mnt\r\n/dev/sda4 /uuid'
- /dev/root /
/dev/sda1 /boot
+ /dev/sda2 /
- /dev/sda3 /mnt+ /dev/sda3 /mnt
? ++
+ /dev/sda4 /uuid

Quoted 7 lines · Tom Rini

- Add a '/uuid' partition to wic-image-minimal.wks with a known UUID.
- In test_qemu, sort our output from checking the output of 'mount' as it may not be stable. Also, do not check the exit code as passing any output to cut ensures a 0 exit code.
- Check for a 'UUID=' line in /etc/fstab with out expected output.

Review

Quoted 7 lines
---
 meta-selftest/recipes-test/images/wic-image-minimal.wks | 1 +
 meta/lib/oeqa/selftest/cases/wic.py                     | 9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/meta-selftest/recipes-test/images/wic-image-minimal.wks

meta-selftest/recipes-test/images/wic-image-minimal.wks line 5

Quoted 5 lines

index 9410b684bed8..2fb34c4ef40a 100644

meta-selftest/recipes-test/images/wic-image-minimal.wks +0 -0
@@ -5,5 +5,6 @@
 part /boot --source bootimg-pcbios --ondisk sda --label boot --active

--align 1024

meta-selftest/recipes-test/images/wic-image-minimal.wks line 6

Quoted 1 line
meta-selftest/recipes-test/images/wic-image-minimal.wks +0 -0
 part / --source rootfs --ondisk sda --fstype=ext4 --label platform

--align 1024 --use-uuid

meta-selftest/recipes-test/images/wic-image-minimal.wks line 7

Quoted 1 line
meta-selftest/recipes-test/images/wic-image-minimal.wks +0 -0
 part /mnt --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda

--fstype=ext4 --label core --align 1024

meta-selftest/recipes-test/images/wic-image-minimal.wks line 8

Quoted 1 line
meta-selftest/recipes-test/images/wic-image-minimal.wks +1 -0
+part /uuid --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda

--fstype=ext4 --label uuid-test --align 1024 --use-uuid --fsuuid 2c71ef06-a81d-4735-9d3a-379b69c6bdba

Review

Quoted 3 lines
meta-selftest/recipes-test/images/wic-image-minimal.wks +0 -0
 bootloader --ptable gpt --timeout=0  --append="rootwait console=tty0"
(quoted diff) +0 -0

b/meta/lib/oeqa/selftest/cases/wic.py

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0

Quoted 4 lines

index 651d575dc3b2..969ee1054d8b 100644

meta/lib/oeqa/selftest/cases/wic.py +0 -0
@@ -633,11 +633,14 @@ part /etc --source rootfs --ondisk mmcblk0

--fstype=ext4 --exclude-path bin/ --r

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r

Quoted 6 lines
meta/lib/oeqa/selftest/cases/wic.py +1 -2
         self.assertEqual(0, bitbake('wic-image-minimal').status)
         self.remove_config(config)
 
-        with runqemu('wic-image-minimal', ssh=False) as qemu:
-            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' '"
+        with runqemu('wic-image-minimal', ssh=False,

runqemuparams="nographic") as qemu:

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +3 -0
+            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' ' | sort"
+            status, output = qemu.run_serial(cmd)
+            self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2

/\r\n/dev/sda3 /mnt\r\n/dev/sda4 /uuid')

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +1 -0
+            cmd = "grep UUID= /etc/fstab"
             status, output = qemu.run_serial(cmd)
             self.assertEqual(1, status, 'Failed to run command "%s": %s'

% (cmd, output))

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 · line 640

Quoted 1 line
meta/lib/oeqa/selftest/cases/wic.py +0 -1
-            self.assertEqual(output, '/dev/root /\r\n/dev/sda1

/boot\r\n/dev/sda3 /mnt')

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 · line 643

Quoted 1 line
meta/lib/oeqa/selftest/cases/wic.py +1 -0
+            self.assertEqual(output,

'UUID=2c71ef06-a81d-4735-9d3a-379b69c6bdba\t/uuid\text4\tdefaults\t0\t0')

Quoted 11 lines
meta/lib/oeqa/selftest/cases/wic.py +0 -1
     @only_for_arch(['i586', 'i686', 'x86_64'])
     @OETestID(1852)
--

2.7.4

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

author
#6 lore raw

Re: [PATCHv2 4/4] meta-selftest: wic: Add test for --use-uuid / --fsuuid

Quoted 19 lines · Ross

Still fails on the autobuilder though:

2017-11-24 03:33:51,694 - oe-selftest - INFO - FAIL: test_qemu (wic.Wic)
2017-11-24 03:33:51,694 - oe-selftest - INFO -
----------------------------------------------------------------------
2017-11-24 03:33:51,694 - oe-selftest - INFO - Traceback (most recent call

last):
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f
return func(*args, **kwargs)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py", line 58, in wrapped_f
return func(*args, **kwargs)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py", line 639, in test_qemu

    self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2 /\r\n/dev/sda3
Quoted 9 lines

/mnt\r\n/dev/sda4 /uuid')
AssertionError: '/dev/root /\r\n/dev/sda1 /boot\r\n/dev/sda3 /mnt' != '/dev/sda1 /boot\r\n/dev/sda2 /\r\n/dev/sda3 /mnt\r\n/dev/sda4 /uuid'
- /dev/root /
/dev/sda1 /boot
+ /dev/sda2 /
- /dev/sda3 /mnt+ /dev/sda3 /mnt
? ++
+ /dev/sda4 /uuid

Erm, that doesn't make any sense:

Quoted 11 lines

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +0 -0
@@ -633,11 +633,14 @@ part /etc --source rootfs --ondisk mmcblk0

--fstype=ext4 --exclude-path bin/ --r

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r

Quoted 6 lines
meta/lib/oeqa/selftest/cases/wic.py +1 -2
         self.assertEqual(0, bitbake('wic-image-minimal').status)
         self.remove_config(config)
 
-        with runqemu('wic-image-minimal', ssh=False) as qemu:
-            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' '"
+        with runqemu('wic-image-minimal', ssh=False,

runqemuparams="nographic") as qemu:

... I'll v2 since disabling graphics was a local thing, oops.

Quoted 4 lines

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +3 -0
+            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' ' | sort"
+            status, output = qemu.run_serial(cmd)
+            self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2

/\r\n/dev/sda3 /mnt\r\n/dev/sda4 /uuid')

Quoted 8 lines

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +1 -0
+            cmd = "grep UUID= /etc/fstab"
             status, output = qemu.run_serial(cmd)
             self.assertEqual(1, status, 'Failed to run command "%s": %s'

% (cmd, output))

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 · line 640

Quoted 1 line
meta/lib/oeqa/selftest/cases/wic.py +0 -1
-            self.assertEqual(output, '/dev/root /\r\n/dev/sda1

/boot\r\n/dev/sda3 /mnt')

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 · line 643

Quoted 1 line
meta/lib/oeqa/selftest/cases/wic.py +1 -0
+            self.assertEqual(output,

'UUID=2c71ef06-a81d-4735-9d3a-379b69c6bdba\t/uuid\text4\tdefaults\t0\t0')

We no longer want to match the string you've got showing up, and the string you have showing up says that /uuid wasn't mounted either.

Can you check the sources in the autobuilder please and make sure the whole series got applied correctly? Thanks!

Signature · 1 line
Tom
author
#7 lore raw

Re: [PATCHv2 4/4] meta-selftest: wic: Add test for --use-uuid / --fsuuid

Quoted 56 lines · Tom Rini
Quoted 19 lines · Ross

Still fails on the autobuilder though:

2017-11-24 03:33:51,694 - oe-selftest - INFO - FAIL: test_qemu (wic.Wic)
2017-11-24 03:33:51,694 - oe-selftest - INFO -
----------------------------------------------------------------------
2017-11-24 03:33:51,694 - oe-selftest - INFO - Traceback (most recent call

last):
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f
return func(*args, **kwargs)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py", line 58, in wrapped_f
return func(*args, **kwargs)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py", line 639, in test_qemu

    self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2 /\r\n/dev/sda3
Quoted 9 lines

/mnt\r\n/dev/sda4 /uuid')
AssertionError: '/dev/root /\r\n/dev/sda1 /boot\r\n/dev/sda3 /mnt' != '/dev/sda1 /boot\r\n/dev/sda2 /\r\n/dev/sda3 /mnt\r\n/dev/sda4 /uuid'
- /dev/root /
/dev/sda1 /boot
+ /dev/sda2 /
- /dev/sda3 /mnt+ /dev/sda3 /mnt
? ++
+ /dev/sda4 /uuid

Erm, that doesn't make any sense:

Quoted 11 lines

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +0 -0
@@ -633,11 +633,14 @@ part /etc --source rootfs --ondisk mmcblk0

--fstype=ext4 --exclude-path bin/ --r

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r

Quoted 6 lines
meta/lib/oeqa/selftest/cases/wic.py +1 -2
         self.assertEqual(0, bitbake('wic-image-minimal').status)
         self.remove_config(config)
 
-        with runqemu('wic-image-minimal', ssh=False) as qemu:
-            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' '"
+        with runqemu('wic-image-minimal', ssh=False,

runqemuparams="nographic") as qemu:

... I'll v2 since disabling graphics was a local thing, oops.

Quoted 10 lines

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +3 -0
+            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' ' | sort"
+            status, output = qemu.run_serial(cmd)
+            self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2

/\r\n/dev/sda3 /mnt\r\n/dev/sda4 /uuid')

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +1 -0
+            cmd = "grep UUID= /etc/fstab"
             status, output = qemu.run_serial(cmd)
             self.assertEqual(1, status, 'Failed to run command "%s": %s'

% (cmd, output))

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 · line 640

Quoted 1 line
meta/lib/oeqa/selftest/cases/wic.py +0 -1
-            self.assertEqual(output, '/dev/root /\r\n/dev/sda1

/boot\r\n/dev/sda3 /mnt')

Quoted 8 lines
Quoted 2 lines

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 · line 643

Quoted 1 line
meta/lib/oeqa/selftest/cases/wic.py +1 -0
+            self.assertEqual(output,

'UUID=2c71ef06-a81d-4735-9d3a-379b69c6bdba\t/uuid\text4\tdefaults\t0\t0')

We no longer want to match the string you've got showing up, and the string you have showing up says that /uuid wasn't mounted either.

Can you check the sources in the autobuilder please and make sure the whole series got applied correctly? Thanks!

Have you had a chance to look at this? It's really confusing as the test output is basically the wic-minimal-image without the change that's included in this patch having been applied (it's 3 partitions). Thanks!

Signature · 1 line
Tom
#8 lore raw

Re: [PATCHv2 4/4] meta-selftest: wic: Add test for --use-uuid / --fsuuid

I finally made it break locally, with MACHINE=qemux86 and using sysvinit instead of systemd. Basically, a pristine poky local.conf. I've not dug into it beyond that, or why it passes with systemd.

Ross

Quoted 81 lines · Tom Rini
Quoted 4 lines · Tom Rini
Quoted 3 lines · Ross

Still fails on the autobuilder though:

2017-11-24 03:33:51,694 - oe-selftest - INFO - FAIL: test_qemu

(wic.Wic)

Quoted 3 lines
Quoted 3 lines
2017-11-24 03:33:51,694 - oe-selftest - INFO -
----------------------------------------------------------------------
2017-11-24 03:33:51,694 - oe-selftest - INFO - Traceback (most recent

call

Quoted 3 lines
Quoted 3 lines

last):
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/

nightly-oe-selftest/build/meta/lib/oeqa/core/decorator/__init__.py",

Quoted 4 lines
Quoted 4 lines

line 32, in wrapped_f
return func(*args, **kwargs)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/

nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py",

Quoted 4 lines
Quoted 4 lines

line 58, in wrapped_f
return func(*args, **kwargs)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/

nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py",

Quoted 2 lines
Quoted 2 lines

line 639, in test_qemu
self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2

/\r\n/dev/sda3

Quoted 19 lines
Quoted 9 lines

/mnt\r\n/dev/sda4 /uuid')
AssertionError: '/dev/root /\r\n/dev/sda1 /boot\r\n/dev/sda3 /mnt' != '/dev/sda1 /boot\r\n/dev/sda2 /\r\n/dev/sda3 /mnt\r\n/dev/sda4 /uuid'
- /dev/root /
/dev/sda1 /boot
+ /dev/sda2 /
- /dev/sda3 /mnt+ /dev/sda3 /mnt
? ++
+ /dev/sda4 /uuid

Erm, that doesn't make any sense:

Quoted 7 lines

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +0 -0
@@ -633,11 +633,14 @@ part /etc --source rootfs --ondisk mmcblk0

--fstype=ext4 --exclude-path bin/ --r

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +0 -0
         self.assertEqual(0, bitbake('wic-image-minimal').status)
         self.remove_config(config)
 
Quoted 14 lines
Quoted 4 lines

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +1 -2
-        with runqemu('wic-image-minimal', ssh=False) as qemu:
-            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' '"
+        with runqemu('wic-image-minimal', ssh=False,

runqemuparams="nographic") as qemu:

... I'll v2 since disabling graphics was a local thing, oops.

Quoted 7 lines

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +3 -0
+            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' ' | sort"
+            status, output = qemu.run_serial(cmd)
+            self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2

/\r\n/dev/sda3 /mnt\r\n/dev/sda4 /uuid')

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +1 -0
+            cmd = "grep UUID= /etc/fstab"
             status, output = qemu.run_serial(cmd)
             self.assertEqual(1, status, 'Failed to run command

"%s": %s'

Quoted 5 lines
Quoted 5 lines

% (cmd, output))

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 · line 640

Quoted 1 line
meta/lib/oeqa/selftest/cases/wic.py +0 -1
-            self.assertEqual(output, '/dev/root /\r\n/dev/sda1

/boot\r\n/dev/sda3 /mnt')

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 · line 643

Quoted 1 line
meta/lib/oeqa/selftest/cases/wic.py +1 -0
+            self.assertEqual(output,

'UUID=2c71ef06-a81d-4735-9d3a-379b69c6bdba\t/uuid\text4\

tdefaults\t0\t0')

Quoted 6 lines

We no longer want to match the string you've got showing up, and the string you have showing up says that /uuid wasn't mounted either.

Can you check the sources in the autobuilder please and make sure the whole series got applied correctly? Thanks!

Have you had a chance to look at this? It's really confusing as the test output is basically the wic-minimal-image without the change that's included in this patch having been applied (it's 3 partitions). Thanks!

--
Tom

author
#9 lore raw

Re: [PATCHv2 4/4] meta-selftest: wic: Add test for --use-uuid / --fsuuid

Quoted 3 lines · Ross

I finally made it break locally, with MACHINE=qemux86 and using sysvinit instead of systemd. Basically, a pristine poky local.conf. I've not dug into it beyond that, or why it passes with systemd.

OK, thanks! I'll see if I can reproduce locally.

Signature · 1 line
Tom
author
#10 lore raw

Re: [PATCHv2 4/4] meta-selftest: wic: Add test for --use-uuid / --fsuuid

In reply to Burton, Ross
Quoted 3 lines · Ross

I finally made it break locally, with MACHINE=qemux86 and using sysvinit instead of systemd. Basically, a pristine poky local.conf. I've not dug into it beyond that, or why it passes with systemd.

I found it, and, erm, ugh? Here's what appears to be a systemd vs sysvinit difference. With systemd, if you have an fstab entry and the mount point doesn't exist, it will get made. So an entry of /uuid (a very non-HFS and just made up directory) the mount happens. With sysvinit, no, the mount fails. That's why the test fails.

My gut reaction is that no, it's not wic's job to ensure that the underlying filesystems have all mount points and I should just re-do the test to use /mnt instead of /uuid, for the UUID test mount point.

Quoted 92 lines

Ross

Quoted 81 lines · Tom Rini
Quoted 4 lines · Tom Rini
Quoted 3 lines · Ross

Still fails on the autobuilder though:

2017-11-24 03:33:51,694 - oe-selftest - INFO - FAIL: test_qemu

(wic.Wic)

Quoted 3 lines
Quoted 3 lines
2017-11-24 03:33:51,694 - oe-selftest - INFO -
----------------------------------------------------------------------
2017-11-24 03:33:51,694 - oe-selftest - INFO - Traceback (most recent

call

Quoted 3 lines
Quoted 3 lines

last):
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/

nightly-oe-selftest/build/meta/lib/oeqa/core/decorator/__init__.py",

Quoted 4 lines
Quoted 4 lines

line 32, in wrapped_f
return func(*args, **kwargs)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/

nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py",

Quoted 4 lines
Quoted 4 lines

line 58, in wrapped_f
return func(*args, **kwargs)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/

nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py",

Quoted 2 lines
Quoted 2 lines

line 639, in test_qemu
self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2

/\r\n/dev/sda3

Quoted 19 lines
Quoted 9 lines

/mnt\r\n/dev/sda4 /uuid')
AssertionError: '/dev/root /\r\n/dev/sda1 /boot\r\n/dev/sda3 /mnt' != '/dev/sda1 /boot\r\n/dev/sda2 /\r\n/dev/sda3 /mnt\r\n/dev/sda4 /uuid'
- /dev/root /
/dev/sda1 /boot
+ /dev/sda2 /
- /dev/sda3 /mnt+ /dev/sda3 /mnt
? ++
+ /dev/sda4 /uuid

Erm, that doesn't make any sense:

Quoted 7 lines

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +0 -0
@@ -633,11 +633,14 @@ part /etc --source rootfs --ondisk mmcblk0

--fstype=ext4 --exclude-path bin/ --r

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +0 -0
         self.assertEqual(0, bitbake('wic-image-minimal').status)
         self.remove_config(config)
 
Quoted 14 lines
Quoted 4 lines

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +1 -2
-        with runqemu('wic-image-minimal', ssh=False) as qemu:
-            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' '"
+        with runqemu('wic-image-minimal', ssh=False,

runqemuparams="nographic") as qemu:

... I'll v2 since disabling graphics was a local thing, oops.

Quoted 7 lines

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +3 -0
+            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' ' | sort"
+            status, output = qemu.run_serial(cmd)
+            self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2

/\r\n/dev/sda3 /mnt\r\n/dev/sda4 /uuid')

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +1 -0
+            cmd = "grep UUID= /etc/fstab"
             status, output = qemu.run_serial(cmd)
             self.assertEqual(1, status, 'Failed to run command

"%s": %s'

Quoted 5 lines
Quoted 5 lines

% (cmd, output))

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 · line 640

Quoted 1 line
meta/lib/oeqa/selftest/cases/wic.py +0 -1
-            self.assertEqual(output, '/dev/root /\r\n/dev/sda1

/boot\r\n/dev/sda3 /mnt')

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 · line 643

Quoted 1 line
meta/lib/oeqa/selftest/cases/wic.py +1 -0
+            self.assertEqual(output,

'UUID=2c71ef06-a81d-4735-9d3a-379b69c6bdba\t/uuid\text4\

tdefaults\t0\t0')

Quoted 6 lines

We no longer want to match the string you've got showing up, and the string you have showing up says that /uuid wasn't mounted either.

Can you check the sources in the autobuilder please and make sure the whole series got applied correctly? Thanks!

Have you had a chance to look at this? It's really confusing as the test output is basically the wic-minimal-image without the change that's included in this patch having been applied (it's 3 partitions). Thanks!

--
Tom

Signature · 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Tom
author
#11 lore raw

Re: [PATCHv2 4/4] meta-selftest: wic: Add test for --use-uuid / --fsuuid

Quoted 12 lines · Tom Rini
Quoted 3 lines · Ross

I finally made it break locally, with MACHINE=qemux86 and using sysvinit instead of systemd. Basically, a pristine poky local.conf. I've not dug into it beyond that, or why it passes with systemd.

I found it, and, erm, ugh? Here's what appears to be a systemd vs sysvinit difference. With systemd, if you have an fstab entry and the mount point doesn't exist, it will get made. So an entry of /uuid (a very non-HFS and just made up directory) the mount happens. With sysvinit, no, the mount fails. That's why the test fails.

Quoted 3 lines

My gut reaction is that no, it's not wic's job to ensure that the underlying filesystems have all mount points and I should just re-do the test to use /mnt instead of /uuid, for the UUID test mount point.

And in fact, systemd just can't be used for oe-selftest and have everything expect to pass today. The existing wic.Wic.test_qemu will fail on /dev/root vs /dev/sda2. So I'm going to post a v4 that puts the UUID one into /media, and I've run the tests and they pass atm. Thanks!

Quoted 97 lines
Quoted 93 lines

Ross

Quoted 81 lines · Tom Rini
Quoted 4 lines · Tom Rini
Quoted 3 lines · Ross

Still fails on the autobuilder though:

2017-11-24 03:33:51,694 - oe-selftest - INFO - FAIL: test_qemu

(wic.Wic)

Quoted 3 lines
Quoted 3 lines
2017-11-24 03:33:51,694 - oe-selftest - INFO -
----------------------------------------------------------------------
2017-11-24 03:33:51,694 - oe-selftest - INFO - Traceback (most recent

call

Quoted 3 lines
Quoted 3 lines

last):
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/

nightly-oe-selftest/build/meta/lib/oeqa/core/decorator/__init__.py",

Quoted 4 lines
Quoted 4 lines

line 32, in wrapped_f
return func(*args, **kwargs)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/

nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py",

Quoted 4 lines
Quoted 4 lines

line 58, in wrapped_f
return func(*args, **kwargs)
File
"/home/pokybuild/yocto-autobuilder/yocto-worker/

nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py",

Quoted 2 lines
Quoted 2 lines

line 639, in test_qemu
self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2

/\r\n/dev/sda3

Quoted 19 lines
Quoted 9 lines

/mnt\r\n/dev/sda4 /uuid')
AssertionError: '/dev/root /\r\n/dev/sda1 /boot\r\n/dev/sda3 /mnt' != '/dev/sda1 /boot\r\n/dev/sda2 /\r\n/dev/sda3 /mnt\r\n/dev/sda4 /uuid'
- /dev/root /
/dev/sda1 /boot
+ /dev/sda2 /
- /dev/sda3 /mnt+ /dev/sda3 /mnt
? ++
+ /dev/sda4 /uuid

Erm, that doesn't make any sense:

Quoted 7 lines

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +0 -0
@@ -633,11 +633,14 @@ part /etc --source rootfs --ondisk mmcblk0

--fstype=ext4 --exclude-path bin/ --r

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +0 -0
         self.assertEqual(0, bitbake('wic-image-minimal').status)
         self.remove_config(config)
 
Quoted 14 lines
Quoted 4 lines

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +1 -2
-        with runqemu('wic-image-minimal', ssh=False) as qemu:
-            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' '"
+        with runqemu('wic-image-minimal', ssh=False,

runqemuparams="nographic") as qemu:

... I'll v2 since disabling graphics was a local thing, oops.

Quoted 7 lines

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +3 -0
+            cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' ' | sort"
+            status, output = qemu.run_serial(cmd)
+            self.assertEqual(output, '/dev/sda1 /boot\r\n/dev/sda2

/\r\n/dev/sda3 /mnt\r\n/dev/sda4 /uuid')

Quoted 3 lines
meta/lib/oeqa/selftest/cases/wic.py +1 -0
+            cmd = "grep UUID= /etc/fstab"
             status, output = qemu.run_serial(cmd)
             self.assertEqual(1, status, 'Failed to run command

"%s": %s'

Quoted 5 lines
Quoted 5 lines

% (cmd, output))

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 · line 640

Quoted 1 line
meta/lib/oeqa/selftest/cases/wic.py +0 -1
-            self.assertEqual(output, '/dev/root /\r\n/dev/sda1

/boot\r\n/dev/sda3 /mnt')

meta/lib/oeqa/selftest/cases/wic.py part /etc --source rootfs --ondisk mmcblk0 · line 643

Quoted 1 line
meta/lib/oeqa/selftest/cases/wic.py +1 -0
+            self.assertEqual(output,

'UUID=2c71ef06-a81d-4735-9d3a-379b69c6bdba\t/uuid\text4\

tdefaults\t0\t0')

Quoted 6 lines

We no longer want to match the string you've got showing up, and the string you have showing up says that /uuid wasn't mounted either.

Can you check the sources in the autobuilder please and make sure the whole series got applied correctly? Thanks!

Have you had a chance to look at this? It's really confusing as the test output is basically the wic-minimal-image without the change that's included in this patch having been applied (it's 3 partitions). Thanks!

--
Tom

Signature · 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Tom
Signature · 1 line
Tom
#12 lore raw

Re: [PATCHv2 4/4] meta-selftest: wic: Add test for --use-uuid / --fsuuid

Quoted 13 lines · Tom Rini
Quoted 12 lines · Tom Rini
Quoted 3 lines · Ross

I finally made it break locally, with MACHINE=qemux86 and using sysvinit instead of systemd. Basically, a pristine poky local.conf. I've not dug into it beyond that, or why it passes with systemd.

I found it, and, erm, ugh? Here's what appears to be a systemd vs sysvinit difference. With systemd, if you have an fstab entry and the mount point doesn't exist, it will get made. So an entry of /uuid (a very non-HFS and just made up directory) the mount happens. With sysvinit, no, the mount fails. That's why the test fails.

Quoted 9 lines
Quoted 3 lines

My gut reaction is that no, it's not wic's job to ensure that the underlying filesystems have all mount points and I should just re-do the test to use /mnt instead of /uuid, for the UUID test mount point.

And in fact, systemd just can't be used for oe-selftest and have everything expect to pass today. The existing wic.Wic.test_qemu will fail on /dev/root vs /dev/sda2. So I'm going to post a v4 that puts the UUID one into /media, and I've run the tests and they pass atm. Thanks!

/media is usually automounted when removable media is inserted. you might want to use something else.

#13 lore raw
In reply to Tom Rini

Hi Tom,

Thank you for the great patchset!

+1

Quoted 24 lines · Tom Rini

Hey all,

So, per Ed's feedback on my first series, I went and spent some time trying to figure out how to have wic know what the UUID would be when updating the fstab. It turns out the easiest answer here is to have WIC make the UUID. Per Otavio's concern last time, I also make sure that the filesystem UUID can be passed in, for reproducibility. One thing to keep in mind here is that FAT filesystem UUIDs are a bit funny to deal with as mkfs.vfat / mkdosfs / etc want to be given a 32bit hexadecimal value. But when we talk mount, it must be split and it must be in uppercase. To make the rest of the code easier I'm encoding the '0x' portion into part.fsuuid rather than doing "-i 0x%s" in a bunch of places.

While preparing all of this, I found a few minor things such as we did not test for squashfs and --use-uuid (not supported) and an incorrect comment around the btrfs support.

Since v1, I've added a testcase into wic.Wic.test_qemu for a UUID mount and the UUID that we've given. I think this is cleaner than adding a python function to make a wks file just for this task.

--
Tom

Signature · 3 lines
--
Regards,
Ed