Skip to content
Draft

Gps #1417

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buildroot
3 changes: 0 additions & 3 deletions configs/aarch64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ BR2_PACKAGE_DBUS_CXX=y
BR2_PACKAGE_DBUS_GLIB=y
BR2_PACKAGE_EUDEV_RULES_GEN=y
# BR2_PACKAGE_EUDEV_ENABLE_HWDB is not set
BR2_PACKAGE_GPSD_DEVICES="/dev/gps0"
BR2_PACKAGE_GPSD_MAX_CLIENT_VALUE=2
BR2_PACKAGE_GPSD_MAX_DEV_VALUE=1
BR2_PACKAGE_GPTFDISK=y
BR2_PACKAGE_GPTFDISK_SGDISK=y
BR2_PACKAGE_MDIO_TOOLS=y
Expand Down
4 changes: 0 additions & 4 deletions configs/aarch64_minimal_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ BR2_PACKAGE_DBUS_CXX=y
BR2_PACKAGE_DBUS_GLIB=y
BR2_PACKAGE_EUDEV_RULES_GEN=y
# BR2_PACKAGE_EUDEV_ENABLE_HWDB is not set
BR2_PACKAGE_GPSD_DEVICES="/dev/gps0"
BR2_PACKAGE_GPSD_MAX_CLIENT_VALUE=2
BR2_PACKAGE_GPSD_MAX_DEV_VALUE=1
BR2_PACKAGE_GPTFDISK=y
BR2_PACKAGE_GPTFDISK_SGDISK=y
BR2_PACKAGE_MDIO_TOOLS=y
Expand Down Expand Up @@ -126,7 +123,6 @@ INFIX_DESC="Infix is an immutable, friendly, and secure operating system that tu
INFIX_HOME="https://github.com/kernelkit/infix/"
INFIX_DOC="https://www.kernelkit.org/infix/"
INFIX_SUPPORT="mailto:kernelkit@googlegroups.com"
BR2_PACKAGE_FEATURE_GPS=y
BR2_PACKAGE_CONFD=y
BR2_PACKAGE_NETD=y
BR2_PACKAGE_CONFD_TEST_MODE=y
Expand Down
3 changes: 0 additions & 3 deletions configs/arm_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ BR2_PACKAGE_DBUS_CXX=y
BR2_PACKAGE_DBUS_GLIB=y
BR2_PACKAGE_EUDEV_RULES_GEN=y
# BR2_PACKAGE_EUDEV_ENABLE_HWDB is not set
BR2_PACKAGE_GPSD_DEVICES="/dev/gps0"
BR2_PACKAGE_GPSD_MAX_CLIENT_VALUE=2
BR2_PACKAGE_GPSD_MAX_DEV_VALUE=1
BR2_PACKAGE_GPTFDISK=y
BR2_PACKAGE_GPTFDISK_SGDISK=y
BR2_PACKAGE_MDIO_TOOLS=y
Expand Down
4 changes: 0 additions & 4 deletions configs/arm_minimal_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ BR2_PACKAGE_DBUS_CXX=y
BR2_PACKAGE_DBUS_GLIB=y
BR2_PACKAGE_EUDEV_RULES_GEN=y
# BR2_PACKAGE_EUDEV_ENABLE_HWDB is not set
BR2_PACKAGE_GPSD_DEVICES="/dev/gps0"
BR2_PACKAGE_GPSD_MAX_CLIENT_VALUE=2
BR2_PACKAGE_GPSD_MAX_DEV_VALUE=1
BR2_PACKAGE_GPTFDISK=y
BR2_PACKAGE_GPTFDISK_SGDISK=y
BR2_PACKAGE_MDIO_TOOLS=y
Expand Down Expand Up @@ -126,7 +123,6 @@ INFIX_DESC="Infix is an immutable, friendly, and secure operating system that tu
INFIX_HOME="https://github.com/kernelkit/infix/"
INFIX_DOC="https://www.kernelkit.org/infix/"
INFIX_SUPPORT="mailto:kernelkit@googlegroups.com"
BR2_PACKAGE_FEATURE_GPS=y
BR2_PACKAGE_CONFD=y
BR2_PACKAGE_NETD=y
BR2_PACKAGE_CONFD_TEST_MODE=y
Expand Down
3 changes: 0 additions & 3 deletions configs/riscv64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ BR2_PACKAGE_DBUS_CXX=y
BR2_PACKAGE_DBUS_GLIB=y
BR2_PACKAGE_EUDEV_RULES_GEN=y
# BR2_PACKAGE_EUDEV_ENABLE_HWDB is not set
BR2_PACKAGE_GPSD_DEVICES="/dev/gps0"
BR2_PACKAGE_GPSD_MAX_CLIENT_VALUE=2
BR2_PACKAGE_GPSD_MAX_DEV_VALUE=1
BR2_PACKAGE_GPTFDISK=y
BR2_PACKAGE_GPTFDISK_SGDISK=y
BR2_PACKAGE_MDIO_TOOLS=y
Expand Down
3 changes: 0 additions & 3 deletions configs/x86_64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ BR2_PACKAGE_DBUS_CXX=y
BR2_PACKAGE_DBUS_GLIB=y
BR2_PACKAGE_EUDEV_RULES_GEN=y
# BR2_PACKAGE_EUDEV_ENABLE_HWDB is not set
BR2_PACKAGE_GPSD_DEVICES="/dev/gps0"
BR2_PACKAGE_GPSD_MAX_CLIENT_VALUE=2
BR2_PACKAGE_GPSD_MAX_DEV_VALUE=1
BR2_PACKAGE_GPTFDISK=y
BR2_PACKAGE_GPTFDISK_SGDISK=y
BR2_PACKAGE_RNG_TOOLS=y
Expand Down
4 changes: 0 additions & 4 deletions configs/x86_64_minimal_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ BR2_PACKAGE_DBUS_CXX=y
BR2_PACKAGE_DBUS_GLIB=y
BR2_PACKAGE_EUDEV_RULES_GEN=y
# BR2_PACKAGE_EUDEV_ENABLE_HWDB is not set
BR2_PACKAGE_GPSD_DEVICES="/dev/gps0"
BR2_PACKAGE_GPSD_MAX_CLIENT_VALUE=2
BR2_PACKAGE_GPSD_MAX_DEV_VALUE=1
BR2_PACKAGE_GPTFDISK=y
BR2_PACKAGE_GPTFDISK_SGDISK=y
BR2_PACKAGE_RNG_TOOLS=y
Expand Down Expand Up @@ -125,7 +122,6 @@ INFIX_DESC="Infix is an immutable, friendly, and secure operating system that tu
INFIX_HOME="https://github.com/kernelkit/infix/"
INFIX_DOC="https://www.kernelkit.org/infix/"
INFIX_SUPPORT="mailto:kernelkit@googlegroups.com"
BR2_PACKAGE_FEATURE_GPS=y
BR2_PACKAGE_CONFD=y
BR2_PACKAGE_NETD=y
BR2_PACKAGE_CONFD_TEST_MODE=y
Expand Down
12 changes: 12 additions & 0 deletions package/confd/confd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ CONFD_CONF_OPTS += --enable-wifi
else
CONFD_CONF_OPTS += --disable-wifi
endif
ifeq ($(BR2_PACKAGE_FEATURE_GPS),y)
CONFD_CONF_OPTS += --enable-gps
else
CONFD_CONF_OPTS += --disable-gps
endif
define CONFD_INSTALL_EXTRA
for fn in confd.conf resolvconf.conf; do \
cp $(CONFD_PKGDIR)/$$fn $(FINIT_D)/available/; \
Expand Down Expand Up @@ -80,6 +85,12 @@ define CONFD_INSTALL_YANG_MODULES_WIFI
$(BR2_EXTERNAL_INFIX_PATH)/utils/srload $(@D)/yang/wifi.inc
endef
endif
ifeq ($(BR2_PACKAGE_FEATURE_GPS),y)
define CONFD_INSTALL_YANG_MODULES_GPS
$(COMMON_SYSREPO_ENV) \
$(BR2_EXTERNAL_INFIX_PATH)/utils/srload $(@D)/yang/gps.inc
endef
endif

