diff mbox series

[isar-cip-core,v4,1/6] Move efibootguard specific settings from include to class file

Message ID 20240108102638.2966221-2-Quirin.Gylstorff@siemens.com (mailing list archive)
State Changes Requested
Headers show
Series Add Bootloader to sw-description | expand

Commit Message

Quirin Gylstorff Jan. 8, 2024, 10:25 a.m. UTC
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

This is done in preparations to reduce similar code.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 classes/efibootguard.bbclass         | 17 +++++++++++++++++
 recipes-core/images/efibootguard.inc |  9 ++-------
 2 files changed, 19 insertions(+), 7 deletions(-)
 create mode 100644 classes/efibootguard.bbclass

Comments

Jan Kiszka Jan. 8, 2024, 1:54 p.m. UTC | #1
On 08.01.24 11:25, Quirin Gylstorff wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> This is done in preparations to reduce similar code.
> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
>  classes/efibootguard.bbclass         | 17 +++++++++++++++++
>  recipes-core/images/efibootguard.inc |  9 ++-------
>  2 files changed, 19 insertions(+), 7 deletions(-)
>  create mode 100644 classes/efibootguard.bbclass
> 
> diff --git a/classes/efibootguard.bbclass b/classes/efibootguard.bbclass
> new file mode 100644
> index 0000000..bc99d3a
> --- /dev/null
> +++ b/classes/efibootguard.bbclass
> @@ -0,0 +1,17 @@
> +#
> +# CIP Core, generic profile
> +#
> +# Copyright (c) Siemens AG, 2024
> +#
> +# Authors:
> +#  Quirin Gylstorff <quirin.gylstorff@siemens.com>
> +#
> +# SPDX-License-Identifier: MIT
> +#
> +
> +IMAGE_INSTALL:append = " efibootguard libebgenv0"
> +IMAGER_INSTALL:wic:append = " efibootguard:${DISTRO_ARCH}"
> +WDOG_TIMEOUT ?= "60"
> +WICVARS += "WDOG_TIMEOUT KERNEL_IMAGE INITRD_DEPLOY_FILE DTB_FILES EFI_ARCH EFI_LIB_ARCH"

EFI_* vars are likely topic for patch 2, right?

> +IMAGE_TYPEDEP:swu:append = " wic"
> +

Extra newline and EOF...

> diff --git a/recipes-core/images/efibootguard.inc b/recipes-core/images/efibootguard.inc
> index 0f26b7d..f512b3c 100644
> --- a/recipes-core/images/efibootguard.inc
> +++ b/recipes-core/images/efibootguard.inc
> @@ -1,7 +1,7 @@
>  #
>  # CIP Core, generic profile
>  #
> -# Copyright (c) Siemens AG, 2020
> +# Copyright (c) Siemens AG, 2020, 2024
>  #
>  # Authors:
>  #  Quirin Gylstorff <quirin.gylstorff@siemens.com>
> @@ -9,9 +9,4 @@
>  # SPDX-License-Identifier: MIT
>  #
>  
> -IMAGE_INSTALL:append = " efibootguard libebgenv0"
> -IMAGER_INSTALL:wic:append = " efibootguard:${DISTRO_ARCH}"
> -WDOG_TIMEOUT ?= "60"
> -WICVARS += "WDOG_TIMEOUT KERNEL_IMAGE INITRD_DEPLOY_FILE DTB_FILES"
> -IMAGE_FSTYPES:append = " wic"
> -IMAGE_TYPEDEP:swu:append = " wic"
> +inherit efibootguard

Jan
Felix Moessbauer Jan. 25, 2024, 3:23 p.m. UTC | #2
On Mon, 2024-01-08 at 14:54 +0100, Jan Kiszka wrote:
> On 08.01.24 11:25, Quirin Gylstorff wrote:
> > From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> > 
> > This is done in preparations to reduce similar code.
> > 
> > Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> > ---
> >  classes/efibootguard.bbclass         | 17 +++++++++++++++++
> >  recipes-core/images/efibootguard.inc |  9 ++-------
> >  2 files changed, 19 insertions(+), 7 deletions(-)
> >  create mode 100644 classes/efibootguard.bbclass
> > 
> > diff --git a/classes/efibootguard.bbclass
> > b/classes/efibootguard.bbclass
> > new file mode 100644
> > index 0000000..bc99d3a
> > --- /dev/null
> > +++ b/classes/efibootguard.bbclass
> > @@ -0,0 +1,17 @@
> > +#
> > +# CIP Core, generic profile
> > +#
> > +# Copyright (c) Siemens AG, 2024
> > +#
> > +# Authors:
> > +#  Quirin Gylstorff <quirin.gylstorff@siemens.com>
> > +#
> > +# SPDX-License-Identifier: MIT
> > +#
> > +
> > +IMAGE_INSTALL:append = " efibootguard libebgenv0"
> > +IMAGER_INSTALL:wic:append = " efibootguard:${DISTRO_ARCH}"

