Create swupdate-progress-sysvinit and swupdate-progress-systemd packages with
the necessary startup scripts for swupdate-progress to run correctly during
startup for both virtual/init managers. swupdate-image initramfs should RDEPEND
on swupdate-progress-sysvinit, which now adds a dependency on the swupdate-progress
binary (packaged in swupdate-progress-bin).
This allows swupdate-progress to simultaneously be installed in both a distro's
main rootfs which uses the systemd DISTRO_FEATURE, and the initramfs image which
uses sysvinit.
The old swupdate-progress package is now empty, and can still be used as an
RDEPENDS on the main rootfs image recipe, and swupdate will automatically
select the appropriate startup script based on DISTRO_FEATURES.
Signed-off-by: Kyle Russell <
bkyler...@gmail.com>
---
recipes-extended/images/swupdate-image.inc | 2 +-
recipes-support/swupdate/swupdate.inc | 27 ++++++++++++++--------
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/recipes-extended/images/swupdate-image.inc b/recipes-extended/images/swupdate-image.inc
index 795b4a2..928edad 100644
--- a/recipes-extended/images/swupdate-image.inc
+++ b/recipes-extended/images/swupdate-image.inc
@@ -12,7 +12,7 @@ IMAGE_INSTALL = "base-files \
libconfig \
swupdate \
swupdate-www \
- ${@bb.utils.contains('SWUPDATE_INIT', 'tiny', 'virtual/initscripts-swupdate', 'initscripts sysvinit', d)} \
+ ${@bb.utils.contains('SWUPDATE_INIT', 'tiny', 'virtual/initscripts-swupdate', 'initscripts sysvinit swupdate-progress-sysvinit', d)} \
util-linux-sfdisk \
"
diff --git a/recipes-support/swupdate/swupdate.inc b/recipes-support/swupdate/swupdate.inc
index 0d382bd..c072f63 100644
--- a/recipes-support/swupdate/swupdate.inc
+++ b/recipes-support/swupdate/swupdate.inc
@@ -36,6 +36,9 @@ PACKAGES =+ " \
${PN}-client \
${PN}-lua \
${PN}-progress \
+ ${PN}-progress-bin \
+ ${PN}-progress-systemd \
+ ${PN}-progress-sysvinit \
${PN}-tools \
${PN}-tools-hawkbit \
${PN}-usb \
@@ -48,11 +51,12 @@ ALLOW_EMPTY_${PN}-tools = "1"
FILES_${PN}-client = "${bindir}/swupdate-client"
FILES_${PN}-lua += "${libdir}/lua/"
-FILES_${PN}-progress = " \
- ${bindir}/swupdate-progress \
- ${systemd_system_unitdir}/swupdate-progress.service \
- ${libdir}/swupdate/conf.d/90-start-progress \
-"
+
+ALLOW_EMPTY_${PN}-progress = "1"
+FILES_${PN}-progress-bin = "${bindir}/swupdate-progress"
+FILES_${PN}-progress-systemd = "${systemd_system_unitdir}/swupdate-progress.service"
+FILES_${PN}-progress-sysvinit = "${libdir}/swupdate/conf.d/90-start-progress"
+
FILES_${PN}-usb = " \
${sysconfdir}/udev/rules.d/swupdate-usb.rules \
${systemd_system_unitdir}/swupdate-usb@.service \
@@ -74,6 +78,9 @@ FILES_${PN}-www = " \
"
RDEPENDS_${PN}-usb += "${PN}-client"
+RDEPENDS_${PN}-progress += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}-progress-systemd','${PN}-progress-sysvinit',d)}"
+RDEPENDS_${PN}-progress-systemd += "${PN}-progress-bin"
+RDEPENDS_${PN}-progress-sysvinit += "${PN}-progress-bin"
# The tools package is deprecated, it is an empty meta package for backward compatibility
RDEPENDS_${PN}-tools += "${PN}-client ${PN}-progress ${PN}-tools-hawkbit \
@@ -255,16 +262,16 @@ do_install () {
install -m 0644 ${WORKDIR}/tmpfiles-swupdate.conf ${D}${libdir}/tmpfiles.d/swupdate.conf
install -d ${D}${sysconfdir}/udev/rules.d
install -m 0644 ${WORKDIR}/swupdate-usb.rules ${D}${sysconfdir}/udev/rules.d/
- else
- # in case of systemd there is a service file, for sysv init we need to start it as well
- install -m 0644 ${WORKDIR}/90-start-progress ${D}${libdir}/swupdate/conf.d/
fi
+
+ # in case of systemd there is a service file, for sysv init we need to start it as well
+ install -m 0644 ${WORKDIR}/90-start-progress ${D}${libdir}/swupdate/conf.d/
}
INITSCRIPT_NAME = "swupdate"
INITSCRIPT_PARAMS = "defaults 70"
-SYSTEMD_PACKAGES = "${PN} ${PN}-progress ${PN}-usb"
+SYSTEMD_PACKAGES = "${PN} ${PN}-progress-systemd ${PN}-usb"
SYSTEMD_SERVICE_${PN} = "swupdate.service swupdate.socket"
-SYSTEMD_SERVICE_${PN}-progress = "swupdate-progress.service"
+SYSTEMD_SERVICE_${PN}-progress-systemd = "swupdate-progress.service"
SYSTEMD_SERVICE_${PN}-usb = "swupdate-usb@.service"
--
2.25.1