Files
felhom.eu/scripts/iso/pkg/debian/postinst
T
admin eb1ae37095
gates / gates (push) Successful in 23s
ISO 1.29.0 source + an English download page (R-559 slice 4, source only)
THE IMAGE IS NOT BUILT AND NOT PUBLISHED BY THIS COMMIT. Publishing to
iso.felhom.eu is public and irreversible and its runbook requires a proof
install on BOTH menu entries plus the 16-criterion gate run against the exact
uploaded bytes. That is the operator's step. The download pages therefore still
name 1.28.0 - the image that is actually published - and a new site gate
refuses the two pages naming different files or hashes.

Three texts a person meets before any dashboard become bilingual: Hungarian
block first, byte for byte as before, then English, inside the same frame. The
pairing banner, the bound banner, /etc/issue (and the postinst's byte-coupled
copy), plus an English half on the GRUB entries.

The Hungarian is a GOLDEN, not a grep: test/golden/*.hu.txt were captured from
the script at 183727db9c before one English line existed, and the harness
asserts each banner's first N lines are exactly the golden. Red-proofed by one
changed byte, by an "a" planted in the English block, and by an over-wide line.

R-586, found on the way in: running the harness UNCHANGED at the base commit
failed two R-496 checks. The script paints with `>`, which truncates a FILE but
is a no-op on a console device; ISO 1.28.0's new bound banner (c033b3b) paints
straight after the pairing one and wiped it before the check read it. c033b3b
did not touch the harness, and nobody saw it because the harness is in no gate
and no CI run. Fixed with a FIFO; production code untouched. The harness being
ungated is still open.

The release gate's G16 required every Felhom string to be Hungarian and would
have STOPPED this publication. Operator ruling 1b of 2026-09-17 supersedes that
scope, so G16 is rewritten rather than waived: Hungarian FIRST, pinned by the
golden, each secret named once per language.

letoltes.html changes by four lines only. The English link is not in the nav -
the nav is a shared block site_gates.py pins across every page, and the gate
convicted the first attempt.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
2026-09-18 17:40:29 +02:00

69 lines
4.0 KiB
Bash
Executable File

#!/bin/sh
# felhom-bootstrap postinst.
#
# THIS SCRIPT MUST NOT BE ABLE TO FAIL. It runs under `dpkg --configure -a` INSIDE THE PVE INSTALLER
# CHROOT, in the middle of a customer's installation. A non-zero exit surfaces to that customer as an
# install error — far worse than the bootstrap simply not running. The stub not running costs one
# documented command; a broken install costs the machine.
#
# Four constraints, every one MEASURED in SPIKE-universal-iso-4-2026-07-31.md §3:
# 1. NO `set -e` — it converts any unexpected non-zero into the failure above.
# 2. NO systemctl start / daemon-reload — pid1 in the chroot is `unconfigured.sh` and NO systemd is
# running; those verbs are meaningless there. `enable` is the only one
# that works, and it was measured to work (it wrote the symlink).
# 3. NO network use — the network was up in the probe ONLY because the installer's DHCP
# happened to hold. A box installed with the cable out has none.
# 4. Real work at first boot — the unit does it, where systemd, network and a booted kernel exist.
#
# Every statement below is therefore individually guarded and the script ends `exit 0` unconditionally.
UNIT=felhom-bootstrap.service
LOG=/var/log/felhom-bootstrap-postinst.log
# A positive observable that this ran. SPIKE 2 R-150: a hook that never ran is indistinguishable from
# one that succeeded if you only look for errors.
{
echo "felhom-bootstrap postinst: arg1=${1:-} date=$(date -u -Is 2>/dev/null || echo unknown)"
} >> "$LOG" 2>&1 || true
chmod 0644 "$LOG" 2>/dev/null || true
if [ "${1:-}" = "configure" ]; then
# R-496 (v1.27.1): the console's login text is Felhom's from the FIRST boot. pvebanner.service rewrites
# /etc/issue with the Proxmox admin URL on every boot; on 1.27.0 it ran before felhom-bootstrap could
# mask it (proof install screen 331-s20). Masking is a SYMLINK to /dev/null — a file act, valid in this
# systemd-less chroot, like the wants-symlink fallback below. Both acts guarded; neither can fail the install.
mkdir -p /etc/systemd/system 2>/dev/null || true
if ln -sf /dev/null /etc/systemd/system/pvebanner.service 2>/dev/null; then
echo "felhom-bootstrap postinst: pvebanner.service masked (symlink)" >> "$LOG" 2>&1 || true
fi
# Byte-identical to felhom-bootstrap.sh install_felhom_issue (harness PI pins it). No ő/ű: the login
# screen is painted before the Latin-2 font loads.
if { printf '\n'
printf ' Felhom otthoni szerver\n\n'
printf ' Ezen a gépen most nincs dolgod, és bejelentkezni sem kell.\n'
printf ' A beállításhoz kövesd a Felhomtól kapott útmutatót.\n\n'
printf ' Felhom home server\n\n'
printf ' There is nothing to do on this machine, and no need to log in.\n'
printf ' Follow the guide you received from Felhom.\n\n'
} > /etc/issue.felhom-tmp 2>/dev/null && mv -f /etc/issue.felhom-tmp /etc/issue 2>/dev/null; then
echo "felhom-bootstrap postinst: /etc/issue is the Felhom text" >> "$LOG" 2>&1 || true
else
rm -f /etc/issue.felhom-tmp 2>/dev/null || true
fi
# `enable` only. Guarded, and its outcome recorded either way.
if systemctl enable "$UNIT" >> "$LOG" 2>&1; then
echo "felhom-bootstrap postinst: enabled $UNIT via systemctl" >> "$LOG" 2>&1 || true
else
# Fallback: write the wants-symlink by hand. Also guarded — if this fails too, the unit is
# simply not enabled and the operator runs the documented one-liner. The install still succeeds.
mkdir -p /etc/systemd/system/multi-user.target.wants 2>/dev/null || true
ln -sf "/lib/systemd/system/$UNIT" \
"/etc/systemd/system/multi-user.target.wants/$UNIT" 2>/dev/null || true
echo "felhom-bootstrap postinst: systemctl enable failed; wrote wants-symlink by hand" \
>> "$LOG" 2>&1 || true
fi
fi
exit 0