From 236992a05851a4ff2f9dae702f59689edabbcf7e Mon Sep 17 00:00:00 2001 From: felixfelix-bot Date: Mon, 26 Oct 2026 23:39:58 +0100 Subject: [PATCH] fix(packaging): postinst fails loud when nodogsplash was orphan-removed (#715) The guard now ships in both live copies: the module Makefile inline postinst (test/repro lane) and packaging/postinst, plus the feed recipe (separate PR). A zero-byte nodogsplash binary/init refuses the install. --- changelog.d/715-postinst-nds-husk.fixed.md | 12 ++++++++++++ packaging/Makefile | 12 ++++++++++++ packaging/postinst | 12 ++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 changelog.d/715-postinst-nds-husk.fixed.md diff --git a/changelog.d/715-postinst-nds-husk.fixed.md b/changelog.d/715-postinst-nds-husk.fixed.md new file mode 100644 index 000000000..1a6647697 --- /dev/null +++ b/changelog.d/715-postinst-nds-husk.fixed.md @@ -0,0 +1,12 @@ +- **The package postinst now fails loudly when nodogsplash was + orphan-removed.** An aborted opkg transaction can orphan-remove runtime + dependencies and leave zero-byte husks — the nodogsplash binary and init + script, plus libmicrohttpd, curl, socat, jq — while the old postinst's + `restart 2>/dev/null || true` reported success over the dead captive + portal, hiding the damage until every downstream symptom looked like a + product bug. The postinst now refuses to claim success when the + nodogsplash binary or init script is empty and points at the + remediation (`opkg update`, then reinstall nodogsplash and this + package) + ([#715](https://github.com/OpenTollGate/tollgate-module-basic-go/pull/715)). +- The same guard now ships in the feed recipe (FreedomTechFeed/packages), the lane routers actually install. diff --git a/packaging/Makefile b/packaging/Makefile index 9028f6196..5fd67fd4f 100644 --- a/packaging/Makefile +++ b/packaging/Makefile @@ -187,6 +187,18 @@ wifi reload 2>/dev/null || true /etc/init.d/firewall reload 2>/dev/null || true /etc/init.d/dnsmasq restart 2>/dev/null || true /etc/init.d/uhttpd restart 2>/dev/null || true +# Fail loud when the captive portal cannot serve: an aborted opkg +# transaction can orphan-remove runtime deps and leave zero-byte husks +# (nodogsplash binary/init — issue #109, the #93 class). Installing +# "successfully" with a dead portal hides the damage until every +# downstream test fails opaquely. +if [ ! -s /usr/bin/nodogsplash ] || [ ! -s /etc/init.d/nodogsplash ]; then + echo "ERROR: nodogsplash binary or init script is empty (zero bytes) —" >&2 + echo "the install transaction likely aborted and orphan-removed runtime" >&2 + echo "deps. Run 'opkg update' and reinstall nodogsplash, then reinstall" >&2 + echo "this package. Refusing to claim success with a dead portal." >&2 + exit 1 +fi /etc/init.d/nodogsplash restart 2>/dev/null || true if [ -x /etc/init.d/tollgate-wrt ]; then diff --git a/packaging/postinst b/packaging/postinst index 1ad8887d0..a3fac33a0 100755 --- a/packaging/postinst +++ b/packaging/postinst @@ -85,6 +85,18 @@ wifi reload 2>/dev/null || true /etc/init.d/firewall reload 2>/dev/null || true /etc/init.d/dnsmasq restart 2>/dev/null || true /etc/init.d/uhttpd restart 2>/dev/null || true +# Fail loud when the captive portal cannot serve: an aborted opkg +# transaction can orphan-remove runtime deps and leave zero-byte husks +# (nodogsplash binary/init — issue #109, the #93 class). Installing +# "successfully" with a dead portal hides the damage until every +# downstream test fails opaquely. +if [ ! -s /usr/bin/nodogsplash ] || [ ! -s /etc/init.d/nodogsplash ]; then + echo "ERROR: nodogsplash binary or init script is empty (zero bytes) —" >&2 + echo "the install transaction likely aborted and orphan-removed runtime" >&2 + echo "deps. Run 'opkg update' and reinstall nodogsplash, then reinstall" >&2 + echo "this package. Refusing to claim success with a dead portal." >&2 + exit 1 +fi /etc/init.d/nodogsplash restart 2>/dev/null || true if [ -x /etc/init.d/tollgate-wrt ]; then