aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorPiotr Dymacz <pepe2k@gmail.com>2017-03-05 19:30:44 +0100
committerPiotr Dymacz <pepe2k@gmail.com>2017-04-02 15:09:09 +0200
commit0cb669b46976a83b94bba26b4a54424e513dafc4 (patch)
tree7a54ce288516bb8382c8b339a31ead79649d4336 /package
parent0dcc4d239da78bc20b091d50c097c386e0e61902 (diff)
downloadupstream-0cb669b46976a83b94bba26b4a54424e513dafc4.tar.gz
upstream-0cb669b46976a83b94bba26b4a54424e513dafc4.tar.bz2
upstream-0cb669b46976a83b94bba26b4a54424e513dafc4.zip
ugps: fix and improve init script
The ugps tool expects device path in last argument. If it's provided before other options, they won't be processed at all. Additionally, make it possible to use absolute path for gps character device in related uci configuration. Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Diffstat (limited to 'package')
-rw-r--r--package/utils/ugps/Makefile2
-rw-r--r--package/utils/ugps/files/ugps.init8
2 files changed, 7 insertions, 3 deletions
diff --git a/package/utils/ugps/Makefile b/package/utils/ugps/Makefile
index 9dc33ca9eb..0243b773e0 100644
--- a/package/utils/ugps/Makefile
+++ b/package/utils/ugps/Makefile
@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ugps
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE_URL=$(LEDE_GIT)/project/ugps.git
PKG_SOURCE_PROTO:=git
diff --git a/package/utils/ugps/files/ugps.init b/package/utils/ugps/files/ugps.init
index a7a88c2258..157043cc28 100644
--- a/package/utils/ugps/files/ugps.init
+++ b/package/utils/ugps/files/ugps.init
@@ -14,11 +14,15 @@ start_service() {
local tty="$(uci get gps.@gps[-1].tty)"
local atime="$(uci get gps.@gps[-1].adjust_time)"
- [ -d "/sys/class/tty/$tty/" ] || return
+ [ -c "$tty" ] || {
+ tty="/dev/$tty"
+ [ -c "$tty" ] || return
+ }
procd_open_instance
- procd_set_param command "$PROG" "/dev/$tty"
+ procd_set_param command "$PROG"
[ "$atime" -eq 0 ] || procd_append_param command "-a"
+ procd_append_param command "$tty"
procd_set_param respawn
procd_close_instance
}