From 0e94459ad52e87033c170522610e83215a444242 Mon Sep 17 00:00:00 2001 From: James Hilliard Date: Sat, 28 Aug 2021 20:46:32 -0600 Subject: [PATCH] package/swupdate: add progress/usb services Install progress/usb services for swupdate based on meta-swupdate configs. Signed-off-by: James Hilliard Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- package/swupdate/90-start-progress | 1 + package/swupdate/swupdate-progress.service | 9 +++++++++ package/swupdate/swupdate-usb@.service | 8 ++++++++ package/swupdate/swupdate.mk | 8 ++++++++ package/swupdate/swupdate.socket | 11 +++++++++++ 5 files changed, 37 insertions(+) create mode 100644 package/swupdate/90-start-progress create mode 100644 package/swupdate/swupdate-progress.service create mode 100644 package/swupdate/swupdate-usb@.service create mode 100644 package/swupdate/swupdate.socket diff --git a/package/swupdate/90-start-progress b/package/swupdate/90-start-progress new file mode 100644 index 0000000000..3b0eb5e7d7 --- /dev/null +++ b/package/swupdate/90-start-progress @@ -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 index 0000000000..0d464bb420 --- /dev/null +++ b/package/swupdate/swupdate-progress.service @@ -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 index 0000000000..eda9d1539c --- /dev/null +++ b/package/swupdate/swupdate-usb@.service @@ -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 diff --git a/package/swupdate/swupdate.mk b/package/swupdate/swupdate.mk index 4bcdb96602..c49af7ebf7 100644 --- a/package/swupdate/swupdate.mk +++ b/package/swupdate/swupdate.mk @@ -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 index 0000000000..2b756714c5 --- /dev/null +++ b/package/swupdate/swupdate.socket @@ -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 -- 2.30.2