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 <gabriel.valcazar@digi.com>
This commit is contained in:
parent
e02108dce5
commit
32e46e4f9b
|
|
@ -20,7 +20,7 @@
|
||||||
ENV_BOOT_RECOVERY="boot_recovery"
|
ENV_BOOT_RECOVERY="boot_recovery"
|
||||||
ENV_RECOVERY_COMMAND="recovery_command"
|
ENV_RECOVERY_COMMAND="recovery_command"
|
||||||
|
|
||||||
SW_CONFIG="/etc/swupdate.cfg"
|
SW_CONFIG="/etc/swupdate.config"
|
||||||
PUBLIC_KEY="/etc/ssl/certs/key.pub"
|
PUBLIC_KEY="/etc/ssl/certs/key.pub"
|
||||||
|
|
||||||
USB_MOUNT_DIR="/run/media"
|
USB_MOUNT_DIR="/run/media"
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
# CONFIG_CURL_SSL is not set
|
# CONFIG_CURL_SSL is not set
|
||||||
# CONFIG_DISKFORMAT is not set
|
# CONFIG_DISKFORMAT is not set
|
||||||
# CONFIG_SYSTEMD 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_SCRIPTS=y
|
||||||
# CONFIG_HW_COMPATIBILITY is not set
|
# CONFIG_HW_COMPATIBILITY is not set
|
||||||
CONFIG_SW_VERSIONS_FILE="/etc/sw-versions"
|
CONFIG_SW_VERSIONS_FILE="/etc/sw-versions"
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ SRC_URI += " \
|
||||||
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'file://systemd.cfg', '', d)} \
|
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'file://systemd.cfg', '', d)} \
|
||||||
${@bb.utils.contains('STORAGE_MEDIA', 'mtd', 'file://mtd.cfg', '', d)} \
|
${@bb.utils.contains('STORAGE_MEDIA', 'mtd', 'file://mtd.cfg', '', d)} \
|
||||||
${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'file://signed_images.cfg', '', d)} \
|
${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'file://signed_images.cfg', '', d)} \
|
||||||
file://swupdate.cfg \
|
file://swupdate.config \
|
||||||
"
|
"
|
||||||
|
|
||||||
do_install:append() {
|
do_install:append() {
|
||||||
|
|
@ -22,16 +22,16 @@ do_install:append() {
|
||||||
|
|
||||||
# Copy config file
|
# Copy config file
|
||||||
install -d ${D}${sysconfdir}/
|
install -d ${D}${sysconfdir}/
|
||||||
install -m 0755 ${WORKDIR}/swupdate.cfg ${D}${sysconfdir}
|
install -m 0755 ${WORKDIR}/swupdate.config ${D}${sysconfdir}
|
||||||
|
|
||||||
# Add MTD blacklist
|
# Add MTD blacklist
|
||||||
if ${@oe.utils.conditional('STORAGE_MEDIA', 'mtd', 'true', 'false', d)}; then
|
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
|
fi
|
||||||
|
|
||||||
# Add public-key-file setting to config file if TrustFence is enabled
|
# Add public-key-file setting to config file if TrustFence is enabled
|
||||||
if ${@oe.utils.conditional('TRUSTFENCE_ENABLED', '1', 'true', 'false', d)}; then
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue