All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wic/imager/direct: Ensure correct ROOTFS_DIR is shown
@ 2018-04-19 12:26 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2018-04-19 12:26 UTC (permalink / raw)
  To: openembedded-core

This changes the output of "wic create mkefidisk -e core-image-sato" from:

The following build artifacts were used to create the image(s):
  ROOTFS_DIR:                   /media/build1/poky/build/tmp.wic.ybraavmb/rootfs_copy

to:

The following build artifacts were used to create the image(s):
  ROOTFS_DIR:                   /media/build1/poky/build/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r0/rootfs

which s much less confusing for the user.

[YOCTO #12564]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 scripts/lib/wic/plugins/imager/direct.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index 71c0b1c..1fa6b91 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -63,6 +63,7 @@ class DirectPlugin(ImagerPlugin):
 
         # parse possible 'rootfs=name' items
         self.rootfs_dir = dict(rdir.split('=') for rdir in rootfs_dir.split(' '))
+        self.replaced_rootfs_paths = {}
         self.bootimg_dir = bootimg_dir
         self.kernel_dir = kernel_dir
         self.native_sysroot = native_sysroot
@@ -183,6 +184,7 @@ class DirectPlugin(ImagerPlugin):
             new_rootfs = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
         if new_rootfs:
             # rootfs was copied to update fstab
+            self.replaced_rootfs_paths[new_rootfs] = self.rootfs_dir['ROOTFS_DIR']
             self.rootfs_dir['ROOTFS_DIR'] = new_rootfs
 
         for part in self.parts:
@@ -258,7 +260,10 @@ class DirectPlugin(ImagerPlugin):
                 suffix = ':'
             else:
                 suffix = '["%s"]:' % (part.mountpoint or part.label)
-            msg += '  ROOTFS_DIR%s%s\n' % (suffix.ljust(20), part.rootfs_dir)
+            rootdir = part.rootfs_dir
+            if rootdir in self.replaced_rootfs_paths:
+                rootdir = self.replaced_rootfs_paths[rootdir]
+            msg += '  ROOTFS_DIR%s%s\n' % (suffix.ljust(20), rootdir)
 
         msg += '  BOOTIMG_DIR:                  %s\n' % self.bootimg_dir
         msg += '  KERNEL_DIR:                   %s\n' % self.kernel_dir
-- 
2.7.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-19 12:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19 12:26 [PATCH] wic/imager/direct: Ensure correct ROOTFS_DIR is shown Richard Purdie

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.