summaryrefslogtreecommitdiff
path: root/recipes-navigation
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2018-09-17 16:30:51 -0500
committerJohn Klug <john.klug@multitech.com>2018-09-17 16:30:51 -0500
commit1a40c25104753b698c9af80967e42c3a7935eba4 (patch)
tree7c7672b4649bde1b401e6c6176a8a1f1a2dac72d /recipes-navigation
parent2505357bb390300f9066fae0ce1486773eb2a799 (diff)
downloadmeta-mlinux-1a40c25104753b698c9af80967e42c3a7935eba4.tar.gz
meta-mlinux-1a40c25104753b698c9af80967e42c3a7935eba4.tar.bz2
meta-mlinux-1a40c25104753b698c9af80967e42c3a7935eba4.zip
Make gpsd-3.17 available.
Diffstat (limited to 'recipes-navigation')
-rw-r--r--recipes-navigation/gpsd/gpsd-3.17/0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch81
-rw-r--r--recipes-navigation/gpsd/gpsd-3.17/0001-include-sys-ttydefaults.h.patch35
-rw-r--r--recipes-navigation/gpsd/gpsd-3.17/0004-SConstruct-disable-html-and-man-docs-building-becaus.patch51
-rw-r--r--recipes-navigation/gpsd/gpsd-3.17/0005-suppress-text-in-binary.patch30
-rw-r--r--recipes-navigation/gpsd/gpsd-3.17/0006-ubxtimelps.patch200
-rw-r--r--recipes-navigation/gpsd/gpsd-3.17/leap2017Aug31.patch167
-rw-r--r--recipes-navigation/gpsd/gpsd-3.17/leap2017Aug31.readme.txt169
-rw-r--r--recipes-navigation/gpsd/gpsd_3.17.bb179
8 files changed, 912 insertions, 0 deletions
diff --git a/recipes-navigation/gpsd/gpsd-3.17/0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch b/recipes-navigation/gpsd/gpsd-3.17/0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch
new file mode 100644
index 0000000..1fa27c2
--- /dev/null
+++ b/recipes-navigation/gpsd/gpsd-3.17/0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch
@@ -0,0 +1,81 @@
+From 1e2cea8945bc2183fbe1a012dcd633a352125952 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Tue, 24 Apr 2012 18:45:14 +0200
+Subject: [PATCH] SConstruct: prefix includepy with sysroot and drop sysroot
+ from python_lib_dir
+
+* without PYTHONPATH, distutil's sysconfig returns INCLUDEPY without sysroot prefix
+ and with PYTHONPATH from OE it's pointing to native python dir
+
+ $ export PYTHONPATH=/OE/shr-core/tmp-eglibc/sysroots/om-gta02/usr/lib/python2.7/
+ $ python
+ Python 2.7.2 (default, Apr 18 2012, 09:19:59)
+ [GCC 4.6.2] on linux2
+ Type "help", "copyright", "credits" or "license" for more information.
+ >>> from distutils import sysconfig
+ >>> sysconfig.get_config_vars('INCLUDEPY')
+ ['/OE/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/include/python2.7']
+ >>>
+ $ unset PYTHONPATH
+ $ python
+ Python 2.7.2 (default, Apr 18 2012, 09:19:59)
+ [GCC 4.6.2] on linux2
+ Type "help", "copyright", "credits" or "license" for more information.
+ >>> from distutils import sysconfig
+ >>> sysconfig.get_config_vars('INCLUDEPY')
+ ['/python2.7']
+ >>> import sysconfig
+ >>> sysconfig.get_config_vars('INCLUDEPY')
+ ['/OE/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/include/python2.7']
+* python_lib_dir = python_lib_dir.replace(env['sysroot'], '')
+ returns path to target sysroot
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+Signed-off-by: Peter A. Bigot <pab@pabigot.com>
+---
+ SConstruct | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/SConstruct b/SConstruct
+index 3318bb48..e1c4f963 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -934,7 +934,7 @@ else:
+
+ # Set up configuration for target Python
+
+-PYTHON_LIBDIR_CALL = 'sysconfig.get_python_lib()'
++PYTHON_LIBDIR_CALL = 'sysconfig.get_python_lib(plat_specific=1)'
+
+ PYTHON_CONFIG_NAMES = ['CC', 'CXX', 'OPT', 'BASECFLAGS',
+ 'CCSHARED', 'LDSHARED', 'SO', 'INCLUDEPY', 'LDFLAGS']
+@@ -1364,7 +1364,7 @@ else:
+ LINK=ldshared,
+ SHLIBPREFIX="",
+ SHLIBSUFFIX=python_config['SO'],
+- CPPPATH=[python_config['INCLUDEPY']],
++ CPPPATH=[os.path.normpath("%s/%s/%s/%s" % (env['sysroot'], env['prefix'], env['includedir'], python_config['INCLUDEPY']))] if env['sysroot'] else [python_config['INCLUDEPY']],
+ CPPFLAGS=python_config['OPT'],
+ CFLAGS=python_config['BASECFLAGS'],
+ CXXFLAGS=python_config['BASECFLAGS'])
+@@ -1662,12 +1662,15 @@ if ((not env['debug'] and not env['profiling'] and not env['nostrip']
+ if not env['python']:
+ python_install = []
+ else:
++ python_libdir = python_libdir.replace(env['sysroot'], '')
+ python_module_dir = python_libdir + os.sep + 'gps'
+ python_extensions_install = python_env.Install(DESTDIR + python_module_dir,
+ python_built_extensions)
+ if ((not env['debug'] and not env['profiling']
+ and not env['nostrip'] and not sys.platform.startswith('darwin'))):
+ python_env.AddPostAction(python_extensions_install, '$STRIP $TARGET')
++ env.AddPostAction(python_extensions_install, '$CHRPATH -r "%s" "$TARGET"' \
++ % (python_libdir, ))
+
+ python_modules_install = python_env.Install(DESTDIR + python_module_dir,
+ python_modules)
+--
+2.1.0
+
diff --git a/recipes-navigation/gpsd/gpsd-3.17/0001-include-sys-ttydefaults.h.patch b/recipes-navigation/gpsd/gpsd-3.17/0001-include-sys-ttydefaults.h.patch
new file mode 100644
index 0000000..e91e4e9
--- /dev/null
+++ b/recipes-navigation/gpsd/gpsd-3.17/0001-include-sys-ttydefaults.h.patch
@@ -0,0 +1,35 @@
+From f221fa959c80b43c65426500a6836a1b5cf6fe0c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 17 Aug 2016 02:16:12 +0000
+Subject: [PATCH] include sys/ttydefaults.h
+
+This is needed for CTRL definition, as exposed by musl on glibc
+this include file gets pulled indirectly.
+
+/usr/src/debug/gpsd/3.14-r0/gpsd-3.14/gpsmon.c:605: undefined reference to `CTRL'
+clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)
+scons: *** [gpsmon] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Foreward port to gpsd 3.16
+Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
+---
+ gpsmon.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gpsmon.c b/gpsmon.c
+index 89c43ee2..5cc0dabd 100644
+--- a/gpsmon.c
++++ b/gpsmon.c
+@@ -24,6 +24,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/select.h>
++#include <sys/ttydefaults.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+
+--
+2.12.0
+
diff --git a/recipes-navigation/gpsd/gpsd-3.17/0004-SConstruct-disable-html-and-man-docs-building-becaus.patch b/recipes-navigation/gpsd/gpsd-3.17/0004-SConstruct-disable-html-and-man-docs-building-becaus.patch
new file mode 100644
index 0000000..ba3d205
--- /dev/null
+++ b/recipes-navigation/gpsd/gpsd-3.17/0004-SConstruct-disable-html-and-man-docs-building-becaus.patch
@@ -0,0 +1,51 @@
+From 697e2e9ff97487266d817cdd41bacc83f681e3d7 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sun, 29 Apr 2012 00:05:59 +0200
+Subject: [PATCH 4/4] SConstruct: disable html and man docs building because
+ xmlto-native from OE is broken
+
+It will try to load dtd and fail:
+| xmlto man gpsctl.xml; mv `basename gpsctl.1` gpsctl.1
+| xmlto: /var/lib/jenkins/jobs/shr-core-branches/workspace/shr-core/tmp-eglibc/work/armv4t-oe-linux-gnueabi/gpsd-3.4-r2/gpsd-3.4/gpsctl.xml does not validate (status 3)
+| xmlto: Fix document syntax or use --skip-validation option
+| I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd
+| /var/lib/jenkins/jobs/shr-core-branches/workspace/shr-core/tmp-eglibc/work/armv4t-oe-linux-gnueabi/gpsd-3.4-r2/gpsd-3.4/gpsctl.xml:8: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
+| "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+| ^
+| I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd
+| warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
+| validity error : Could not load the external subset "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
+| Document /var/lib/jenkins/jobs/shr-core-branches/workspace/shr-core/tmp-eglibc/work/armv4t-oe-linux-gnueabi/gpsd-3.4-r2/gpsd-3.4/gpsctl.xml does not validate
+| mv: cannot stat `gpsctl.1': No such file or directory
+| scons: *** [gpsctl.1] Error 1
+| scons: building terminated because of errors.
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+Signed-off-by: Peter A. Bigot <pab@pabigot.com>
+---
+ SConstruct | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/SConstruct b/SConstruct
+index 3318bb48..a5bb756d 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -889,11 +889,11 @@ else:
+
+ manbuilder = htmlbuilder = None
+ if env['manbuild']:
+- if config.CheckXsltproc():
++ if False and config.CheckXsltproc():
+ build = "xsltproc --nonet %s $SOURCE >$TARGET"
+ htmlbuilder = build % docbook_html_uri
+ manbuilder = build % docbook_man_uri
+- elif WhereIs("xmlto"):
++ elif False and WhereIs("xmlto"):
+ xmlto = "xmlto %s $SOURCE || mv `basename $TARGET` " \
+ "`dirname $TARGET`"
+ htmlbuilder = xmlto % "html-nochunks"
+--
+1.8.5.5
+
diff --git a/recipes-navigation/gpsd/gpsd-3.17/0005-suppress-text-in-binary.patch b/recipes-navigation/gpsd/gpsd-3.17/0005-suppress-text-in-binary.patch
new file mode 100644
index 0000000..f338126
--- /dev/null
+++ b/recipes-navigation/gpsd/gpsd-3.17/0005-suppress-text-in-binary.patch
@@ -0,0 +1,30 @@
+diff -u old/gpsctl.c new/gpsctl.c
+--- old/gpsctl.c 2017-01-03 15:57:50.517120891 -0600
++++ new/gpsctl.c 2017-01-03 18:31:21.421101434 -0600
+@@ -175,7 +175,7 @@
+ int option, status;
+ char *device = NULL, *devtype = NULL;
+ char *speed = NULL, *control = NULL, *rate = NULL;
+- bool to_binary = false, to_nmea = false, reset = false;
++ bool to_binary = false, to_nmea = false, reset = false, control_string = false;
+ bool lowlevel=false, echo=false;
+ struct gps_data_t gpsdata;
+ const struct gps_type_t *forcetype = NULL;
+@@ -205,6 +205,7 @@
+ #ifdef CONTROLSEND_ENABLE
+ control = optarg;
+ lowlevel = true;
++ control_string = true;
+ if ((cooklen = hex_escapes(cooked, control)) <= 0) {
+ gpsd_log(&context.errout, LOG_ERROR,
+ "invalid escape string (error %d)\n", (int)cooklen);
+@@ -704,7 +705,8 @@
+ }
+ }
+
+- (void)printf("%s identified as a %s at %u baud.\n",
++ if(!control_string)
++ (void)printf("%s identified as a %s at %u baud.\n",
+ device, gpsd_id(&session),
+ session.gpsdata.dev.baudrate);
+
diff --git a/recipes-navigation/gpsd/gpsd-3.17/0006-ubxtimelps.patch b/recipes-navigation/gpsd/gpsd-3.17/0006-ubxtimelps.patch
new file mode 100644
index 0000000..e715847
--- /dev/null
+++ b/recipes-navigation/gpsd/gpsd-3.17/0006-ubxtimelps.patch
@@ -0,0 +1,200 @@
+diff -Naur old/driver_ubx.c new/driver_ubx.c
+--- old/driver_ubx.c 2017-01-19 14:12:25.099231346 -0600
++++ new/driver_ubx.c 2017-01-19 15:13:58.552152991 -0600
+@@ -57,6 +57,29 @@
+ #define UBX_CFG_LEN 20
+ #define outProtoMask 14
+
++#ifdef UBLOXTIMELS_ENABLE
++/* UBX-NAV-TIMELS support */
++static char *srcOfCurrLs[] = {
++ "firmware",
++ "GPS GLONASS difference",
++ "GPS",
++ "SBAS",
++ "BeiDou",
++ "Galileo",
++ "Aided data",
++ "Configured"
++};
++static char *srcOfLsChange[] = {
++ "No Source",
++ "Undefined",
++ "GPS",
++ "SBAS",
++ "BeiDou",
++ "Galileo",
++ "GLONOSS",
++};
++#endif /* UBLOXTIMELS_ENABLE */
++
+ static gps_mask_t ubx_parse(struct gps_device_t *session, unsigned char *buf,
+ size_t len);
+ static gps_mask_t ubx_msg_nav_dop(struct gps_device_t *session,
+@@ -237,6 +260,89 @@
+ return mask;
+ }
+
++#ifdef UBLOXTIMELS_ENABLE
++/**
++ * Navigation time to leap second
++ *
++ * Sets leap_notify if leap second is < 23 hours away.
++ */
++static void
++ubx_msg_nav_timels(struct gps_device_t *session, unsigned char *buf,
++ size_t data_len)
++{
++ int version;
++ unsigned int flags;
++ int valid_curr_ls;
++ int valid_time_to_ls_event;
++
++ if (data_len != 24) {
++ gpsd_log(&session->context->errout, LOG_WARN,
++ "UBX-NAV-TIMELS: unexpected length %d, expecting 24\n",
++ data_len);
++ return;
++ }
++ version = getsb(buf,4);
++ /* Only version 0 is defined so far. */
++ flags = (unsigned int)getub(buf, 23);
++ gpsd_log(&session->context->errout, LOG_DATA,
++ "UBX-NAV-TIMELS: flags 0x%x message version %d\n",flags, version);
++ valid_curr_ls = flags & UBX_TIMELS_VALID_CURR_LS;
++ valid_time_to_ls_event = flags & UBX_TIMELS_VALID_TIME_LS_EVT;
++ if(valid_curr_ls) {
++ unsigned int src_of_curr_ls = getub(buf,8);
++ int curr_ls = getsb(buf,9);
++ char *src = "Unknown";
++
++ if(src_of_curr_ls < (sizeof srcOfCurrLs/(sizeof srcOfCurrLs[0])))
++ src = srcOfCurrLs[src_of_curr_ls];
++
++ gpsd_log(&session->context->errout, LOG_DATA,
++ "UBX-NAV-TIMELS: source_of_current_leapsecond=%u:%s curr_ls=%d\n",
++ src_of_curr_ls,src,curr_ls);
++ session->context->leap_seconds = curr_ls;
++ session->context->valid |= LEAP_SECOND_VALID;
++ } /* Valid current leap second */
++ if(valid_time_to_ls_event) {
++ char *src="Unknown";
++ unsigned int src_of_ls_change;
++ unsigned short dateOfLSGpsWn, dateOfLSGpsDn;
++ int lsChange = getsb(buf,11);
++ int timeToLsEvent = getles32(buf,12);
++ src_of_ls_change = getub(buf,10);
++ if(src_of_ls_change < (sizeof srcOfLsChange/(sizeof srcOfLsChange[0])))
++ src = srcOfLsChange[src_of_ls_change];
++ dateOfLSGpsWn = getles16(buf,16);
++ dateOfLSGpsDn = getles16(buf,18);
++ gpsd_log(&session->context->errout, LOG_DATA,
++ "UBX_NAV_TIMELS: source_of_leapsecond_change=%u:%s "
++ "leapSecondChage=%d timeToLsEvent=%d\n",
++ src_of_ls_change,src,lsChange,timeToLsEvent);
++ gpsd_log(&session->context->errout, LOG_DATA,
++ "UBX_NAV_TIMELS: dateOfLSGpsWn=%d dateOfLSGpsDn=%d\n",
++ dateOfLSGpsWn,dateOfLSGpsDn);
++ if(timeToLsEvent < 60*60*23 && timeToLsEvent > 0) {
++ if(lsChange == 0)
++ session->context->leap_notify = LEAP_NOWARNING;
++ else if (lsChange == 1)
++ session->context->leap_notify = LEAP_ADDSECOND;
++ else if (lsChange == -1)
++ session->context->leap_notify = LEAP_DELSECOND;
++ } else
++ session->context->leap_notify = LEAP_NOWARNING;
++
++ if (session->context->leap_notify == LEAP_ADDSECOND)
++ gpsd_log(&session->context->errout,LOG_INF,
++ "UBX_NAV_TIMELS: Add leap second today\n");
++ else if (session->context->leap_notify == LEAP_DELSECOND)
++ gpsd_log(&session->context->errout,LOG_INF,
++ "UBX_NAV_TIMELS: Remove leap second today\n");
++
++ gpsd_log(&session->context->errout, LOG_DATA,
++ "UBX_NAV_TIMELS: leaving: leap_notify=%d\n",
++ session->context->leap_notify);
++ }
++}
++#endif /* UBLOXTIMELS_ENABLE */
+ /**
+ * Geodetic position solution message
+ */
+@@ -523,13 +629,22 @@
+ case UBX_NAV_EKFSTATUS:
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_EKFSTATUS\n");
+ break;
+-
++ case UBX_NAV_TIMELS:
++ gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_TIMELS\n");
++#ifdef UBLOXTIMELS_ENABLE
++ ubx_msg_nav_timels(session, &buf[UBX_PREFIX_LEN],data_len);
++#endif // UBLOXTIMELS_ENABLE
++ break;
+ case UBX_RXM_RAW:
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_RXM_RAW\n");
+ break;
+ case UBX_RXM_SFRB:
++ gpsd_log(&session->context->errout, LOG_DATA, "UBX_RXM_SFRB\n");
+ mask = ubx_msg_sfrb(session, &buf[UBX_PREFIX_LEN]);
+ break;
++ case UBX_RXM_SFRBX:
++ gpsd_log(&session->context->errout, LOG_DATA, "UBX_RXM_SFRBX\n");
++ break;
+ case UBX_RXM_SVSI:
+ gpsd_log(&session->context->errout, LOG_PROG, "UBX_RXM_SVSI\n");
+ break;
+@@ -955,6 +1070,12 @@
+ msg[1] = 0x20; /* msg id = UBX_NAV_TIMEGPS */
+ msg[2] = 0x01; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
++#ifdef UBLOXTIMELS_ENABLE
++ msg[0] = 0x01; /* class */
++ msg[1] = 0x26; /* msg id = UBX_NAV_TIMELS */
++ msg[2] = 0xff; /* rate */
++#endif /* UBLOXTIMELS_ENABLE */
++ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ msg[0] = 0x01; /* class */
+ msg[1] = 0x30; /* msg id = NAV-SVINFO */
+ msg[2] = 0x0a; /* rate */
+diff -Naur old/driver_ubx.h new/driver_ubx.h
+--- old/driver_ubx.h 2017-01-19 14:12:25.099231346 -0600
++++ new/driver_ubx.h 2017-01-19 14:01:48.177653001 -0600
+@@ -35,6 +35,7 @@
+ UBX_NAV_TIMEGPS = UBX_MSGID(UBX_CLASS_NAV, 0x20),
+ UBX_NAV_TIMEUTC = UBX_MSGID(UBX_CLASS_NAV, 0x21),
+ UBX_NAV_CLOCK = UBX_MSGID(UBX_CLASS_NAV, 0x22),
++ UBX_NAV_TIMELS = UBX_MSGID(UBX_CLASS_NAV, 0x26),
+ UBX_NAV_SVINFO = UBX_MSGID(UBX_CLASS_NAV, 0x30),
+ UBX_NAV_DGPS = UBX_MSGID(UBX_CLASS_NAV, 0x31),
+ UBX_NAV_SBAS = UBX_MSGID(UBX_CLASS_NAV, 0x32),
+@@ -42,6 +43,7 @@
+
+ UBX_RXM_RAW = UBX_MSGID(UBX_CLASS_RXM, 0x10),
+ UBX_RXM_SFRB = UBX_MSGID(UBX_CLASS_RXM, 0x11),
++ UBX_RXM_SFRBX = UBX_MSGID(UBX_CLASS_RXM, 0x13),
+ UBX_RXM_SVSI = UBX_MSGID(UBX_CLASS_RXM, 0x20),
+ UBX_RXM_ALM = UBX_MSGID(UBX_CLASS_RXM, 0x30),
+ UBX_RXM_EPH = UBX_MSGID(UBX_CLASS_RXM, 0x31),
+@@ -102,6 +104,9 @@
+ #define UBX_SOL_VALID_WEEK 0x04
+ #define UBX_SOL_VALID_TIME 0x08
+
++#define UBX_TIMELS_VALID_CURR_LS 0x01
++#define UBX_TIMELS_VALID_TIME_LS_EVT 0x01
++
+ /* from UBX_NAV_SVINFO */
+ #define UBX_SAT_USED 0x01
+ #define UBX_SAT_DGPS 0x02
+diff -Naur old/SConstruct new/SConstruct
+--- old/SConstruct 2017-01-19 14:51:35.638466569 -0600
++++ new/SConstruct 2017-01-19 15:20:02.488159765 -0600
+@@ -113,6 +113,7 @@
+ ("tripmate", True, "DeLorme TripMate support"),
+ ("tsip", True, "Trimble TSIP support"),
+ ("ublox", True, "u-blox Protocol support"),
++ ("ubloxtimels", False, "u-blox UBX-NAV-TIMELS support (leap second)"),
+ ("fury", True, "Jackson Labs Fury and Firefly support"),
+ ("nmea2000", True, "NMEA2000/CAN support"),
+ # Non-GPS protocols
diff --git a/recipes-navigation/gpsd/gpsd-3.17/leap2017Aug31.patch b/recipes-navigation/gpsd/gpsd-3.17/leap2017Aug31.patch
new file mode 100644
index 0000000..658b757
--- /dev/null
+++ b/recipes-navigation/gpsd/gpsd-3.17/leap2017Aug31.patch
@@ -0,0 +1,167 @@
+diff -Naur old/driver_ubx.c new/driver_ubx.c
+--- old/driver_ubx.c 2017-08-01 10:56:05.757282801 -0500
++++ new/driver_ubx.c 2017-08-01 10:53:49.785286827 -0500
+@@ -57,6 +57,29 @@
+ #define UBX_CFG_LEN 20
+ #define outProtoMask 14
+
++#ifdef UBLOXTIMELS_ENABLE
++/* UBX-NAV-TIMELS support */
++static char *srcOfCurrLs[] = {
++ "firmware",
++ "GPS GLONASS difference",
++ "GPS",
++ "SBAS",
++ "BeiDou",
++ "Galileo",
++ "Aided data",
++ "Configured"
++};
++static char *srcOfLsChange[] = {
++ "No Source",
++ "Undefined",
++ "GPS",
++ "SBAS",
++ "BeiDou",
++ "Galileo",
++ "GLONOSS",
++};
++#endif /* UBLOXTIMELS_ENABLE */
++
+ static gps_mask_t ubx_parse(struct gps_device_t *session, unsigned char *buf,
+ size_t len);
+ static gps_mask_t ubx_msg_nav_dop(struct gps_device_t *session,
+@@ -237,6 +260,96 @@
+ return mask;
+ }
+
++#ifdef UBLOXTIMELS_ENABLE
++/**
++ * Navigation time to leap second
++ *
++ * Sets leap_notify if leap second is < 23 hours away.
++ */
++static void
++ubx_msg_nav_timels(struct gps_device_t *session, unsigned char *buf,
++ size_t data_len)
++{
++ int version;
++ unsigned int flags;
++ int valid_curr_ls;
++ int valid_time_to_ls_event;
++
++ if (data_len != 24) {
++ gpsd_log(&session->context->errout, LOG_WARN,
++ "UBX-NAV-TIMELS: unexpected length %d, expecting 24\n",
++ data_len);
++ return;
++ }
++ version = getsb(buf,4);
++ /* Only version 0 is defined so far. */
++ flags = (unsigned int)getub(buf, 23);
++ gpsd_log(&session->context->errout, LOG_DATA,
++ "UBX-NAV-TIMELS: flags 0x%x message version %d\n",flags, version);
++ valid_curr_ls = flags & UBX_TIMELS_VALID_CURR_LS;
++ valid_time_to_ls_event = flags & UBX_TIMELS_VALID_TIME_LS_EVT;
++ if(valid_curr_ls) {
++ unsigned int src_of_curr_ls = getub(buf,8);
++ int curr_ls = getsb(buf,9);
++ char *src = "Unknown";
++
++ if(src_of_curr_ls < (sizeof srcOfCurrLs/(sizeof srcOfCurrLs[0])))
++ src = srcOfCurrLs[src_of_curr_ls];
++
++ gpsd_log(&session->context->errout, LOG_DATA,
++ "UBX-NAV-TIMELS: source_of_current_leapsecond=%u:%s curr_ls=%d\n",
++ src_of_curr_ls,src,curr_ls);
++ session->context->leap_seconds = curr_ls;
++ session->context->valid |= LEAP_SECOND_VALID;
++ } /* Valid current leap second */
++ if(valid_time_to_ls_event) {
++ char *src="Unknown";
++ unsigned int src_of_ls_change;
++ unsigned short dateOfLSGpsWn, dateOfLSGpsDn;
++ int lsChange = getsb(buf,11);
++ int timeToLsEvent = getles32(buf,12);
++int secondsperday=24*60*60;
++lsChange = 1; /* JAK Forward one second */
++ src_of_ls_change = getub(buf,10);
++ if(src_of_ls_change < (sizeof srcOfLsChange/(sizeof srcOfLsChange[0])))
++ src = srcOfLsChange[src_of_ls_change];
++ dateOfLSGpsWn = getles16(buf,16);
++ dateOfLSGpsDn = getles16(buf,18);
++ gpsd_log(&session->context->errout, LOG_DATA,
++ "UBX_NAV_TIMELS: source_of_leapsecond_change=%u:%s "
++ "leapSecondChage=%d timeToLsEvent=%d\n",
++ src_of_ls_change,src,lsChange,timeToLsEvent);
++timeToLsEvent += 212*secondsperday; /* JAK Jul 31 Leap second for test */
++ gpsd_log(&session->context->errout, LOG_DATA,
++ "UBX_NAV_TIMELS2: source_of_leapsecond_change=%u:%s "
++ "leapSecondChage=%d timeToLsEvent=%d\n",
++ src_of_ls_change,src,lsChange,timeToLsEvent); /* JAK */
++ gpsd_log(&session->context->errout, LOG_DATA,
++ "UBX_NAV_TIMELS: dateOfLSGpsWn=%d dateOfLSGpsDn=%d\n",
++ dateOfLSGpsWn,dateOfLSGpsDn);
++ if(timeToLsEvent < 60*60*23 && timeToLsEvent > 0) {
++ if(lsChange == 0)
++ session->context->leap_notify = LEAP_NOWARNING;
++ else if (lsChange == 1)
++ session->context->leap_notify = LEAP_ADDSECOND;
++ else if (lsChange == -1)
++ session->context->leap_notify = LEAP_DELSECOND;
++ } else
++ session->context->leap_notify = LEAP_NOWARNING;
++
++ if (session->context->leap_notify == LEAP_ADDSECOND)
++ gpsd_log(&session->context->errout,LOG_INF,
++ "UBX_NAV_TIMELS: Add leap second today\n");
++ else if (session->context->leap_notify == LEAP_DELSECOND)
++ gpsd_log(&session->context->errout,LOG_INF,
++ "UBX_NAV_TIMELS: Remove leap second today\n");
++
++ gpsd_log(&session->context->errout, LOG_DATA,
++ "UBX_NAV_TIMELS: leaving: leap_notify=%d\n",
++ session->context->leap_notify);
++ }
++}
++#endif /* UBLOXTIMELS_ENABLE */
+ /**
+ * Geodetic position solution message
+ */
+@@ -523,13 +636,22 @@
+ case UBX_NAV_EKFSTATUS:
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_EKFSTATUS\n");
+ break;
+-
++ case UBX_NAV_TIMELS:
++ gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_TIMELS\n");
++#ifdef UBLOXTIMELS_ENABLE
++ ubx_msg_nav_timels(session, &buf[UBX_PREFIX_LEN],data_len);
++#endif // UBLOXTIMELS_ENABLE
++ break;
+ case UBX_RXM_RAW:
+ gpsd_log(&session->context->errout, LOG_DATA, "UBX_RXM_RAW\n");
+ break;
+ case UBX_RXM_SFRB:
++ gpsd_log(&session->context->errout, LOG_DATA, "UBX_RXM_SFRB\n");
+ mask = ubx_msg_sfrb(session, &buf[UBX_PREFIX_LEN]);
+ break;
++ case UBX_RXM_SFRBX:
++ gpsd_log(&session->context->errout, LOG_DATA, "UBX_RXM_SFRBX\n");
++ break;
+ case UBX_RXM_SVSI:
+ gpsd_log(&session->context->errout, LOG_PROG, "UBX_RXM_SVSI\n");
+ break;
+@@ -955,6 +1077,12 @@
+ msg[1] = 0x20; /* msg id = UBX_NAV_TIMEGPS */
+ msg[2] = 0x01; /* rate */
+ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
++#ifdef UBLOXTIMELS_ENABLE
++ msg[0] = 0x01; /* class */
++ msg[1] = 0x26; /* msg id = UBX_NAV_TIMELS */
++ msg[2] = 0xff; /* rate */
++#endif /* UBLOXTIMELS_ENABLE */
++ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
+ msg[0] = 0x01; /* class */
+ msg[1] = 0x30; /* msg id = NAV-SVINFO */
+ msg[2] = 0x0a; /* rate */
diff --git a/recipes-navigation/gpsd/gpsd-3.17/leap2017Aug31.readme.txt b/recipes-navigation/gpsd/gpsd-3.17/leap2017Aug31.readme.txt
new file mode 100644
index 0000000..d9bf4b1
--- /dev/null
+++ b/recipes-navigation/gpsd/gpsd-3.17/leap2017Aug31.readme.txt
@@ -0,0 +1,169 @@
+The purpose of this test is to verify leap second operation with ntp. This is done
+by artificially setting the leap second offset in gpsd. ntp is not modified.
+Software levels:
+ gpsd - 3.16-m2.9 + the Aug 31 test patch
+ ntp - 4.2.8p9-r0.mlinux3.0. Release candidate for mLinux 4.0
+
+ntpd leap second test gpsd artificially causes a leap second on Aug 31, 2017 23:59:59 UTC.
+
+The patch for this test is leap2017Aug31.patch. This patch replaces 0006-ubxtimelps.patch.
+
+
+Kernel Log:
+
+2017-07-31T18:50:02.012018-05:00 leaptest CROND[5205]: (root) CMD (/usr/sbin/logrotate /etc/logrotate.conf)
+2017-07-31T18:55:01.119140-05:00 leaptest CROND[5223]: (root) CMD (/usr/sbin/logrotate /etc/logrotate.conf)
+2017-07-31T18:59:59.016393-05:00 leaptest kernel: Clock: inserting leap second 23:59:60 UTC
+2017-07-31T19:00:01.215873-05:00 leaptest CROND[5240]: (root) CMD (/usr/sbin/logrotate /etc/logrotate.conf)
+2017-07-31T19:00:07.381218-05:00 leaptest ntpd[501]: kernel reports leap second has occurred
+2017-07-31T19:00:07.381528-05:00 leaptest ntpd[501]: kernel reports leap second has occurred
+2017-07-31T19:05:01.313170-05:00 leaptest CROND[5258]: (root) CMD (/usr/sbin/logrotate /etc/logrotate.conf)
+
+
+Time log from user space. 18:59:59 repeats twice 19:00:00 appears only once.:
+
+2017-07-31T18:59:57.855895-05:00 leaptest CTST: epoch: 1501545597.855 boot: 442607.123
+2017-07-31T18:59:58.106318-05:00 leaptest CTST: epoch: 1501545598.106 boot: 442607.373
+2017-07-31T18:59:58.356758-05:00 leaptest CTST: epoch: 1501545598.356 boot: 442607.624
+2017-07-31T18:59:58.607171-05:00 leaptest CTST: epoch: 1501545598.606 boot: 442607.874
+2017-07-31T18:59:58.857621-05:00 leaptest CTST: epoch: 1501545598.857 boot: 442608.124
+2017-07-31T18:59:59.108072-05:00 leaptest CTST: epoch: 1501545599.107 boot: 442608.375
+2017-07-31T18:59:59.358506-05:00 leaptest CTST: epoch: 1501545599.358 boot: 442608.625
+2017-07-31T18:59:59.608952-05:00 leaptest CTST: epoch: 1501545599.608 boot: 442608.876
+2017-07-31T18:59:59.859364-05:00 leaptest CTST: epoch: 1501545599.859 boot: 442609.126
+2017-07-31T18:59:59.109780-05:00 leaptest CTST: epoch: 1501545599.109 boot: 442609.377
+2017-07-31T18:59:59.360195-05:00 leaptest CTST: epoch: 1501545599.359 boot: 442609.627
+2017-07-31T18:59:59.610608-05:00 leaptest CTST: epoch: 1501545599.610 boot: 442609.877
+2017-07-31T18:59:59.861023-05:00 leaptest CTST: epoch: 1501545599.860 boot: 442610.128
+2017-07-31T19:00:00.111461-05:00 leaptest CTST: epoch: 1501545600.111 boot: 442610.378
+2017-07-31T19:00:00.361916-05:00 leaptest CTST: epoch: 1501545600.361 boot: 442610.629
+2017-07-31T19:00:00.612329-05:00 leaptest CTST: epoch: 1501545600.612 boot: 442610.879
+2017-07-31T19:00:00.862825-05:00 leaptest CTST: epoch: 1501545600.862 boot: 442611.130
+2017-07-31T19:00:01.113251-05:00 leaptest CTST: epoch: 1501545601.112 boot: 442611.380
+2017-07-31T19:00:01.363695-05:00 leaptest CTST: epoch: 1501545601.363 boot: 442611.630
+2017-07-31T19:00:01.614114-05:00 leaptest CTST: epoch: 1501545601.613 boot: 442611.881
+2017-07-31T19:00:01.864524-05:00 leaptest CTST: epoch: 1501545601.864 boot: 442612.131
+
+
+
+Leap second flag set artifically by gpsd, and noticed by ntp (leap=01 for SHM(0) and SHM(2) and leap_armed):
+2017-07-31T18:59:22.952281-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T18:59:22.962756-05:00 leaptest ntpstatus.sh: ntpq -c lassoc -c mrv &1 &999 leap,srcadr,stratum
+2017-07-31T18:59:22.964152-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T18:59:23.130829-05:00 leaptest ntpstatus.sh: ind assid status conf reach auth condition last_event cnt
+2017-07-31T18:59:23.131062-05:00 leaptest ntpstatus.sh: ===========================================================
+2017-07-31T18:59:23.131258-05:00 leaptest ntpstatus.sh: 1 18654 943a yes yes none candidate sys_peer 3
+2017-07-31T18:59:23.131451-05:00 leaptest ntpstatus.sh: 2 18655 9649 yes yes none sys.peer leap_armed 4
+2017-07-31T18:59:23.131647-05:00 leaptest ntpstatus.sh: 3 18656 8011 yes no none reject mobilize 1
+2017-07-31T18:59:23.131840-05:00 leaptest ntpstatus.sh: srcadr=SHM(0), leap=01, stratum=0
+2017-07-31T18:59:23.132031-05:00 leaptest ntpstatus.sh: srcadr=SHM(2), leap=01, stratum=0
+2017-07-31T18:59:23.132220-05:00 leaptest ntpstatus.sh: srcadr=LOCAL(0), leap=11, stratum=14
+2017-07-31T18:59:23.138000-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T18:59:23.138206-05:00 leaptest ntpstatus.sh: ntpq -p
+2017-07-31T18:59:23.138404-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T18:59:23.434429-05:00 leaptest ntpstatus.sh: remote refid st t when poll reach delay offset jitter
+2017-07-31T18:59:23.434666-05:00 leaptest ntpstatus.sh: ==============================================================================
+2017-07-31T18:59:23.434863-05:00 leaptest ntpstatus.sh: +SHM(0) .GPS. 0 l 20 64 377 0.000 6.410 1.265
+2017-07-31T18:59:23.435055-05:00 leaptest ntpstatus.sh: *SHM(2) .PPS. 0 l 19 64 377 0.000 0.062 0.008
+2017-07-31T18:59:23.435249-05:00 leaptest ntpstatus.sh: LOCAL(0) .LOCL. 14 l - 32 0 0.000 0.000 0.000
+2017-07-31T19:00:22.459905-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:00:22.460141-05:00 leaptest ntpstatus.sh: ntpq -c lassoc -c mrv &1 &999 leap,srcadr,stratum
+
+
+
+2017-07-31T19:00:22.460343-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:00:22.618627-05:00 leaptest ntpstatus.sh: ind assid status conf reach auth condition last_event cnt
+2017-07-31T19:00:22.618857-05:00 leaptest ntpstatus.sh: ===========================================================
+2017-07-31T19:00:22.619057-05:00 leaptest ntpstatus.sh: 1 18654 943a yes yes none candidate sys_peer 3
+2017-07-31T19:00:22.619252-05:00 leaptest ntpstatus.sh: 2 18655 9649 yes yes none sys.peer leap_armed 4
+2017-07-31T19:00:22.619444-05:00 leaptest ntpstatus.sh: 3 18656 8011 yes no none reject mobilize 1
+2017-07-31T19:00:22.619634-05:00 leaptest ntpstatus.sh: srcadr=SHM(0), leap=01, stratum=0
+2017-07-31T19:00:22.619824-05:00 leaptest ntpstatus.sh: srcadr=SHM(2), leap=01, stratum=0
+2017-07-31T19:00:22.620016-05:00 leaptest ntpstatus.sh: srcadr=LOCAL(0), leap=11, stratum=14
+2017-07-31T19:00:22.628414-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:00:22.628654-05:00 leaptest ntpstatus.sh: ntpq -p
+2017-07-31T19:00:22.628868-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:00:22.922779-05:00 leaptest ntpstatus.sh: remote refid st t when poll reach delay offset jitter
+2017-07-31T19:00:22.924191-05:00 leaptest ntpstatus.sh: ==============================================================================
+2017-07-31T19:00:22.925595-05:00 leaptest ntpstatus.sh: +SHM(0) .GPS. 0 l 16 64 377 0.000 7.369 0.661
+2017-07-31T19:00:22.927000-05:00 leaptest ntpstatus.sh: *SHM(2) .PPS. 0 l 15 64 377 0.000 0.059 0.008
+2017-07-31T19:00:22.928402-05:00 leaptest ntpstatus.sh: LOCAL(0) .LOCL. 14 l - 32 0 0.000 0.000 0.000
+2017-07-31T19:01:22.942937-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:01:22.943171-05:00 leaptest ntpstatus.sh: ntpq -c lassoc -c mrv &1 &999 leap,srcadr,stratum
+2017-07-31T19:01:22.943371-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:01:23.118319-05:00 leaptest ntpstatus.sh: ind assid status conf reach auth condition last_event cnt
+2017-07-31T19:01:23.118551-05:00 leaptest ntpstatus.sh: ===========================================================
+2017-07-31T19:01:23.118750-05:00 leaptest ntpstatus.sh: 1 18654 943a yes yes none candidate sys_peer 3
+2017-07-31T19:01:23.118943-05:00 leaptest ntpstatus.sh: 2 18655 9649 yes yes none sys.peer leap_armed 4
+2017-07-31T19:01:23.119137-05:00 leaptest ntpstatus.sh: 3 18656 8011 yes no none reject mobilize 1
+2017-07-31T19:01:23.119330-05:00 leaptest ntpstatus.sh: srcadr=SHM(0), leap=01, stratum=0
+2017-07-31T19:01:23.119520-05:00 leaptest ntpstatus.sh: srcadr=SHM(2), leap=01, stratum=0
+2017-07-31T19:01:23.119710-05:00 leaptest ntpstatus.sh: srcadr=LOCAL(0), leap=11, stratum=14
+2017-07-31T19:01:23.128565-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:01:23.128809-05:00 leaptest ntpstatus.sh: ntpq -p
+2017-07-31T19:01:23.129026-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:01:23.417707-05:00 leaptest ntpstatus.sh: remote refid st t when poll reach delay offset jitter
+2017-07-31T19:01:23.417942-05:00 leaptest ntpstatus.sh: ==============================================================================
+2017-07-31T19:01:23.418140-05:00 leaptest ntpstatus.sh: +SHM(0) .GPS. 0 l 13 64 377 0.000 1007.48 1000.36
+2017-07-31T19:01:23.418337-05:00 leaptest ntpstatus.sh: *SHM(2) .PPS. 0 l 12 64 377 0.000 1000.05 999.994
+2017-07-31T19:01:23.418529-05:00 leaptest ntpstatus.sh: LOCAL(0) .LOCL. 14 l - 32 0 0.000 0.000 0.000
+2017-07-31T19:02:23.442898-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:02:23.443131-05:00 leaptest ntpstatus.sh: ntpq -c lassoc -c mrv &1 &999 leap,srcadr,stratum
+2017-07-31T19:02:23.443332-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:02:23.617413-05:00 leaptest ntpstatus.sh: ind assid status conf reach auth condition last_event cnt
+
+
+Offset goes to one second, because there was no leap second:
+2017-07-31T19:00:22.618857-05:00 leaptest ntpstatus.sh: ===========================================================
+2017-07-31T19:00:22.619057-05:00 leaptest ntpstatus.sh: 1 18654 943a yes yes none candidate sys_peer 3
+2017-07-31T19:00:22.619252-05:00 leaptest ntpstatus.sh: 2 18655 9649 yes yes none sys.peer leap_armed 4
+2017-07-31T19:00:22.619444-05:00 leaptest ntpstatus.sh: 3 18656 8011 yes no none reject mobilize 1
+2017-07-31T19:00:22.619634-05:00 leaptest ntpstatus.sh: srcadr=SHM(0), leap=01, stratum=0
+2017-07-31T19:00:22.619824-05:00 leaptest ntpstatus.sh: srcadr=SHM(2), leap=01, stratum=0
+2017-07-31T19:00:22.620016-05:00 leaptest ntpstatus.sh: srcadr=LOCAL(0), leap=11, stratum=14
+2017-07-31T19:00:22.628414-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:00:22.628654-05:00 leaptest ntpstatus.sh: ntpq -p
+2017-07-31T19:00:22.628868-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:00:22.922779-05:00 leaptest ntpstatus.sh: remote refid st t when poll reach delay offset jitter
+2017-07-31T19:00:22.924191-05:00 leaptest ntpstatus.sh: ==============================================================================
+2017-07-31T19:00:22.925595-05:00 leaptest ntpstatus.sh: +SHM(0) .GPS. 0 l 16 64 377 0.000 7.369 0.661
+2017-07-31T19:00:22.927000-05:00 leaptest ntpstatus.sh: *SHM(2) .PPS. 0 l 15 64 377 0.000 0.059 0.008
+2017-07-31T19:00:22.928402-05:00 leaptest ntpstatus.sh: LOCAL(0) .LOCL. 14 l - 32 0 0.000 0.000 0.000
+2017-07-31T19:01:22.942937-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:01:22.943171-05:00 leaptest ntpstatus.sh: ntpq -c lassoc -c mrv &1 &999 leap,srcadr,stratum
+2017-07-31T19:01:22.943371-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:01:23.118319-05:00 leaptest ntpstatus.sh: ind assid status conf reach auth condition last_event cnt
+2017-07-31T19:01:23.118551-05:00 leaptest ntpstatus.sh: ===========================================================
+2017-07-31T19:01:23.118750-05:00 leaptest ntpstatus.sh: 1 18654 943a yes yes none candidate sys_peer 3
+2017-07-31T19:01:23.118943-05:00 leaptest ntpstatus.sh: 2 18655 9649 yes yes none sys.peer leap_armed 4
+2017-07-31T19:01:23.119137-05:00 leaptest ntpstatus.sh: 3 18656 8011 yes no none reject mobilize 1
+2017-07-31T19:01:23.119330-05:00 leaptest ntpstatus.sh: srcadr=SHM(0), leap=01, stratum=0
+2017-07-31T19:01:23.119520-05:00 leaptest ntpstatus.sh: srcadr=SHM(2), leap=01, stratum=0
+2017-07-31T19:01:23.119710-05:00 leaptest ntpstatus.sh: srcadr=LOCAL(0), leap=11, stratum=14
+2017-07-31T19:01:23.128565-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:01:23.128809-05:00 leaptest ntpstatus.sh: ntpq -p
+2017-07-31T19:01:23.129026-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:01:23.417707-05:00 leaptest ntpstatus.sh: remote refid st t when poll reach delay offset jitter
+2017-07-31T19:01:23.417942-05:00 leaptest ntpstatus.sh: ==============================================================================
+2017-07-31T19:01:23.418140-05:00 leaptest ntpstatus.sh: +SHM(0) .GPS. 0 l 13 64 377 0.000 1007.48 1000.36
+2017-07-31T19:01:23.418337-05:00 leaptest ntpstatus.sh: *SHM(2) .PPS. 0 l 12 64 377 0.000 1000.05 999.994
+2017-07-31T19:01:23.418529-05:00 leaptest ntpstatus.sh: LOCAL(0) .LOCL. 14 l - 32 0 0.000 0.000 0.000
+2017-07-31T19:02:23.442898-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:02:23.443131-05:00 leaptest ntpstatus.sh: ntpq -c lassoc -c mrv &1 &999 leap,srcadr,stratum
+2017-07-31T19:02:23.443332-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:02:23.617413-05:00 leaptest ntpstatus.sh: ind assid status conf reach auth condition last_event cnt
+
+
+Leap second flag is clear, leap_armed is removed so no leap second on Aug 1, 2017:
+2017-07-31T19:38:42.630432-05:00 leaptest ntpstatus.sh: ntpq -c lassoc -c mrv &1 &999 leap,srcadr,stratum
+2017-07-31T19:38:42.630636-05:00 leaptest ntpstatus.sh: ==========================================================
+2017-07-31T19:38:42.791369-05:00 leaptest ntpstatus.sh: ind assid status conf reach auth condition last_event cnt
+2017-07-31T19:38:42.791605-05:00 leaptest ntpstatus.sh: ===========================================================
+2017-07-31T19:38:42.791803-05:00 leaptest ntpstatus.sh: 1 18654 945a yes yes none candidate sys_peer 5
+2017-07-31T19:38:42.791994-05:00 leaptest ntpstatus.sh: 2 18655 966a yes yes none sys.peer sys_peer 6
+2017-07-31T19:38:42.792189-05:00 leaptest ntpstatus.sh: 3 18656 8033 yes no none reject unreachable 3
+2017-07-31T19:38:42.792379-05:00 leaptest ntpstatus.sh: srcadr=SHM(0), leap=00, stratum=0
+2017-07-31T19:38:42.802875-05:00 leaptest ntpstatus.sh: srcadr=SHM(2), leap=00, stratum=0
+2017-07-31T19:38:42.804254-05:00 leaptest ntpstatus.sh: srcadr=LOCAL(0), leap=00, stratum=14
+
+
diff --git a/recipes-navigation/gpsd/gpsd_3.17.bb b/recipes-navigation/gpsd/gpsd_3.17.bb
new file mode 100644
index 0000000..08566c2
--- /dev/null
+++ b/recipes-navigation/gpsd/gpsd_3.17.bb
@@ -0,0 +1,179 @@
+SUMMARY = "A TCP/IP Daemon simplifying the communication with GPS devices"
+SECTION = "console/network"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d217a23f408e91c94359447735bc1800"
+DEPENDS = "dbus dbus-glib ncurses python libusb1 chrpath-replacement-native pps-tools"
+PROVIDES = "virtual/gpsd"
+PR="m1"
+
+EXTRANATIVEPATH += "chrpath-native"
+
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \
+ file://0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch \
+ file://0004-SConstruct-disable-html-and-man-docs-building-becaus.patch \
+ file://0001-include-sys-ttydefaults.h.patch \
+ file://0006-ubxtimelps.patch \
+ file://gpsd-default \
+ file://gpsd \
+ file://gpsd_ubx_fixed.sh \
+ file://gpsd_ubx_settime.sh \
+ file://gpsd.rules \
+ file://gpsd.service \
+"
+SRC_URI[md5sum] = "e0cfadcf4a65dfbdd2afb11c58f4e4a1"
+SRC_URI[sha256sum] = "68e0dbecfb5831997f8b3d6ba48aed812eb465d8c0089420ab68f9ce4d85e77a"
+
+
+inherit scons update-rc.d python-dir pythonnative systemd
+
+INITSCRIPT_NAME = "gpsd"
+INITSCRIPT_PARAMS = "defaults 10"
+
+SYSTEMD_OESCONS = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false',d)}"
+
+export STAGING_INCDIR
+export STAGING_LIBDIR
+
+# Necessary for python
+export BUILD_SYS
+export HOST_SYS
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)}"
+PACKAGECONFIG[bluez] = "bluez='false',${BLUEZ}"
+PACKAGECONFIG[qt] = "qt='yes',qt='no',qt4-x11-free"
+EXTRA_OESCONS = " \
+ sysroot=${STAGING_DIR_TARGET} \
+ libQgpsmm='false' \
+ debug='true' \
+ strip='false' \
+ chrpath='yes' \
+ systemd='${SYSTEMD_OESCONS}' \
+ libdir='${libdir}' \
+ ublox='yes' \
+ ubloxtimels='yes' \
+ pps='yes' \
+ gpsd_group='gps' \
+ ntpshm='yes' \
+ ${PACKAGECONFIG_CONFARGS} \
+"
+# this cannot be used, because then chrpath is not found and only static lib is built
+# target=${HOST_SYS}
+
+do_compile_prepend() {
+ export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
+ export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
+ export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
+ export LINKFLAGS="${LDFLAGS}"
+}
+
+do_install() {
+ export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}"
+ export PKG_CONFIG="PKG_CONFIG_SYSROOT_DIR=\"${PKG_CONFIG_SYSROOT_DIR}\" pkg-config"
+ export STAGING_PREFIX="${STAGING_DIR_HOST}/${prefix}"
+ export LINKFLAGS="${LDFLAGS}"
+
+ export DESTDIR="${D}"
+ # prefix is used for RPATH and DESTDIR/prefix for instalation
+ ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} install ${EXTRA_OESCONS}|| \
+ bbfatal "scons install execution failed."
+}
+
+do_install_append() {
+ install -d ${D}/${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/gpsd ${D}/${sysconfdir}/init.d/
+ install -d ${D}/${sysconfdir}/default
+ install -m 0644 ${WORKDIR}/gpsd-default ${D}/${sysconfdir}/default/gpsd.default
+ install -d ${D}${sbindir}
+ 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
+
+ #support for udev
+ install -d ${D}/${sysconfdir}/udev/rules.d
+ install -m 0644 ${S}/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
+ install -m 755 ${S}/gps/*.py ${D}/${PYTHON_SITEPACKAGES_DIR}/gps
+
+ #support for systemd
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/${BPN}.service ${D}${systemd_unitdir}/system/${BPN}.service
+ install -m 0644 ${S}/systemd/${BPN}.socket ${D}${systemd_unitdir}/system/${BPN}.socket
+
+ # support for dev (development)
+ mkdir -p -m 0644 ${D}/${includedir}/gps
+ install -m 0644 ${S}/gpsd.h ${D}/${includedir}/gps
+ install -m 0644 ${S}/revision.h ${D}/${includedir}/gps
+ install -m 0644 ${S}/gpsdclient.h ${D}/${includedir}/gps
+ install -m 0644 ${S}/gpsd_config.h ${D}/${includedir}/gps
+ install -m 0644 ${S}/compiler.h ${D}/${includedir}/gps
+ install -m 0644 ${S}/ppsthread.h ${D}/${includedir}/gps
+}
+
+RDEPENDS_${PN}-conf += "bash"
+
+pkg_postinst_${PN}-conf() {
+ update-alternatives --install ${sysconfdir}/default/gpsd gpsd-defaults ${sysconfdir}/default/gpsd.default 10
+}
+
+pkg_postrm_${PN}-conf() {
+ update-alternatives --remove gpsd-defaults ${sysconfdir}/default/gpsd.default
+}
+
+PACKAGES =+ "libgps libgpsd python-pygps-dbg python-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils"
+
+# File does not exist: ${libdir}/libQgpsmm.prl
+FILES_${PN}-dev += "${libdir}/pkgconfdir/libgpsd.pc ${libdir}/pkgconfdir/libgps.pc \
+ ${libdir}/libQgpsmm.prl \
+ ${includedir}/gps.h ${includedir}/libgpsmm.h ${includedir}/gps"
+
+FILES_${PN} += "${sbindir}/gpsd_ubx_fixed ${sbindir}/gpsd_ubx_settime"
+
+FILES_python-pygps-dbg += " ${libdir}/python*/site-packages/gps/.debug"
+
+RDEPENDS_${PN} = "gpsd-gpsctl bash"
+RRECOMMENDS_${PN} = "gpsd-conf gpsd-udev gpsd-machine-conf"
+
+SUMMARY_${PN}-udev = "udev relevant files to use gpsd hotplugging"
+FILES_${PN}-udev = "${base_libdir}/udev ${sysconfdir}/udev/*"
+RDEPENDS_${PN}-udev += "udev gpsd-conf"
+
+SUMMARY_libgpsd = "C service library used for communicating with gpsd"
+FILES_libgpsd = "${libdir}/libgpsd.so.*"
+
+SUMMARY_libgps = "C service library used for communicating with gpsd"
+FILES_libgps = "${libdir}/libgps.so.*"
+
+SUMMARY_${PN}-conf = "gpsd configuration files and init scripts"
+FILES_${PN}-conf = "${sysconfdir}"
+CONFFILES_${PN}-conf = "${sysconfdir}/default/gpsd.default"
+
+SUMMARY_${PN}-gpsctl = "Tool for tweaking GPS modes"
+FILES_${PN}-gpsctl = "${bindir}/gpsctl"
+
+SUMMARY_gps-utils = "Utils used for simulating, monitoring,... a GPS"
+FILES_gps-utils = "${bindir}/*"
+RDEPENDS_gps-utils = "python-pygps"
+
+SUMMARY_python-pygps = "Python bindings to gpsd"
+FILES_python-pygps = "${PYTHON_SITEPACKAGES_DIR}/*"
+RDEPENDS_python-pygps = " \
+ python-core \
+ python-io \
+ python-threading \
+ python-terminal \
+ python-curses \
+ gpsd \
+ python-json"
+
+RPROVIDES_${PN} += "${PN}-systemd"
+RREPLACES_${PN} += "${PN}-systemd"
+RCONFLICTS_${PN} += "${PN}-systemd"
+SYSTEMD_SERVICE_${PN} = "${BPN}.socket ${BPN}ctl@.service"
+
+
+ALTERNATIVE_${PN} = "gpsd-defaults"
+ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
+ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.default"