All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] wic: When using --use-uuid make sure that we update the fstab with PARTUUID
@ 2017-09-21 17:46 Tom Rini
  2017-09-21 17:46 ` [PATCH 2/2] wic: Update canned-wks for systemd to use UUID everywhere Tom Rini
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Tom Rini @ 2017-09-21 17:46 UTC (permalink / raw)
  To: openembedded-core

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>
---
 scripts/lib/wic/plugins/imager/direct.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index a6abc3d09ef0..b0da54511b77 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -139,9 +139,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,
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2017-11-08 15:42 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-21 17:46 [PATCH 1/2] wic: When using --use-uuid make sure that we update the fstab with PARTUUID Tom Rini
2017-09-21 17:46 ` [PATCH 2/2] wic: Update canned-wks for systemd to use UUID everywhere Tom Rini
2017-09-21 21:15 ` [PATCH 1/2] wic: When using --use-uuid make sure that we update the fstab with PARTUUID Otavio Salvador
2017-09-21 21:19   ` Tom Rini
2017-09-21 21:20   ` Mark Hatle
2017-09-21 21:21     ` Tom Rini
2017-09-28 12:26       ` Ed Bartosh
2017-10-10 21:01 ` Tom Rini
2017-10-20 13:15   ` Tom Rini
2017-11-03 12:51     ` Tom Rini
2017-11-06 10:08       ` Ed Bartosh
2017-11-06 11:36         ` Otavio Salvador
2017-11-06 12:44           ` Tom Rini
2017-11-06 12:51             ` Otavio Salvador
2017-11-06 13:02               ` Tom Rini
2017-11-07  8:11             ` Ed Bartosh
2017-11-07 14:54               ` Tom Rini
2017-11-08 11:20                 ` Ed Bartosh
2017-11-08 15:00                   ` Tom Rini
2017-11-08 14:30                     ` Ed Bartosh
2017-11-06 12:44         ` Tom Rini
2017-11-07  8:27           ` Ed Bartosh
2017-11-07 14:55             ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.