# PER_PACKAGE_DIR
# Since the last package in the dependency chain that runs sysrepoctl is confd, we need to
Expand Down Expand Up @@ -109,6 +120,7 @@ CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_EXTRA
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_YANG_MODULES
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_YANG_MODULES_CONTAINERS
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_YANG_MODULES_WIFI
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_YANG_MODULES_GPS
CONFD_POST_INSTALL_TARGET_HOOKS += CONFD_INSTALL_IN_ROMFS
CONFD_TARGET_FINALIZE_HOOKS += CONFD_CLEANUP

Expand Down
42 changes: 22 additions & 20 deletions package/feature-gps/25-gpsd.rules
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,61 @@ SUBSYSTEM!="tty", GOTO="gpsd_rules_end"

# Prolific Technology, Inc. PL2303 Serial Port [linux module: pl2303]
# !!! rule disabled in Debian as it matches too many other devices
# ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"
# ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="gps%n"
# ATEN International Co., Ltd UC-232A Serial Port [linux module: pl2303]
ATTRS{idVendor}=="0557", ATTRS{idProduct}=="2008", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"
ATTRS{idVendor}=="0557", ATTRS{idProduct}=="2008", SYMLINK+="gps%n"

# PS-360 OEM (GPS sold with MS Street and Trips 2005) [linux module: pl2303]
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="aaa0", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="aaa0", SYMLINK+="gps%n"

