Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 1/2] wic: When using --use-uuid make sure that we update the fstab with PARTUUID
Date: Thu, 21 Sep 2017 13:46:16 -0400	[thread overview]
Message-ID: <1506015977-16858-1-git-send-email-trini@konsulko.com> (raw)

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



             reply	other threads:[~2017-09-21 17:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-21 17:46 Tom Rini [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1506015977-16858-1-git-send-email-trini@konsulko.com \
    --to=trini@konsulko.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox