From 8df1b0c2466e054facf02b1a3420918fb2891b9b Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 22 Nov 2022 15:22:49 +0100 Subject: [PATCH] swupdate: do not run swupdate daemon on non-dualboot devices On recovery based devices, the swupdate process is executed in the recovery, so there is no need to have the swupdate daemon running on the rootfs. Add a on-target post installation script to disable the swupdate bootscript on the normal rootfs. This has the side effect of failing in the recovery initramfs because the initramfs does not have a complete SysV init system. For that case add a rootfs postprocess function to delete the postinst script. Signed-off-by: Javier Viguera --- .../recipes-core/images/dey-image-recovery-initramfs.bb | 6 ++++++ .../recipes-support/swupdate/swupdate_2022.05.bbappend | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb b/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb index 54a78c8d7..32d04995a 100644 --- a/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb +++ b/meta-digi-dey/recipes-core/images/dey-image-recovery-initramfs.bb @@ -34,3 +34,9 @@ BAD_RECOMMENDATIONS += " \ " export IMAGE_BASENAME = "dey-image-recovery-initramfs" + +initramfs_cleanup() { + # Delete SWUPDATE postinst script + rm -f ${IMAGE_ROOTFS}${sysconfdir}/rpm-postinsts/*swupdate* +} +ROOTFS_POSTPROCESS_COMMAND += "initramfs_cleanup; " diff --git a/meta-digi-dey/recipes-support/swupdate/swupdate_2022.05.bbappend b/meta-digi-dey/recipes-support/swupdate/swupdate_2022.05.bbappend index 0635fb6f9..6c38638a2 100644 --- a/meta-digi-dey/recipes-support/swupdate/swupdate_2022.05.bbappend +++ b/meta-digi-dey/recipes-support/swupdate/swupdate_2022.05.bbappend @@ -28,3 +28,9 @@ do_install:append() { install -d ${D}${bindir}/ install -m 0755 tools/swupdate-progress ${D}${bindir}/progress } + +pkg_postinst_ontarget:${PN}() { + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','false','true',d)}; then + [ "$(fw_printenv -n dualboot 2>/dev/null)" = "no" ] && update-rc.d -f swupdate remove + fi +}