# FTDI 8U232AM / FT232 [linux module: ftdi_sio]
# !!! rule disabled in Debian as it matches too many other devices
# ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"
# ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="gps%n"

# Cypress M8/CY7C64013 (Delorme uses these) [linux module: cypress_m8]
ATTRS{idVendor}=="1163", ATTRS{idProduct}=="0100", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"
ATTRS{idVendor}=="1163", ATTRS{idProduct}=="0100", SYMLINK+="gps%n"

# Cypress M8/CY7C64013 (DeLorme LT-40)
ATTRS{idVendor}=="1163", ATTRS{idProduct}=="0200", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"
ATTRS{idVendor}=="1163", ATTRS{idProduct}=="0200", SYMLINK+="gps%n"

# Garmin International GPSmap, various models (tested with Garmin GPS 18 USB) [linux module: garmin_gps]
ATTRS{idVendor}=="091e", ATTRS{idProduct}=="0003", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"
ATTRS{idVendor}=="091e", ATTRS{idProduct}=="0003", SYMLINK+="gps%n"

# Cygnal Integrated Products, Inc. CP210x Composite Device (Used by Holux m241 and Wintec grays2 wbt-201) [linux module: cp210x]
# !!! rule disabled in Debian as it matches too many other devices
#ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"
#ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="gps%n"

# Cygnal Integrated Products, Inc. [linux module: cp210x]
# !!! rule disabled in Debian as it matches too many other devices
#ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea71", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"
#ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea71", SYMLINK+="gps%n"

# u-blox AG, u-blox 5 (tested with Navilock NL-402U) [linux module: cdc_acm]
ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a5", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"
ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a5", SYMLINK+="gps%n"

# u-blox AG, u-blox 6 (tested with GNSS Evaluation Kit TCXO) [linux module: cdc_acm]
ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a6", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"
ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a6", SYMLINK+="gps%n"

# u-blox AG, u-blox 7 [linux module: cdc_acm]
ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a7", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"
ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a7", SYMLINK+="gps%n"

# u-blox AG, u-blox 8 (tested with GNSS Evaluation Kit EKV-M8N) [linux module: cdc_acm]
ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a8", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"
ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a8", SYMLINK+="gps%n"

# u-blox AG, u-blox 9 (tested with GNSS Evaluation Kit C099-F9P) [linux module: cdc_acm]
ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a9", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"
ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a9", SYMLINK+="gps%n"

# MediaTek (tested with HOLUX M-1200E) [linux module: cdc_acm]
ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="3329", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"
ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="3329", SYMLINK+="gps%n"

# Telit wireless solutions (tested with HE910G) [linux module: cdc_acm]
ATTRS{interface}=="Telit Wireless Module Port", ATTRS{bInterfaceNumber}=="06", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"
ATTRS{interface}=="Telit Wireless Module Port", ATTRS{bInterfaceNumber}=="06", SYMLINK+="gps%n"

