···160160# after running, so it deleted the served directory out from under a still
161161# running dnsmasq and then went back to waiting. Only symlinks live here, so
162162# leaving them behind between runs costs nothing.
163163-ROOT="${XDG_RUNTIME_DIR:-/tmp}/${PROG}/${MACHINE}"
163163+#
164164+# Not under XDG_RUNTIME_DIR: dnsmasq drops privileges after startup, and
165165+# /run/user/$UID is mode 0700, so the unprivileged dnsmasq cannot traverse it
166166+# ("TFTP directory ... inaccessible: Permission denied", then it refuses to
167167+# start). Everything served is a symlink into the world-readable nix store,
168168+# so a world-traversable directory costs nothing.
169169+ROOT="/var/tmp/${PROG}/${MACHINE}"
164170rm -rf "$ROOT"
165171mkdir -p "$ROOT"
166166-chmod 755 "$ROOT"
172172+chmod 755 "/var/tmp/${PROG}" "$ROOT"
167173168174ln -s "${KERNEL}/${KERNEL_FILE}" "$ROOT/bzImage"
169175ln -s "${INITRD}/initrd" "$ROOT/initrd"