From 32e46e4f9b6ac10283b32e32ac11a5bf8081f075 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Wed, 27 Dec 2023 16:57:02 +0100 Subject: [PATCH] swupdate: change runtime config file suffix to avoid build-time config errors We were using the .cfg suffix for both the build-time config fragments and the runtime configuration file. During do_configure(), all files in SRC_URI ending in .cfg were being merged together to create the final build configuration, including said runtime file, which has a completely different syntax. In most cases, the contents of this file were being ignored, but when tweaking swupdate's configuration and re-building the package, sometimes strange errors would prevent the build from finishing. Change the runtime file's suffix entirely to separate it from the config fragments and prevent it from being treated as such, and reflect the name change in the defconfig and the recovery script. Signed-off-by: Gabriel Valcazar --- .../recovery/recovery-initramfs/recovery-initramfs-init | 2 +- meta-digi-dey/recipes-support/swupdate/swupdate/defconfig | 2 +- .../swupdate/swupdate/{swupdate.cfg => swupdate.config} | 0 .../recipes-support/swupdate/swupdate_%.bbappend | 8 ++++---- 4 files changed, 6 insertions(+), 6 deletions(-) rename meta-digi-dey/recipes-support/swupdate/swupdate/{swupdate.cfg => swupdate.config} (100%) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index 0e64cf8c5..1bde325b3 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -20,7 +20,7 @@ ENV_BOOT_RECOVERY="boot_recovery" ENV_RECOVERY_COMMAND="recovery_command" -SW_CONFIG="/etc/swupdate.cfg" +SW_CONFIG="/etc/swupdate.config" PUBLIC_KEY="/etc/ssl/certs/key.pub" USB_MOUNT_DIR="/run/media" diff --git a/meta-digi-dey/recipes-support/swupdate/swupdate/defconfig b/meta-digi-dey/recipes-support/swupdate/swupdate/defconfig index 8b52b25d9..464fe703f 100644 --- a/meta-digi-dey/recipes-support/swupdate/swupdate/defconfig +++ b/meta-digi-dey/recipes-support/swupdate/swupdate/defconfig @@ -14,7 +14,7 @@ # CONFIG_CURL_SSL is not set # CONFIG_DISKFORMAT is not set # CONFIG_SYSTEMD is not set -CONFIG_DEFAULT_CONFIG_FILE="/etc/swupdate.cfg" +CONFIG_DEFAULT_CONFIG_FILE="/etc/swupdate.config" CONFIG_SCRIPTS=y # CONFIG_HW_COMPATIBILITY is not set CONFIG_SW_VERSIONS_FILE="/etc/sw-versions" diff --git a/meta-digi-dey/recipes-support/swupdate/swupdate/swupdate.cfg b/meta-digi-dey/recipes-support/swupdate/swupdate/swupdate.config similarity index 100% rename from meta-digi-dey/recipes-support/swupdate/swupdate/swupdate.cfg rename to meta-digi-dey/recipes-support/swupdate/swupdate/swupdate.config diff --git a/meta-digi-dey/recipes-support/swupdate/swupdate_%.bbappend b/meta-digi-dey/recipes-support/swupdate/swupdate_%.bbappend index acf5d6dd0..2e3b33e6c 100644 --- a/meta-digi-dey/recipes-support/swupdate/swupdate_%.bbappend +++ b/meta-digi-dey/recipes-support/swupdate/swupdate_%.bbappend @@ -12,7 +12,7 @@ SRC_URI += " \ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'file://systemd.cfg', '', d)} \ ${@bb.utils.contains('STORAGE_MEDIA', 'mtd', 'file://mtd.cfg', '', d)} \ ${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'file://signed_images.cfg', '', d)} \ - file://swupdate.cfg \ + file://swupdate.config \ " do_install:append() { @@ -22,16 +22,16 @@ do_install:append() { # Copy config file install -d ${D}${sysconfdir}/ - install -m 0755 ${WORKDIR}/swupdate.cfg ${D}${sysconfdir} + install -m 0755 ${WORKDIR}/swupdate.config ${D}${sysconfdir} # Add MTD blacklist if ${@oe.utils.conditional('STORAGE_MEDIA', 'mtd', 'true', 'false', d)}; then - sed -i "s,\(^\s*\)#mtd-blacklist,\1mtd-blacklist = \"${SWUPDATE_MTD_BLACKLIST}\",g" ${D}${sysconfdir}/swupdate.cfg + sed -i "s,\(^\s*\)#mtd-blacklist,\1mtd-blacklist = \"${SWUPDATE_MTD_BLACKLIST}\",g" ${D}${sysconfdir}/swupdate.config fi # Add public-key-file setting to config file if TrustFence is enabled if ${@oe.utils.conditional('TRUSTFENCE_ENABLED', '1', 'true', 'false', d)}; then - sed -i "s,\(^\s*\)#public-key-file,\1public-key-file = \"${sysconfdir}/ssl/certs/key.pub\",g" ${D}${sysconfdir}/swupdate.cfg + sed -i "s,\(^\s*\)#public-key-file,\1public-key-file = \"${sysconfdir}/ssl/certs/key.pub\",g" ${D}${sysconfdir}/swupdate.config fi }