diff mbox series

[isar-cip-core,v2] read-only-rootfs.bbclass: Exclude boot,home and var from the erofs and squashfs

Message ID 20250130085342.2806658-1-Quirin.Gylstorff@siemens.com (mailing list archive)
State New
Headers show
Series [isar-cip-core,v2] read-only-rootfs.bbclass: Exclude boot,home and var from the erofs and squashfs | expand

Commit Message

Quirin Gylstorff Jan. 30, 2025, 8:51 a.m. UTC
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

This excludes the content of boot,home and var from the root file
system. Home and var are stored in separate partitions and boot
is not necessary as we use a unified kernel image(UKI). This UKI
is stored twice in separate partitions.

It should fix issue #126.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
Changes v2:
 - Also exclude /boot
 - define empty RO_ROOTFS_EXCLUDE_DIRS in read-only-rootfs
 - define excluded partitions in recipes-core/images/swupdate.inc
 - Update Copyrights
 - Add information to commit message

 classes/read-only-rootfs.bbclass | 6 +++++-
 recipes-core/images/swupdate.inc | 8 +++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

Comments

Jan Kiszka Jan. 30, 2025, 9:39 a.m. UTC | #1
On 30.01.25 09:51, Quirin Gylstorff wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> This excludes the content of boot,home and var from the root file
> system. Home and var are stored in separate partitions and boot
> is not necessary as we use a unified kernel image(UKI). This UKI
> is stored twice in separate partitions.
> 
> It should fix issue #126.
> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
> Changes v2:
>  - Also exclude /boot
>  - define empty RO_ROOTFS_EXCLUDE_DIRS in read-only-rootfs
>  - define excluded partitions in recipes-core/images/swupdate.inc
>  - Update Copyrights
>  - Add information to commit message
> 
>  classes/read-only-rootfs.bbclass | 6 +++++-
>  recipes-core/images/swupdate.inc | 8 +++++++-
>  2 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/classes/read-only-rootfs.bbclass b/classes/read-only-rootfs.bbclass
> index 9ebcadc..35a3ab3 100644
> --- a/classes/read-only-rootfs.bbclass
> +++ b/classes/read-only-rootfs.bbclass
> @@ -1,7 +1,7 @@
>  #
>  # CIP Core, generic profile
>  #
> -# Copyright (c) Siemens AG, 2020
> +# Copyright (c) Siemens AG, 2020-2025
>  #
>  # Authors:
>  #  Quirin Gylstorff <quirin.gylstorff@siemens.com>
> @@ -34,6 +34,10 @@ copy_dpkg_state() {
>      sudo cp -a ${ROOTFSDIR}/var/lib/dpkg "$IMMUTABLE_VAR_LIB/"
>  }
>  
> +RO_ROOTFS_EXCLUDE_DIRS ??= ""
> +EROFS_EXCLUDE_DIRS = "${RO_ROOTFS_EXCLUDE_DIRS}"
> +SQUASHFS_EXCLUDE_DIRS = "${RO_ROOTFS_EXCLUDE_DIRS}"
> +
>  image_configure_fstab() {
>      sudo tee '${IMAGE_ROOTFS}/etc/fstab' << EOF
>  # Begin /etc/fstab
> diff --git a/recipes-core/images/swupdate.inc b/recipes-core/images/swupdate.inc
> index 81c3365..07dbe97 100644
> --- a/recipes-core/images/swupdate.inc
> +++ b/recipes-core/images/swupdate.inc
> @@ -1,7 +1,7 @@
>  #
>  # CIP Core, generic profile
>  #
> -# Copyright (c) Siemens AG, 2023-2024
> +# Copyright (c) Siemens AG, 2023-2025
>  #
>  # Authors:
>  #  Quirin Gylstorff <quirin.gylstorff@siemens.com>
> @@ -12,6 +12,12 @@
>  inherit image_uuid
>  inherit read-only-rootfs
>  
> +# read-only rootfs with /home and /var
> +# as separate partitions is used
> +# /boot is excluded as an unified kernel image
> +# is used. This images are stored in seperate partitions.

separate - spell checking editor?

> +RO_ROOTFS_EXCLUDE_DIRS = "boot var home"
> +
>  SWU_SIGNED ?= "1"
>  SWU_HW_COMPAT ?= "cip-core-1.0"
>  IMAGER_BUILD_DEPS:swu += "${@'swupdate-signer' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}"

Looks good to me but more comments welcome.

Jan
Quirin Gylstorff Jan. 30, 2025, 9:41 a.m. UTC | #2
On 1/30/25 10:39, Jan Kiszka wrote:
> On 30.01.25 09:51, Quirin Gylstorff wrote:
>> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>>
>> This excludes the content of boot,home and var from the root file
>> system. Home and var are stored in separate partitions and boot
>> is not necessary as we use a unified kernel image(UKI). This UKI
>> is stored twice in separate partitions.
>>
>> It should fix issue #126.
>>
>> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>> ---
>> Changes v2:
>>   - Also exclude /boot
>>   - define empty RO_ROOTFS_EXCLUDE_DIRS in read-only-rootfs
>>   - define excluded partitions in recipes-core/images/swupdate.inc
>>   - Update Copyrights
>>   - Add information to commit message
>>
>>   classes/read-only-rootfs.bbclass | 6 +++++-
>>   recipes-core/images/swupdate.inc | 8 +++++++-
>>   2 files changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/classes/read-only-rootfs.bbclass b/classes/read-only-rootfs.bbclass
>> index 9ebcadc..35a3ab3 100644
>> --- a/classes/read-only-rootfs.bbclass
>> +++ b/classes/read-only-rootfs.bbclass
>> @@ -1,7 +1,7 @@
>>   #
>>   # CIP Core, generic profile
>>   #
>> -# Copyright (c) Siemens AG, 2020
>> +# Copyright (c) Siemens AG, 2020-2025
>>   #
>>   # Authors:
>>   #  Quirin Gylstorff <quirin.gylstorff@siemens.com>
>> @@ -34,6 +34,10 @@ copy_dpkg_state() {
>>       sudo cp -a ${ROOTFSDIR}/var/lib/dpkg "$IMMUTABLE_VAR_LIB/"
>>   }
>>   
>> +RO_ROOTFS_EXCLUDE_DIRS ??= ""
>> +EROFS_EXCLUDE_DIRS = "${RO_ROOTFS_EXCLUDE_DIRS}"
>> +SQUASHFS_EXCLUDE_DIRS = "${RO_ROOTFS_EXCLUDE_DIRS}"
>> +
>>   image_configure_fstab() {
>>       sudo tee '${IMAGE_ROOTFS}/etc/fstab' << EOF
>>   # Begin /etc/fstab
>> diff --git a/recipes-core/images/swupdate.inc b/recipes-core/images/swupdate.inc
>> index 81c3365..07dbe97 100644
>> --- a/recipes-core/images/swupdate.inc
>> +++ b/recipes-core/images/swupdate.inc
>> @@ -1,7 +1,7 @@
>>   #
>>   # CIP Core, generic profile
>>   #
>> -# Copyright (c) Siemens AG, 2023-2024
>> +# Copyright (c) Siemens AG, 2023-2025
>>   #
>>   # Authors:
>>   #  Quirin Gylstorff <quirin.gylstorff@siemens.com>
>> @@ -12,6 +12,12 @@
>>   inherit image_uuid
>>   inherit read-only-rootfs
>>   
>> +# read-only rootfs with /home and /var
>> +# as separate partitions is used
>> +# /boot is excluded as an unified kernel image
>> +# is used. This images are stored in seperate partitions.
> 
> separate - spell checking editor?
No the user should follow the instructions of the editor :-D
Quirin
> 
>> +RO_ROOTFS_EXCLUDE_DIRS = "boot var home"
>> +
>>   SWU_SIGNED ?= "1"
>>   SWU_HW_COMPAT ?= "cip-core-1.0"
>>   IMAGER_BUILD_DEPS:swu += "${@'swupdate-signer' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}"
> 
> Looks good to me but more comments welcome.
> 
> Jan
>
Jan Kiszka Feb. 3, 2025, 5:33 p.m. UTC | #3
On 30.01.25 09:51, Quirin Gylstorff wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> This excludes the content of boot,home and var from the root file
> system. Home and var are stored in separate partitions and boot
> is not necessary as we use a unified kernel image(UKI). This UKI
> is stored twice in separate partitions.
> 
> It should fix issue #126.
> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
> Changes v2:
>  - Also exclude /boot
>  - define empty RO_ROOTFS_EXCLUDE_DIRS in read-only-rootfs
>  - define excluded partitions in recipes-core/images/swupdate.inc
>  - Update Copyrights
>  - Add information to commit message
> 
>  classes/read-only-rootfs.bbclass | 6 +++++-
>  recipes-core/images/swupdate.inc | 8 +++++++-
>  2 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/classes/read-only-rootfs.bbclass b/classes/read-only-rootfs.bbclass
> index 9ebcadc..35a3ab3 100644
> --- a/classes/read-only-rootfs.bbclass
> +++ b/classes/read-only-rootfs.bbclass
> @@ -1,7 +1,7 @@
>  #
>  # CIP Core, generic profile
>  #
> -# Copyright (c) Siemens AG, 2020
> +# Copyright (c) Siemens AG, 2020-2025
>  #
>  # Authors:
>  #  Quirin Gylstorff <quirin.gylstorff@siemens.com>
> @@ -34,6 +34,10 @@ copy_dpkg_state() {
>      sudo cp -a ${ROOTFSDIR}/var/lib/dpkg "$IMMUTABLE_VAR_LIB/"
>  }
>  
> +RO_ROOTFS_EXCLUDE_DIRS ??= ""
> +EROFS_EXCLUDE_DIRS = "${RO_ROOTFS_EXCLUDE_DIRS}"
> +SQUASHFS_EXCLUDE_DIRS = "${RO_ROOTFS_EXCLUDE_DIRS}"
> +
>  image_configure_fstab() {
>      sudo tee '${IMAGE_ROOTFS}/etc/fstab' << EOF
>  # Begin /etc/fstab
> diff --git a/recipes-core/images/swupdate.inc b/recipes-core/images/swupdate.inc
> index 81c3365..07dbe97 100644
> --- a/recipes-core/images/swupdate.inc
> +++ b/recipes-core/images/swupdate.inc
> @@ -1,7 +1,7 @@
>  #
>  # CIP Core, generic profile
>  #
> -# Copyright (c) Siemens AG, 2023-2024
> +# Copyright (c) Siemens AG, 2023-2025
>  #
>  # Authors:
>  #  Quirin Gylstorff <quirin.gylstorff@siemens.com>
> @@ -12,6 +12,12 @@
>  inherit image_uuid
>  inherit read-only-rootfs
>  
> +# read-only rootfs with /home and /var
> +# as separate partitions is used
> +# /boot is excluded as an unified kernel image
> +# is used. This images are stored in seperate partitions.
> +RO_ROOTFS_EXCLUDE_DIRS = "boot var home"
> +
>  SWU_SIGNED ?= "1"
>  SWU_HW_COMPAT ?= "cip-core-1.0"
>  IMAGER_BUILD_DEPS:swu += "${@'swupdate-signer' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}"

Thanks, applied (with spell-fix).

Jan
diff mbox series

Patch

diff --git a/classes/read-only-rootfs.bbclass b/classes/read-only-rootfs.bbclass
index 9ebcadc..35a3ab3 100644
--- a/classes/read-only-rootfs.bbclass
+++ b/classes/read-only-rootfs.bbclass
@@ -1,7 +1,7 @@ 
 #
 # CIP Core, generic profile
 #
-# Copyright (c) Siemens AG, 2020
+# Copyright (c) Siemens AG, 2020-2025
 #
 # Authors:
 #  Quirin Gylstorff <quirin.gylstorff@siemens.com>
@@ -34,6 +34,10 @@  copy_dpkg_state() {
     sudo cp -a ${ROOTFSDIR}/var/lib/dpkg "$IMMUTABLE_VAR_LIB/"
 }
 
+RO_ROOTFS_EXCLUDE_DIRS ??= ""
+EROFS_EXCLUDE_DIRS = "${RO_ROOTFS_EXCLUDE_DIRS}"
+SQUASHFS_EXCLUDE_DIRS = "${RO_ROOTFS_EXCLUDE_DIRS}"
+
 image_configure_fstab() {
     sudo tee '${IMAGE_ROOTFS}/etc/fstab' << EOF
 # Begin /etc/fstab
diff --git a/recipes-core/images/swupdate.inc b/recipes-core/images/swupdate.inc
index 81c3365..07dbe97 100644
--- a/recipes-core/images/swupdate.inc
+++ b/recipes-core/images/swupdate.inc
@@ -1,7 +1,7 @@ 
 #
 # CIP Core, generic profile
 #
-# Copyright (c) Siemens AG, 2023-2024
+# Copyright (c) Siemens AG, 2023-2025
 #
 # Authors:
 #  Quirin Gylstorff <quirin.gylstorff@siemens.com>
@@ -12,6 +12,12 @@ 
 inherit image_uuid
 inherit read-only-rootfs
 
+# read-only rootfs with /home and /var
+# as separate partitions is used
+# /boot is excluded as an unified kernel image
+# is used. This images are stored in seperate partitions.
+RO_ROOTFS_EXCLUDE_DIRS = "boot var home"
+
 SWU_SIGNED ?= "1"
 SWU_HW_COMPAT ?= "cip-core-1.0"
 IMAGER_BUILD_DEPS:swu += "${@'swupdate-signer' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}"