# u-blox AG, u-blox 8 (tested with u-blox8 GNSS Mouse Receiver / GR-801) [linux module: cdc_acm]
# u-blox AG, u-blox 8 (tested with u-blox8 GNSS Mouse Receiver / GR-801) [linux module: cdc_acm]
# !!! rule disabled in Debian as it matches too many other devices
#ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="gps%n", RUN+="/usr/lib/udev/gpsd.hotplug"

ACTION=="remove", RUN+="/usr/lib/udev/gpsd.hotplug"
#ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="gps%n"

LABEL="gpsd_rules_end"

# Virtio serial GPS ports (QEMU emulated GPS for testing)
SUBSYSTEM=="virtio-ports", ATTR{name}=="gps0", SYMLINK+="gps0"
SUBSYSTEM=="virtio-ports", ATTR{name}=="gps1", SYMLINK+="gps1"
3 changes: 0 additions & 3 deletions package/feature-gps/Config.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
config BR2_PACKAGE_FEATURE_GPS
bool "Feature GPS/GNSS"
select BR2_PACKAGE_GPSD
select BR2_PACKAGE_GPSD_MAX_CLIENT
select BR2_PACKAGE_GPSD_MAX_DEV
select BR2_PACKAGE_GPSD_SQUELCH
select BR2_PACKAGE_GPSD_ASHTECH
select BR2_PACKAGE_GPSD_EARTHMATE
select BR2_PACKAGE_GPSD_EVERMORE
Expand Down
41 changes: 41 additions & 0 deletions patches/gpsd/0001-Always-log-to-syslog.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From 9ba3bc688c45a0c9e761c6c8bd0be83d6570c9dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= <lazzer@gmail.com>
Date: Fri, 27 Feb 2026 16:58:12 +0100
Subject: [PATCH] Always log to syslog
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Wires

Signed-off-by: Mattias Walström <lazzer@gmail.com>
---
gpsd/libgpsd_core.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/gpsd/libgpsd_core.c b/gpsd/libgpsd_core.c
index 982f822b8..c53c64838 100644
--- a/gpsd/libgpsd_core.c
+++ b/gpsd/libgpsd_core.c
@@ -180,17 +180,8 @@ static void gpsd_vlog(const int errlevel,
// this was crazy expensive, just fix the bad log calls
// gps_visibilize(outbuf, outlen, buf, strlen(buf));

- if (getpid() == getsid(getpid())) {
- // I think this calls syslog() only when daemonized
- syslog(level, "%s", outbuf);
- } else if (NULL != errout->report) {
- // we are a thread, use report()?
- // FIXME: is POSIX syslog() thread safe?
- errout->report(outbuf);
- } else {
- // foreground, use stderr?
- (void)fputs(outbuf, stderr);
- }
+ // always log to syslog, even with -N
+ syslog(level, "%s", outbuf);
gpsd_release_reporting_lock();
#endif // !SQUELCH_ENABLE
}
--
2.43.0

8 changes: 8 additions & 0 deletions src/confd/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ AC_ARG_ENABLE(wifi,
AS_HELP_STRING([--enable-wifi], [Enable support for Wi-Fi]),,[
enable_wifi=no])

AC_ARG_ENABLE(gps,
AS_HELP_STRING([--enable-gps], [Enable support for GPS receivers]),,[
enable_gps=no])

