Преглед на файлове

swupdate: reboot on update from initramfs recovery image

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 <bkylerussell@gmail.com>
Kyle Russell преди 4 години
родител
ревизия
9a0e029d47
променени са 2 файла, в които са добавени 16 реда и са изтрити 9 реда
  1. 1 1
      recipes-extended/images/swupdate-image.inc
  2. 15 8
      recipes-support/swupdate/swupdate.inc

+ 1 - 1
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 \
 		 "
 

+ 15 - 8
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,10 +262,10 @@ 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"