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