All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] package/swupdate: add option to enable USB install
@ 2021-09-19  9:30 Yann E. MORIN
  0 siblings, 0 replies; only message in thread
From: Yann E. MORIN @ 2021-09-19  9:30 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=536e209ccaec94b4289d09060e2c8e05696bd0fe
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
[yann.morin.1998@free.fr:
  - do not default to 'y'
  - add comment
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
 package/swupdate/Config.in          | 9 +++++++++
 package/swupdate/swupdate-usb.rules | 1 +
 package/swupdate/swupdate.mk        | 3 +++
 3 files changed, 13 insertions(+)

diff --git a/package/swupdate/Config.in b/package/swupdate/Config.in
index 6b832cfcbf..7d9fc90e10 100644
--- a/package/swupdate/Config.in
+++ b/package/swupdate/Config.in
@@ -60,6 +60,15 @@ config BR2_PACKAGE_SWUPDATE_CONFIG
 	  I you wish to use your own modified swupdate configuration
 	  file specify the config file location with this option.
 
+config BR2_PACKAGE_SWUPDATE_USB
+	bool "swupdate usb"
+	depends on BR2_PACKAGE_SYSTEMD
+	help
+	  Enable update from USB disk.
+
+comment "swupdate usb needs systemd"
+	depends on !BR2_PACKAGE_SYSTEMD
+
 config BR2_PACKAGE_SWUPDATE_WEBSERVER
 	bool "swupdate webserver"
 	default y
diff --git a/package/swupdate/swupdate-usb.rules b/package/swupdate/swupdate-usb.rules
new file mode 100644
index 0000000000..72e003d74d
--- /dev/null
+++ b/package/swupdate/swupdate-usb.rules
@@ -0,0 +1 @@
+ACTION=="add", KERNEL=="sd*", SUBSYSTEM=="block", ENV{ID_BUS}=="usb", ENV{ID_FS_USAGE}=="filesystem", TAG+="systemd", ENV{SYSTEMD_WANTS}+="swupdate-usb@%k.service"
diff --git a/package/swupdate/swupdate.mk b/package/swupdate/swupdate.mk
index e191ab384a..5ed2ca55d2 100644
--- a/package/swupdate/swupdate.mk
+++ b/package/swupdate/swupdate.mk
@@ -252,6 +252,9 @@ define SWUPDATE_INSTALL_INIT_SYSTEMD
 		$(TARGET_DIR)/usr/lib/systemd/system/swupdate.socket
 	$(INSTALL) -D -m 644 $(SWUPDATE_PKGDIR)/swupdate-usb@.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/swupdate-usb@.service
+	$(if $(BR2_PACKAGE_SWUPDATE_USB), \
+		$(INSTALL) -D -m 644 $(SWUPDATE_PKGDIR)/swupdate-usb.rules \
+			$(TARGET_DIR)/lib/udev/rules.d/swupdate-usb.rules)
 	$(INSTALL) -D -m 644 $(SWUPDATE_PKGDIR)/swupdate-progress.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/swupdate-progress.service
 	$(INSTALL) -D -m 644 $(SWUPDATE_PKGDIR)/tmpfiles-swupdate.conf \
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-19  9:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-19  9:30 [Buildroot] [git commit] package/swupdate: add option to enable USB install Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.