Update Template for Debian with fixes and improvements
This commit is contained in:
@@ -241,6 +241,38 @@ build {
|
||||
name = "debian-13-gui-template"
|
||||
sources = ["source.vsphere-iso.debian"]
|
||||
|
||||
# Install VS Code + YAML extension and Zeal docsets (requires internet via DHCP)
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"set -e",
|
||||
# BDs are mounted at boot via fstab (installer keeps trays closed via
|
||||
# cdrom-detect/eject=false in preseed).
|
||||
"for n in 1 2 3 4 5 6; do mountpoint -q /mnt/bd$n || mount /mnt/bd$n; done",
|
||||
"sudo apt-get update",
|
||||
# ── VS Code ─────────────────────────────────────────────────────────────
|
||||
# Download the .deb directly — avoids apt-get update hitting stale CD-ROM sources
|
||||
"curl -fL --retry 3 'https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64' -o /tmp/vscode.deb",
|
||||
"file /tmp/vscode.deb | grep -q 'Debian binary package' || { echo 'VS Code download is not a valid .deb'; head -c 500 /tmp/vscode.deb; exit 1; }",
|
||||
"dpkg -i /tmp/vscode.deb || apt-get install -fy",
|
||||
"rm -f /tmp/vscode.deb",
|
||||
"code --install-extension redhat.vscode-yaml --no-sandbox --user-data-dir /root/.vscode --force",
|
||||
|
||||
# Patch the .desktop launcher so VS Code opens without the root sandbox error
|
||||
"sed -i 's|Exec=/usr/share/code/code|Exec=/usr/share/code/code --no-sandbox|g' /usr/share/applications/code.desktop",
|
||||
|
||||
# ── Zeal ────────────────────────────────────────────────────────────────
|
||||
"apt-get install -y zeal",
|
||||
# Qt WebEngine (Chromium) refuses to run as root without disabling sandbox.
|
||||
# Patch the launcher to pass the env var instead of --no-sandbox flag.
|
||||
"sed -i 's|^Exec=zeal|Exec=env QTWEBENGINE_CHROMIUM_FLAGS=--no-sandbox zeal|' /usr/share/applications/org.zealdocs.zeal.desktop",
|
||||
"mkdir -p /root/.local/share/Zeal/Zeal/docsets",
|
||||
"wget -qO /tmp/Python.tgz https://kapeli.com/feeds/Python.tgz && tar -xz -C /root/.local/share/Zeal/Zeal/docsets -f /tmp/Python.tgz && rm /tmp/Python.tgz",
|
||||
"wget -qO /tmp/Ansible.tgz https://kapeli.com/feeds/Ansible.tgz && tar -xz -C /root/.local/share/Zeal/Zeal/docsets -f /tmp/Ansible.tgz && rm /tmp/Ansible.tgz",
|
||||
"wget -qO /tmp/Nginx.tgz https://kapeli.com/feeds/Nginx.tgz && tar -xz -C /root/.local/share/Zeal/Zeal/docsets -f /tmp/Nginx.tgz && rm /tmp/Nginx.tgz",
|
||||
"wget -qO /tmp/Bash.tgz https://kapeli.com/feeds/Bash.tgz && tar -xz -C /root/.local/share/Zeal/Zeal/docsets -f /tmp/Bash.tgz && rm /tmp/Bash.tgz",
|
||||
]
|
||||
}
|
||||
|
||||
# Generalise the VM so every clone starts with a clean identity
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
|
||||
@@ -135,7 +135,13 @@ d-i preseed/late_command string \
|
||||
in-target sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config; \
|
||||
in-target sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config; \
|
||||
in-target systemctl enable ssh; \
|
||||
in-target sh -c 'printf "[SeatDefaults]\nautologin-user=root\nautologin-user-timeout=0\n" >> /etc/lightdm/lightdm.conf'
|
||||
in-target sh -c 'printf "[SeatDefaults]\nautologin-user=root\nautologin-user-timeout=0\n" >> /etc/lightdm/lightdm.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
|
||||
|
||||
Reference in New Issue
Block a user