openembedded-core.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/1] wic/plugins/rootfs: Fix permissions when splitting rootfs folders across partitions
@ 2022-05-06  8:59 Felix Moessbauer
  2022-05-06  8:59 ` [PATCH v2 1/1] " Felix Moessbauer
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Moessbauer @ 2022-05-06  8:59 UTC (permalink / raw)
  To: openembedded-core; +Cc: jan.kiszka, Felix Moessbauer

Changes since v1:

- restore previous behavior
- implement support for --rootfs-dir=${IMAGE_ROOTFS}/<x> via fallback

Best regards,
Felix Moessbauer
Siemens AG

Felix Moessbauer (1):
  wic/plugins/rootfs: Fix permissions when splitting rootfs folders
    across partitions

 scripts/lib/wic/plugins/source/rootfs.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

-- 
2.30.2



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

* [PATCH v2 1/1] wic/plugins/rootfs: Fix permissions when splitting rootfs folders across partitions
  2022-05-06  8:59 [PATCH v2 0/1] wic/plugins/rootfs: Fix permissions when splitting rootfs folders across partitions Felix Moessbauer
@ 2022-05-06  8:59 ` Felix Moessbauer
  0 siblings, 0 replies; 2+ messages in thread
From: Felix Moessbauer @ 2022-05-06  8:59 UTC (permalink / raw)
  To: openembedded-core; +Cc: jan.kiszka, Felix Moessbauer

This patches makes locating the file database containing the file and
folder usernames and permissions more reliable.
In addition to locating it relative to the partition directory, we also
try to locate it relative to the IMAGE_ROOTFS.

Prior to this patch, the database was not found when using
--rootfs-dir=${IMAGE_ROOTFS}/<x> in the WIC script, leading to erronous file
permissions and ownership.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 scripts/lib/wic/plugins/source/rootfs.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py
index 2e34e715ca..25bb41dd70 100644
--- a/scripts/lib/wic/plugins/source/rootfs.py
+++ b/scripts/lib/wic/plugins/source/rootfs.py
@@ -50,7 +50,7 @@ class RootfsPlugin(SourcePlugin):
 
     @staticmethod
     def __get_rootfs_dir(rootfs_dir):
-        if os.path.isdir(rootfs_dir):
+        if rootfs_dir and os.path.isdir(rootfs_dir):
             return os.path.realpath(rootfs_dir)
 
         image_rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", rootfs_dir)
@@ -96,6 +96,9 @@ class RootfsPlugin(SourcePlugin):
         part.rootfs_dir = cls.__get_rootfs_dir(rootfs_dir)
         part.has_fstab = os.path.exists(os.path.join(part.rootfs_dir, "etc/fstab"))
         pseudo_dir = os.path.join(part.rootfs_dir, "../pseudo")
+        if not os.path.lexists(pseudo_dir):
+            pseudo_dir = os.path.join(cls.__get_rootfs_dir(None), '../pseudo')
+
         if not os.path.lexists(pseudo_dir):
             logger.warn("%s folder does not exist. "
                         "Usernames and permissions will be invalid " % pseudo_dir)
-- 
2.30.2



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

end of thread, other threads:[~2022-05-06  9:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06  8:59 [PATCH v2 0/1] wic/plugins/rootfs: Fix permissions when splitting rootfs folders across partitions Felix Moessbauer
2022-05-06  8:59 ` [PATCH v2 1/1] " Felix Moessbauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).