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 <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2022-11-22 15:22:49 +01:00
parent 2d34c34619
commit 8df1b0c246
2 changed files with 12 additions and 0 deletions

View File

@ -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; "

View File

@ -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
}