diff options
-rw-r--r-- | classes/swupd-image.bbclass | 20 | ||||
-rw-r--r-- | recipes-core/swupd-client/os-release.bbappend | 4 |
2 files changed, 20 insertions, 4 deletions
diff --git a/classes/swupd-image.bbclass b/classes/swupd-image.bbclass index 006ca63..436ab2d 100644 --- a/classes/swupd-image.bbclass +++ b/classes/swupd-image.bbclass @@ -530,3 +530,23 @@ python swupd_replace_hardlinks () { os.symlink(reltarget, path) } ROOTFS_POSTPROCESS_COMMAND += "swupd_replace_hardlinks; " + +# swupd-client checks VERSION_ID, which must match the OS_VERSION +# used for generating swupd bundles in the current build. +# +# We patch this during image creation and exclude OS_VERSION from the +# dependencies because doing it during the compilation of os-release.bb +# would trigger a rebuild even if all that changed is the OS_VERSION. +# It would also affect builds of images where swupd is not active. Both +# is undesirable. +# +# If triggering a rebuild on each OS_VERSION change is desired, +# then this can be achieved by influencing the os-release package +# by setting in local.conf: +# VERSION_ID = "${OS_VERSION}" + +swupd_patch_os_release () { + sed -i -e 's/^VERSION_ID *=.*/VERSION_ID="${OS_VERSION}"/' ${IMAGE_ROOTFS}/usr/lib/os-release +} +swupd_patch_os_release[vardepsexclude] = "OS_VERSION" +ROOTFS_POSTPROCESS_COMMAND += "swupd_patch_os_release; " diff --git a/recipes-core/swupd-client/os-release.bbappend b/recipes-core/swupd-client/os-release.bbappend index 69cb7c5..f73f861 100644 --- a/recipes-core/swupd-client/os-release.bbappend +++ b/recipes-core/swupd-client/os-release.bbappend @@ -1,7 +1,3 @@ -# swupd-client checks VERSION_ID, which must match the OS_VERSION -# used for generating swupd bundles in the current build. -VERSION_ID = "${OS_VERSION}" - FILES_${PN}_append = " /usr/lib/os-release " # As swupd-client doesn't update files in /etc move os-release's |