diff mbox series

[isar-cip-core] recipes-core/swupdate: Cleanup swupdate.inc

Message ID 20231218143023.1507226-1-Quirin.Gylstorff@siemens.com (mailing list archive)
State Superseded
Headers show
Series [isar-cip-core] recipes-core/swupdate: Cleanup swupdate.inc | expand

Commit Message

Quirin Gylstorff Dec. 18, 2023, 2:30 p.m. UTC
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

As software loads the bootloader libraries dynamically it is no longer
necessary to set the build loader with BUILD_PROFILES.

Also add PROVIDES for the additional packages swupdate provides.

The profile 'pkg.swupdate.nosigning' is automatically set if signing is
not set to `1`.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 recipes-core/swupdate/swupdate.inc        | 25 ++++++++++++++---------
 recipes-core/swupdate/swupdate_2023.05.bb |  9 --------
 2 files changed, 15 insertions(+), 19 deletions(-)

Comments

Jan Kiszka Dec. 18, 2023, 5:22 p.m. UTC | #1
On 18.12.23 15:30, Quirin Gylstorff wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> As software loads the bootloader libraries dynamically it is no longer
> necessary to set the build loader with BUILD_PROFILES.
> 
> Also add PROVIDES for the additional packages swupdate provides.
> 
> The profile 'pkg.swupdate.nosigning' is automatically set if signing is
> not set to `1`.
> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
>  recipes-core/swupdate/swupdate.inc        | 25 ++++++++++++++---------
>  recipes-core/swupdate/swupdate_2023.05.bb |  9 --------
>  2 files changed, 15 insertions(+), 19 deletions(-)
> 
> diff --git a/recipes-core/swupdate/swupdate.inc b/recipes-core/swupdate/swupdate.inc
> index e5e7282..4442ca5 100644
> --- a/recipes-core/swupdate/swupdate.inc
> +++ b/recipes-core/swupdate/swupdate.inc
> @@ -1,7 +1,7 @@
>  #
>  # CIP Core, generic profile
>  #
> -# Copyright (c) Siemens AG, 2021-2022
> +# Copyright (c) Siemens AG, 2021-2023
>  #
>  # Authors:
>  #  Quirin Gylstorff <quirin.gylstorff@siemens.com>
> @@ -13,15 +13,11 @@ HOMEPAGE= "https://github.com/sbabic/swupdate"
>  LICENSE = "GPL-2.0"
>  LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
>  
> -def get_bootloader_build_profile(d):
> -    bootloader = d.getVar("SWUPDATE_BOOTLOADER") or ""
> -    if bootloader == "efibootguard":
> -        return "pkg.swupdate.efibootguard"
> -    if bootloader == "u-boot":
> -        return "pkg.swupdate.uboot"
> -    return ""
> +PROVIDES += "libswupdate-dev"
> +PROVIDES += "libswupdate0.1"
> +PROVIDES += "lua-swupdate"
>  
> -DEB_BUILD_PROFILES += "${@get_bootloader_build_profile(d)}"
> +DEB_BUILD_PROFILES += "${@'pkg.swupdate.nosigning' if not d.getVar('SWU_SIGNED') == '1' else ''}"
>  
>  def get_bootloader_dependencies(d):
>      bootloader = d.getVar("SWUPDATE_BOOTLOADER") or ""
> @@ -33,13 +29,22 @@ def get_bootloader_dependencies(d):
>          else:
>              return "libubootenv"
>      return ""
> -

Stray newline removal.

>  DEPENDS += "${@get_bootloader_dependencies(d)}"
>  DEPENDS += "${@bb.utils.contains('DEB_BUILD_PROFILES', 'mtd', 'mtd-utils', '', d)}"
>  
> +# deactivate hardware compability for simple a/b rootfs update
> +DEB_BUILD_PROFILES += "pkg.swupdate.nohwcompat"
> +
> +# suricatta wfx requires suricatta lua and the dependency
> +# is not set automatically
> +DEB_BUILD_PROFILES += "pkg.swupdate.suricattalua"
> +# add suricatta wfx
> +DEB_BUILD_PROFILES += "pkg.swupdate.suricattawfx"
> +
>  python do_check_bootloader () {
>      bootloader = d.getVar("SWUPDATE_BOOTLOADER") or "None"
>      if not bootloader in ["efibootguard", "u-boot"]:
>          bb.warn("swupdate: SWUPDATE_BOOTLOADER set to incompatible value: " + bootloader)
>  }
>  addtask check_bootloader before do_fetch
> +

Stray newline.

> diff --git a/recipes-core/swupdate/swupdate_2023.05.bb b/recipes-core/swupdate/swupdate_2023.05.bb
> index 77b7431..e52a329 100644
> --- a/recipes-core/swupdate/swupdate_2023.05.bb
> +++ b/recipes-core/swupdate/swupdate_2023.05.bb
> @@ -35,15 +35,6 @@ SRC_URI:append:bullseye = " file://0004-d-swupdate-www.install-Fix-path-for-debi
>  # of update binaries
>  # DEB_BUILD_PROFILES += "pkg.swupdate.nosigning"

