* [isar-cip-core] [PATCH] classes/squashfs: exclude boot dir during squshfs image creation
@ 2024-07-18 10:57 srinuvasan.a
2024-07-18 11:30 ` Jan Kiszka
2024-07-19 6:55 ` MOESSBAUER, Felix
0 siblings, 2 replies; 8+ messages in thread
From: srinuvasan.a @ 2024-07-18 10:57 UTC (permalink / raw)
To: cip-dev; +Cc: jan.kiszka, Srinuvasan A
From: Srinuvasan A <srinuvasan.a@siemens.com>
For all the UEFI based bsps we used bootloader as efi bootguard, this
linux.efi contains necessary boot files to boot the system, hence remove
the boot content from squash root filesystem.
Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
---
classes/squashfs.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/classes/squashfs.bbclass b/classes/squashfs.bbclass
index b39be0c..f9c7bf4 100644
--- a/classes/squashfs.bbclass
+++ b/classes/squashfs.bbclass
@@ -22,7 +22,7 @@ def get_free_mem():
IMAGER_INSTALL:squashfs += "squashfs-tools"
-SQUASHFS_EXCLUDE_DIRS ?= ""
+SQUASHFS_EXCLUDE_DIRS ?= "boot"
SQUASHFS_CONTENT ?= "${PP_ROOTFS}"
SQUASHFS_CREATION_ARGS ?= ""
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [isar-cip-core] [PATCH] classes/squashfs: exclude boot dir during squshfs image creation
2024-07-18 10:57 [isar-cip-core] [PATCH] classes/squashfs: exclude boot dir during squshfs image creation srinuvasan.a
@ 2024-07-18 11:30 ` Jan Kiszka
2024-07-18 12:00 ` Arjunan, Srinu
2024-07-19 6:55 ` MOESSBAUER, Felix
1 sibling, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2024-07-18 11:30 UTC (permalink / raw)
To: srinuvasan.a, cip-dev
On 18.07.24 12:57, srinuvasan.a@siemens.com wrote:
> From: Srinuvasan A <srinuvasan.a@siemens.com>
>
> For all the UEFI based bsps we used bootloader as efi bootguard, this
> linux.efi contains necessary boot files to boot the system, hence remove
> the boot content from squash root filesystem.
>
I can understand the goal, but the squashfs class is not logically
coupled with UEFI booting. I suspect we need a better place to add "boo"
to SQUASHFS_EXCLUDE_DIRS, a place where it is clear what the class is
packaging.
Jan
> Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
> ---
> classes/squashfs.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/classes/squashfs.bbclass b/classes/squashfs.bbclass
> index b39be0c..f9c7bf4 100644
> --- a/classes/squashfs.bbclass
> +++ b/classes/squashfs.bbclass
> @@ -22,7 +22,7 @@ def get_free_mem():
>
> IMAGER_INSTALL:squashfs += "squashfs-tools"
>
> -SQUASHFS_EXCLUDE_DIRS ?= ""
> +SQUASHFS_EXCLUDE_DIRS ?= "boot"
> SQUASHFS_CONTENT ?= "${PP_ROOTFS}"
> SQUASHFS_CREATION_ARGS ?= ""
>
--
Siemens AG, Technology
Linux Expert Center
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [isar-cip-core] [PATCH] classes/squashfs: exclude boot dir during squshfs image creation
2024-07-18 11:30 ` Jan Kiszka
@ 2024-07-18 12:00 ` Arjunan, Srinu
0 siblings, 0 replies; 8+ messages in thread
From: Arjunan, Srinu @ 2024-07-18 12:00 UTC (permalink / raw)
To: Kiszka, Jan, cip-dev@lists.cip-project.org
Yes, it is valid point , I will come up with the changes in V2.
Thanks,
Srinu
-----Original Message-----
From: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>
Sent: 18 July 2024 17:00
To: Arjunan, Srinu (DI CTO FDS CES LX PBU 2) <srinuvasan.a@siemens.com>; cip-dev@lists.cip-project.org
Subject: Re: [isar-cip-core] [PATCH] classes/squashfs: exclude boot dir during squshfs image creation
On 18.07.24 12:57, srinuvasan.a@siemens.com wrote:
> From: Srinuvasan A <srinuvasan.a@siemens.com>
>
> For all the UEFI based bsps we used bootloader as efi bootguard, this
> linux.efi contains necessary boot files to boot the system, hence
> remove the boot content from squash root filesystem.
>
I can understand the goal, but the squashfs class is not logically coupled with UEFI booting. I suspect we need a better place to add "boo"
to SQUASHFS_EXCLUDE_DIRS, a place where it is clear what the class is packaging.
Jan
> Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
> ---
> classes/squashfs.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/classes/squashfs.bbclass b/classes/squashfs.bbclass index
> b39be0c..f9c7bf4 100644
> --- a/classes/squashfs.bbclass
> +++ b/classes/squashfs.bbclass
> @@ -22,7 +22,7 @@ def get_free_mem():
>
> IMAGER_INSTALL:squashfs += "squashfs-tools"
>
> -SQUASHFS_EXCLUDE_DIRS ?= ""
> +SQUASHFS_EXCLUDE_DIRS ?= "boot"
> SQUASHFS_CONTENT ?= "${PP_ROOTFS}"
> SQUASHFS_CREATION_ARGS ?= ""
>
--
Siemens AG, Technology
Linux Expert Center
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [isar-cip-core] [PATCH] classes/squashfs: exclude boot dir during squshfs image creation
2024-07-18 10:57 [isar-cip-core] [PATCH] classes/squashfs: exclude boot dir during squshfs image creation srinuvasan.a
2024-07-18 11:30 ` Jan Kiszka
@ 2024-07-19 6:55 ` MOESSBAUER, Felix
2024-07-19 6:57 ` Arjunan, Srinu
2024-07-23 10:06 ` [isar-cip-core] [PATCH v2] classes/squashfs.bbclass: exclude boot dir for efibootguard bootloader srinuvasan.a
1 sibling, 2 replies; 8+ messages in thread
From: MOESSBAUER, Felix @ 2024-07-19 6:55 UTC (permalink / raw)
To: cip-dev@lists.cip-project.org, Arjunan, Srinu; +Cc: Kiszka, Jan
On Thu, 2024-07-18 at 16:27 +0530, srinuvasan.a@siemens.com wrote:
> From: Srinuvasan A <srinuvasan.a@siemens.com>
>
> For all the UEFI based bsps we used bootloader as efi bootguard, this
> linux.efi contains necessary boot files to boot the system, hence
> remove
> the boot content from squash root filesystem.
>
> Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
> ---
> classes/squashfs.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/classes/squashfs.bbclass b/classes/squashfs.bbclass
> index b39be0c..f9c7bf4 100644
> --- a/classes/squashfs.bbclass
> +++ b/classes/squashfs.bbclass
> @@ -22,7 +22,7 @@ def get_free_mem():
>
> IMAGER_INSTALL:squashfs += "squashfs-tools"
>
> -SQUASHFS_EXCLUDE_DIRS ?= ""
> +SQUASHFS_EXCLUDE_DIRS ?= "boot"
Hi, we also need to exclude /var (but only from bookworm on).
But we need to ensure that only everything below /var or /boot is
removed, but not the mountpoint itself. In case of wic, the syntax is
<dir> resp. <dir>/. I hope this is supported by squashfs as well.
Felix
> SQUASHFS_CONTENT ?= "${PP_ROOTFS}"
> SQUASHFS_CREATION_ARGS ?= ""
>
--
Siemens AG, Technology
Linux Expert Center
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [isar-cip-core] [PATCH] classes/squashfs: exclude boot dir during squshfs image creation
2024-07-19 6:55 ` MOESSBAUER, Felix
@ 2024-07-19 6:57 ` Arjunan, Srinu
2024-07-23 10:06 ` [isar-cip-core] [PATCH v2] classes/squashfs.bbclass: exclude boot dir for efibootguard bootloader srinuvasan.a
1 sibling, 0 replies; 8+ messages in thread
From: Arjunan, Srinu @ 2024-07-19 6:57 UTC (permalink / raw)
To: MOESSBAUER, Felix, cip-dev@lists.cip-project.org; +Cc: Kiszka, Jan
Hi Felix,
Sure , thanks for the suggestion, let me check on that and send the next version PR soon.
Thanks,
Srinu
-----Original Message-----
From: Moessbauer, Felix (T CED OES-DE) <felix.moessbauer@siemens.com>
Sent: 19 July 2024 12:26
To: cip-dev@lists.cip-project.org; Arjunan, Srinu (DI CTO FDS CES LX PBU 2) <srinuvasan.a@siemens.com>
Cc: Kiszka, Jan (T CED) <jan.kiszka@siemens.com>
Subject: Re: [isar-cip-core] [PATCH] classes/squashfs: exclude boot dir during squshfs image creation
On Thu, 2024-07-18 at 16:27 +0530, srinuvasan.a@siemens.com wrote:
> From: Srinuvasan A <srinuvasan.a@siemens.com>
>
> For all the UEFI based bsps we used bootloader as efi bootguard, this
> linux.efi contains necessary boot files to boot the system, hence
> remove the boot content from squash root filesystem.
>
> Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
> ---
> classes/squashfs.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/classes/squashfs.bbclass b/classes/squashfs.bbclass index
> b39be0c..f9c7bf4 100644
> --- a/classes/squashfs.bbclass
> +++ b/classes/squashfs.bbclass
> @@ -22,7 +22,7 @@ def get_free_mem():
>
> IMAGER_INSTALL:squashfs += "squashfs-tools"
>
> -SQUASHFS_EXCLUDE_DIRS ?= ""
> +SQUASHFS_EXCLUDE_DIRS ?= "boot"
Hi, we also need to exclude /var (but only from bookworm on).
But we need to ensure that only everything below /var or /boot is removed, but not the mountpoint itself. In case of wic, the syntax is <dir> resp. <dir>/. I hope this is supported by squashfs as well.
Felix
> SQUASHFS_CONTENT ?= "${PP_ROOTFS}"
> SQUASHFS_CREATION_ARGS ?= ""
>
--
Siemens AG, Technology
Linux Expert Center
^ permalink raw reply [flat|nested] 8+ messages in thread
* [isar-cip-core] [PATCH v2] classes/squashfs.bbclass: exclude boot dir for efibootguard bootloader
2024-07-19 6:55 ` MOESSBAUER, Felix
2024-07-19 6:57 ` Arjunan, Srinu
@ 2024-07-23 10:06 ` srinuvasan.a
2024-07-31 17:01 ` Jan Kiszka
1 sibling, 1 reply; 8+ messages in thread
From: srinuvasan.a @ 2024-07-23 10:06 UTC (permalink / raw)
To: cip-dev; +Cc: jan.kiszka, felix.moessbauer, srinuvasan
From: srinuvasan <srinuvasan.a@siemens.com>
efibootguard based bootloader boot the system using linux.efi (UKI) and it has
the necessary boot files to boot the system, hence we added boot dir as the exclude dir
in squashfs root file system to remove the contents from the boot dir.
Signed-off-by: srinuvasan <srinuvasan.a@siemens.com>
---
classes/squashfs.bbclass | 3 +++
1 file changed, 3 insertions(+)
diff --git a/classes/squashfs.bbclass b/classes/squashfs.bbclass
index b39be0c..2582ce2 100644
--- a/classes/squashfs.bbclass
+++ b/classes/squashfs.bbclass
@@ -23,6 +23,7 @@ def get_free_mem():
IMAGER_INSTALL:squashfs += "squashfs-tools"
SQUASHFS_EXCLUDE_DIRS ?= ""
+SQUASHFS_EXCLUDE_DIRS_EFI ?= "boot"
SQUASHFS_CONTENT ?= "${PP_ROOTFS}"
SQUASHFS_CREATION_ARGS ?= ""
@@ -31,6 +32,8 @@ SQUASHFS_MEMLIMIT ?= "${@int(get_free_mem() * 3/4)}"
SQUASHFS_CREATION_LIMITS = "-mem ${SQUASHFS_MEMLIMIT} -processors ${SQUASHFS_THREADS}"
python __anonymous() {
+ if (d.getVar('SWUPDATE_BOOTLOADER') == 'efibootguard'):
+ d.setVar('SQUASHFS_EXCLUDE_DIRS', '${SQUASHFS_EXCLUDE_DIRS_EFI}')
exclude_directories = d.getVar('SQUASHFS_EXCLUDE_DIRS').split()
if len(exclude_directories) == 0:
return
--
2.39.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [isar-cip-core] [PATCH v2] classes/squashfs.bbclass: exclude boot dir for efibootguard bootloader
2024-07-23 10:06 ` [isar-cip-core] [PATCH v2] classes/squashfs.bbclass: exclude boot dir for efibootguard bootloader srinuvasan.a
@ 2024-07-31 17:01 ` Jan Kiszka
2024-08-01 6:33 ` MOESSBAUER, Felix
0 siblings, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2024-07-31 17:01 UTC (permalink / raw)
To: srinuvasan.a, cip-dev; +Cc: felix.moessbauer
On 23.07.24 12:06, srinuvasan.a@siemens.com wrote:
> From: srinuvasan <srinuvasan.a@siemens.com>
>
> efibootguard based bootloader boot the system using linux.efi (UKI) and it has
> the necessary boot files to boot the system, hence we added boot dir as the exclude dir
> in squashfs root file system to remove the contents from the boot dir.
>
> Signed-off-by: srinuvasan <srinuvasan.a@siemens.com>
> ---
> classes/squashfs.bbclass | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/classes/squashfs.bbclass b/classes/squashfs.bbclass
> index b39be0c..2582ce2 100644
> --- a/classes/squashfs.bbclass
> +++ b/classes/squashfs.bbclass
> @@ -23,6 +23,7 @@ def get_free_mem():
> IMAGER_INSTALL:squashfs += "squashfs-tools"
>
> SQUASHFS_EXCLUDE_DIRS ?= ""
> +SQUASHFS_EXCLUDE_DIRS_EFI ?= "boot"
> SQUASHFS_CONTENT ?= "${PP_ROOTFS}"
> SQUASHFS_CREATION_ARGS ?= ""
>
> @@ -31,6 +32,8 @@ SQUASHFS_MEMLIMIT ?= "${@int(get_free_mem() * 3/4)}"
> SQUASHFS_CREATION_LIMITS = "-mem ${SQUASHFS_MEMLIMIT} -processors ${SQUASHFS_THREADS}"
>
> python __anonymous() {
> + if (d.getVar('SWUPDATE_BOOTLOADER') == 'efibootguard'):
> + d.setVar('SQUASHFS_EXCLUDE_DIRS', '${SQUASHFS_EXCLUDE_DIRS_EFI}')
I still don't get why we should carry this knowledge here. It is also
mixing up "EFI" with "efibootguard" - there is no efibootguard without
EFI, but the other way around is possible.
And then it is the image recipe or - even closer - the wks file that
brings it all together, the fact that squashfs is used for rootfs (and
only for that?!?), that there is some boot folder that is not needed twice.
Jan
> exclude_directories = d.getVar('SQUASHFS_EXCLUDE_DIRS').split()
> if len(exclude_directories) == 0:
> return
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [isar-cip-core] [PATCH v2] classes/squashfs.bbclass: exclude boot dir for efibootguard bootloader
2024-07-31 17:01 ` Jan Kiszka
@ 2024-08-01 6:33 ` MOESSBAUER, Felix
0 siblings, 0 replies; 8+ messages in thread
From: MOESSBAUER, Felix @ 2024-08-01 6:33 UTC (permalink / raw)
To: jan.kiszka@web.de, cip-dev@lists.cip-project.org, Arjunan, Srinu
On Wed, 2024-07-31 at 19:01 +0200, Jan Kiszka wrote:
> On 23.07.24 12:06, srinuvasan.a@siemens.com wrote:
> > From: srinuvasan <srinuvasan.a@siemens.com>
> >
> > efibootguard based bootloader boot the system using linux.efi (UKI)
> > and it has
> > the necessary boot files to boot the system, hence we added boot
> > dir as the exclude dir
> > in squashfs root file system to remove the contents from the boot
> > dir.
> >
> > Signed-off-by: srinuvasan <srinuvasan.a@siemens.com>
> > ---
> > classes/squashfs.bbclass | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/classes/squashfs.bbclass b/classes/squashfs.bbclass
> > index b39be0c..2582ce2 100644
> > --- a/classes/squashfs.bbclass
> > +++ b/classes/squashfs.bbclass
> > @@ -23,6 +23,7 @@ def get_free_mem():
> > IMAGER_INSTALL:squashfs += "squashfs-tools"
> >
> > SQUASHFS_EXCLUDE_DIRS ?= ""
> > +SQUASHFS_EXCLUDE_DIRS_EFI ?= "boot"
> > SQUASHFS_CONTENT ?= "${PP_ROOTFS}"
> > SQUASHFS_CREATION_ARGS ?= ""
> >
> > @@ -31,6 +32,8 @@ SQUASHFS_MEMLIMIT ?= "${@int(get_free_mem() *
> > 3/4)}"
> > SQUASHFS_CREATION_LIMITS = "-mem ${SQUASHFS_MEMLIMIT} -processors
> > ${SQUASHFS_THREADS}"
> >
> > python __anonymous() {
> > + if (d.getVar('SWUPDATE_BOOTLOADER') == 'efibootguard'):
> > + d.setVar('SQUASHFS_EXCLUDE_DIRS',
> > '${SQUASHFS_EXCLUDE_DIRS_EFI}')
>
> I still don't get why we should carry this knowledge here. It is also
> mixing up "EFI" with "efibootguard" - there is no efibootguard
> without
> EFI, but the other way around is possible.
I would rather just add the /boot dir to the generic
SQUASHFS_EXCLUDE_DIRS variable. There is no need to dispatch based on
the bootloader (as we can exclude dirs which are not present as well).
>
> And then it is the image recipe or - even closer - the wks file that
> brings it all together, the fact that squashfs is used for rootfs
> (and
> only for that?!?), that there is some boot folder that is not needed
> twice.
I don't know why the squashfs rootfs was modeled as bbclass and not as
part of the wic imaging. This already created problems in the past, as
the fstab in the squashfs is the one from the rootfs and not the
patched one from wic.
Changing this might be a some effort, due to its integration in the
swupdate class, though.
Felix
>
> Jan
>
> > exclude_directories =
> > d.getVar('SQUASHFS_EXCLUDE_DIRS').split()
> > if len(exclude_directories) == 0:
> > return
>
--
Siemens AG, Technology
Linux Expert Center
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-08-01 11:43 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-18 10:57 [isar-cip-core] [PATCH] classes/squashfs: exclude boot dir during squshfs image creation srinuvasan.a
2024-07-18 11:30 ` Jan Kiszka
2024-07-18 12:00 ` Arjunan, Srinu
2024-07-19 6:55 ` MOESSBAUER, Felix
2024-07-19 6:57 ` Arjunan, Srinu
2024-07-23 10:06 ` [isar-cip-core] [PATCH v2] classes/squashfs.bbclass: exclude boot dir for efibootguard bootloader srinuvasan.a
2024-07-31 17:01 ` Jan Kiszka
2024-08-01 6:33 ` MOESSBAUER, Felix
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox