mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Ladislav Michl <ladis@linux-mips.org>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH] usb_modeswitch: udev helper
Date: Fri, 22 Jan 2016 14:38:55 +0100	[thread overview]
Message-ID: <20160122133855.GA15581@localhost.localdomain> (raw)
In-Reply-To: <20160122002427.GA10492@localhost.localdomain>

Install also udev helper and systemd service file

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 rules/usb-modeswitch.in   | 20 +++++++++++++++++---
 rules/usb-modeswitch.make | 13 +++++++++++++
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/rules/usb-modeswitch.in b/rules/usb-modeswitch.in
index aaefd86..28ba777 100644
--- a/rules/usb-modeswitch.in
+++ b/rules/usb-modeswitch.in
@@ -1,11 +1,25 @@
 ## SECTION=shell_and_console
 
-config USB_MODESWITCH
-	tristate
-	prompt "usb-modeswitch"
+menuconfig USB_MODESWITCH
+	tristate "usb-modeswitch                "
 	select LIBUSB
+	select TCL if USB_MODESWITCH_UDEV_HELPER || USB_MODESWITCH_SYSTEMD_UNIT
 	help
 	  USB_ModeSwitch is (surprise!) a mode switching tool
 	  for controlling 'multi-mode' USB devices.
 
+if USB_MODESWITCH
+
+config USB_MODESWITCH_UDEV_HELPER
+	bool "install udev helper"
+	default y
+	depends on UDEV
+
+config USB_MODESWITCH_SYSTEMD_UNIT
+	bool "install systemd unit file"
+	default y
+	depends on SYSTEMD
+
+endif
+
 # vim: set sw=8 ts=8 noet ft=kconfig:
diff --git a/rules/usb-modeswitch.make b/rules/usb-modeswitch.make
index 4ebf0e8..3f558f7 100644
--- a/rules/usb-modeswitch.make
+++ b/rules/usb-modeswitch.make
@@ -51,6 +51,19 @@ $(STATEDIR)/usb-modeswitch.targetinstall:
 
 	@$(call install_copy, usb-modeswitch, 0, 0, 0755, -, \
 		/usr/sbin/usb_modeswitch)
+ifneq ($(or $(PTXCONF_USB_MODESWITCH_UDEV_HELPER) $(PTXCONF_USB_MODESWITCH_SYSTEMD_UNIT)),)
+	@$(call install_copy, usb-modeswitch, 0, 0, 0755, -, \
+		/usr/sbin/usb_modeswitch_dispatcher)
+endif
+ifdef PTXCONF_USB_MODESWITCH_UDEV_HELPER
+	@$(call install_copy, usb-modeswitch, 0, 0, 0755, -, \
+		/lib/udev/usb_modeswitch)
+endif
+ifdef PTXCONF_USB_MODESWITCH_SYSTEMD_UNIT
+	@$(call install_copy, usb-modeswitch, 0, 0, 0644, \
+		$(USB_MODESWITCH_DIR)/usb_modeswitch@.service, \
+		/lib/systemd/system/usb_modeswitch@.service)
+endif
 
 	@$(call install_finish, usb-modeswitch)
 
-- 
2.1.4


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2016-01-22 13:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-22  0:24 [ptxdist] [PATCH] usb_modeswitch: version bump 2.2.1 -> 2.3.0 Ladislav Michl
2016-01-22 13:38 ` Ladislav Michl [this message]
2016-01-22 15:10   ` [ptxdist] [PATCH] usb_modeswitch: udev helper Michael Olbrich
2016-01-22 16:27     ` [ptxdist] [PATCH v2] " Ladislav Michl
2016-02-11 11:25       ` Michael Olbrich
2016-02-11 11:24 ` [ptxdist] [PATCH] usb_modeswitch: version bump 2.2.1 -> 2.3.0 Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160122133855.GA15581@localhost.localdomain \
    --to=ladis@linux-mips.org \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox