From c1ec2a0207fc11870465a8e86a7c5f983d5d7163 Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Thu, 30 Apr 2020 09:52:21 +0200 Subject: [PATCH] Revert "gpsd: Clearly separate NetModule from mainline version" This reverts commit 791d40ccd7d4281b16e3e111304e97af945e06dc. It is bringing licenses problem, leading to errors. This has to be fixed first. BugzID: 62684 --- ...andling-of-defaults-from-the-environ.patch | 0 .../gpsd/files/60-ublox-neo.rules | 1 + .../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, 76 insertions(+), 45 deletions(-) rename recipes-connectivity/gpsd/{gpsd => files}/0001-Revert-Fix-the-handling-of-defaults-from-the-environ.patch (100%) create mode 100644 recipes-connectivity/gpsd/files/60-ublox-neo.rules create mode 100644 recipes-connectivity/gpsd/gpsd/0001-gps_shm_close-Free-privdata.patch delete mode 100644 recipes-connectivity/gpsd/gpsd_nm-3.20.bb diff --git a/recipes-connectivity/gpsd/gpsd/0001-Revert-Fix-the-handling-of-defaults-from-the-environ.patch b/recipes-connectivity/gpsd/files/0001-Revert-Fix-the-handling-of-defaults-from-the-environ.patch similarity index 100% rename from recipes-connectivity/gpsd/gpsd/0001-Revert-Fix-the-handling-of-defaults-from-the-environ.patch rename to recipes-connectivity/gpsd/files/0001-Revert-Fix-the-handling-of-defaults-from-the-environ.patch diff --git a/recipes-connectivity/gpsd/files/60-ublox-neo.rules b/recipes-connectivity/gpsd/files/60-ublox-neo.rules new file mode 100644 index 0000000..d9fc793 --- /dev/null +++ b/recipes-connectivity/gpsd/files/60-ublox-neo.rules @@ -0,0 +1 @@ +KERNEL=="ttyACM?", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a8", SYMLINK+="gps0" 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 new file mode 100644 index 0000000..9b38015 --- /dev/null +++ b/recipes-connectivity/gpsd/gpsd/0001-gps_shm_close-Free-privdata.patch @@ -0,0 +1,37 @@ +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 ccfce3a..276dec3 100644 --- a/recipes-connectivity/gpsd/gpsd_%.bbappend +++ b/recipes-connectivity/gpsd/gpsd_%.bbappend @@ -1,13 +1,48 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" -TTY_DEVICE = "/dev/gnss0" +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" 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 ba752f8..07aad5c 100644 --- a/recipes-connectivity/gpsd/gpsd_3.20.bb +++ b/recipes-connectivity/gpsd/gpsd_3.20.bb @@ -7,10 +7,9 @@ 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] = "cf7fdec7ce7221d20bee1a7246362b05" -SRC_URI[sha256sum] = "172a7805068eacb815a3c5225436fcb0be46e7e49a5001a94034eac43df85e50" +SRC_URI[md5sum] = "b3bf88706794eb8e5f2c2543bf7ba87b" +SRC_URI[sha256sum] = "27dd24d45b2ac69baab7933da2bf6ae5fb0be90130f67e753c110a3477155f39" 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 deleted file mode 100644 index 43387e8..0000000 --- a/recipes-connectivity/gpsd/gpsd_nm-3.20.bb +++ /dev/null @@ -1,41 +0,0 @@ -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"