diff mbox series

[meta-swupdate,morty,1/3] swupdate: systemd units from master

Message ID 1522239624-19924-1-git-send-email-sbabic@denx.de
State Accepted
Headers show
Series [meta-swupdate,morty,1/3] swupdate: systemd units from master | expand

Commit Message

Stefano Babic March 28, 2018, 12:20 p.m. UTC
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 recipes-support/swupdate/swupdate/swupdate-progress.service | 6 ++++++
 recipes-support/swupdate/swupdate/swupdate-usb.rules        | 2 ++
 recipes-support/swupdate/swupdate/swupdate-usb@.service     | 8 ++++++++
 3 files changed, 16 insertions(+)
 create mode 100644 recipes-support/swupdate/swupdate/swupdate-progress.service
 create mode 100644 recipes-support/swupdate/swupdate/swupdate-usb.rules
 create mode 100644 recipes-support/swupdate/swupdate/swupdate-usb@.service
diff mbox series

Patch

diff --git a/recipes-support/swupdate/swupdate/swupdate-progress.service b/recipes-support/swupdate/swupdate/swupdate-progress.service
new file mode 100644
index 0000000..de80b16
--- /dev/null
+++ b/recipes-support/swupdate/swupdate/swupdate-progress.service
@@ -0,0 +1,6 @@ 
+[Unit]
+Description=swupdate progress service
+Requires=swupdate.service
+
+[Service]
+ExecStart=/usr/bin/swupdate-progress -r -w
diff --git a/recipes-support/swupdate/swupdate/swupdate-usb.rules b/recipes-support/swupdate/swupdate/swupdate-usb.rules
new file mode 100644
index 0000000..7bba227
--- /dev/null
+++ b/recipes-support/swupdate/swupdate/swupdate-usb.rules
@@ -0,0 +1,2 @@ 
+ACTION=="add", KERNEL=="sd*", SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesystem", TAG+="systemd", ENV{SYSTEMD_WANTS}+="swupdate-usb@%k.service"
+
diff --git a/recipes-support/swupdate/swupdate/swupdate-usb@.service b/recipes-support/swupdate/swupdate/swupdate-usb@.service
new file mode 100644
index 0000000..eda9d15
--- /dev/null
+++ b/recipes-support/swupdate/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