From 791d40ccd7d4281b16e3e111304e97af945e06dc Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Fri, 24 Apr 2020 14:43:48 +0200 Subject: [PATCH] gpsd: Clearly separate NetModule from mainline version Making it clear what is related to netmodule version and what can be appended to any gpsd version. Additional small changes: 1. Removed udev rules createing /dev/gps0 Not needed since we have proper udev rules in their own repo now. 2. Removed patch 0001-gps_shm_close-Free-privdata.patch It was not used referenced anywhere, probably a remans of an old version. 3. Use gnss0 as default TTY device on all targets. It avoids rebuilding everything when changing MACHINE 4. Update checksums for mainline gpsd archive. This recipe alone is still not building but at least the checksums are now correct. BugzID: 62684 --- .../gpsd/files/60-ublox-neo.rules | 1 - ...andling-of-defaults-from-the-environ.patch | 0 .../0001-gps_shm_close-Free-privdata.patch | 37 ----------------- recipes-connectivity/gpsd/gpsd_%.bbappend | 37 +---------------- recipes-connectivity/gpsd/gpsd_3.20.bb | 5 ++- recipes-connectivity/gpsd/gpsd_nm-3.20.bb | 41 +++++++++++++++++++ 6 files changed, 45 insertions(+), 76 deletions(-) delete mode 100644 recipes-connectivity/gpsd/files/60-ublox-neo.rules rename recipes-connectivity/gpsd/{files => gpsd}/0001-Revert-Fix-the-handling-of-defaults-from-the-environ.patch (100%) delete mode 100644 recipes-connectivity/gpsd/gpsd/0001-gps_shm_close-Free-privdata.patch create mode 100644 recipes-connectivity/gpsd/gpsd_nm-3.20.bb diff --git a/recipes-connectivity/gpsd/files/60-ublox-neo.rules b/recipes-connectivity/gpsd/files/60-ublox-neo.rules deleted file mode 100644 index d9fc793..0000000 --- a/recipes-connectivity/gpsd/files/60-ublox-neo.rules +++ /dev/null @@ -1 +0,0 @@ -KERNEL=="ttyACM?", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a8", SYMLINK+="gps0" diff --git a/recipes-connectivity/gpsd/files/0001-Revert-Fix-the-handling-of-defaults-from-the-environ.patch b/recipes-connectivity/gpsd/gpsd/0001-Revert-Fix-the-handling-of-defaults-from-the-environ.patch similarity index 100% rename from recipes-connectivity/gpsd/files/0001-Revert-Fix-the-handling-of-defaults-from-the-environ.patch rename to recipes-connectivity/gpsd/gpsd/0001-Revert-Fix-the-handling-of-defaults-from-the-environ.patch diff --git a/recipes-connectivity/gpsd/gpsd/0001-gps_shm_close-Free-privdata.patch b/recipes-connectivity/gpsd/gpsd/0001-gps_shm_close-Free-privdata.patch deleted file mode 100644 index 9b38015..0000000 --- a/recipes-connectivity/gpsd/gpsd/0001-gps_shm_close-Free-privdata.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 2a4b3bcde0d73a3a4a6644d5f944ac9d16023ba9 Mon Sep 17 00:00:00 2001 -From: Adrian Bunk -Date: Mon, 21 Oct 2019 13:53:25 +0300 -Subject: gps_shm_close: Free privdata - -Previously every open/close cycle leaked privdata. - -Signed-off-by: Adrian Bunk -Signed-off-by: Gary E. Miller - -Upstream-Status: Backport ---- - libgps_shm.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/libgps_shm.c b/libgps_shm.c -index d93972bba..12bb3760b 100644 ---- a/libgps_shm.c -+++ b/libgps_shm.c -@@ -163,8 +163,12 @@ int gps_shm_read(struct gps_data_t *gpsdata) - - void gps_shm_close(struct gps_data_t *gpsdata) - { -- if (PRIVATE(gpsdata) && PRIVATE(gpsdata)->shmseg != NULL) -- (void)shmdt((const void *)PRIVATE(gpsdata)->shmseg); -+ if (PRIVATE(gpsdata)) { -+ if (PRIVATE(gpsdata)->shmseg != NULL) -+ (void)shmdt((const void *)PRIVATE(gpsdata)->shmseg); -+ free(PRIVATE(gpsdata)); -+ gpsdata->privdata = NULL; -+ } - } - - int gps_shm_mainloop(struct gps_data_t *gpsdata, int timeout, --- -2.20.1 - diff --git a/recipes-connectivity/gpsd/gpsd_%.bbappend b/recipes-connectivity/gpsd/gpsd_%.bbappend index 276dec3..ccfce3a 100644 --- a/recipes-connectivity/gpsd/gpsd_%.bbappend +++ b/recipes-connectivity/gpsd/gpsd_%.bbappend @@ -1,48 +1,13 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" -RDEPENDS_${PN} += "python3-pyserial" - -SRC_URI_prepend = " \ - git://gitlab.com/netmodule/third-party/gpsd.git;protocol=ssh;user=git;branch=3.20/netmodule \ - file://60-ublox-neo.rules \ - file://0001-Revert-Fix-the-handling-of-defaults-from-the-environ.patch \ - " -SRC_URI_remove = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz" - -SRC_URI_append = " \ - file://gnss0.ubx \ - " - -# overwrite default gpsd.service file with our configuration -SRCREV = "${AUTOREV}" -S = "${WORKDIR}/git" - -SYSTEMD_SERVICE_${PN} += "${BPN}.service \ - " -TTY_DEVICE = "/dev/ttyS3" -TTY_DEVICE_imx8-nmhw23 = "/dev/gps0" -TTY_DEVICE_am335x-nmhw24 = "/dev/ttyS3" +TTY_DEVICE = "/dev/gnss0" USBAUTO_STATE = "false" do_install_append () { - install -d ${D}${sysconfdir}/udev/rules.d - install -m 0644 ${WORKDIR}/60-ublox-neo.rules ${D}${sysconfdir}/udev/rules.d - - install -d ${D}${bindir} - install -m 744 ${WORKDIR}/git/neom8tool ${D}${bindir}/neom8tool - - install -d ${D}${sysconfdir}/gnss - install -m 644 ${WORKDIR}/gnss0.ubx ${D}${sysconfdir}/gnss/gnss0.ubx - sed -i 's|DEVICES=""|DEVICES="${TTY_DEVICE}"|g' ${D}/etc/default/gpsd.default sed -i 's|USBAUTO="true"|USBAUTO="${USBAUTO_STATE}"|g' ${D}/etc/default/gpsd.default } -SUMMARY_gps-utils-conf = "gps-utils configuration files" -PACKAGES_prepend = "gps-utils-conf " -RDEPENDS_gps-utils += "gps-utils-conf python" -FILES_gps-utils-conf = "${sysconfdir}/gnss/*.ubx" # workaround for receipe backport: gpsd 3.19 is installing shared object files in different # place than expect. diff --git a/recipes-connectivity/gpsd/gpsd_3.20.bb b/recipes-connectivity/gpsd/gpsd_3.20.bb index 07aad5c..ba752f8 100644 --- a/recipes-connectivity/gpsd/gpsd_3.20.bb +++ b/recipes-connectivity/gpsd/gpsd_3.20.bb @@ -7,9 +7,10 @@ PROVIDES = "virtual/gpsd" SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \ file://0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch \ + file://0001-Revert-Fix-the-handling-of-defaults-from-the-environ.patch \ " -SRC_URI[md5sum] = "b3bf88706794eb8e5f2c2543bf7ba87b" -SRC_URI[sha256sum] = "27dd24d45b2ac69baab7933da2bf6ae5fb0be90130f67e753c110a3477155f39" +SRC_URI[md5sum] = "cf7fdec7ce7221d20bee1a7246362b05" +SRC_URI[sha256sum] = "172a7805068eacb815a3c5225436fcb0be46e7e49a5001a94034eac43df85e50" inherit scons update-rc.d python-dir pythonnative systemd update-alternatives diff --git a/recipes-connectivity/gpsd/gpsd_nm-3.20.bb b/recipes-connectivity/gpsd/gpsd_nm-3.20.bb new file mode 100644 index 0000000..43387e8 --- /dev/null +++ b/recipes-connectivity/gpsd/gpsd_nm-3.20.bb @@ -0,0 +1,41 @@ +require recipes-connectivity/gpsd/gpsd_3.20.bb + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +# Additional package containing configuration files for gps-utils +# Mainly ubx configuration file +SUMMARY_gps-utils-conf = "gps-utils configuration files" +PACKAGES =+ "gps-utils-conf" + +GIT_REPO = " \ + git://gitlab.com/netmodule/third-party/gpsd.git;protocol=ssh;user=git;branch=3.20/netmodule \ +" + +SRC_URI += "file://gnss0.ubx" + +# Use own git repo but keep patches +python() { + import re + src_uri = d.getVar('SRC_URI') + src_uri = re.sub(r'git://[^\s]*', '', src_uri) + src_uri = re.sub(r'http://[^\s]*', '', src_uri) + src_uri = re.sub(r'https://[^\s]*', '', src_uri) + src_uri = ' '.join([d.getVar('GIT_REPO'), src_uri]) + d.setVar('SRC_URI', src_uri) +} + +SRCREV = "${AUTOREV}" +S = "${WORKDIR}/git" + +RDEPENDS_${PN} += "python3-pyserial" +RDEPENDS_gps-utils += "gps-utils-conf python" + +do_install_append() { + install -d ${D}${bindir} + install -m 744 ${S}/neom8tool ${D}${bindir}/neom8tool + + install -d ${D}${sysconfdir}/gnss + install -m 644 ${WORKDIR}/gnss0.ubx ${D}${sysconfdir}/gnss/gnss0.ubx +} + +FILES_gps-utils-conf = "${sysconfdir}/gnss/*.ubx"