AC_ARG_WITH(login-shell,
AS_HELP_STRING([--with-login-shell=shell], [Login shell for new users, default: /bin/false]),
[login_shell=$withval], [login_shell=yes])
Expand All @@ -60,6 +64,9 @@ AS_IF([test "x$enable_containers" = "xyes"], [
AS_IF([test "x$enable_wifi" = "xyes"], [
AC_DEFINE(HAVE_WIFI, 1, [Built with Wi-Fi support])])

AS_IF([test "x$enable_gps" = "xyes"], [
AC_DEFINE(HAVE_GPS, 1, [Built with GPS receiver support])])

AS_IF([test "x$with_login_shell" != "xno"], [
AS_IF([test "x$login_shell" = "xyes"], [login_shell=/bin/false])
AC_DEFINE_UNQUOTED(LOGIN_SHELL, "$login_shell", [Default: /bin/false])],[
Expand Down Expand Up @@ -131,6 +138,7 @@ cat <<EOF
Optional features:
Container support ....: $enable_containers
Wi-Fi support ........: $enable_wifi
GPS support ..........: $enable_gps
Login shell ..........: $login_shell
Default crypt algo ...: $crypt

Expand Down
75 changes: 71 additions & 4 deletions src/confd/src/hardware.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
#define XPATH_BASE_ "/ietf-hardware:hardware"
#define HOSTAPD_CONF "/etc/hostapd-%s.conf"
#define HOSTAPD_CONF_NEXT HOSTAPD_CONF"+"
#define GPSD_CONF "/etc/finit.d/available/gpsd.conf"
#define GPSD_CONF_NEXT GPSD_CONF"+"
#define GPSD_MAX_DEVICES 4

static int dir_cb(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf)
{
Expand Down Expand Up @@ -593,6 +596,7 @@ int hardware_change(sr_session_ctx_t *session, struct lyd_node *config, struct l
{
struct lyd_node *difs = NULL, *dif = NULL;
int rc = SR_ERR_OK;
int gps_changed = 0;

if (!lydx_find_xpathf(diff, XPATH_BASE_))
return SR_ERR_OK;
Expand Down Expand Up @@ -707,13 +711,76 @@ int hardware_change(sr_session_ctx_t *session, struct lyd_node *config, struct l
wifi_iface_count = 0;
}
} else if (!strcmp(class, "infix-hardware:gps")) {
if (event != SR_EV_DONE)
continue;

systemf("initctl -nbq touch statd");
gps_changed = 1;
}
}

if (gps_changed) {
const char *gps_names[GPSD_MAX_DEVICES] = { NULL };
struct lyd_node *cifs, *comp;
int num_gps = 0;

switch (event) {
case SR_EV_UPDATE:
case SR_EV_ENABLED:
case SR_EV_RPC:
break;

case SR_EV_ABORT:
unlink(GPSD_CONF_NEXT);
break;

case SR_EV_CHANGE:
cifs = lydx_get_descendant(config, "hardware", "component", NULL);
LYX_LIST_FOR_EACH(cifs, comp, "component") {
const char *cls = lydx_get_cattr(comp, "class");

if (strcmp(cls, "infix-hardware:gps"))
continue;
if (num_gps < GPSD_MAX_DEVICES)
gps_names[num_gps] = lydx_get_cattr(comp, "name");
else
return SR_ERR_INTERNAL;
num_gps++;
}
if (num_gps > 0) {
FILE *fp;

fp = fopen(GPSD_CONF_NEXT, "w");
if (!fp) {
ERROR("Could not open " GPSD_CONF_NEXT);
return SR_ERR_INTERNAL;
}
int i;

fprintf(fp, "# Generated by confd, do not edit.\n");
fprintf(fp, "service");
fprintf(fp, " <!");
for (i = 0; i < num_gps && i < GPSD_MAX_DEVICES; i++)
fprintf(fp, "%sdev/%s", i ? "," : "", gps_names[i]);
fprintf(fp, ">");
fprintf(fp, " pid:!/run/gpsd.pid");
fprintf(fp, " env:-/etc/default/gpsd \\\n");
fprintf(fp, "\t[2345] gpsd -n");
for (i = 0; i < num_gps && i < GPSD_MAX_DEVICES; i++)
fprintf(fp, " /dev/%s", gps_names[i]);
fprintf(fp, " -P /run/gpsd.pid -- GPS Daemon\n");
fclose(fp);
}
break;

case SR_EV_DONE:
if (fexist(GPSD_CONF_NEXT)) {
unlink(GPSD_CONF);
rename(GPSD_CONF_NEXT, GPSD_CONF);
systemf("initctl -nbq enable gpsd");
} else {
unlink(GPSD_CONF);
systemf("initctl -nbq disable gpsd");
}
break;
}
}
err:

return rc;
Expand Down
Loading