meta-agl: gpsd: enable udev GPS device detection 49/10649/7
authorMatt Ranostay <matt.ranostay@konsulko.com>
Thu, 17 Aug 2017 03:41:58 +0000 (06:41 +0300)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Mon, 18 Sep 2017 03:46:54 +0000 (03:46 +0000)
enable the systemd device detection for GPS devices which
autoenables it within the gpsd.socket

Bug-AGL: SPEC-831
Change-Id: Ifec05c61c7802d0a246ac2c7c609de4ecd56b94d
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/10649
Tested-by: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org>
ci-image-build: Jenkins Job builder account <agl-jobbuilder@automotivelinux.org>
Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
meta-agl/recipes-navigation/gpsd/gpsd_%.bbappend [new file with mode: 0644]

diff --git a/meta-agl/recipes-navigation/gpsd/gpsd_%.bbappend b/meta-agl/recipes-navigation/gpsd/gpsd_%.bbappend
new file mode 100644 (file)
index 0000000..af72aec
--- /dev/null
@@ -0,0 +1,14 @@
+SYSTEMD_SERVICE_${PN} += " gpsdctl@.service"
+
+do_install_append() {
+    # use the systemd compatible gpsd.rules
+    install -d ${D}/${sysconfdir}/udev/rules.d
+    install -m 0644 ${S}/gpsd.rules ${D}/${sysconfdir}/udev/rules.d/60-gpsd.rules
+
+    #support for systemd
+    install -d ${D}${systemd_unitdir}/system/
+    install -m 0644 ${S}/systemd/gpsdctl@.service ${D}${systemd_unitdir}/system
+
+    #autoprobe usb gps devices
+    echo 'USBAUTO="true"' >> ${D}${sysconfdir}/default/gpsd.default
+}