From 7ed87b82fb556395d5e905c0162c1d6b2cfd2c63 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 20 Jan 2026 18:34:04 -0600 Subject: Fix mDNS, hostname, and build safety - Add safe_cleanup_work_dir() to prevent /dev corruption on interrupted builds - Fix shadow file: use sed to modify root entry instead of replacing file - Add /etc/hosts and /etc/nsswitch.conf for proper hostname/mDNS resolution - Add inetutils package for hostname command - Add sanity tests for password, avahi, mdns, and hostname --- scripts/sanity-test.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/sanity-test.sh b/scripts/sanity-test.sh index 0b338a3..eeb4d29 100755 --- a/scripts/sanity-test.sh +++ b/scripts/sanity-test.sh @@ -260,12 +260,21 @@ run_sanity_tests() { # Test 6: SSH is working (implicit - we're connected) pass "SSH connectivity" + # Test 6b: Root password is set (not empty in shadow file) + run_test "Root password is set" \ + "grep '^root:' /etc/shadow | cut -d: -f2 | grep -q '.' && echo 'password set'" \ + "password set" + # Test 7: Network manager available run_test "NetworkManager available" \ "systemctl is-enabled NetworkManager 2>/dev/null || echo 'available'" \ "" # Test 8: Avahi mDNS for network discovery + run_test "Avahi package installed" \ + "command -v avahi-daemon && echo 'found'" \ + "found" + run_test "Avahi daemon enabled" \ "systemctl is-enabled avahi-daemon" \ "enabled" @@ -274,7 +283,16 @@ run_sanity_tests() { "systemctl is-active avahi-daemon" \ "active" - # Test 9: Kernel version (LTS) + run_test "nss-mdns configured" \ + "grep -q 'mdns' /etc/nsswitch.conf && echo 'configured'" \ + "configured" + + # Test 9: Hostname set to archzfs + run_test "Hostname is archzfs" \ + "cat /etc/hostname" \ + "archzfs" + + # Test 10: Kernel version (LTS) run_test "Running LTS kernel" \ "uname -r" \ "lts" -- cgit v1.2.3