]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: When using --use-uuid make sure that we update the fstab with PARTUUID
authorTom Rini <trini@konsulko.com>
Thu, 21 Sep 2017 17:46:16 +0000 (13:46 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 8 Nov 2017 22:23:44 +0000 (22:23 +0000)
When we have been told to use the UUID we should also update the fstab
to make use of PARTUUID instead of hard-coding the device in question.
This will make the resulting image much more portable.

Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/wic/plugins/imager/direct.py

index bdb83856203b583f0d4f0d68b002c24e098484e5..da1c061063d25e86888d9ab1a2bcfdf928e63355 100644 (file)
@@ -140,9 +140,12 @@ class DirectPlugin(ImagerPlugin):
                or part.mountpoint == "/":
                 continue
 
-            # mmc device partitions are named mmcblk0p1, mmcblk0p2..
-            prefix = 'p' if  part.disk.startswith('mmcblk') else ''
-            device_name = "/dev/%s%s%d" % (part.disk, prefix, part.realnum)
+            if part.use_uuid:
+                device_name = "PARTUUID=%s" % part.uuid
+            else:
+                # mmc device partitions are named mmcblk0p1, mmcblk0p2..
+                prefix = 'p' if  part.disk.startswith('mmcblk') else ''
+                device_name = "/dev/%s%s%d" % (part.disk, prefix, part.realnum)
 
             opts = part.fsopts if part.fsopts else "defaults"
             line = "\t".join([device_name, part.mountpoint, part.fstype,