All of lore.kernel.org
 help / color / mirror / Atom feed
From: Quirin Gylstorff <Quirin.Gylstorff@siemens.com>
To: cip-dev@lists.cip-project.org, jan.kiszka@siemens.com
Subject: [cip-dev][isar-cip-core][PATCH v3 1/4] swupdate-config: move swupdate.cfg from customizations to own recipe
Date: Fri, 16 Feb 2024 16:30:02 +0100	[thread overview]
Message-ID: <20240216153024.260416-2-Quirin.Gylstorff@siemens.com> (raw)
In-Reply-To: <20240216153024.260416-1-Quirin.Gylstorff@siemens.com>

From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

This allows downstream customizations without including unwanted
packages.

It also adds the new variable `MACHINE_HW_VERSION` to check the
compatibility between machine/image and the swupdate file.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 recipes-core/customizations/common.inc        |  8 ++----
 .../swupdate-config/files/hwrevision.tmpl     |  1 +
 .../files/swupdate.cfg                        |  0
 .../swupdate-config/swupdate-config_0.1.bb    | 27 +++++++++++++++++++
 4 files changed, 30 insertions(+), 6 deletions(-)
 create mode 100644 recipes-core/swupdate-config/files/hwrevision.tmpl
 rename recipes-core/{customizations => swupdate-config}/files/swupdate.cfg (100%)
 create mode 100644 recipes-core/swupdate-config/swupdate-config_0.1.bb

diff --git a/recipes-core/customizations/common.inc b/recipes-core/customizations/common.inc
index 79bf80d..37872c1 100644
--- a/recipes-core/customizations/common.inc
+++ b/recipes-core/customizations/common.inc
@@ -19,8 +19,6 @@ SRC_URI = " \
     file://99-silent-printk.conf \
     file://99-watchdog.conf"
 
-SRC_URI:append:swupdate = " file://swupdate.cfg"
-
 CUSTOM_HOSTNAME ??= "demo"
 WIRELESS_FIRMWARE_PACKAGE ?= ""
 INSTALL_WIRELESS_TOOLS ??= "0"
@@ -29,12 +27,14 @@ TEMPLATE_FILES += "postinst.tmpl"
 TEMPLATE_VARS += "CUSTOM_HOSTNAME"
 
 DEPENDS += "sshd-regen-keys change-root-homedir"
+RDEPENDS:append:swupdate = " swupdate-config"
 
 DEBIAN_DEPENDS = " \
     ifupdown, isc-dhcp-client, net-tools, iputils-ping, ssh, sshd-regen-keys, \
     change-root-homedir \
     ${@(', iw, wireless-regdb, ' + d.getVar('WIRELESS_FIRMWARE_PACKAGE')) \
 	if d.getVar('INSTALL_WIRELESS_TOOLS') == '1' else ''}"
+DEBIAN_DEPENDS:append:swupdate = ", swupdate-config"
 
 do_install() {
 	install -v -d ${D}/etc/network/interfaces.d
@@ -46,7 +46,3 @@ do_install() {
 	install -v -d ${D}/etc/systemd/system.conf.d
 	install -v -m 644 ${WORKDIR}/99-watchdog.conf ${D}/etc/systemd/system.conf.d/
 }
-
-do_install:append:swupdate() {
-	install -v -m 644 ${WORKDIR}/swupdate.cfg ${D}/etc/
-}
diff --git a/recipes-core/swupdate-config/files/hwrevision.tmpl b/recipes-core/swupdate-config/files/hwrevision.tmpl
new file mode 100644
index 0000000..1eb0996
--- /dev/null
+++ b/recipes-core/swupdate-config/files/hwrevision.tmpl
@@ -0,0 +1 @@
+cip-${MACHINE} ${MACHINE_HW_VERSION}
diff --git a/recipes-core/customizations/files/swupdate.cfg b/recipes-core/swupdate-config/files/swupdate.cfg
similarity index 100%
rename from recipes-core/customizations/files/swupdate.cfg
rename to recipes-core/swupdate-config/files/swupdate.cfg
diff --git a/recipes-core/swupdate-config/swupdate-config_0.1.bb b/recipes-core/swupdate-config/swupdate-config_0.1.bb
new file mode 100644
index 0000000..6991321
--- /dev/null
+++ b/recipes-core/swupdate-config/swupdate-config_0.1.bb
@@ -0,0 +1,27 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2024
+#
+# Authors:
+#  Quirin Gylstorff <quirin.gylstorff@siemens.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+inherit dpkg-raw
+
+SRC_URI = "file://swupdate.cfg \
+           file://hwrevision.tmpl"
+
+MACHINE_HW_VERSION ??= ""
+TEMPLATE_FILES += "hwrevision.tmpl"
+TEMPLATE_VARS += "MACHINE MACHINE_HW_VERSION"
+
+do_install[cleandirs] = "${D}/etc/"
+do_install() {
+	install -v -m 644 "${WORKDIR}"/swupdate.cfg "${D}"/etc/
+        if [ -n "${MACHINE_HW_VERSION}" ]; then
+            install -v -m 644 "${WORKDIR}"/hwrevision "${D}"/etc/
+        fi
+}
-- 
2.43.0



  reply	other threads:[~2024-02-16 15:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 15:30 [cip-dev][isar-cip-core][PATCH v3 0/4] Reduce difference to debian Quirin Gylstorff
2024-02-16 15:30 ` Quirin Gylstorff [this message]
2024-02-16 15:30 ` [cip-dev][isar-cip-core][PATCH v3 2/4] swupdate: set SWU_HW_COMPAT Quirin Gylstorff
2024-02-16 15:30 ` [cip-dev][isar-cip-core][PATCH v3 3/4] swupdate.bbclass: weak default assignment for SWU_HW_COMPAT Quirin Gylstorff
2024-02-16 15:30 ` [cip-dev][isar-cip-core][PATCH v3 4/4] doc/README.swupdate.md: Add documentation for hardware compatibility Quirin Gylstorff
2024-02-16 15:39   ` Jan Kiszka
2024-02-16 16:50     ` Gylstorff Quirin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240216153024.260416-2-Quirin.Gylstorff@siemens.com \
    --to=quirin.gylstorff@siemens.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=jan.kiszka@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.