aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmi-proxy
diff options
context:
space:
mode:
authorRoshan Pius <rpius@chromium.org>2014-12-19 10:22:18 -0800
committerAleksander Morgado <aleksander@aleksander.es>2014-12-19 20:32:12 +0100
commitbec32bd8d570b66fcfcf1325af8c80752a784b61 (patch)
treecaaa98be5a8441eacab61a27965b66e5565d8a38 /src/qmi-proxy
parentb84db57fe24652238a06c8aaff70f769ccfa6a0e (diff)
downloadexternal_libqmi-bec32bd8d570b66fcfcf1325af8c80752a784b61.zip
external_libqmi-bec32bd8d570b66fcfcf1325af8c80752a784b61.tar.gz
external_libqmi-bec32bd8d570b66fcfcf1325af8c80752a784b61.tar.bz2
libqmi-glib,proxy: Change ownership of QMI devices to the configured user.
Adding a udev rule to change ownership of all QMI devices to the configured user specified at compile time using --enable-qmi-username flag.
Diffstat (limited to 'src/qmi-proxy')
-rw-r--r--src/qmi-proxy/76-qmi-proxy-device-ownership.rules.in12
-rw-r--r--src/qmi-proxy/Makefile.am9
2 files changed, 21 insertions, 0 deletions
diff --git a/src/qmi-proxy/76-qmi-proxy-device-ownership.rules.in b/src/qmi-proxy/76-qmi-proxy-device-ownership.rules.in
new file mode 100644
index 0000000..458113d
--- /dev/null
+++ b/src/qmi-proxy/76-qmi-proxy-device-ownership.rules.in
@@ -0,0 +1,12 @@
+# do not edit this file, it will be overwritten on update
+
+ACTION!="add|change|move", GOTO="qmi_proxy_device_ownership_end"
+
+# A 'cdc-wdm' device is from a MBIM and QMI-based modems.
+KERNEL=="cdc-wdm[0-9]", DRIVERS=="qmi_wwan", SUBSYSTEM=="usbmisc", GOTO="qmi_proxy_device_ownership_change"
+GOTO="qmi_proxy_device_ownership_end"
+
+LABEL="qmi_proxy_device_ownership_change"
+OWNER="@QMI_USERNAME@"
+
+LABEL="qmi_proxy_device_ownership_end"
diff --git a/src/qmi-proxy/Makefile.am b/src/qmi-proxy/Makefile.am
index 709f712..3eb532e 100644
--- a/src/qmi-proxy/Makefile.am
+++ b/src/qmi-proxy/Makefile.am
@@ -14,3 +14,12 @@ qmi_proxy_SOURCES = qmi-proxy.c
qmi_proxy_LDADD = \
$(GLIB_LIBS) \
$(top_builddir)/src/libqmi-glib/libqmi-glib.la
+
+#Install udev rules only if configured with --enable-qmi-username
+if INSTALL_QMI_UDEV_RULES
+udevrulesdir = $(UDEV_BASE_DIR)/rules.d
+udevrules_DATA = 76-qmi-proxy-device-ownership.rules
+
+EXTRA_DIST = \
+ 76-qmi-proxy-device-ownership.rules.in
+endif