I suppose this comment is now obsolete with the automatic selection, no?

>  
> -# deactivate hardware compability for simple a/b rootfs update
> -DEB_BUILD_PROFILES += "pkg.swupdate.nohwcompat"
> -
> -# suricatta wfx requires suricatta lua and the dependency
> -# is not set automatically
> -DEB_BUILD_PROFILES += "pkg.swupdate.suricattalua"
> -# add suricatta wfx
> -DEB_BUILD_PROFILES += "pkg.swupdate.suricattawfx"
> -
>  # Disable cross for arm and arm64 on bullseye
>  # with cross compile we have a unsat-dependency to dh-nodejs on arm/arm64
>  ISAR_CROSS_COMPILE:bullseye = "0"

You are moving many DEB_BUILD_PROFILES into the include but you are not
updating swupdate_2021.11-1+debian-gbp.bb accordingly.

Jan
diff mbox series

Patch

diff --git a/recipes-core/swupdate/swupdate.inc b/recipes-core/swupdate/swupdate.inc
index e5e7282..4442ca5 100644
--- a/recipes-core/swupdate/swupdate.inc
+++ b/recipes-core/swupdate/swupdate.inc
@@ -1,7 +1,7 @@ 
 #
 # CIP Core, generic profile
 #
-# Copyright (c) Siemens AG, 2021-2022
+# Copyright (c) Siemens AG, 2021-2023
 #
 # Authors:
 #  Quirin Gylstorff <quirin.gylstorff@siemens.com>
@@ -13,15 +13,11 @@  HOMEPAGE= "https://github.com/sbabic/swupdate"
 LICENSE = "GPL-2.0"
 LIC_FILES_CHKSUM = "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
 
-def get_bootloader_build_profile(d):
-    bootloader = d.getVar("SWUPDATE_BOOTLOADER") or ""
-    if bootloader == "efibootguard":
-        return "pkg.swupdate.efibootguard"
-    if bootloader == "u-boot":
-        return "pkg.swupdate.uboot"
-    return ""
+PROVIDES += "libswupdate-dev"
+PROVIDES += "libswupdate0.1"
+PROVIDES += "lua-swupdate"
 
-DEB_BUILD_PROFILES += "${@get_bootloader_build_profile(d)}"
+DEB_BUILD_PROFILES += "${@'pkg.swupdate.nosigning' if not d.getVar('SWU_SIGNED') == '1' else ''}"
 
 def get_bootloader_dependencies(d):
     bootloader = d.getVar("SWUPDATE_BOOTLOADER") or ""
@@ -33,13 +29,22 @@  def get_bootloader_dependencies(d):
         else:
             return "libubootenv"
     return ""
-
 DEPENDS += "${@get_bootloader_dependencies(d)}"
 DEPENDS += "${@bb.utils.contains('DEB_BUILD_PROFILES', 'mtd', 'mtd-utils', '', d)}"
 
+# deactivate hardware compability for simple a/b rootfs update
+DEB_BUILD_PROFILES += "pkg.swupdate.nohwcompat"
+
+# suricatta wfx requires suricatta lua and the dependency
+# is not set automatically
+DEB_BUILD_PROFILES += "pkg.swupdate.suricattalua"
+# add suricatta wfx
+DEB_BUILD_PROFILES += "pkg.swupdate.suricattawfx"
+
 python do_check_bootloader () {
     bootloader = d.getVar("SWUPDATE_BOOTLOADER") or "None"
     if not bootloader in ["efibootguard", "u-boot"]:
         bb.warn("swupdate: SWUPDATE_BOOTLOADER set to incompatible value: " + bootloader)
 }
 addtask check_bootloader before do_fetch
+
diff --git a/recipes-core/swupdate/swupdate_2023.05.bb b/recipes-core/swupdate/swupdate_2023.05.bb
index 77b7431..e52a329 100644
--- a/recipes-core/swupdate/swupdate_2023.05.bb
+++ b/recipes-core/swupdate/swupdate_2023.05.bb
@@ -35,15 +35,6 @@  SRC_URI:append:bullseye = " file://0004-d-swupdate-www.install-Fix-path-for-debi
 # of update binaries
 # DEB_BUILD_PROFILES += "pkg.swupdate.nosigning"
 
-# deactivate hardware compability for simple a/b rootfs update
-DEB_BUILD_PROFILES += "pkg.swupdate.nohwcompat"
-
-# suricatta wfx requires suricatta lua and the dependency
-# is not set automatically
-DEB_BUILD_PROFILES += "pkg.swupdate.suricattalua"
-# add suricatta wfx
-DEB_BUILD_PROFILES += "pkg.swupdate.suricattawfx"
-
 # Disable cross for arm and arm64 on bullseye
 # with cross compile we have a unsat-dependency to dh-nodejs on arm/arm64
 ISAR_CROSS_COMPILE:bullseye = "0"