Update Template for Debian with fixes and improvements

This commit is contained in:
2026-04-17 07:31:56 +02:00
parent 005213ac7f
commit 3b14aa7c2b
6 changed files with 81 additions and 12 deletions

View File

@@ -244,6 +244,10 @@ build {
# Generalise the VM so every clone starts with a clean identity
provisioner "shell" {
inline = [
"set -e",
# Ensure BD ISOs are mounted (fstab handles this at boot via cdrom-detect/eject=false)
"for n in 1 2 3 4 5 6; do mountpoint -q /mnt/bd$n || mount /mnt/bd$n; done",
# Remove SSH host keys — regenerated on first boot of each clone
"sudo rm -f /etc/ssh/ssh_host_*",

View File

@@ -136,7 +136,13 @@ d-i preseed/late_command string \
in-target systemctl enable ssh; \
rm -f /target/var/lib/dhcp/*.leases; \
rm -f /target/etc/resolv.conf; \
in-target ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
in-target ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf; \
in-target mkdir -p /mnt/bd1 /mnt/bd2 /mnt/bd3 /mnt/bd4 /mnt/bd5 /mnt/bd6; \
printf '/dev/sr0\t/mnt/bd1\tiso9660\tro,nofail,x-systemd.device-timeout=30\t0\t0\n/dev/sr1\t/mnt/bd2\tiso9660\tro,nofail,x-systemd.device-timeout=30\t0\t0\n/dev/sr2\t/mnt/bd3\tiso9660\tro,nofail,x-systemd.device-timeout=30\t0\t0\n/dev/sr3\t/mnt/bd4\tiso9660\tro,nofail,x-systemd.device-timeout=30\t0\t0\n/dev/sr4\t/mnt/bd5\tiso9660\tro,nofail,x-systemd.device-timeout=30\t0\t0\n/dev/sr5\t/mnt/bd6\tiso9660\tro,nofail,x-systemd.device-timeout=30\t0\t0\n' >> /target/etc/fstab; \
printf 'deb [trusted=yes] file:///mnt/bd1 trixie main\ndeb [trusted=yes] file:///mnt/bd2 trixie main\ndeb [trusted=yes] file:///mnt/bd3 trixie main\ndeb [trusted=yes] file:///mnt/bd4 trixie main\ndeb [trusted=yes] file:///mnt/bd5 trixie main\ndeb [trusted=yes] file:///mnt/bd6 trixie main\n' > /target/etc/apt/sources.list
# ── Finish ────────────────────────────────────────────────────────────────────
# Do not eject the CDs at end of install — leaves the trays open so the
# installed system boots with "no medium" and fstab mounts fail.
d-i cdrom-detect/eject boolean false
d-i finish-install/reboot_in_progress note