This patch needs to be reverted.

We cannot simply add things to IMAGE(ER)_INSTALL in a class, as this
logic is executed whenever the class is inherited. As we inherit this
class transitively via swupdate.bbclass, which is added to
IMAGE_CLASSES, all images now will depend on and install efibootguard.

Inheriting the other classes was fine before, as they did not change
any image properties except if requested.

Maybe we should also remove the IMAGE_CLASSES part from the layer.conf
again, as it is too intrusive.

Felix

> > +WDOG_TIMEOUT ?= "60"
> > +WICVARS += "WDOG_TIMEOUT KERNEL_IMAGE INITRD_DEPLOY_FILE DTB_FILES
> > EFI_ARCH EFI_LIB_ARCH"
> 
> EFI_* vars are likely topic for patch 2, right?
> 
> > +IMAGE_TYPEDEP:swu:append = " wic"
> > +
> 
> Extra newline and EOF...
> 
> > diff --git a/recipes-core/images/efibootguard.inc b/recipes-
> > core/images/efibootguard.inc
> > index 0f26b7d..f512b3c 100644
> > --- a/recipes-core/images/efibootguard.inc
> > +++ b/recipes-core/images/efibootguard.inc
> > @@ -1,7 +1,7 @@
> >  #
> >  # CIP Core, generic profile
> >  #
> > -# Copyright (c) Siemens AG, 2020
> > +# Copyright (c) Siemens AG, 2020, 2024
> >  #
> >  # Authors:
> >  #  Quirin Gylstorff <quirin.gylstorff@siemens.com>
> > @@ -9,9 +9,4 @@
> >  # SPDX-License-Identifier: MIT
> >  #
> >  
> > -IMAGE_INSTALL:append = " efibootguard libebgenv0"
> > -IMAGER_INSTALL:wic:append = " efibootguard:${DISTRO_ARCH}"
> > -WDOG_TIMEOUT ?= "60"
> > -WICVARS += "WDOG_TIMEOUT KERNEL_IMAGE INITRD_DEPLOY_FILE
> > DTB_FILES"
> > -IMAGE_FSTYPES:append = " wic"
> > -IMAGE_TYPEDEP:swu:append = " wic"
> > +inherit efibootguard
> 
> Jan
>
diff mbox series

Patch

diff --git a/classes/efibootguard.bbclass b/classes/efibootguard.bbclass
new file mode 100644
index 0000000..bc99d3a
--- /dev/null
+++ b/classes/efibootguard.bbclass
@@ -0,0 +1,17 @@ 
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2024
+#
+# Authors:
+#  Quirin Gylstorff <quirin.gylstorff@siemens.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+IMAGE_INSTALL:append = " efibootguard libebgenv0"
+IMAGER_INSTALL:wic:append = " efibootguard:${DISTRO_ARCH}"
+WDOG_TIMEOUT ?= "60"
+WICVARS += "WDOG_TIMEOUT KERNEL_IMAGE INITRD_DEPLOY_FILE DTB_FILES EFI_ARCH EFI_LIB_ARCH"
+IMAGE_TYPEDEP:swu:append = " wic"
+
diff --git a/recipes-core/images/efibootguard.inc b/recipes-core/images/efibootguard.inc
index 0f26b7d..f512b3c 100644
--- a/recipes-core/images/efibootguard.inc
+++ b/recipes-core/images/efibootguard.inc
@@ -1,7 +1,7 @@ 
 #
 # CIP Core, generic profile
 #
-# Copyright (c) Siemens AG, 2020
+# Copyright (c) Siemens AG, 2020, 2024
 #
 # Authors:
 #  Quirin Gylstorff <quirin.gylstorff@siemens.com>
@@ -9,9 +9,4 @@ 
 # SPDX-License-Identifier: MIT
 #
 
-IMAGE_INSTALL:append = " efibootguard libebgenv0"
-IMAGER_INSTALL:wic:append = " efibootguard:${DISTRO_ARCH}"
-WDOG_TIMEOUT ?= "60"
-WICVARS += "WDOG_TIMEOUT KERNEL_IMAGE INITRD_DEPLOY_FILE DTB_FILES"
-IMAGE_FSTYPES:append = " wic"
-IMAGE_TYPEDEP:swu:append = " wic"
+inherit efibootguard