From bb46a5f01f16f8517f0daa2469b53e35a178b770 Mon Sep 17 00:00:00 2001 From: John Klug Date: Mon, 16 Jan 2017 17:29:12 -0600 Subject: Have udev create /dev/gps0 --- recipes-core/images/mlinux-factory-image.bb | 2 +- recipes-navigation/gpsd/gpsd/60-gpsd.rules | 47 -------------------------- recipes-navigation/gpsd/gpsd/gpsd.rules | 51 +++++++++++++++++++++++++++++ recipes-navigation/gpsd/gpsd_3.16.bb | 8 +++-- 4 files changed, 58 insertions(+), 50 deletions(-) delete mode 100644 recipes-navigation/gpsd/gpsd/60-gpsd.rules create mode 100644 recipes-navigation/gpsd/gpsd/gpsd.rules diff --git a/recipes-core/images/mlinux-factory-image.bb b/recipes-core/images/mlinux-factory-image.bb index f8a395d..710ebf7 100644 --- a/recipes-core/images/mlinux-factory-image.bb +++ b/recipes-core/images/mlinux-factory-image.bb @@ -82,6 +82,6 @@ IMAGE_INSTALL += "venus-gps" IMAGE_INSTALL += "pps-tools" # When ntp is to use the GPS, gps-utils is required -IMAGE_INSTALL += "gpsd ntp gps-utils" +IMAGE_INSTALL += "gpsd ntp gps-utils gpsd-udev" IMAGE_INSTALL += "uvccapture" diff --git a/recipes-navigation/gpsd/gpsd/60-gpsd.rules b/recipes-navigation/gpsd/gpsd/60-gpsd.rules deleted file mode 100644 index 61143b8..0000000 --- a/recipes-navigation/gpsd/gpsd/60-gpsd.rules +++ /dev/null @@ -1,47 +0,0 @@ -# udev rules for gpsd -# $Id$ -# -# GPSes don't have their own USB device class. They're serial-over-USB -# devices, so what you see is actually the ID of the serial-over-USB chip. -# Fortunately, just two of these account for over 80% of consumer-grade -# GPS sensors. The gpsd.hotplug.wrapper script will tell a running gpsd -# that it should look at the device that just went active, because it -# might be a GPS. -# -# The following setup works on Debian - something similar will apply on -# other distributions: -# -# /etc/udev/gpsd.rules -# /etc/udev/rules.d/025_gpsd.rules -> ../gpsd.rules -# /lib/udev/gpsd.hotplug.wrapper -# /lib/udev/gpsd.hotplug -# -# Setting the link in /etc/udev/rules.d activates the rule and determines -# when to run it on boot (similar to init.d processing). - -SUBSYSTEM!="tty", GOTO="gpsd_rules_end" - -# Prolific Technology, Inc. PL2303 Serial Port -ATTR{idVendor}=="067b", ATTR{idProduct}=="2303", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" -# ATEN International Co., Ltd UC-232A Serial Port [pl2303] -ATTR{idVendor}=="0557", ATTR{idProduct}=="2008", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" -# FTDI 8U232AM -ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" -# Cypress M8/CY7C64013 (DeLorme uses these) -ATTR{idVendor}=="1163", ATTR{idProduct}=="0100", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" -# PS-360 OEM (Microsoft GPS sold with Street and Trips 2005) -ATTR{idVendor}=="067b", ATTR{idProduct}=="aaa0", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" -# Garmin International GPSmap, various models (tested with Garmin GPS 18 USB) -ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" -# Cygnal Integrated Products, Inc. CP210x Composite Device (Used by Holux m241) -ATTR{idVendor}=="10c4", ATTR{idProduct}=="ea60", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" -# u-blox AG, u-blox 5 (tested with Navilock NL-402U) -ATTR{idVendor}=="1546", ATTR{idProduct}=="01a5", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" -# FTDI FT232 -ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" -# u-blox 4 -ATTR{idVendor}=="1546", ATTR{idProduct}=="01a4", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" - -ACTION=="remove", RUN+="/lib/udev/gpsd.hotplug.wrapper" - -LABEL="gpsd_rules_end" diff --git a/recipes-navigation/gpsd/gpsd/gpsd.rules b/recipes-navigation/gpsd/gpsd/gpsd.rules new file mode 100644 index 0000000..c314b54 --- /dev/null +++ b/recipes-navigation/gpsd/gpsd/gpsd.rules @@ -0,0 +1,51 @@ +# udev rules for gpsd +# $Id$ +# +# GPSes don't have their own USB device class. They're serial-over-USB +# devices, so what you see is actually the ID of the serial-over-USB chip. +# Fortunately, just two of these account for over 80% of consumer-grade +# GPS sensors. The gpsd.hotplug.wrapper script will tell a running gpsd +# that it should look at the device that just went active, because it +# might be a GPS. +# +# The following setup works on Debian - something similar will apply on +# other distributions: +# +# /etc/udev/gpsd.rules +# /etc/udev/rules.d/025_gpsd.rules -> ../gpsd.rules +# /lib/udev/gpsd.hotplug.wrapper +# /lib/udev/gpsd.hotplug +# +# Setting the link in /etc/udev/rules.d activates the rule and determines +# when to run it on boot (similar to init.d processing). + +SUBSYSTEM!="tty", GOTO="gpsd_rules_end" + +# Prolific Technology, Inc. PL2303 Serial Port +ATTR{idVendor}=="067b", ATTR{idProduct}=="2303", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# ATEN International Co., Ltd UC-232A Serial Port [pl2303] +ATTR{idVendor}=="0557", ATTR{idProduct}=="2008", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# FTDI 8U232AM +ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# Cypress M8/CY7C64013 (DeLorme uses these) +ATTR{idVendor}=="1163", ATTR{idProduct}=="0100", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# PS-360 OEM (Microsoft GPS sold with Street and Trips 2005) +ATTR{idVendor}=="067b", ATTR{idProduct}=="aaa0", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# Garmin International GPSmap, various models (tested with Garmin GPS 18 USB) +ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# Cygnal Integrated Products, Inc. CP210x Composite Device (Used by Holux m241) +ATTR{idVendor}=="10c4", ATTR{idProduct}=="ea60", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# u-blox AG, u-blox 5 (tested with Navilock NL-402U) +ATTR{idVendor}=="1546", ATTR{idProduct}=="01a5", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# FTDI FT232 +ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" +# u-blox 4 +ATTR{idVendor}=="1546", ATTR{idProduct}=="01a4", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper" + +ACTION=="remove", RUN+="/lib/udev/gpsd.hotplug.wrapper" + +KERNEL=="ttyXRUSB2", SYMLINK+="gps0" +KERNEL=="pps0", OWNER="root", GROUP="tty", MODE="0660", SYMLINK+="gpspps0" +KERNEL=="ttyXRUSB2", RUN+="/bin/setserial -v /dev/%k low_latency + +LABEL="gpsd_rules_end" diff --git a/recipes-navigation/gpsd/gpsd_3.16.bb b/recipes-navigation/gpsd/gpsd_3.16.bb index 7a61f68..7e573f8 100644 --- a/recipes-navigation/gpsd/gpsd_3.16.bb +++ b/recipes-navigation/gpsd/gpsd_3.16.bb @@ -18,7 +18,7 @@ SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \ file://gpsd \ file://gpsd_ubx_fixed.sh \ file://gpsd_ubx_settime.sh \ - file://60-gpsd.rules \ + file://gpsd.rules \ file://gpsd.service \ " # Fixed @@ -94,7 +94,11 @@ do_install_append() { install -m 0755 ${WORKDIR}/gpsd_ubx_fixed.sh ${D}${sbindir}/gpsd_ubx_fixed install -m 0755 ${WORKDIR}/gpsd_ubx_settime.sh ${D}${sbindir}/gpsd_ubx_settime - # UDEV code assumed a USB GPS. + #support for udev + install -d ${D}/${sysconfdir}/udev/rules.d + install -m 0644 ${WORKDIR}/gpsd.rules ${D}/${sysconfdir}/udev/rules.d + install -d ${D}${base_libdir}/udev/ + install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/ #support for python install -d ${D}/${PYTHON_SITEPACKAGES_DIR}/gps -- cgit v1.2.3