diff mbox series

[isar-cip-core] RFC v2 8/9] kas: Patch isar for correct permissions in var and home

Message ID 20211116112752.1521211-9-Quirin.Gylstorff@siemens.com (mailing list archive)
State Handled Elsewhere
Headers show
Series [isar-cip-core] RFC v2 8/9] kas: Patch isar for correct permissions in var and home | expand

Commit Message

Gylstorff Quirin Nov. 16, 2021, 11:27 a.m. UTC
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 kas-cip.yml                                   |  4 +++
 ...when-splitting-rootfs-folders-across.patch | 35 +++++++++++++++++++
 2 files changed, 39 insertions(+)
 create mode 100644 patches/isar/0001-Fix-permissions-when-splitting-rootfs-folders-across.patch

Comments

Christian Storm Nov. 17, 2021, 10:27 a.m. UTC | #1
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>


A note where this comes from, where it's supposed to go in oder to get
rid of this patch here eventually would be helpful.


> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
>  kas-cip.yml                                   |  4 +++
>  ...when-splitting-rootfs-folders-across.patch | 35 +++++++++++++++++++
>  2 files changed, 39 insertions(+)
>  create mode 100644 patches/isar/0001-Fix-permissions-when-splitting-rootfs-folders-across.patch
> 
> diff --git a/kas-cip.yml b/kas-cip.yml
> index dc56729..8226954 100644
> --- a/kas-cip.yml
> +++ b/kas-cip.yml
> @@ -25,6 +25,10 @@ repos:
>      refspec: ceb7e21154fc4862f704bb5c7739e87a26db6eb3
>      layers:
>        meta:
> +    patches:
> +      fix-pseudo:
> +        repo: cip-core
> +        path: patches/isar/0001-Fix-permissions-when-splitting-rootfs-folders-across.patch
>  
>  bblayers_conf_header:
>    standard: |
> diff --git a/patches/isar/0001-Fix-permissions-when-splitting-rootfs-folders-across.patch b/patches/isar/0001-Fix-permissions-when-splitting-rootfs-folders-across.patch
> new file mode 100644
> index 0000000..34704f0
> --- /dev/null
> +++ b/patches/isar/0001-Fix-permissions-when-splitting-rootfs-folders-across.patch
> @@ -0,0 +1,35 @@
> +From 34b37fccd5e454d29d6d4d002d48a9619782b1bb Mon Sep 17 00:00:00 2001
> +From: Felix Moessbauer <felix.moessbauer@siemens.com>
> +Date: Wed, 3 Nov 2021 13:53:00 +0100
> +Subject: [PATCH] Fix permissions when splitting rootfs folders across
> + partitions.
> +
> +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 96d940a9..5ab771e5 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)
> +-- 
> +2.30.2
> +
> -- 
> 2.30.2
> 



Kind regards,
   Christian
Gylstorff Quirin Nov. 17, 2021, 11:41 a.m. UTC | #2
On 11/17/21 11:27 AM, Christian Storm via lists.cip-project.org wrote:
>> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> 
> A note where this comes from, where it's supposed to go in oder to get
> rid of this patch here eventually would be helpful.
> 
I will add a link to the discussion of the Patch on the ISAR mailing 
list[1] in the next version.

[1]: https://groups.google.com/g/isar-users/c/wlanc7f7UnQ

Kind regards
Quirin

> 
>> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>> ---
>>   kas-cip.yml                                   |  4 +++
>>   ...when-splitting-rootfs-folders-across.patch | 35 +++++++++++++++++++
>>   2 files changed, 39 insertions(+)
>>   create mode 100644 patches/isar/0001-Fix-permissions-when-splitting-rootfs-folders-across.patch
>>
>> diff --git a/kas-cip.yml b/kas-cip.yml
>> index dc56729..8226954 100644
>> --- a/kas-cip.yml
>> +++ b/kas-cip.yml
>> @@ -25,6 +25,10 @@ repos:
>>       refspec: ceb7e21154fc4862f704bb5c7739e87a26db6eb3
>>       layers:
>>         meta:
>> +    patches:
>> +      fix-pseudo:
>> +        repo: cip-core
>> +        path: patches/isar/0001-Fix-permissions-when-splitting-rootfs-folders-across.patch
>>   
>>   bblayers_conf_header:
>>     standard: |
>> diff --git a/patches/isar/0001-Fix-permissions-when-splitting-rootfs-folders-across.patch b/patches/isar/0001-Fix-permissions-when-splitting-rootfs-folders-across.patch
>> new file mode 100644
>> index 0000000..34704f0
>> --- /dev/null
>> +++ b/patches/isar/0001-Fix-permissions-when-splitting-rootfs-folders-across.patch
>> @@ -0,0 +1,35 @@
>> +From 34b37fccd5e454d29d6d4d002d48a9619782b1bb Mon Sep 17 00:00:00 2001
>> +From: Felix Moessbauer <felix.moessbauer@siemens.com>
>> +Date: Wed, 3 Nov 2021 13:53:00 +0100
>> +Subject: [PATCH] Fix permissions when splitting rootfs folders across
>> + partitions.
>> +
>> +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 96d940a9..5ab771e5 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)
>> +--
>> +2.30.2
>> +
>> -- 
>> 2.30.2
>>
> 
> 
> 
> Kind regards,
>     Christian
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#6936): https://lists.cip-project.org/g/cip-dev/message/6936
> Mute This Topic: https://lists.cip-project.org/mt/87092663/1753640
> Group Owner: cip-dev+owner@lists.cip-project.org
> Unsubscribe: https://lists.cip-project.org/g/cip-dev/leave/8129121/1753640/1405269326/xyzzy [quirin.gylstorff@siemens.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/kas-cip.yml b/kas-cip.yml
index dc56729..8226954 100644
--- a/kas-cip.yml
+++ b/kas-cip.yml
@@ -25,6 +25,10 @@  repos:
     refspec: ceb7e21154fc4862f704bb5c7739e87a26db6eb3
     layers:
       meta:
+    patches:
+      fix-pseudo:
+        repo: cip-core
+        path: patches/isar/0001-Fix-permissions-when-splitting-rootfs-folders-across.patch
 
 bblayers_conf_header:
   standard: |
diff --git a/patches/isar/0001-Fix-permissions-when-splitting-rootfs-folders-across.patch b/patches/isar/0001-Fix-permissions-when-splitting-rootfs-folders-across.patch
new file mode 100644
index 0000000..34704f0
--- /dev/null
+++ b/patches/isar/0001-Fix-permissions-when-splitting-rootfs-folders-across.patch
@@ -0,0 +1,35 @@ 
+From 34b37fccd5e454d29d6d4d002d48a9619782b1bb Mon Sep 17 00:00:00 2001
+From: Felix Moessbauer <felix.moessbauer@siemens.com>
+Date: Wed, 3 Nov 2021 13:53:00 +0100
+Subject: [PATCH] Fix permissions when splitting rootfs folders across
+ partitions.
+
+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 96d940a9..5ab771e5 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)
+-- 
+2.30.2
+