[v1,1/1] Fix permissions when splitting rootfs folders across partitions.

Message ID 20211103125305.3021016-1-felix.moessbauer@siemens.com
State Awaiting Upstream
Headers show
Series [v1,1/1] Fix permissions when splitting rootfs folders across partitions. | expand

Commit Message

MOESSBAUER, Felix Nov. 3, 2021, 2:53 a.m. UTC
This patches ensures that the file database containing the file and
folder usernames and permissions is always located relative to the
source and not to the appended rootfs-dir.

Prior to this patch, the database was not found when using
-rootfs-dir 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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Kiszka Nov. 3, 2021, 3:26 a.m. UTC | #1
On 03.11.21 13:53, Felix Moessbauer wrote:
> This patches ensures that the file database containing the file and
> folder usernames and permissions is always located relative to the
> source and not to the appended rootfs-dir.
> 
> Prior to this patch, the database was not found when using
> -rootfs-dir 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 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py
> index 96d940a..5ab771e 100644
> --- a/scripts/lib/wic/plugins/source/rootfs.py
> +++ b/scripts/lib/wic/plugins/source/rootfs.py
> @@ -95,7 +95,7 @@ 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")
> +        pseudo_dir = os.path.join(krootfs_dir['ROOTFS_DIR'], "../pseudo")
>          if not os.path.lexists(pseudo_dir):
>              logger.warn("%s folder does not exist. "
>                          "Usernames and permissions will be invalid " % pseudo_dir)
> 

Upstream first: first OE, then Isar. At least submit to OE first. If
it's urgent, we can still decide to apply here earlier.

Jan
Jan Kiszka April 21, 2022, 6:42 a.m. UTC | #2
On 03.11.21 14:26, Jan Kiszka wrote:
> On 03.11.21 13:53, Felix Moessbauer wrote:
>> This patches ensures that the file database containing the file and
>> folder usernames and permissions is always located relative to the
>> source and not to the appended rootfs-dir.
>>
>> Prior to this patch, the database was not found when using
>> -rootfs-dir 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 | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py
>> index 96d940a..5ab771e 100644
>> --- a/scripts/lib/wic/plugins/source/rootfs.py
>> +++ b/scripts/lib/wic/plugins/source/rootfs.py
>> @@ -95,7 +95,7 @@ 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")
>> +        pseudo_dir = os.path.join(krootfs_dir['ROOTFS_DIR'], "../pseudo")
>>          if not os.path.lexists(pseudo_dir):
>>              logger.warn("%s folder does not exist. "
>>                          "Usernames and permissions will be invalid " % pseudo_dir)
>>
> 
> Upstream first: first OE, then Isar. At least submit to OE first. If
> it's urgent, we can still decide to apply here earlier.
> 

What's the status here? Asking as I see this patch more and more in
downstream layers, and it's needed there.

Jan
MOESSBAUER, Felix April 21, 2022, 8:09 a.m. UTC | #3
> -----Original Message-----
> From: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>
> Sent: Thursday, April 21, 2022 4:43 PM
> To: Moessbauer, Felix (T CED SES-DE) <felix.moessbauer@siemens.com>; isar-
> users@googlegroups.com
> Cc: Schild, Henning (T CED SES-DE) <henning.schild@siemens.com>; Schmidt,
> Adriaan (T CED SES-DE) <adriaan.schmidt@siemens.com>
> Subject: Re: [PATCH v1 1/1] Fix permissions when splitting rootfs folders across
> partitions.
> 
> On 03.11.21 14:26, Jan Kiszka wrote:
> > On 03.11.21 13:53, Felix Moessbauer wrote:
> >> This patches ensures that the file database containing the file and
> >> folder usernames and permissions is always located relative to the
> >> source and not to the appended rootfs-dir.
> >>
> >> Prior to this patch, the database was not found when using
> >> -rootfs-dir 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 | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/scripts/lib/wic/plugins/source/rootfs.py
> >> b/scripts/lib/wic/plugins/source/rootfs.py
> >> index 96d940a..5ab771e 100644
> >> --- a/scripts/lib/wic/plugins/source/rootfs.py
> >> +++ b/scripts/lib/wic/plugins/source/rootfs.py
> >> @@ -95,7 +95,7 @@ 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")
> >> +        pseudo_dir = os.path.join(krootfs_dir['ROOTFS_DIR'],
> >> + "../pseudo")
> >>          if not os.path.lexists(pseudo_dir):
> >>              logger.warn("%s folder does not exist. "
> >>                          "Usernames and permissions will be invalid "
> >> % pseudo_dir)
> >>
> >
> > Upstream first: first OE, then Isar. At least submit to OE first. If
> > it's urgent, we can still decide to apply here earlier.
> >
> 
> What's the status here? Asking as I see this patch more and more in downstream
> layers, and it's needed there.

Thanks for the hint. I just sent out the patch to oe-core. It's still valid and required.

Felix

> 
> Jan
> 
> --
> Siemens AG, Technology
> Competence Center Embedded Linux

Patch

diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py
index 96d940a..5ab771e 100644
--- a/scripts/lib/wic/plugins/source/rootfs.py
+++ b/scripts/lib/wic/plugins/source/rootfs.py
@@ -95,7 +95,7 @@  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")
+        pseudo_dir = os.path.join(krootfs_dir['ROOTFS_DIR'], "../pseudo")
         if not os.path.lexists(pseudo_dir):
             logger.warn("%s folder does not exist. "
                         "Usernames and permissions will be invalid " % pseudo_dir)