From 5474693dfd952894dc4857b678d1b135c1032b77 Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Sun, 19 Jan 2020 14:31:13 -0800 Subject: [PATCH 01/20] Add "make install" target with INSTALL and prefix variables --- Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Makefile b/Makefile index 8251ffd..c92144a 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,11 @@ CXXFLAGS:= -std=gnu++17 -Wall -O0 -MMD -MP -fno-omit-frame-pointer -Iext/CLI11 \ # CXXFLAGS += -Wno-delete-non-virtual-dtor +# If unset, create a variable for the path or binary to use as "install" for debuild. +INSTALL ?= install +# If unset, create a variable with the path used by "make install" +prefix ?= /usr/local/ubxtool + ifneq (,$(wildcard ubxsec.c)) EXTRADEP = ubxsec.o else ifneq (,$(wildcard ubxsec.o)) @@ -33,6 +38,19 @@ clean: rm -f *~ *.o *.d ext/*/*.o $(PROGRAMS) navmon.pb.h navmon.pb.cc $(patsubst %.cc,%.o,$(wildcard ext/sgp4/libsgp4/*.cc)) $(H2OPP) $(SIMPLESOCKETS) rm -f ext/fmt-5.2.1/src/format.o +install: $(PROGRAMS) + $(INSTALL) -s -m 755 -D navparse $(DESTDIR)$(prefix)/bin/navparse + $(INSTALL) -s -m 755 -D ubxtool $(DESTDIR)$(prefix)/bin/ubxtool + $(INSTALL) -s -m 755 -D navnexus $(DESTDIR)$(prefix)/bin/navnexus + $(INSTALL) -s -m 755 -D navcat $(DESTDIR)$(prefix)/bin/navcat + $(INSTALL) -s -m 755 -D navrecv $(DESTDIR)$(prefix)/bin/navrecv + $(INSTALL) -s -m 755 -D navdump $(DESTDIR)$(prefix)/bin/navdump + $(INSTALL) -s -m 755 -D navdisplay $(DESTDIR)$(prefix)/bin/navdisplay + $(INSTALL) -s -m 755 -D tlecatch $(DESTDIR)$(prefix)/bin/tlecatch + $(INSTALL) -s -m 755 -D reporter $(DESTDIR)$(prefix)/bin/reporter + $(INSTALL) -s -m 755 -D galmonmon $(DESTDIR)$(prefix)/bin/galmonmon + $(INSTALL) -s -m 755 -D testrunner $(DESTDIR)$(prefix)/bin/testrunner + decrypt: decrypt.o bits.o ext/fmt-5.2.1/src/format.o $(CXX) -std=gnu++17 $^ -o $@ From f0ac720719a60010b3b567f9aead9a872f97f847 Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Sun, 19 Jan 2020 23:07:23 -0800 Subject: [PATCH 02/20] add html directory to install target. Debian-default path hard-coded. --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index c92144a..e8a105a 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,9 @@ install: $(PROGRAMS) $(INSTALL) -s -m 755 -D reporter $(DESTDIR)$(prefix)/bin/reporter $(INSTALL) -s -m 755 -D galmonmon $(DESTDIR)$(prefix)/bin/galmonmon $(INSTALL) -s -m 755 -D testrunner $(DESTDIR)$(prefix)/bin/testrunner + @echo "using cp instead of install because recursive directories of ascii" + mkdir -p $(DESTDIR)$(prefix)/share/package/galmon + cp -a html $(DESTDIR)$(prefix)/share/package/galmon/ decrypt: decrypt.o bits.o ext/fmt-5.2.1/src/format.o $(CXX) -std=gnu++17 $^ -o $@ From 639cf86f240e5c5fbd064b4be8384932f3ba2f33 Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Sun, 19 Jan 2020 23:14:17 -0800 Subject: [PATCH 03/20] git add PACKAGE-DEBIAN.md debian --- Makefile | 6 ++ PACKAGE-DEBIAN.md | 105 +++++++++++++++++++++++++++++++++ debian/README.Debian | 9 +++ debian/changelog | 5 ++ debian/compat | 1 + debian/control | 23 ++++++++ debian/copyright | 45 ++++++++++++++ debian/galmon.default | 28 +++++++++ debian/galmon.postinst | 50 ++++++++++++++++ debian/galmon.substvars | 3 + debian/galmon.ubxtool@.service | 20 +++++++ debian/patches/series | 1 + debian/profile-debuild.sh | 17 ++++++ debian/rules | 13 ++++ debian/source/format | 1 + debian/source/local-options | 2 + debian/watch | 1 + 17 files changed, 330 insertions(+) create mode 100644 PACKAGE-DEBIAN.md create mode 100644 debian/README.Debian create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/galmon.default create mode 100755 debian/galmon.postinst create mode 100644 debian/galmon.substvars create mode 100644 debian/galmon.ubxtool@.service create mode 100644 debian/patches/series create mode 100644 debian/profile-debuild.sh create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/source/local-options create mode 100644 debian/watch diff --git a/Makefile b/Makefile index e8a105a..5f6dab2 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,12 @@ install: $(PROGRAMS) mkdir -p $(DESTDIR)$(prefix)/share/package/galmon cp -a html $(DESTDIR)$(prefix)/share/package/galmon/ +install-debian: + apt-key adv --fetch-keys https://ota.bike/public-package-signing-keys/86E7F51C04FBAAB0.asc + echo "deb https://ota.bike/debian/ buster main" > /etc/apt/sources.list.d/galmon.list + apt-get update && apt-get install -y galmon + cp -i /etc/default/galmon /etc/default/ubxtool-ttyACM0 + decrypt: decrypt.o bits.o ext/fmt-5.2.1/src/format.o $(CXX) -std=gnu++17 $^ -o $@ diff --git a/PACKAGE-DEBIAN.md b/PACKAGE-DEBIAN.md new file mode 100644 index 0000000..6f12b8b --- /dev/null +++ b/PACKAGE-DEBIAN.md @@ -0,0 +1,105 @@ +# .deb Package Overview + +2020-01-20: Initial Commit + +## Important Information + +This section is a step-by-step tutorial. + +### Basic Installation + +Pick either debian (almost everything) or raspbian (special armv6 build for older models) and create the source file. +```sh +echo "deb https://ota.bike/raspbian/ buster main" > /etc/apt/sources.list.d/galmon.list +echo "deb https://ota.bike/debian/ buster main" > /etc/apt/sources.list.d/galmon.list +``` + +Install the file used to ensure the software is verified. +```sh +apt-key adv --fetch-keys https://ota.bike/public-package-signing-keys/86E7F51C04FBAAB0.asc +``` + +Update your package list and install galmon. Then create a configuration file and start the daemon. +```sh +apt-get update && apt-get install -y galmon +cp /etc/default/galmon /etc/default/ubxtool-ttyACM0 +systemctl enable --now ubxtool@ttyACM0 +``` + +Alternate or multiple devices just repeats that: +```sh +cp /etc/default/galmon /etc/default/ubxtool-ttyACM3 +systemctl enable --now ubxtool@ttyACM3 +``` + +### Automatic Updates + +Armbian and Raspbian have apt-daily timers enabled by default. + +Sources should update randomly twice daily but actual package updates +will be applied randomly during a one-hour window depending on computer timezone. + +You can perform an immediate update by hand: +```sh +apt-get update && apt-get -y upgrade galmon && systemctl restart ubxtool@* +``` + +## Reference Information + +You can stop reading here if your insterest was limited to installing a compiled package. + +### One time steps for bootstrapping package build on a fresh git repo + +Run debmake in the source directory. It tries to autocreate 90% of everything you need in the debian folder. +Key files: copyright, changelog, control, and anything else that looks interesting to cat. Once they exist, we're done. +Refer to the manual's [tutorial](https://www.debian.org/doc/manuals/debmake-doc/ch04.en.html) + +### One time steps for creating package-specific files and scripts + +Inside the debian directory are files that begin with galmon, the name of the package as defined in the control file. +- galmon.postinst: this script is run after installation to verify a system account exists. +- galmon.default: this file is installed as /etc/default/galmon +- galmon.ubxtool@.service: this unit file uses %i as a reference to the device for computers with multiple inputs. + +### How to build the package locally + +In short you need to set some variables, refer to profile-debuild.sh in the debian/ directory. +After that, use debuild to install the package. Signing of the end result may fail and creating +GPG key pairs is beyond the scope of this document but just make sure you match the email in the changelog. +```sh +apt-get install -y build-essential devscripts lintian diffutils patch patchutils +git clone $flags galmon.git ; cd galmon +./make-githash.h +# create and source variables in /etc/profile.d/debuild.sh +debuild +dpkg -i ../*.deb +``` + +## Future maintenance considerations + +The githash.h files cannot change after the debuild process has started. +For now, the Makefile used by debuild does not run that script and +the files must be created before starting the debuild process. + +## Real World Build Results in January 2020 + +Avoid arm6 computers. The arm6 used in cheap Raspberry Pi models is an expensive model to support +relative to the much faster arm7 and arm8 computers available. Compiling approaches 90 minutes at O3. + +The arm7 and arm8 both compile in 20 to 30 minutes at -j1 -O3 but the 64 bit arm8 has approximately +double the RAM requirements during compilation. To avoid swapping, increasing compile time 150%, +use hardware with at least 1GB of RAM. The NanoPi Neo2 and NanoPi ZeroPi models with 512MB of RAM +are perfect clients, but the OrangePi PCs with 1GB of RAM and the Allwinner H3 or H5 are +better suited for smooth building. + +These are fast multi-core computers but we turn off parallel compiles because of limited RAM. + +## Why do this? + +Convenience, uniformity, and scalability: +Hand-compiling software is fun, but vendor package management solutions +exist to give us reliable unattended installations for free. + +## Signing key + +GPG Public Key [86E7F51C04FBAAB0](debian/86E7F51C04FBAAB0.asc) diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..1e39077 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,9 @@ +galmon for Debian + +This directory contains files created by debmake and +required by debuild to create Debian packages. + +For further instruction, review the Guide for Debian Maintainers +by Osamu Aoki: https:/www.debian.org/doc/manuals/debmake-doc/ + + -- Patrick Tudor Sun, 19 Jan 2020 22:52:16 +0000 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..ae8406c --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +galmon (0.20191231-1) stable; urgency=low + + * Initial release. + + -- Patrick Tudor Tue, 31 Dec 2019 00:00:00 +0000 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b4de394 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +11 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..d6cd7cb --- /dev/null +++ b/debian/control @@ -0,0 +1,23 @@ +Source: galmon +Section: net +Priority: optional +Maintainer: Patrick Tudor +Build-Depends: debhelper (>=11~) +Standards-Version: 4.1.4 +Homepage: https://github.com/ahupowerdns/galmon/ + +Package: galmon +Architecture: any +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: galmon GNSS Monitoring Project software + 88 + 88 + 88 + ,adPPYb,d8 ,adPPYYba, 88 88,dPYba,,adPYba, ,adPPYba, 8b,dPPYba, + a8" `Y88 "" `Y8 88 88P' "88" "8a a8" "8a 88P' `"8a + 8b 88 ,adPPPPP88 88 88 88 88 8b d8 88 88 + "8a, ,d88 88, ,88 88 88 88 88 "8a, ,a8" 88 88 + `"YbbdP"Y8 `"8bbdP"Y8 88 88 88 88 `"YbbdP"' 88 88 + aa, ,88 + "Y8bbdP" diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..a5f110a --- /dev/null +++ b/debian/copyright @@ -0,0 +1,45 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: galmon +Source: https://github.com/ahupowerdns/galmon + +Files: * +Copyright: AHU Holding BV - bert@hubertnet.nl - https://berthub.eu/ +License: GPL-3 + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + . + On Debian systems, the complete text of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL-3'. + +Files: minicurl.cc + minicurl.hh +Copyright: 2018-2019 powerdns.com bv +License: Expat + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. diff --git a/debian/galmon.default b/debian/galmon.default new file mode 100644 index 0000000..19e77b1 --- /dev/null +++ b/debian/galmon.default @@ -0,0 +1,28 @@ +# Copyright 2020 AHU Holding BV - bert@hubertnet.nl - https://berthub.eu/ +# This package is free software: /usr/share/common-licenses/GPL-3 +# +# INSTRUCTIONS: +# Copy this file from /etc/default/galmon to /etc/default/ubxtool-ttyACM0 +# Please choose your constellations, update the owner and remark, and set your station and destination (ipv6 supported) +# After customization, start the daemon: +# systemctl enable --now ubxtool@ttyACM0 && journalctl -fu ubxtool +# +# +# FOR HELP: +# Review the Operator.md file: https://github.com/ahupowerdns/galmon/blob/master/Operator.md +# Download an IRC client like Textual (Mac) or HexChat (Windows). Join #galileo on the OFTC servers. +# Thank you for contributing, it is nice to see data from your location on the map. +# +# +# DO NOT SET DEVICE HERE. +# The device is set by an argument to service, see above. +# +# uBlox M8-series and Aliexpress Specials support ( (gps AND galileo) AND ( beidou OR glonass) ) with optional SBAS. +# +DAEMON_OPTS="--wait --owner 'OWNER' --remark 'REMARK' --gps --galileo --station 65000 --destination ::1" +#DAEMON_OPTS="--wait --owner 'OWNER' --remark 'REMARK' --gps --galileo --beidou --sbas --station 65000 --destination ::1" +#DAEMON_OPTS="--wait --owner 'OWNER' --remark 'REMARK' --gps --galileo --glonass --sbas --station 65000 --destination ::1" +# +# uBlox ZED F9T and F9P modules support all four major constellations but not SBAS. +# +#DAEMON_OPTS="--wait --owner 'OWNER' --remark 'REMARK' --gps --galileo --beidou --glonass --station 65000 --destination ::1" diff --git a/debian/galmon.postinst b/debian/galmon.postinst new file mode 100755 index 0000000..5ebdd5c --- /dev/null +++ b/debian/galmon.postinst @@ -0,0 +1,50 @@ +#!/bin/sh +# ptudor 20200120 +set -e + +#. /usr/share/debconf/confmodule + +setup_user() { + +if getent group ubxtool > /dev/null ; then + echo "galmon: ubxtool group exists, skipping" +else + echo "galmon: creating ubxtool system group" + addgroup --system ubxtool +fi + +if getent passwd ubxtool > /dev/null ; then + echo "galmon: ubxtool user exists, skipping" +else + echo "galmon: creating ubxtool system user" + adduser --system ubxtool && adduser ubxtool ubxtool + echo "galmon: adding ubxtool user to dialout group" + adduser ubxtool dialout +fi +} + +restart_ubxtool_daemon() { +# I feel like this belongs in rules with dh_installsystemd but do not understand how to add the wildcard. +if systemctl is-active 'ubxtool@*' > /dev/null ; then + echo "galmon: restarting ubxtool." + systemctl daemon-reload && systemctl restart 'ubxtool@*' +else + echo "galmon: ubxtool services are not currently enabled, not restarting." +fi +} + +print_help_text() { + echo "Galmon installation finished. If this is your first time, please:" + echo " 1) Create a ubxtool configuration 2) Enabled the service" + echo "Replace ttyACM0 below with your device listed in /dev" + echo "Example: cp /etc/default/galmon /etc/default/ubxtool-ttyACM0" + echo "Example: vi /etc/default/ubxtool-ttyACM0" + echo "Example: systemctl enable --now ubxtool@ttyACM0" +} + +setup_user +print_help_text +restart_ubxtool_daemon + +#DEBHELPER# + diff --git a/debian/galmon.substvars b/debian/galmon.substvars new file mode 100644 index 0000000..93cbc70 --- /dev/null +++ b/debian/galmon.substvars @@ -0,0 +1,3 @@ +shlibs:Depends=libc6 (>= 2.28), libcurl4 (>= 7.16.2), libgcc1 (>= 1:3.5), libh2o-evloop0.13, libncurses6 (>= 6), libprotobuf17, libssl1.1 (>= 1.1.0), libstdc++6 (>= 6), libtinfo6 (>= 6), zlib1g (>= 1:1.1.4) +misc:Depends= +misc:Pre-Depends= diff --git a/debian/galmon.ubxtool@.service b/debian/galmon.ubxtool@.service new file mode 100644 index 0000000..dc2ec35 --- /dev/null +++ b/debian/galmon.ubxtool@.service @@ -0,0 +1,20 @@ +[Unit] +Description=galmon ubxtool on /dev/%I +After=network.target nss-lookup.target +StartLimitIntervalSec=0 +# require that both the device and configuration exist +ConditionPathExists=/dev/%i +ConditionPathExists=/etc/default/ubxtool-%i + +[Service] +EnvironmentFile=-/etc/default/ubxtool-%i +Type=simple +Restart=always +RestartSec=4 +User=ubxtool +Group=ubxtool +RuntimeDirectory=ubxtool +ExecStart=/usr/bin/ubxtool --port /dev/%i $DAEMON_OPTS + +[Install] +WantedBy=multi-user.target diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..4a97dfa --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +# You must remove unused comment lines for the released package. diff --git a/debian/profile-debuild.sh b/debian/profile-debuild.sh new file mode 100644 index 0000000..fb27ffd --- /dev/null +++ b/debian/profile-debuild.sh @@ -0,0 +1,17 @@ +# This file of environment variables is sourced via /etc/profile.d/debuild.sh +# +# It sets the email and name of the maintainer first. +# Next we disable parallel builds for ram conservation, normally enabled. +# Finally we add hardening to the build. + +DEBEMAIL="debian@ptudor.net" +DEBFULLNAME="Patrick Tudor" + +# "nocheck" here because testrunner runs out of ram on most current arm hardware -pht +# manual: dh_auto_test: If the DEB_BUILD_OPTIONS environment variable contains nocheck, no tests will be performed. +DEB_BUILD_OPTIONS='parallel=1 nocheck' + +# https://wiki.debian.org/Hardening +DEB_BUILD_MAINT_OPTIONS='hardening=+all' + +export DEBEMAIL DEBFULLNAME DEB_BUILD_OPTIONS DEB_BUILD_MAINT_OPTIONS diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..33586a2 --- /dev/null +++ b/debian/rules @@ -0,0 +1,13 @@ +#!/usr/bin/make -f +export DEB_BUILD_MAINT_OPTIONS = hardening=+all +export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + +%: + dh $@ + +override_dh_auto_install: + dh_auto_install -- prefix=/usr + +override_dh_installsystemd: + dh_installsystemd --no-enable --no-start --name=ubxtool@ ubxtool@.service diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/local-options b/debian/source/local-options new file mode 100644 index 0000000..00131ee --- /dev/null +++ b/debian/source/local-options @@ -0,0 +1,2 @@ +#abort-on-upstream-changes +#unapply-patches diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..9e7c0da --- /dev/null +++ b/debian/watch @@ -0,0 +1 @@ +version=3 From 30fbe7f27a7af77eb35bec44313434fb6ef1fbbe Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Sun, 19 Jan 2020 23:16:33 -0800 Subject: [PATCH 04/20] git add 86E7F51C04FBAAB0.asc --- debian/86E7F51C04FBAAB0.asc | 87 +++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 debian/86E7F51C04FBAAB0.asc diff --git a/debian/86E7F51C04FBAAB0.asc b/debian/86E7F51C04FBAAB0.asc new file mode 100644 index 0000000..6e989b3 --- /dev/null +++ b/debian/86E7F51C04FBAAB0.asc @@ -0,0 +1,87 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBF4kzeMBEAClLiZy741lfdoZHvlCbU1k4o9CglhVAPnSqTo7tH0AkdXmp/sG +Sxk20miLlNNaxTYhHLyWIMhLoR3ogAJSoUsbMo4cpC5owdai06Q2nINTGiD1Vwak +MmSStQl/aG01G1u9Ei/FVSr/K6Nd8u+dvUoU6tFSoXtXXaRB5pkyLOaZXq6UTwhw +tI5f+uH2d8kgkoGNWl/jevn7K5AqCWmklfzYFCeogXemcNMdisrm2RzYzay70Qo+ +3qKHzQUN5S6Ne2yYKYN1UacGg+38+zhoSNGy8fB2XfCf8mbW2NnnZBdPEmpu1yos +uvjj/oauZlLgkx/ZzK4PzmWqpe+aEiV7Z8lPO3Y2U/cwkU56aMIFQq2DU4FgQUdn +6J+tLeMPh0sbIfYeOfF5IdFi85PdD4w7C8hmxu7aHl/B/GCnOFYAsSChpf4bpgWB +G1Pne56evHeSNYXQCdE4rjyYGqB/F+EWn/NYcOdKSkOxxE5bL/aU/uqPss5E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KNBqkdNeY9UbTT5bv +WUlHWO5qClsCbRIPwjvsTgZk9qjAWrWbIFivXpPcC8z7NDCFVD5JTBxnkBbcXyvP +W68+BvknNJ2Ilnww2aNNp5zmzGeDLSV28MTtUJXb3w6cXfeOazqcydgHqPO1gyTq +oarCkgPEQlyLey/3qDmsmUskHQ8c81bQKPyGKH4dLiz0qdayRB/GICEIN7O+uk7/ +GdSem/sTXa/k9IpOm2eimdKG0y9C0k2kQb/IAr4cYMpbtN/gsyOr/UhqkzjawRCx +wgHjKnXTNYtKcxuCpBpaPLQPFOE6IjG6Acpkh+LEdIYrY4hZmlaQqE3rXcye94rr +F8ga+2XPNAwVH9zngrk1gZrTZmPkNkTG94kTfFwuAEmFWd6Dyf4IBoMacdpUyLTV +99zduIWc4SOdzEawU0JdD50dkSlHDJsoNamhHe60MELbLOQjN43n3KqKHjIpgZcd +2k2OFa/4uOXYoj3KmWxTKCV+BIcMuQfaaLJLHd1Uar59DExIatvw0aVWuj2M70tu +J7VNNdmxD1RF3zsMFsPTQWY= +=fqVo +-----END PGP PUBLIC KEY BLOCK----- From 685bb96594bc7de3cd09491198a4b9c6f3dfe34b Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Mon, 20 Jan 2020 00:46:57 -0800 Subject: [PATCH 05/20] typo and rm --wait --- PACKAGE-DEBIAN.md | 4 ++-- debian/galmon.default | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PACKAGE-DEBIAN.md b/PACKAGE-DEBIAN.md index 6f12b8b..48aec05 100644 --- a/PACKAGE-DEBIAN.md +++ b/PACKAGE-DEBIAN.md @@ -46,13 +46,13 @@ apt-get update && apt-get -y upgrade galmon && systemctl restart ubxtool@* ## Reference Information -You can stop reading here if your insterest was limited to installing a compiled package. +You can stop reading here if your interest was limited to installing a compiled package. ### One time steps for bootstrapping package build on a fresh git repo Run debmake in the source directory. It tries to autocreate 90% of everything you need in the debian folder. Key files: copyright, changelog, control, and anything else that looks interesting to cat. Once they exist, we're done. -Refer to the manual's [tutorial](https://www.debian.org/doc/manuals/debmake-doc/ch04.en.html) +Refer to the manual's [tutorial](https://www.debian.org/doc/manuals/debmake-doc/ch04.en.html). ### One time steps for creating package-specific files and scripts diff --git a/debian/galmon.default b/debian/galmon.default index 19e77b1..e19c4a5 100644 --- a/debian/galmon.default +++ b/debian/galmon.default @@ -19,10 +19,10 @@ # # uBlox M8-series and Aliexpress Specials support ( (gps AND galileo) AND ( beidou OR glonass) ) with optional SBAS. # -DAEMON_OPTS="--wait --owner 'OWNER' --remark 'REMARK' --gps --galileo --station 65000 --destination ::1" -#DAEMON_OPTS="--wait --owner 'OWNER' --remark 'REMARK' --gps --galileo --beidou --sbas --station 65000 --destination ::1" -#DAEMON_OPTS="--wait --owner 'OWNER' --remark 'REMARK' --gps --galileo --glonass --sbas --station 65000 --destination ::1" +DAEMON_OPTS="--owner 'OWNER' --remark 'REMARK' --gps --galileo --station 65000 --destination ::1" +#DAEMON_OPTS="--owner 'OWNER' --remark 'REMARK' --gps --galileo --beidou --sbas --station 65000 --destination ::1" +#DAEMON_OPTS="--owner 'OWNER' --remark 'REMARK' --gps --galileo --glonass --sbas --station 65000 --destination ::1" # -# uBlox ZED F9T and F9P modules support all four major constellations but not SBAS. +# uBlox ZED F9T and F9P modules support all four major constellations simultaneously but not SBAS. # -#DAEMON_OPTS="--wait --owner 'OWNER' --remark 'REMARK' --gps --galileo --beidou --glonass --station 65000 --destination ::1" +#DAEMON_OPTS="--owner 'OWNER' --remark 'REMARK' --gps --galileo --beidou --glonass --station 65000 --destination ::1" From 06347d1ff39d157344d398d94090d1483542439f Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Mon, 20 Jan 2020 01:20:51 -0800 Subject: [PATCH 06/20] fix hard-coded /share/package as $htdocs --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5f6dab2..9687aba 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,8 @@ CXXFLAGS:= -std=gnu++17 -Wall -O0 -MMD -MP -fno-omit-frame-pointer -Iext/CLI11 \ INSTALL ?= install # If unset, create a variable with the path used by "make install" prefix ?= /usr/local/ubxtool +# If unset, create a variable for a path underneath $prefix that stores html files +htdocs ?= /share/package ifneq (,$(wildcard ubxsec.c)) EXTRADEP = ubxsec.o @@ -51,8 +53,8 @@ install: $(PROGRAMS) $(INSTALL) -s -m 755 -D galmonmon $(DESTDIR)$(prefix)/bin/galmonmon $(INSTALL) -s -m 755 -D testrunner $(DESTDIR)$(prefix)/bin/testrunner @echo "using cp instead of install because recursive directories of ascii" - mkdir -p $(DESTDIR)$(prefix)/share/package/galmon - cp -a html $(DESTDIR)$(prefix)/share/package/galmon/ + mkdir -p $(DESTDIR)$(prefix)$(htdocs)/galmon + cp -a html $(DESTDIR)$(prefix)$(htdocs)/galmon/ install-debian: apt-key adv --fetch-keys https://ota.bike/public-package-signing-keys/86E7F51C04FBAAB0.asc From 5ea69091cd0dbb1658f1515e37bfba4763df7664 Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Mon, 20 Jan 2020 02:15:06 -0800 Subject: [PATCH 07/20] clarify option to not use is named "port" not device --- debian/galmon.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/galmon.default b/debian/galmon.default index e19c4a5..daf33e8 100644 --- a/debian/galmon.default +++ b/debian/galmon.default @@ -14,7 +14,7 @@ # Thank you for contributing, it is nice to see data from your location on the map. # # -# DO NOT SET DEVICE HERE. +# DO NOT SET THE "PORT" OPTION HERE. # The device is set by an argument to service, see above. # # uBlox M8-series and Aliexpress Specials support ( (gps AND galileo) AND ( beidou OR glonass) ) with optional SBAS. From 71a9cad2a4ad63ffc8c94b03cf29b0ba23bd8333 Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Mon, 20 Jan 2020 12:32:40 -0800 Subject: [PATCH 08/20] alphabetical order for list --- Makefile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 9687aba..49828d8 100644 --- a/Makefile +++ b/Makefile @@ -41,17 +41,17 @@ clean: rm -f ext/fmt-5.2.1/src/format.o install: $(PROGRAMS) - $(INSTALL) -s -m 755 -D navparse $(DESTDIR)$(prefix)/bin/navparse - $(INSTALL) -s -m 755 -D ubxtool $(DESTDIR)$(prefix)/bin/ubxtool - $(INSTALL) -s -m 755 -D navnexus $(DESTDIR)$(prefix)/bin/navnexus - $(INSTALL) -s -m 755 -D navcat $(DESTDIR)$(prefix)/bin/navcat - $(INSTALL) -s -m 755 -D navrecv $(DESTDIR)$(prefix)/bin/navrecv - $(INSTALL) -s -m 755 -D navdump $(DESTDIR)$(prefix)/bin/navdump - $(INSTALL) -s -m 755 -D navdisplay $(DESTDIR)$(prefix)/bin/navdisplay - $(INSTALL) -s -m 755 -D tlecatch $(DESTDIR)$(prefix)/bin/tlecatch - $(INSTALL) -s -m 755 -D reporter $(DESTDIR)$(prefix)/bin/reporter $(INSTALL) -s -m 755 -D galmonmon $(DESTDIR)$(prefix)/bin/galmonmon + $(INSTALL) -s -m 755 -D navcat $(DESTDIR)$(prefix)/bin/navcat + $(INSTALL) -s -m 755 -D navdisplay $(DESTDIR)$(prefix)/bin/navdisplay + $(INSTALL) -s -m 755 -D navdump $(DESTDIR)$(prefix)/bin/navdump + $(INSTALL) -s -m 755 -D navnexus $(DESTDIR)$(prefix)/bin/navnexus + $(INSTALL) -s -m 755 -D navparse $(DESTDIR)$(prefix)/bin/navparse + $(INSTALL) -s -m 755 -D navrecv $(DESTDIR)$(prefix)/bin/navrecv + $(INSTALL) -s -m 755 -D reporter $(DESTDIR)$(prefix)/bin/reporter $(INSTALL) -s -m 755 -D testrunner $(DESTDIR)$(prefix)/bin/testrunner + $(INSTALL) -s -m 755 -D tlecatch $(DESTDIR)$(prefix)/bin/tlecatch + $(INSTALL) -s -m 755 -D ubxtool $(DESTDIR)$(prefix)/bin/ubxtool @echo "using cp instead of install because recursive directories of ascii" mkdir -p $(DESTDIR)$(prefix)$(htdocs)/galmon cp -a html $(DESTDIR)$(prefix)$(htdocs)/galmon/ From 7388777f69be9f1204b09c2d7f7193c54a4f46b3 Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Mon, 20 Jan 2020 13:30:24 -0800 Subject: [PATCH 09/20] git add galmon.docs galmon.navnexus.service galmon.navrecv.service galmon.navstar.default --- debian/galmon.docs | 6 ++++++ debian/galmon.navnexus.service | 20 ++++++++++++++++++++ debian/galmon.navrecv.service | 20 ++++++++++++++++++++ debian/galmon.navstar.default | 8 ++++++++ debian/rules | 7 +++++++ 5 files changed, 61 insertions(+) create mode 100644 debian/galmon.docs create mode 100644 debian/galmon.navnexus.service create mode 100644 debian/galmon.navrecv.service create mode 100644 debian/galmon.navstar.default diff --git a/debian/galmon.docs b/debian/galmon.docs new file mode 100644 index 0000000..b78a1aa --- /dev/null +++ b/debian/galmon.docs @@ -0,0 +1,6 @@ +Building.md +influxdb.md +Operator.md +PACKAGE-DEBIAN.md +README.md + diff --git a/debian/galmon.navnexus.service b/debian/galmon.navnexus.service new file mode 100644 index 0000000..8058f3f --- /dev/null +++ b/debian/galmon.navnexus.service @@ -0,0 +1,20 @@ +[Unit] +Description=galmon navnexus (serve recorded data on port 29601) +After=network.target nss-lookup.target +StartLimitIntervalSec=0 +# require that the pre-installed configuration file exists +ConditionPathExists=/etc/default/navstar + +[Service] +# Customize $DAEMON_OPTS_NAVNEXUS in /etc/default/navstar +EnvironmentFile=-/etc/default/navstar +Type=simple +Restart=always +RestartSec=4 +User=ubxtool +Group=ubxtool +RuntimeDirectory=navnexus +ExecStart=/usr/bin/navnexus $DAEMON_OPTS_NAVNEXUS + +[Install] +WantedBy=multi-user.target diff --git a/debian/galmon.navrecv.service b/debian/galmon.navrecv.service new file mode 100644 index 0000000..12c06b5 --- /dev/null +++ b/debian/galmon.navrecv.service @@ -0,0 +1,20 @@ +[Unit] +Description=galmon navrecv (receive data on port 29603) +After=network.target nss-lookup.target +StartLimitIntervalSec=0 +# require that the pre-installed configuration file exists +ConditionPathExists=/etc/default/navstar + +[Service] +# Customize $DAEMON_OPTS_NAVRECV in /etc/default/navstar +EnvironmentFile=-/etc/default/navstar +Type=simple +Restart=always +RestartSec=1 +User=ubxtool +Group=ubxtool +RuntimeDirectory=navrecv +ExecStart=/usr/bin/navrecv $DAEMON_OPTS_NAVRECV + +[Install] +WantedBy=multi-user.target diff --git a/debian/galmon.navstar.default b/debian/galmon.navstar.default new file mode 100644 index 0000000..bbfee29 --- /dev/null +++ b/debian/galmon.navstar.default @@ -0,0 +1,8 @@ +# Copyright 2020 AHU Holding BV - bert@hubertnet.nl - https://berthub.eu/ +# This package is free software: /usr/share/common-licenses/GPL-3 +# +# Here are daemon options used by the navrecv and navnexus services +DAEMON_OPTS_NAVNEXUS="/var/lib/galmon/storage ::" +DAEMON_OPTS_NAVRECV=":: /var/lib/galmon/storage" +# +DAEMON_OPTS_NAVPARSE="[::]:10000 html galileo" diff --git a/debian/rules b/debian/rules index 33586a2..4120a69 100755 --- a/debian/rules +++ b/debian/rules @@ -9,5 +9,12 @@ export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed override_dh_auto_install: dh_auto_install -- prefix=/usr +# override to install /etc/default/navstar alongside /etc/default/galmon +override_dh_installinit: + dh_installinit --name=navstar + dh_installinit + override_dh_installsystemd: + dh_installsystemd --no-enable --no-start --name=navnexus navnexus.service + dh_installsystemd --no-enable --no-start --name=navrecv navrecv.service dh_installsystemd --no-enable --no-start --name=ubxtool@ ubxtool@.service From 64fe1cb0720ac1a3fb4c1d7ac7716e6b5274ea6a Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Mon, 20 Jan 2020 19:03:56 -0800 Subject: [PATCH 10/20] debian control Conflicts: gpsd-clients --- debian/control | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index d6cd7cb..820b320 100644 --- a/debian/control +++ b/debian/control @@ -3,12 +3,13 @@ Section: net Priority: optional Maintainer: Patrick Tudor Build-Depends: debhelper (>=11~) -Standards-Version: 4.1.4 +Standards-Version: 4.3.0 Homepage: https://github.com/ahupowerdns/galmon/ Package: galmon Architecture: any Multi-Arch: foreign +Conflicts: gpsd-clients Depends: ${misc:Depends}, ${shlibs:Depends} Description: galmon GNSS Monitoring Project software 88 From f6c7db73e452ade5373b5f17f655b1891946ce6f Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Fri, 24 Jan 2020 22:24:13 -0800 Subject: [PATCH 11/20] git add galmon.galmon-upgrade.timer galmon.galmon-upgrade.service --- PACKAGE-DEBIAN.md | 7 +++++-- debian/galmon.galmon-upgrade.service | 15 +++++++++++++++ debian/galmon.galmon-upgrade.timer | 10 ++++++++++ debian/galmon.postinst | 4 +++- debian/rules | 2 ++ 5 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 debian/galmon.galmon-upgrade.service create mode 100644 debian/galmon.galmon-upgrade.timer diff --git a/PACKAGE-DEBIAN.md b/PACKAGE-DEBIAN.md index 48aec05..ac93435 100644 --- a/PACKAGE-DEBIAN.md +++ b/PACKAGE-DEBIAN.md @@ -35,9 +35,12 @@ systemctl enable --now ubxtool@ttyACM3 ### Automatic Updates Armbian and Raspbian have apt-daily timers enabled by default. +However, most configurations for unattended installs require customization. -Sources should update randomly twice daily but actual package updates -will be applied randomly during a one-hour window depending on computer timezone. +A simple timer is included that will apply any galmon upgrades every three days: +```sh +systemctl enable --now galmon-upgrade.timer +``` You can perform an immediate update by hand: ```sh diff --git a/debian/galmon.galmon-upgrade.service b/debian/galmon.galmon-upgrade.service new file mode 100644 index 0000000..891ca04 --- /dev/null +++ b/debian/galmon.galmon-upgrade.service @@ -0,0 +1,15 @@ +[Unit] +Description=Upgrade Galmon Software +After=network.target nss-lookup.target +StartLimitIntervalSec=0 +# require that the configuration exists +ConditionPathExists=/etc/default/galmon + +[Service] +Type=simple +Restart=never +ExecPreStart=-apt-get update +ExecStart=-apt-get upgrade -y galmon + +[Install] +WantedBy=multi-user.target diff --git a/debian/galmon.galmon-upgrade.timer b/debian/galmon.galmon-upgrade.timer new file mode 100644 index 0000000..7715a4b --- /dev/null +++ b/debian/galmon.galmon-upgrade.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Update galmon +Documentation=man:ubxtool + +[Timer] +OnBootSec=3min +OnUnitActiveSec=3d + +[Install] +WantedBy=timers.target diff --git a/debian/galmon.postinst b/debian/galmon.postinst index 5ebdd5c..f11d2d5 100755 --- a/debian/galmon.postinst +++ b/debian/galmon.postinst @@ -35,11 +35,13 @@ fi print_help_text() { echo "Galmon installation finished. If this is your first time, please:" - echo " 1) Create a ubxtool configuration 2) Enabled the service" + echo " 1) Create a ubxtool configuration 2) Enable the service" + echo " 3) Enable the timer for automatic upgrades if you want" echo "Replace ttyACM0 below with your device listed in /dev" echo "Example: cp /etc/default/galmon /etc/default/ubxtool-ttyACM0" echo "Example: vi /etc/default/ubxtool-ttyACM0" echo "Example: systemctl enable --now ubxtool@ttyACM0" + echo "Example: systemctl enable --now galmon-upgrade.timer" } setup_user diff --git a/debian/rules b/debian/rules index 4120a69..bbd88e5 100755 --- a/debian/rules +++ b/debian/rules @@ -15,6 +15,8 @@ override_dh_installinit: dh_installinit override_dh_installsystemd: + dh_installsystemd --no-enable --no-start --name=galmon-upgrade galmon-upgrade.service + dh_installsystemd --no-enable --no-start --name=galmon-upgrade galmon-upgrade.timer dh_installsystemd --no-enable --no-start --name=navnexus navnexus.service dh_installsystemd --no-enable --no-start --name=navrecv navrecv.service dh_installsystemd --no-enable --no-start --name=ubxtool@ ubxtool@.service From e4a2e8e1d08d49d53efd82d24102b2340ef3d2ea Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Sat, 25 Jan 2020 10:17:02 -0800 Subject: [PATCH 12/20] dash/plus Exec --- debian/galmon.galmon-upgrade.service | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/galmon.galmon-upgrade.service b/debian/galmon.galmon-upgrade.service index 891ca04..0a61856 100644 --- a/debian/galmon.galmon-upgrade.service +++ b/debian/galmon.galmon-upgrade.service @@ -8,8 +8,8 @@ ConditionPathExists=/etc/default/galmon [Service] Type=simple Restart=never -ExecPreStart=-apt-get update -ExecStart=-apt-get upgrade -y galmon +ExecPreStart=+apt-get update +ExecStart=+apt-get upgrade -y galmon [Install] WantedBy=multi-user.target From 65c003ad0475aa298d8c46bb1bddcb12c9dc2f26 Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Sat, 25 Jan 2020 10:43:06 -0800 Subject: [PATCH 13/20] align markdown --- PACKAGE-DEBIAN.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/PACKAGE-DEBIAN.md b/PACKAGE-DEBIAN.md index ac93435..3b8ae0f 100644 --- a/PACKAGE-DEBIAN.md +++ b/PACKAGE-DEBIAN.md @@ -78,31 +78,32 @@ debuild dpkg -i ../*.deb ``` -## Future maintenance considerations +### Future maintenance considerations The githash.h files cannot change after the debuild process has started. For now, the Makefile used by debuild does not run that script and the files must be created before starting the debuild process. -## Real World Build Results in January 2020 +### Real World Build Results in January 2020 -Avoid arm6 computers. The arm6 used in cheap Raspberry Pi models is an expensive model to support +Avoid compiling on arm6 computers, it is slow. The arm6 used in cheap Raspberry Pi models is an expensive model to support relative to the much faster arm7 and arm8 computers available. Compiling approaches 90 minutes at O3. The arm7 and arm8 both compile in 20 to 30 minutes at -j1 -O3 but the 64 bit arm8 has approximately double the RAM requirements during compilation. To avoid swapping, increasing compile time 150%, use hardware with at least 1GB of RAM. The NanoPi Neo2 and NanoPi ZeroPi models with 512MB of RAM are perfect clients, but the OrangePi PCs with 1GB of RAM and the Allwinner H3 or H5 are -better suited for smooth building. +better suited for smooth building. For comparison, a VM on a low-end AMD Ryzen 3 2200G builds the package at -j1 in about two minutes. These are fast multi-core computers but we turn off parallel compiles because of limited RAM. +Limiting optimizations to -O0 cuts the compile time in half approximately. -## Why do this? +### Why do this? Convenience, uniformity, and scalability: Hand-compiling software is fun, but vendor package management solutions exist to give us reliable unattended installations for free. -## Signing key +### Signing key GPG Public Key [86E7F51C04FBAAB0](debian/86E7F51C04FBAAB0.asc) From eede7d6d2b40f11427000d09b34265e9b36ea4d0 Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Sat, 25 Jan 2020 10:47:49 -0800 Subject: [PATCH 14/20] timer typos --- debian/galmon.galmon-upgrade.service | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/galmon.galmon-upgrade.service b/debian/galmon.galmon-upgrade.service index 0a61856..e7da8ab 100644 --- a/debian/galmon.galmon-upgrade.service +++ b/debian/galmon.galmon-upgrade.service @@ -7,8 +7,8 @@ ConditionPathExists=/etc/default/galmon [Service] Type=simple -Restart=never -ExecPreStart=+apt-get update +Restart=no +ExecStartPre=+apt-get update ExecStart=+apt-get upgrade -y galmon [Install] From 1b6dd6066b639223cd21bb1ee7fbad3533736e7b Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Sat, 25 Jan 2020 16:57:46 -0800 Subject: [PATCH 15/20] help2man in Makefile --- Makefile | 28 +++++++++++++++------------- debian/galmon.default | 1 + debian/galmon.navstar.default | 1 + 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 49828d8..41dee7e 100644 --- a/Makefile +++ b/Makefile @@ -40,18 +40,16 @@ clean: rm -f *~ *.o *.d ext/*/*.o $(PROGRAMS) navmon.pb.h navmon.pb.cc $(patsubst %.cc,%.o,$(wildcard ext/sgp4/libsgp4/*.cc)) $(H2OPP) $(SIMPLESOCKETS) rm -f ext/fmt-5.2.1/src/format.o -install: $(PROGRAMS) - $(INSTALL) -s -m 755 -D galmonmon $(DESTDIR)$(prefix)/bin/galmonmon - $(INSTALL) -s -m 755 -D navcat $(DESTDIR)$(prefix)/bin/navcat - $(INSTALL) -s -m 755 -D navdisplay $(DESTDIR)$(prefix)/bin/navdisplay - $(INSTALL) -s -m 755 -D navdump $(DESTDIR)$(prefix)/bin/navdump - $(INSTALL) -s -m 755 -D navnexus $(DESTDIR)$(prefix)/bin/navnexus - $(INSTALL) -s -m 755 -D navparse $(DESTDIR)$(prefix)/bin/navparse - $(INSTALL) -s -m 755 -D navrecv $(DESTDIR)$(prefix)/bin/navrecv - $(INSTALL) -s -m 755 -D reporter $(DESTDIR)$(prefix)/bin/reporter - $(INSTALL) -s -m 755 -D testrunner $(DESTDIR)$(prefix)/bin/testrunner - $(INSTALL) -s -m 755 -D tlecatch $(DESTDIR)$(prefix)/bin/tlecatch - $(INSTALL) -s -m 755 -D ubxtool $(DESTDIR)$(prefix)/bin/ubxtool +help2man: + $(INSTALL) -m 755 -d $(DESTDIR)$(prefix)/share/man/man1 + HELP2MAN_DESCRIPTION=Open-source GNSS Monitoring Project + $(foreach binaryfile,$(PROGRAMS),help2man -N -n "$(HELP2MAN_DESCRIPTION)" ./$(binaryfile) | gzip > $(DESTDIR)$(prefix)/share/man/man1/$(binaryfile).1.gz;) + @echo until these binaries support --help and --version remove the broken output + rm -f $(DESTDIR)$(prefix)/share/man/man1/testrunner.1.gz + +install: $(PROGRAMS) help2man + $(INSTALL) -m 755 -d $(DESTDIR)$(prefix)/bin + $(foreach binaryfile,$(PROGRAMS),$(INSTALL) -s -m 755 -D ./$(binaryfile) $(DESTDIR)$(prefix)/bin/$(binaryfile);) @echo "using cp instead of install because recursive directories of ascii" mkdir -p $(DESTDIR)$(prefix)$(htdocs)/galmon cp -a html $(DESTDIR)$(prefix)$(htdocs)/galmon/ @@ -60,7 +58,11 @@ install-debian: apt-key adv --fetch-keys https://ota.bike/public-package-signing-keys/86E7F51C04FBAAB0.asc echo "deb https://ota.bike/debian/ buster main" > /etc/apt/sources.list.d/galmon.list apt-get update && apt-get install -y galmon - cp -i /etc/default/galmon /etc/default/ubxtool-ttyACM0 + +install-raspbian: + apt-key adv --fetch-keys https://ota.bike/public-package-signing-keys/86E7F51C04FBAAB0.asc + echo "deb https://ota.bike/raspbian/ buster main" > /etc/apt/sources.list.d/galmon.list + apt-get update && apt-get install -y galmon decrypt: decrypt.o bits.o ext/fmt-5.2.1/src/format.o $(CXX) -std=gnu++17 $^ -o $@ diff --git a/debian/galmon.default b/debian/galmon.default index daf33e8..8163be4 100644 --- a/debian/galmon.default +++ b/debian/galmon.default @@ -1,4 +1,5 @@ # Copyright 2020 AHU Holding BV - bert@hubertnet.nl - https://berthub.eu/ +# https://galmon.eu - https://github.com/ahupowerdns/galmon # This package is free software: /usr/share/common-licenses/GPL-3 # # INSTRUCTIONS: diff --git a/debian/galmon.navstar.default b/debian/galmon.navstar.default index bbfee29..a5cbb0b 100644 --- a/debian/galmon.navstar.default +++ b/debian/galmon.navstar.default @@ -1,4 +1,5 @@ # Copyright 2020 AHU Holding BV - bert@hubertnet.nl - https://berthub.eu/ +# https://galmon.eu - https://github.com/ahupowerdns/galmon # This package is free software: /usr/share/common-licenses/GPL-3 # # Here are daemon options used by the navrecv and navnexus services From 2a3f8cb9ad7cef8bef04f31fd5fc96197171e580 Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Sun, 26 Jan 2020 08:16:35 -0800 Subject: [PATCH 16/20] put the correct apt-get here --- debian/galmon.galmon-upgrade.service | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/galmon.galmon-upgrade.service b/debian/galmon.galmon-upgrade.service index e7da8ab..5a25137 100644 --- a/debian/galmon.galmon-upgrade.service +++ b/debian/galmon.galmon-upgrade.service @@ -8,8 +8,8 @@ ConditionPathExists=/etc/default/galmon [Service] Type=simple Restart=no -ExecStartPre=+apt-get update -ExecStart=+apt-get upgrade -y galmon +ExecStartPre=+apt-get upgrade +ExecStart=+apt-get install -y galmon [Install] WantedBy=multi-user.target From 7c24e82734f74480c12ea79c9f7f73708989a782 Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Sun, 26 Jan 2020 08:22:41 -0800 Subject: [PATCH 17/20] extra --- debian/galmon.galmon-upgrade.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/galmon.galmon-upgrade.service b/debian/galmon.galmon-upgrade.service index 5a25137..3c80a14 100644 --- a/debian/galmon.galmon-upgrade.service +++ b/debian/galmon.galmon-upgrade.service @@ -8,7 +8,7 @@ ConditionPathExists=/etc/default/galmon [Service] Type=simple Restart=no -ExecStartPre=+apt-get upgrade +ExecStartPre=+apt-get update ExecStart=+apt-get install -y galmon [Install] From 63efa54c1581fb28fd1847016c01244cf9304c48 Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Sun, 26 Jan 2020 08:50:33 -0800 Subject: [PATCH 18/20] note about systemctl enable --now galmon-upgrade.timer --- debian/galmon.default | 2 ++ debian/galmon.galmon-upgrade.timer | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/galmon.default b/debian/galmon.default index 8163be4..0a86287 100644 --- a/debian/galmon.default +++ b/debian/galmon.default @@ -7,6 +7,8 @@ # Please choose your constellations, update the owner and remark, and set your station and destination (ipv6 supported) # After customization, start the daemon: # systemctl enable --now ubxtool@ttyACM0 && journalctl -fu ubxtool +# If you want, enable automatic upgrades at boot and every three days following: +# systemctl enable --now galmon-upgrade.timer # # # FOR HELP: diff --git a/debian/galmon.galmon-upgrade.timer b/debian/galmon.galmon-upgrade.timer index 7715a4b..d09da10 100644 --- a/debian/galmon.galmon-upgrade.timer +++ b/debian/galmon.galmon-upgrade.timer @@ -1,6 +1,6 @@ [Unit] Description=Update galmon -Documentation=man:ubxtool +Documentation=https://github.com/ahupowerdns/galmon [Timer] OnBootSec=3min From 8f593b74bc14cd324fe733a8f9ac7c110c434a89 Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Sun, 9 Feb 2020 10:36:16 -0800 Subject: [PATCH 19/20] add new dash-dash flags --- debian/galmon.default | 2 +- debian/galmon.navstar.default | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/galmon.default b/debian/galmon.default index 0a86287..204d226 100644 --- a/debian/galmon.default +++ b/debian/galmon.default @@ -22,7 +22,7 @@ # # uBlox M8-series and Aliexpress Specials support ( (gps AND galileo) AND ( beidou OR glonass) ) with optional SBAS. # -DAEMON_OPTS="--owner 'OWNER' --remark 'REMARK' --gps --galileo --station 65000 --destination ::1" +DAEMON_OPTS="--owner 'OWNER' --remark 'REMARK' --gps --galileo --sbas --station 65000 --destination ::1" #DAEMON_OPTS="--owner 'OWNER' --remark 'REMARK' --gps --galileo --beidou --sbas --station 65000 --destination ::1" #DAEMON_OPTS="--owner 'OWNER' --remark 'REMARK' --gps --galileo --glonass --sbas --station 65000 --destination ::1" # diff --git a/debian/galmon.navstar.default b/debian/galmon.navstar.default index a5cbb0b..d593292 100644 --- a/debian/galmon.navstar.default +++ b/debian/galmon.navstar.default @@ -3,7 +3,7 @@ # This package is free software: /usr/share/common-licenses/GPL-3 # # Here are daemon options used by the navrecv and navnexus services -DAEMON_OPTS_NAVNEXUS="/var/lib/galmon/storage ::" -DAEMON_OPTS_NAVRECV=":: /var/lib/galmon/storage" +DAEMON_OPTS_NAVNEXUS="--storage /var/lib/galmon/storage --bind ::1" +DAEMON_OPTS_NAVRECV="--bind ::1 --storage /var/lib/galmon/storage" # -DAEMON_OPTS_NAVPARSE="[::]:10000 html galileo" +DAEMON_OPTS_NAVPARSE="--bind [::1]:10000 --html /usr/share/package/galmon/html --influxdb galileo" From 9ebf9d0dd8f7ab24c649a4148b149eda1db8723e Mon Sep 17 00:00:00 2001 From: Patrick Tudor Date: Sun, 9 Feb 2020 11:03:36 -0800 Subject: [PATCH 20/20] try out "download-debian-package" --- Makefile | 4 ++-- PACKAGE-DEBIAN.md | 7 +++++-- debian/galmon.default | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 41dee7e..acfd0dc 100644 --- a/Makefile +++ b/Makefile @@ -54,12 +54,12 @@ install: $(PROGRAMS) help2man mkdir -p $(DESTDIR)$(prefix)$(htdocs)/galmon cp -a html $(DESTDIR)$(prefix)$(htdocs)/galmon/ -install-debian: +download-debian-package: apt-key adv --fetch-keys https://ota.bike/public-package-signing-keys/86E7F51C04FBAAB0.asc echo "deb https://ota.bike/debian/ buster main" > /etc/apt/sources.list.d/galmon.list apt-get update && apt-get install -y galmon -install-raspbian: +download-raspbian-package: apt-key adv --fetch-keys https://ota.bike/public-package-signing-keys/86E7F51C04FBAAB0.asc echo "deb https://ota.bike/raspbian/ buster main" > /etc/apt/sources.list.d/galmon.list apt-get update && apt-get install -y galmon diff --git a/PACKAGE-DEBIAN.md b/PACKAGE-DEBIAN.md index 3b8ae0f..2239fcd 100644 --- a/PACKAGE-DEBIAN.md +++ b/PACKAGE-DEBIAN.md @@ -20,17 +20,20 @@ apt-key adv --fetch-keys https://ota.bike/public-package-signing-keys/86E7F51C04 ``` Update your package list and install galmon. Then create a configuration file and start the daemon. +If you have a typical device using the onboard USB at /dev/ttyACM0, drop the directory element +and refer to ttyACM0 in both the default variable file and the unit name. ```sh apt-get update && apt-get install -y galmon cp /etc/default/galmon /etc/default/ubxtool-ttyACM0 systemctl enable --now ubxtool@ttyACM0 ``` -Alternate or multiple devices just repeats that: +Alternate or multiple devices just repeats that, updating the device name: ```sh cp /etc/default/galmon /etc/default/ubxtool-ttyACM3 systemctl enable --now ubxtool@ttyACM3 ``` +Both the ubxtool-ttyXYZn file and /dev/ttyXYZn device must exist for the unit file conditions to pass. ### Automatic Updates @@ -44,7 +47,7 @@ systemctl enable --now galmon-upgrade.timer You can perform an immediate update by hand: ```sh -apt-get update && apt-get -y upgrade galmon && systemctl restart ubxtool@* +apt-get update && apt-get -y install galmon && systemctl restart ubxtool@* ``` ## Reference Information diff --git a/debian/galmon.default b/debian/galmon.default index 204d226..82ae9b1 100644 --- a/debian/galmon.default +++ b/debian/galmon.default @@ -3,13 +3,14 @@ # This package is free software: /usr/share/common-licenses/GPL-3 # # INSTRUCTIONS: +# (Pre-condition: "dmesg | tail" reports your GPS device appears on /dev/ttyACM0.) # Copy this file from /etc/default/galmon to /etc/default/ubxtool-ttyACM0 # Please choose your constellations, update the owner and remark, and set your station and destination (ipv6 supported) # After customization, start the daemon: # systemctl enable --now ubxtool@ttyACM0 && journalctl -fu ubxtool # If you want, enable automatic upgrades at boot and every three days following: # systemctl enable --now galmon-upgrade.timer -# +# If you have several devices, enable multiple services with their unique device names. # # FOR HELP: # Review the Operator.md file: https://github.com/ahupowerdns/galmon/blob/master/Operator.md