meta-sysmocom-bsp/recipes-extra/gpsd/gpsd/0002-gps2udp-leave-argv-unt...

59 lines
1.9 KiB
Diff
Raw Normal View History

gpsd: upgrade to 3.24 Usually when upgrading packages, we just copy the upstream package and adjust it slightly. I've looked at the upstream package here: https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-navigation/gpsd (HEAD at f3d14d41ad60d2d52a0ea795ae10fe0882146ed1) But as I compared both packaging trees, I found ours is quite different than upstream. We have a lot of additional patches, still use python2 and have these extra files: ├── gpsd │ ├── 60-gpsd.rules │ ├── gpsd │ ├── gpsd-default │ ├── gpsd.service │ ├── oc2g │ │ ├── gpsd-default │ │ └── gpsd.service │ ├── sysmobts2100 │ │ └── gpsd-default │ ├── sysmobts-v2 │ │ └── gpsd-default │ └── sysmocom-idu │ └── gpsd-default Therefore I didn't start with the upstream packaging but instead increased the gpsd version in our packaging and went through each patch to see if it can be dropped or needs to be forward ported. Change the version by renaming the .bb file. Reset the version of the recipe (PR) back to "r0" again, as it is common practice after changing the package version. The previous value "r3.20" looked a bit like a package version, but it's not that. Rebase patches: * 0001-gps2udp-Add-a-label-timestamp-and-mac-address-to-eac.patch * 0002-gps2udp-leave-argv-untouched.patch (leave-argv-untouched.patch) * 0003-tsip-configure-and-enable-1PPS.patch (gpsd-tsip-pps.patch) Add build fixes: * 0004-SConscript-force-use-of-pthread.patch Drop patches: * 0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch: unused in previous version * 0001-SConstruct-disable-html-and-man-docs-building-becaus.patch: doesn't apply, instead disable docs building via manbuild='no' * 0002-SConstruct-respect-sysroot-also-in-SPLINTOPTS.patch: not needed anymore (no splintopts line in 3.24) * gpsd-3.3-ldflags.patch: fixed upstream * no-rpath-please.patch: doesn't apply, not needed anymore (see 5df2de36 in gpsd.git) Related: https://docs.yoctoproject.org/bitbake/2.2/bitbake-user-manual/bitbake-user-manual-ref-variables.html#term-PR Related: SYS#6222 Change-Id: I2debe481c5f1cc4ee8290ad0dc883d6a4ea73741
2022-12-13 12:28:40 +00:00
From 901b3f9b6747eca8893ecaae824be396a6a4b5db Mon Sep 17 00:00:00 2001
From: Oliver Smith <osmith@sysmocom.de>
Date: Tue, 13 Dec 2022 15:37:15 +0100
Subject: [PATCH] gps2udp: leave argv untouched
Rebase of leave-argv-untouched.patch we carried. Doesn't seem important,
but to keep the behavior consistent. Originally added with the following
commit message to meta-sysmocom-bsp.git:
commit 26d74189eb2023ce14af8dd41b36cd388ab8bebb
Author: Holger Hans Peter Freyther <holger@moiji-mobile.com>
Date: Tue Jul 15 08:28:42 2014 +0200
gpsd: Do not mess with the argv of the process
Henning got really confused that the "a.b.c:1234" he passed to
gps2udp showed up as "a.b.c 1234" in the kernel cmdline. Use
strdup to take a copy of it.
Fixes: SYS#424
---
clients/gps2udp.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/clients/gps2udp.c b/clients/gps2udp.c
index d27814f24..81d141fa2 100644
--- a/clients/gps2udp.c
+++ b/clients/gps2udp.c
@@ -436,6 +436,7 @@ static unsigned int AISGetInt(unsigned char *bitbytes, unsigned int sp,
int main(int argc, char **argv)
{
+ int i;
bool daemonize = false;
long count = -1;
char *udphostport[MAX_UDP_DEST];
@@ -526,7 +527,7 @@ int main(int argc, char **argv)
"gps2udp: too many UDP destinations (max=%d).\n",
MAX_UDP_DEST);
} else {
- udphostport[udpchannel++] = optarg;
+ udphostport[udpchannel++] = strdup(optarg);
if (0 < debug) {
(void)fprintf(stdout, "UDP %s added.\n", optarg);
}
@@ -686,6 +687,9 @@ int main(int argc, char **argv)
} // end len > 3
} // end for (;;)
+ for (i = 0; i < udpchannel; ++i)
+ free(udphostport[i]);
+
// This is an infinite loop, should never be here
(void)fprintf (stderr, "gpsd2udp ERROR abnormal exit\n");
exit (-1);
--
2.34.1