rtl-sdr: Install tweaked udev rules 54/21754/1
authorScott Murray <scott.murray@konsulko.com>
Wed, 26 Jun 2019 21:45:29 +0000 (17:45 -0400)
committerScott Murray <scott.murray@konsulko.com>
Wed, 26 Jun 2019 21:45:29 +0000 (17:45 -0400)
To enable agl-service-radio to access the RTL-SDR USB devices, install
the provided rtl-sdr.rules file in /etc/udev/rules.d, modifying it to
tweak the device permissions, group, and SMACK label to meet the
requirements for the new application framework audio permission.

Bug-AGL: SPEC-2573

Change-Id: I22e2c624b8c57df0b5932ba7f8a377ae2c0d9566
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
meta-agl-profile-core/recipes-connectivity/rtl-sdr/rtl-sdr_0.5.3.bb

index 7d5c021..de6da5e 100644 (file)
@@ -17,10 +17,16 @@ S = "${WORKDIR}/git"
 inherit autotools pkgconfig
 
 EXTRA_OECONF = "--enable-driver-detach"
-#CFLAGS_remove = "
+
 do_configure_append() {
     # remove included temporary path from pc file due to pass-through of OE CFLAGS
     # debug-prefix-map
     # See: http://lists.openembedded.org/pipermail/openembedded-devel/2016-May/107456.html
     sed -i -e "s# -fdebug-prefix-map=.*##g" librtlsdr.pc
-}
\ No newline at end of file
+}
+
+do_install_append() {
+    install -D -m 0644 ${S}/rtl-sdr.rules ${D}${sysconfdir}/udev/rules.d/55-rtl-sdr.rules
+    sed -i 's/MODE:="0666"/GROUP="audio", MODE="0660", SECLABEL{smack}="*"/' \
+        ${D}${sysconfdir}/udev/rules.d/55-rtl-sdr.rules
+}