package/swupdate: add progress/usb services
authorJames Hilliard <james.hilliard1@gmail.com>
Sun, 29 Aug 2021 02:46:32 +0000 (20:46 -0600)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Sat, 11 Sep 2021 14:11:47 +0000 (16:11 +0200)
Install progress/usb services for swupdate based on meta-swupdate
configs.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
package/swupdate/90-start-progress [new file with mode: 0644]
package/swupdate/swupdate-progress.service [new file with mode: 0644]
package/swupdate/swupdate-usb@.service [new file with mode: 0644]
package/swupdate/swupdate.mk
package/swupdate/swupdate.socket [new file with mode: 0644]

diff --git a/package/swupdate/90-start-progress b/package/swupdate/90-start-progress
new file mode 100644 (file)
index 0000000..3b0eb5e
--- /dev/null
@@ -0,0 +1 @@
+exec /usr/bin/swupdate-progress -w -r &
diff --git a/package/swupdate/swupdate-progress.service b/package/swupdate/swupdate-progress.service
new file mode 100644 (file)
index 0000000..0d464bb
--- /dev/null
@@ -0,0 +1,9 @@
+[Unit]
+Description=swupdate progress service
+After=swupdate.service
+
+[Service]
+ExecStart=/usr/bin/swupdate-progress -r -w
+
+[Install]
+WantedBy=swupdate.service
diff --git a/package/swupdate/swupdate-usb@.service b/package/swupdate/swupdate-usb@.service
new file mode 100644 (file)
index 0000000..eda9d15
--- /dev/null
@@ -0,0 +1,8 @@
+[Unit]
+Description=usb media swupdate service
+Requires=swupdate-progress.service
+
+[Service]
+ExecStartPre=/bin/mount /dev/%I /mnt
+ExecStart=/bin/sh -c "swupdate-client -v /mnt/*.swu"
+ExecStopPost=/bin/umount /mnt
index 4bcdb96602c02dc9f23eb17d35f90b1cd3bc3734..c49af7ebf7f5c9f74522c086067b94388590bf6f 100644 (file)
@@ -248,6 +248,12 @@ define SWUPDATE_INSTALL_INIT_SYSTEMD
        $(SWUPDATE_INSTALL_COMMON)
        $(INSTALL) -D -m 644 package/swupdate/swupdate.service \
                $(TARGET_DIR)/usr/lib/systemd/system/swupdate.service
+       $(INSTALL) -D -m 644 package/swupdate/swupdate.socket \
+               $(TARGET_DIR)/usr/lib/systemd/system/swupdate.socket
+       $(INSTALL) -D -m 644 package/swupdate/swupdate-usb@.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/swupdate-usb@.service
+       $(INSTALL) -D -m 644 package/swupdate/swupdate-progress.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/swupdate-progress.service
        $(INSTALL) -D -m 644 package/swupdate/tmpfiles-swupdate.conf \
                $(TARGET_DIR)/usr/lib/tmpfiles.d/tmpfiles-swupdate.conf
 endef
@@ -255,6 +261,8 @@ define SWUPDATE_INSTALL_INIT_SYSV
        $(SWUPDATE_INSTALL_COMMON)
        $(INSTALL) -D -m 755 package/swupdate/S80swupdate \
                $(TARGET_DIR)/etc/init.d/S80swupdate
+       $(INSTALL) -D -m 644 package/swupdate/90-start-progress \
+               $(TARGET_DIR)/usr/lib/swupdate/conf.d/90-start-progress
 endef
 
 $(eval $(kconfig-package))
diff --git a/package/swupdate/swupdate.socket b/package/swupdate/swupdate.socket
new file mode 100644 (file)
index 0000000..2b75671
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=SWUpdate socket listener
+Documentation=https://github.com/sbabic/swupdate
+Documentation=https://sbabic.github.io/swupdate
+
+[Socket]
+ListenStream=/tmp/sockinstctrl
+ListenStream=/tmp/swupdateprog
+
+[Install]
+WantedBy=sockets.target