From 8423ad71c0ef7825421fe10b628a927bd27aa4ff Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Sun, 17 Aug 2025 01:42:43 -0500 Subject: [PATCH 01/25] End of life for Ubuntu 20.04 Fixes #8 --- distros/ubuntu/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distros/ubuntu/default.nix b/distros/ubuntu/default.nix index f134b5e..0ade760 100644 --- a/distros/ubuntu/default.nix +++ b/distros/ubuntu/default.nix @@ -7,7 +7,7 @@ { version = "20.04"; arch = "amd64"; - eol = false; + eol = true; } { version = "22.04"; From e83208601d94396da170cbc99260682fc8f4c8c8 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Sun, 17 Aug 2025 01:43:27 -0500 Subject: [PATCH 02/25] Update path for Debian 12 ISO --- distros/debian/12/amd64.pkrvars.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distros/debian/12/amd64.pkrvars.hcl b/distros/debian/12/amd64.pkrvars.hcl index 61f00ce..2e175e2 100644 --- a/distros/debian/12/amd64.pkrvars.hcl +++ b/distros/debian/12/amd64.pkrvars.hcl @@ -1,7 +1,7 @@ distro = "debian" version = "12" iso = { - url = "https://cdimage.debian.org/cdimage/release/12.11.0/arm64/iso-cd/debian-12.11.0-arm64-netinst.iso" + url = "https://cdimage.debian.org/cdimage/archive/12.11.0/arm64/iso-cd/debian-12.11.0-arm64-netinst.iso" checksum = "5c050c495770ee9b076261cb8025a99a4866a15a4e3cdab2f59c49e8f69fb0ee" } boot_command = [ From 21c04fe7bc0fedcdd9fd4271209f1acd85325d35 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Sun, 17 Aug 2025 02:04:43 -0500 Subject: [PATCH 03/25] Alpine updates New patch releases for 3.19, 3.20, 3.21 New release 3.22 --- distros/alpine/3.19.0/amd64.pkrvars.hcl | 4 +- distros/alpine/3.20/amd64.pkrvars.hcl | 4 +- distros/alpine/3.21/amd64.pkrvars.hcl | 4 +- distros/alpine/3.22/amd64.pkrvars.hcl | 19 ++++++++ distros/alpine/3.22/finalize.sh | 2 + distros/alpine/3.22/http/answers.cfg.sh | 61 +++++++++++++++++++++++++ distros/alpine/3.22/http/in-chroot.sh | 57 +++++++++++++++++++++++ distros/alpine/3.22/qemu.sh | 2 + distros/alpine/3.22/virtualbox.sh | 2 + distros/alpine/3.22/vmware.sh | 4 ++ distros/alpine/default.nix | 5 ++ 11 files changed, 158 insertions(+), 6 deletions(-) create mode 100644 distros/alpine/3.22/amd64.pkrvars.hcl create mode 100644 distros/alpine/3.22/finalize.sh create mode 100644 distros/alpine/3.22/http/answers.cfg.sh create mode 100644 distros/alpine/3.22/http/in-chroot.sh create mode 100644 distros/alpine/3.22/qemu.sh create mode 100644 distros/alpine/3.22/virtualbox.sh create mode 100644 distros/alpine/3.22/vmware.sh diff --git a/distros/alpine/3.19.0/amd64.pkrvars.hcl b/distros/alpine/3.19.0/amd64.pkrvars.hcl index 95b6e41..6a7703b 100644 --- a/distros/alpine/3.19.0/amd64.pkrvars.hcl +++ b/distros/alpine/3.19.0/amd64.pkrvars.hcl @@ -1,8 +1,8 @@ distro = "alpine" version = "3.19.0" iso = { - url = "https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/x86_64/alpine-extended-3.19.7-x86_64.iso" - checksum = "cbcb657e968ed88941fdbade9f26dcb241cb5ee3da496150dc584d7159055ac5" + url = "https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/x86_64/alpine-extended-3.19.8-x86_64.iso" + checksum = "27bae668861c06669505198a6437b7ee16ad4465e3a5a1103a97b4e58796f545" } boot_command = [ "root", diff --git a/distros/alpine/3.20/amd64.pkrvars.hcl b/distros/alpine/3.20/amd64.pkrvars.hcl index 0eabcbb..86d0d4a 100644 --- a/distros/alpine/3.20/amd64.pkrvars.hcl +++ b/distros/alpine/3.20/amd64.pkrvars.hcl @@ -1,8 +1,8 @@ distro = "alpine" version = "3.20" iso = { - url = "https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/x86_64/alpine-extended-3.20.6-x86_64.iso" - checksum = "171974b08932fa437acda9728ad5d600a04f50538156f03358ecf55efbecfff1" + url = "https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/x86_64/alpine-extended-3.20.7-x86_64.iso" + checksum = "92d8a906c6906692349b558de3f41d1a1d3ade85936a0ee6d90fd057249ecac8" } boot_command = [ "root", diff --git a/distros/alpine/3.21/amd64.pkrvars.hcl b/distros/alpine/3.21/amd64.pkrvars.hcl index 72ad5c7..45c7b72 100644 --- a/distros/alpine/3.21/amd64.pkrvars.hcl +++ b/distros/alpine/3.21/amd64.pkrvars.hcl @@ -1,8 +1,8 @@ distro = "alpine" version = "3.21" iso = { - url = "https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/x86_64/alpine-extended-3.21.3-x86_64.iso" - checksum = "3e0ab3b6b4409bd0012be59970f08522e7fb049b6634242875e30add290f5444" + url = "https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/x86_64/alpine-extended-3.21.4-x86_64.iso" + checksum = "09a1de61697738e51a4caf88dab4d18f7fdab4ab16ed3dc1a929a010e569d718" } boot_command = [ "root", diff --git a/distros/alpine/3.22/amd64.pkrvars.hcl b/distros/alpine/3.22/amd64.pkrvars.hcl new file mode 100644 index 0000000..0ebb316 --- /dev/null +++ b/distros/alpine/3.22/amd64.pkrvars.hcl @@ -0,0 +1,19 @@ +distro = "alpine" +version = "3.22" +iso = { + url = "https://dl-cdn.alpinelinux.org/alpine/v3.22/releases/x86_64/alpine-extended-3.22.1-x86_64.iso" + checksum = "223b3bdb3102e39f478a865f6452b587cc1f679f6f78e8866c00e1f1edc52671" +} +boot_command = [ + "root", + "echo 'iface eth0 inet dhcp' > /etc/network/interfaces", + "ifup eth0", + "wget -O answers.cfg.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/answers.cfg.sh", + "", + "wget -O in-chroot.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/in-chroot.sh", + "", + "/bin/ash ./answers.cfg.sh 2>&1 | tee install.log", +] +http_directory = "distros/alpine/3.22/http/" +boot_wait = "20s" +shutdown_command = "sudo poweroff" diff --git a/distros/alpine/3.22/finalize.sh b/distros/alpine/3.22/finalize.sh new file mode 100644 index 0000000..eaaa81a --- /dev/null +++ b/distros/alpine/3.22/finalize.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +set -ex diff --git a/distros/alpine/3.22/http/answers.cfg.sh b/distros/alpine/3.22/http/answers.cfg.sh new file mode 100644 index 0000000..f743a28 --- /dev/null +++ b/distros/alpine/3.22/http/answers.cfg.sh @@ -0,0 +1,61 @@ +#!/bin/ash +# shellcheck shell=dash + +set -ex -o pipefail + +if [ -e /dev/vda ]; then + disk="/dev/vda" +else + disk="/dev/sda" +fi + +cat << EOF > answers.cfg +KEYMAPOPTS="us us" + +HOSTNAMEOPTS="vagrant" + +DEVDOPTS=mdev + +INTERFACESOPTS="auto lo +iface lo inet loopback + +auto eth0 +iface eth0 inet dhcp +hostname vagrant.local" + +TIMEZONEOPTS="UTC" + +PROXYOPTS="none" + +# Add first CDN mirror +APKREPOSOPTS="-1" + +USEROPTS="-a -u -g audio,video,netdev vagrant" + +SSHDOPTS=openssh + +NTPOPTS=none + +DISKOPTS="-m sys ${disk}" + +LBUOPTS=none + +APKCACHEOPTS=none +EOF + +setup-alpine -e -f answers.cfg -q +yes y | setup-disk -m sys "${disk}" || true +# It isn't setting up disk in initial run, but +# it also can't setup disk before the rest of it +# is setup properly. There might be a better workaround +# but this is what I'm choosing to do +setup-alpine -e -f answers.cfg -q + +mount "${disk}3" /mnt +mount "${disk}1" /mnt/boot + +mv in-chroot.sh /mnt +for fs in proc sys dev sys/firmware/efi/efivars; do mount -o bind /${fs} /mnt/${fs}; done +chroot /mnt /bin/ash /in-chroot.sh +rm /mnt/in-chroot.sh +reboot diff --git a/distros/alpine/3.22/http/in-chroot.sh b/distros/alpine/3.22/http/in-chroot.sh new file mode 100644 index 0000000..d127e9c --- /dev/null +++ b/distros/alpine/3.22/http/in-chroot.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env sh +set -ex + +# Enables packages like "sudo" +sed -i 's/#\(.*\/community\)/\1/' /etc/apk/repositories + +# Install bare minimal packages +apk add curl efibootmgr openssh sudo virt-what + +rc-update add sshd default + +# Configure systems +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant-nopasswd +echo 'Defaults !requiretty' >> /etc/sudoers +sed -i 's/.*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config +cat > /etc/ssh/sshd_config.d/10-vagrant-insecure-rsa-key.conf < Date: Sun, 17 Aug 2025 02:05:24 -0500 Subject: [PATCH 04/25] Debian 13 added to releases --- distros/debian/13/amd64.pkrvars.hcl | 22 ++++++++++ distros/debian/13/finalize.sh | 22 ++++++++++ distros/debian/13/http/preseed.cfg | 65 +++++++++++++++++++++++++++++ distros/debian/13/qemu.sh | 6 +++ distros/debian/13/virtualbox.sh | 10 +++++ distros/debian/13/vmware.sh | 4 ++ distros/debian/default.nix | 5 +++ 7 files changed, 134 insertions(+) create mode 100644 distros/debian/13/amd64.pkrvars.hcl create mode 100644 distros/debian/13/finalize.sh create mode 100644 distros/debian/13/http/preseed.cfg create mode 100644 distros/debian/13/qemu.sh create mode 100644 distros/debian/13/virtualbox.sh create mode 100644 distros/debian/13/vmware.sh diff --git a/distros/debian/13/amd64.pkrvars.hcl b/distros/debian/13/amd64.pkrvars.hcl new file mode 100644 index 0000000..b71f285 --- /dev/null +++ b/distros/debian/13/amd64.pkrvars.hcl @@ -0,0 +1,22 @@ +distro = "debian" +version = "13" +iso = { + url = "https://cdimage.debian.org/cdimage/release/13.0.0/amd64/iso-cd/debian-13.0.0-amd64-netinst.iso" + checksum = "e363cae0f1f22ed73363d0bde50b4ca582cb2816185cf6eac28e93d9bb9e1504" +} +boot_command = [ + "e", + "auto ", + "preseed/url=http://{{.HTTPIP}}:{{ .HTTPPort }}/preseed.cfg ", + "ipv6.disable=1 ", + "debian-installer=en_US locale=en_US kbd-chooser/method=us ", + "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", + "keyboard-configuration/variant=USA console-setup/ask_detect=false ", + "keyboard-configuration/xkb-keymap=us ", + "debconf/frontend=noninteractive ", + "hostname={{.Name}} ", + "domain=vagrant ", + "" +] +http_directory = "distros/debian/13/http/" +vbox_os_type = "Debian13_64" diff --git a/distros/debian/13/finalize.sh b/distros/debian/13/finalize.sh new file mode 100644 index 0000000..9da84aa --- /dev/null +++ b/distros/debian/13/finalize.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -ex + +# 5 minute timeout for the package lock to arrive +apt-get -o DPkg::Lock::Timeout=600 autoremove -y + +# Configure sshd to be faster +cat << EOF > /etc/ssh/sshd_config.d/00-vagrant_accept_pubkey.conf +UseDNS no +PubkeyAcceptedKeyTypes +ssh-rsa +EOF + +# Clean up after ourselves +apt-get clean + +virt="$(systemd-detect-virt)" +if [ "${virt}" == "microsoft" ]; then + apt-get install -y hyperv-daemons + systemctl enable hv-fcopy-daemon + systemctl enable hv-kvp-daemon + systemctl enable hv-vss-daemon +fi diff --git a/distros/debian/13/http/preseed.cfg b/distros/debian/13/http/preseed.cfg new file mode 100644 index 0000000..f5d69e1 --- /dev/null +++ b/distros/debian/13/http/preseed.cfg @@ -0,0 +1,65 @@ +d-i debian-installer/locale string en_US +d-i keyboard-configuration/xkb-keymap select us + +d-i passwd/root-password-again password vagrant +d-i passwd/root-password password vagrant +d-i passwd/user-fullname string vagrant +d-i passwd/username string vagrant +d-i passwd/user-password password vagrant +d-i passwd/user-password-again password vagrant + +d-i time/zone string UTC + +d-i partman-auto/method string regular +d-i partman-auto/expert_recipe string \ + scheme :: \ + 512 50 512 fat32 \ + $primary{ } \ + $bootable{ } \ + method{ efi } \ + format{ } \ + mountpoint{ /boot/efi } . \ + 200% 0 200% linux-swap \ + $primary{ } \ + method{ swap } \ + format{ } . \ + 1 0 -1 ext4 \ + $primary{ } \ + method{ format } \ + format{ } \ + use_filesystem{ } \ + filesystem{ ext4 } \ + mountpoint{ / } . +d-i partman-partitioning/confirm_write_new_label boolean true +d-i partman/choose_partition select finish +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true + +# Settings for package manager +d-i apt-setup/non-free boolean true +d-i apt-setup/contrib boolean true +d-i apt-setup/cdrom/set-first boolean false +d-i apt-setup/cdrom/set-next boolean false +d-i apt-setup/cdrom/set-failed boolean false +d-i mirror/country string manual +d-i mirror/http/hostname string httpredir.debian.org +d-i mirror/http/directory string /debian +d-i mirror/http/proxy string + +# Package selection +tasksel tasksel/first multiselect +d-i pkgsel/include string curl openssh-server sudo python3 network-manager +popularity-contest popularity-contest/participate boolean false + +d-i grub-installer/bootdev string default +d-i grub-installer/force-efi-extra-removable boolean true + +d-i finish-install/reboot_in_progress note + +d-i preseed/late_command string \ + echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant; \ + echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /target/etc/sudoers.d/vagrant; \ + chmod 440 /target/etc/sudoers.d/vagrant; \ + sed -i -e 's/ens3/ens5/g' /target/etc/network/interfaces; \ + in-target apt-get update; \ + in-target apt-get upgrade -y diff --git a/distros/debian/13/qemu.sh b/distros/debian/13/qemu.sh new file mode 100644 index 0000000..4ef2dee --- /dev/null +++ b/distros/debian/13/qemu.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -ex + +apt install -y qemu-guest-agent +systemctl start qemu-guest-agent +systemctl enable qemu-guest-agent diff --git a/distros/debian/13/virtualbox.sh b/distros/debian/13/virtualbox.sh new file mode 100644 index 0000000..998449c --- /dev/null +++ b/distros/debian/13/virtualbox.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -ex + +packages=(bzip2 dkms build-essential "linux-headers-$(uname -r)") +apt install -y "${packages[@]}" +mount -t auto /home/vagrant/VBoxGuestAdditions.iso /mnt +/mnt/VBoxLinuxAdditions.run install 2>&1 | tee /root/vbox_addon_install.log +apt remove -y "${packages[@]}" +umount /mnt +rm /home/vagrant/VBoxGuestAdditions.iso diff --git a/distros/debian/13/vmware.sh b/distros/debian/13/vmware.sh new file mode 100644 index 0000000..9560300 --- /dev/null +++ b/distros/debian/13/vmware.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -ex + +apt install -y open-vm-tools diff --git a/distros/debian/default.nix b/distros/debian/default.nix index faa6d88..5bbc53f 100644 --- a/distros/debian/default.nix +++ b/distros/debian/default.nix @@ -22,4 +22,9 @@ "virtualbox-iso" ]; } + { + version = "13"; + arch = "amd64"; + eol = false; + } ] From 80ea1ffb4b1157049f4aba91da847109865a8e19 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Sun, 17 Aug 2025 02:18:53 -0500 Subject: [PATCH 05/25] Update Archlinux ISO --- distros/archlinux/rolling/amd64.pkrvars.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distros/archlinux/rolling/amd64.pkrvars.hcl b/distros/archlinux/rolling/amd64.pkrvars.hcl index 43412f0..92adf7a 100644 --- a/distros/archlinux/rolling/amd64.pkrvars.hcl +++ b/distros/archlinux/rolling/amd64.pkrvars.hcl @@ -1,8 +1,8 @@ distro = "archlinux" version = "rolling" iso = { - url = "https://mirror.rackspace.com/archlinux/iso/2025.05.01/archlinux-2025.05.01-x86_64.iso" - checksum = "2008e6becc86d207272625c94a388d2ee3b14d6a24b401552d8105c4e82c96db" + url = "https://mirror.rackspace.com/archlinux/iso/2025.08.01/archlinux-2025.08.01-x86_64.iso" + checksum = "4b1af44dbeed97acec0204a95f6393818bb8fd903b423a20b7ea141f80b27e59" } boot_command = [ "e net.ifnames=0 biosdevnames=0 ", From b0e1e83aead003e1ca11785c22aaf397ca0708ff Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Sun, 17 Aug 2025 02:20:16 -0500 Subject: [PATCH 06/25] Rocky 10 and 9.6 release --- distros/rockylinux/10/amd64.pkrvars.hcl | 15 +++ distros/rockylinux/10/disc/ks.cfg | 155 ++++++++++++++++++++++++ distros/rockylinux/10/finalize.sh | 4 + distros/rockylinux/10/qemu.sh | 6 + distros/rockylinux/10/virtualbox.sh | 9 ++ distros/rockylinux/10/vmware.sh | 4 + distros/rockylinux/9/amd64.pkrvars.hcl | 4 +- distros/rockylinux/default.nix | 5 + 8 files changed, 200 insertions(+), 2 deletions(-) create mode 100644 distros/rockylinux/10/amd64.pkrvars.hcl create mode 100644 distros/rockylinux/10/disc/ks.cfg create mode 100644 distros/rockylinux/10/finalize.sh create mode 100644 distros/rockylinux/10/qemu.sh create mode 100644 distros/rockylinux/10/virtualbox.sh create mode 100644 distros/rockylinux/10/vmware.sh diff --git a/distros/rockylinux/10/amd64.pkrvars.hcl b/distros/rockylinux/10/amd64.pkrvars.hcl new file mode 100644 index 0000000..46c01ac --- /dev/null +++ b/distros/rockylinux/10/amd64.pkrvars.hcl @@ -0,0 +1,15 @@ +distro = "rockylinux" +version = "10" +iso = { + url = "https://download.rockylinux.org/pub/rocky/10.0/isos/x86_64/Rocky-10.0-x86_64-boot.iso" + checksum = "2bb073606d8d83cbd3c0e25c5e6cd8e5c60c0e989e6e84f0c415c05e163640d3" +} +boot_command = [ + "e", + "", + " inst.text inst.ks=cdrom:/ks.cfg", + " inst.notmux ", + "x" +] +cd_files = [ "distros/rockylinux/10/disc/*" ] +vbox_os_type = "RedHat10_64" diff --git a/distros/rockylinux/10/disc/ks.cfg b/distros/rockylinux/10/disc/ks.cfg new file mode 100644 index 0000000..74978d4 --- /dev/null +++ b/distros/rockylinux/10/disc/ks.cfg @@ -0,0 +1,155 @@ +url --mirrorlist=http://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=rocky-BaseOS-$releasever +repo --name=AppStream --mirrorlist=http://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=rocky-AppStream-$releasever +network --bootproto=dhcp --activate +reboot + +text +keyboard --vckeymap us +lang en_US +skipx +rootpw --plaintext vagrant +firewall --disabled +timezone --utc UTC +services --enabled=vmtoolsd +# The biosdevname and ifnames options ensure we get "eth0" as our interface +# even in environments like virtualbox that emulate a real NW card +bootloader --timeout=1 --append="no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop" +clearpart --all +autopart --type=plain +zerombr + +user --name=vagrant --plaintext --password=vagrant + +%packages --inst-langs=en +bash-completion +man-pages +bzip2 +rsync +nfs-utils +cifs-utils +chrony +yum-utils +hyperv-daemons +open-vm-tools +# Vagrant boxes aren't normally visible, no need for Plymouth +-plymouth +# Microcode updates cannot work in a VM +-microcode_ctl +# Firmware packages are not needed in a VM +-iwl100-firmware +-iwl1000-firmware +-iwl105-firmware +-iwl135-firmware +-iwl2000-firmware +-iwl2030-firmware +-iwl3160-firmware +-iwl3945-firmware +-iwl4965-firmware +-iwl5000-firmware +-iwl5150-firmware +-iwl6000-firmware +-iwl6000g2a-firmware +-iwl6050-firmware +-iwl7260-firmware +# Don't build rescue initramfs +-dracut-config-rescue +%end + +# kdump needs to reserve 160MB + 2bits/4kB RAM, and automatic allocation only +# works on systems with at least 2GB RAM (which excludes most Vagrant boxes) +# CBS doesn't support %addon yet https://bugs.centos.org/view.php?id=12169 +%addon com_redhat_kdump --disable +%end + +%post --erroronfail +dnf update -y + +# configure swap to a file +fallocate -l 2G /swapfile +chmod 600 /swapfile +mkswap /swapfile +echo "/swapfile none swap defaults 0 0" >> /etc/fstab + +# sudo +echo "%vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant +chmod 0440 /etc/sudoers.d/vagrant + +# Fix for https://github.com/CentOS/sig-cloud-instance-build/issues/38 +cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF +DEVICE="eth0" +BOOTPROTO="dhcp" +ONBOOT="yes" +TYPE="Ethernet" +PERSISTENT_DHCLIENT="yes" +EOF + +# sshd: disable password authentication and DNS checks +ex -s /etc/ssh/sshd_config <>/etc/sysconfig/sshd < /etc/ssh/sshd_config.d/00-vagrant_accept_pubkey.conf +PubkeyAcceptedKeyTypes +ssh-rsa +EOF + +# Fix for issue #76, regular users can gain admin privileges via su +ex -s /etc/pam.d/su <<'EOF' +# allow vagrant to use su, but prevent others from becoming root or vagrant +/^account\s\+sufficient\s\+pam_succeed_if.so uid = 0 use_uid quiet$/ +:append +account [success=1 default=ignore] \ + pam_succeed_if.so user = vagrant use_uid quiet +account required pam_succeed_if.so user notin root:vagrant +. +:update +:quit +EOF + +# systemd should generate a new machine id during the first boot, to +# avoid having multiple Vagrant instances with the same id in the local +# network. /etc/machine-id should be empty, but it must exist to prevent +# boot errors (e.g. systemd-journald failing to start). +:>/etc/machine-id + +echo 'vag' > /etc/yum/vars/infra + +# Blacklist the floppy module to avoid probing timeouts +echo blacklist floppy > /etc/modprobe.d/nofloppy.conf +chcon -u system_u -r object_r -t modules_conf_t /etc/modprobe.d/nofloppy.conf + +# Customize the initramfs +pushd /etc/dracut.conf.d +# Enable VMware PVSCSI support for VMware Fusion guests. +echo 'add_drivers+=" vmw_pvscsi "' > vmware-fusion-drivers.conf +echo 'add_drivers+=" hv_netvsc hv_storvsc hv_utils hv_vmbus hid-hyperv "' > hyperv-drivers.conf +# There's no floppy controller, but probing for it generates timeouts +echo 'omit_drivers+=" floppy "' > nofloppy.conf +popd +# Fix the SELinux context of the new files +restorecon -f - <&1 | tee /root/vbox_addon_install.log +umount /mnt +rm /home/vagrant/VBoxGuestAdditions.iso diff --git a/distros/rockylinux/10/vmware.sh b/distros/rockylinux/10/vmware.sh new file mode 100644 index 0000000..058afc2 --- /dev/null +++ b/distros/rockylinux/10/vmware.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -ex + +dnf install -y open-vm-tools diff --git a/distros/rockylinux/9/amd64.pkrvars.hcl b/distros/rockylinux/9/amd64.pkrvars.hcl index 5930ee2..42e43d1 100644 --- a/distros/rockylinux/9/amd64.pkrvars.hcl +++ b/distros/rockylinux/9/amd64.pkrvars.hcl @@ -1,8 +1,8 @@ distro = "rockylinux" version = "9" iso = { - url = "https://download.rockylinux.org/pub/rocky/9.5/isos/x86_64/Rocky-9.5-x86_64-boot.iso" - checksum = "628c069c9685477360640a6b58dc919692a11c44b49a50a024b5627ce3c27d5f" + url = "https://download.rockylinux.org/pub/rocky/9.6/isos/x86_64/Rocky-9.6-x86_64-boot.iso" + checksum = "0fad8d8b19a94a0222ea37152cdf5601229fe0178b651dc476e1cba41d2e6067" } boot_command = [ "e", diff --git a/distros/rockylinux/default.nix b/distros/rockylinux/default.nix index d17f358..415e3c4 100644 --- a/distros/rockylinux/default.nix +++ b/distros/rockylinux/default.nix @@ -9,4 +9,9 @@ arch = "amd64"; eol = false; } + { + version = "10"; + arch = "amd64"; + eol = false; + } ] From fde11d0a98b7e8f4460838103ee4d68089bb5652 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Sun, 17 Aug 2025 02:20:51 -0500 Subject: [PATCH 07/25] Almalinux 10 release --- distros/almalinux/10/amd64.pkrvars.hcl | 15 +++ distros/almalinux/10/disc/ks.cfg | 161 +++++++++++++++++++++++++ distros/almalinux/10/finalize.sh | 4 + distros/almalinux/10/qemu.sh | 6 + distros/almalinux/10/virtualbox.sh | 9 ++ distros/almalinux/10/vmware.sh | 4 + distros/almalinux/default.nix | 5 + 7 files changed, 204 insertions(+) create mode 100644 distros/almalinux/10/amd64.pkrvars.hcl create mode 100644 distros/almalinux/10/disc/ks.cfg create mode 100644 distros/almalinux/10/finalize.sh create mode 100644 distros/almalinux/10/qemu.sh create mode 100644 distros/almalinux/10/virtualbox.sh create mode 100644 distros/almalinux/10/vmware.sh diff --git a/distros/almalinux/10/amd64.pkrvars.hcl b/distros/almalinux/10/amd64.pkrvars.hcl new file mode 100644 index 0000000..4002d28 --- /dev/null +++ b/distros/almalinux/10/amd64.pkrvars.hcl @@ -0,0 +1,15 @@ +distro = "almalinux" +version = "10" +iso = { + url = "https://mirrors.kernel.org/almalinux/10.0/isos/x86_64_v2/AlmaLinux-10.0-x86_64_v2-boot.iso" + checksum = "5571cc6c826300a3d4aff9c2fc5203d03d4762bc5c9955ba061689d1af7867fc" +} +boot_command = [ + "e", + "", + " inst.text inst.ks=cdrom:/ks.cfg", + " inst.notmux", + "x" +] +cd_files = [ "distros/almalinux/10/disc/*" ] +vbox_os_type = "RedHat10_64" diff --git a/distros/almalinux/10/disc/ks.cfg b/distros/almalinux/10/disc/ks.cfg new file mode 100644 index 0000000..043cd64 --- /dev/null +++ b/distros/almalinux/10/disc/ks.cfg @@ -0,0 +1,161 @@ +url --mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/baseos +repo --name=AppStream --mirrorlist=https://mirrors.almalinux.org/mirrorlist/$releasever/appstream +network --bootproto=dhcp --activate +reboot + +text +keyboard --vckeymap us +lang en_US +skipx +rootpw --plaintext vagrant +firewall --disabled +timezone --utc UTC +services --enabled=vmtoolsd +# The biosdevname and ifnames options ensure we get "eth0" as our interface +# even in environments like virtualbox that emulate a real NW card +bootloader --timeout=1 --append="no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop" +clearpart --all +autopart --type=plain +zerombr + +user --name=vagrant --plaintext --password=vagrant + +%packages --inst-langs=en +bash-completion +man-pages +bzip2 +rsync +nfs-utils +cifs-utils +chrony +yum-utils +hyperv-daemons +open-vm-tools +# Vagrant boxes aren't normally visible, no need for Plymouth +-plymouth +# Microcode updates cannot work in a VM +-microcode_ctl +# Firmware packages are not needed in a VM +-iwl100-firmware +-iwl1000-firmware +-iwl105-firmware +-iwl135-firmware +-iwl2000-firmware +-iwl2030-firmware +-iwl3160-firmware +-iwl3945-firmware +-iwl4965-firmware +-iwl5000-firmware +-iwl5150-firmware +-iwl6000-firmware +-iwl6000g2a-firmware +-iwl6050-firmware +-iwl7260-firmware +# Don't build rescue initramfs +-dracut-config-rescue +%end + +# kdump needs to reserve 160MB + 2bits/4kB RAM, and automatic allocation only +# works on systems with at least 2GB RAM (which excludes most Vagrant boxes) +# CBS doesn't support %addon yet https://bugs.centos.org/view.php?id=12169 +%addon com_redhat_kdump --disable +%end + +%post --erroronfail +dnf update -y + +# configure swap to a file +fallocate -l 2G /swapfile +chmod 600 /swapfile +mkswap /swapfile +echo "/swapfile none swap defaults 0 0" >> /etc/fstab + +# sudo +echo "%vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant +chmod 0440 /etc/sudoers.d/vagrant + +# Fix for https://github.com/CentOS/sig-cloud-instance-build/issues/38 +cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF +DEVICE="eth0" +BOOTPROTO="dhcp" +ONBOOT="yes" +TYPE="Ethernet" +PERSISTENT_DHCLIENT="yes" +EOF + +# sshd: disable password authentication and DNS checks +ex -s /etc/ssh/sshd_config <>/etc/sysconfig/sshd < /etc/ssh/sshd_config.d/00-vagrant_accept_pubkey.conf +PubkeyAcceptedKeyTypes +ssh-rsa +EOF + +# Decrease connection time by preventing reverse DNS lookups +# (see https://lists.centos.org/pipermail/centos-devel/2016-July/014981.html +# and man sshd for more information) +OPTIONS="-u0" +EOF + +# Fix for issue #76, regular users can gain admin privileges via su +ex -s /etc/pam.d/su <<'EOF' +# allow vagrant to use su, but prevent others from becoming root or vagrant +/^account\s\+sufficient\s\+pam_succeed_if.so uid = 0 use_uid quiet$/ +:append +account [success=1 default=ignore] \ + pam_succeed_if.so user = vagrant use_uid quiet +account required pam_succeed_if.so user notin root:vagrant +. +:update +:quit +EOF + +# systemd should generate a new machine id during the first boot, to +# avoid having multiple Vagrant instances with the same id in the local +# network. /etc/machine-id should be empty, but it must exist to prevent +# boot errors (e.g. systemd-journald failing to start). +:>/etc/machine-id + +echo 'vag' > /etc/yum/vars/infra + +# Blacklist the floppy module to avoid probing timeouts +echo blacklist floppy > /etc/modprobe.d/nofloppy.conf +chcon -u system_u -r object_r -t modules_conf_t /etc/modprobe.d/nofloppy.conf + +# Customize the initramfs +pushd /etc/dracut.conf.d +# Enable VMware PVSCSI support for VMware Fusion guests. +echo 'add_drivers+=" vmw_pvscsi "' > vmware-fusion-drivers.conf +echo 'add_drivers+=" hv_netvsc hv_storvsc hv_utils hv_vmbus hid-hyperv "' > hyperv-drivers.conf +# There's no floppy controller, but probing for it generates timeouts +echo 'omit_drivers+=" floppy "' > nofloppy.conf +popd +# Fix the SELinux context of the new files +restorecon -f - <&1 | tee /root/vbox_addon_install.log +umount /mnt +rm /home/vagrant/VBoxGuestAdditions.iso diff --git a/distros/almalinux/10/vmware.sh b/distros/almalinux/10/vmware.sh new file mode 100644 index 0000000..058afc2 --- /dev/null +++ b/distros/almalinux/10/vmware.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -ex + +dnf install -y open-vm-tools diff --git a/distros/almalinux/default.nix b/distros/almalinux/default.nix index d17f358..415e3c4 100644 --- a/distros/almalinux/default.nix +++ b/distros/almalinux/default.nix @@ -9,4 +9,9 @@ arch = "amd64"; eol = false; } + { + version = "10"; + arch = "amd64"; + eol = false; + } ] From 55c336b55f53ef0359f4b57f58c1b70ab4048094 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Sun, 17 Aug 2025 14:21:51 -0500 Subject: [PATCH 08/25] Use generic VirtualBox guest OS names Rocky 10, Alma 10, and Debian 13 are not yet known by Virtualbox, so we use the generic versions of those --- distros/almalinux/10/amd64.pkrvars.hcl | 2 +- distros/debian/13/amd64.pkrvars.hcl | 2 +- distros/rockylinux/10/amd64.pkrvars.hcl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/distros/almalinux/10/amd64.pkrvars.hcl b/distros/almalinux/10/amd64.pkrvars.hcl index 4002d28..1f08d84 100644 --- a/distros/almalinux/10/amd64.pkrvars.hcl +++ b/distros/almalinux/10/amd64.pkrvars.hcl @@ -12,4 +12,4 @@ boot_command = [ "x" ] cd_files = [ "distros/almalinux/10/disc/*" ] -vbox_os_type = "RedHat10_64" +vbox_os_type = "RedHat_64" diff --git a/distros/debian/13/amd64.pkrvars.hcl b/distros/debian/13/amd64.pkrvars.hcl index b71f285..92eb455 100644 --- a/distros/debian/13/amd64.pkrvars.hcl +++ b/distros/debian/13/amd64.pkrvars.hcl @@ -19,4 +19,4 @@ boot_command = [ "" ] http_directory = "distros/debian/13/http/" -vbox_os_type = "Debian13_64" +vbox_os_type = "Debian_64" diff --git a/distros/rockylinux/10/amd64.pkrvars.hcl b/distros/rockylinux/10/amd64.pkrvars.hcl index 46c01ac..f4ec9bd 100644 --- a/distros/rockylinux/10/amd64.pkrvars.hcl +++ b/distros/rockylinux/10/amd64.pkrvars.hcl @@ -12,4 +12,4 @@ boot_command = [ "x" ] cd_files = [ "distros/rockylinux/10/disc/*" ] -vbox_os_type = "RedHat10_64" +vbox_os_type = "RedHat_64" From 612e04c4a07138ab97091048524be75b8cb1dfc9 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Sun, 17 Aug 2025 14:22:37 -0500 Subject: [PATCH 09/25] Update the VirtualBox Additions ISO version --- sources/virtualbox-iso.pkr.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/virtualbox-iso.pkr.hcl b/sources/virtualbox-iso.pkr.hcl index f68bf4c..2e16af9 100644 --- a/sources/virtualbox-iso.pkr.hcl +++ b/sources/virtualbox-iso.pkr.hcl @@ -22,8 +22,8 @@ source "virtualbox-iso" "amd64" { firmware = "efi" #hard_drive_interface = "virtio" guest_os_type = var.vbox_os_type - guest_additions_url = "http://download.virtualbox.org/virtualbox/7.0.10/VBoxGuestAdditions_7.0.10.iso" - guest_additions_sha256 = "bbabd89b8fff38a257bab039a278f0c4dc4426eff6e4238c1db01edb7284186a" + guest_additions_url = "https://download.virtualbox.org/virtualbox/7.2.0/VBoxGuestAdditions_7.2.0.iso" + guest_additions_sha256 = "43f7a1045cad0aab40e3af906fea37244ba6873b91b4e227245a14e51b399abd" nic_type = "virtio" gfx_vram_size = 128 vboxmanage = [ From 91500a155cb93eb239623de28ca494b96f4a622d Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Sun, 17 Aug 2025 14:30:55 -0500 Subject: [PATCH 10/25] Streamline the push and build process --- .gitlab-ci.yml | 74 +++++++--------------------------------------- .gitlab/always.yml | 38 ++++++++++++++++++++++++ .gitlab/build.yml | 27 +++++++++++++++++ 3 files changed, 76 insertions(+), 63 deletions(-) create mode 100644 .gitlab/always.yml create mode 100644 .gitlab/build.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f1dedb3..5094a7c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,17 @@ stages: - check - trigger +include: + # Low-effort, we can always do lint checks, validations, and so forth + - local: .gitlab/always.yml + # Actual download of ISOs and building of images. This should only be + # done some of the time + - local: .gitlab/build.yml + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_PIPELINE_SOURCE == "tag" + - if: $CI_COMMIT_BRANCH == "main" + variables: PACKER_CONFIG_DIR: ./packer_config/ PACKER_CACHE_DIR: ./cache/ @@ -11,66 +22,3 @@ default: image: registry.thehellings.com/greg/ci-images/vm-test:latest tags: - nix - -generate: - stage: generate - artifacts: - paths: - - distros/**/*.pkrvars.hcl - reports: - dotenv: build.env - script: nix run ".#generate" - -continue: - stage: generate - artifacts: - paths: - - .gitlab-ci-build.yml - script: - - nix build ".#continue" - - cp result .gitlab-ci-build.yml - - cat result - -shellcheck: - stage: generate - script: nix run ".#shellcheck" - -flake-check: - stage: generate - script: nix flake check - -validate: - stage: check - needs: - - generate - cache: - - key: - files: - - sources/build.pkr.hcl - paths: - - ./packer_config/ - script: nix run ".#validate" - -# Makes sure that all of the ISO files we are looking for are -# present on the S3 buckets that we use -downloads: - stage: check - retry: 2 - needs: - - generate - cache: - - key: - files: - - sources/build.pkr.hcl - paths: - - ./packer_config/ - script: nix run ".#cache" - -trigger: - stage: trigger - trigger: - include: - - artifact: .gitlab-ci-build.yml - job: continue - variables: - PARENT_PIPELINE_ID: $CI_PIPELINE_ID diff --git a/.gitlab/always.yml b/.gitlab/always.yml new file mode 100644 index 0000000..5c0a5b2 --- /dev/null +++ b/.gitlab/always.yml @@ -0,0 +1,38 @@ +generate: + stage: generate + artifacts: + paths: + - distros/**/*.pkrvars.hcl + reports: + dotenv: build.env + script: nix run ".#generate" + +continue: + stage: generate + artifacts: + paths: + - .gitlab-ci-build.yml + script: + - nix build ".#continue" + - cp result .gitlab-ci-build.yml + - cat result + +shellcheck: + stage: generate + script: nix run ".#shellcheck" + +flake-check: + stage: generate + script: nix flake check + +validate: + stage: check + needs: + - generate + cache: + - key: + files: + - sources/build.pkr.hcl + paths: + - ./packer_config/ + script: nix run ".#validate" diff --git a/.gitlab/build.yml b/.gitlab/build.yml new file mode 100644 index 0000000..9d0f951 --- /dev/null +++ b/.gitlab/build.yml @@ -0,0 +1,27 @@ +# These jobs actually fetch the downloads and trigger the +# target builds. I don't want to do that on every single push, +# but only when I'm part of a merge request or release event + +# Makes sure that all of the ISO files we are looking for are +# present on the S3 buckets that we use +downloads: + stage: check + retry: 2 + needs: + - generate + cache: + - key: + files: + - sources/build.pkr.hcl + paths: + - ./packer_config/ + script: nix run ".#cache" + +trigger: + stage: trigger + trigger: + include: + - artifact: .gitlab-ci-build.yml + job: continue + variables: + PARENT_PIPELINE_ID: $CI_PIPELINE_ID From 3a8552bdbfca3537b2eaf1d87bd5221c1697d888 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Aug 2025 00:39:03 -0500 Subject: [PATCH 11/25] OpenSuSE LEAP 16.0 now building --- distros/opensuse/16.0/amd64.pkrvars.hcl | 11 +- distros/opensuse/16.0/http/autoinst.xml | 125 --------------------- distros/opensuse/16.0/http/profile.jsonnet | 8 +- 3 files changed, 13 insertions(+), 131 deletions(-) delete mode 100644 distros/opensuse/16.0/http/autoinst.xml diff --git a/distros/opensuse/16.0/amd64.pkrvars.hcl b/distros/opensuse/16.0/amd64.pkrvars.hcl index a169680..5eb5b1c 100644 --- a/distros/opensuse/16.0/amd64.pkrvars.hcl +++ b/distros/opensuse/16.0/amd64.pkrvars.hcl @@ -1,16 +1,21 @@ distro = "opensuse" version = "16.0" iso = { - url = "https://download.opensuse.org/distribution/leap/16.0/installer/iso/agama-installer-Leap.x86_64-16.0.0-Leap-Build120.5.iso" - checksum = "9da557e454a5cfb9aad8e1385de0003efd9bd4531e08459385f1169b3c0bfd25" + #url = "https://download.opensuse.org/distribution/leap/16.0/installer/iso/agama-installer.x86_64-Leap_16.0.iso" + #checksum = "d3e7a86c4ab7296480ad41a2ca30bde5cad0ff2210b145dd2011403f648f76cb" + url = "https://download.opensuse.org/distribution/leap/16.0/installer/iso/agama-installer.x86_64-17.0.0-Leap_16.0-Build151.4.iso" + checksum = "d3e7a86c4ab7296480ad41a2ca30bde5cad0ff2210b145dd2011403f648f76cb" } boot_command = [ "e", "", "", - " agama.auto=http://{{ .HTTPIP }}:{{ .HTTPPort }}/profile.jsonnet", + " inst.auto=http://{{ .HTTPIP }}:{{ .HTTPPort }}/profile.jsonnet", + " video=VGA-1:800x600", + #" systemd.unit=multi-user.target", "x" ] boot_wait = "8s" +cd_files = [ "distros/opensuse/16.0/http/" ] http_directory = "distros/opensuse/16.0/http/" vbox_os_type = "OpenSUSE_Leap_64" diff --git a/distros/opensuse/16.0/http/autoinst.xml b/distros/opensuse/16.0/http/autoinst.xml deleted file mode 100644 index a20f842..0000000 --- a/distros/opensuse/16.0/http/autoinst.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - false - true - - - - - wheel - vagrant - - - vagrant - vagrant - - - - true - external - - - public - - eth0 - - - ssh - - - - - - - all - - - /boot - 512MiB - - - / - max - - - - - - en_US - - - network_manager - - - - - sshd - - - - - - openssh - sudo - - true - false - - - UTC - UTC - - - - root - vagrant - false - - - vagrant - vagrant - false - - - - - - - - - - /etc/sudoers.d/vagrant - - - - 440 - root - - - /home/vagrant/.ssh/authorized_keys - 600 - vagrant - https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant.pub - - - diff --git a/distros/opensuse/16.0/http/profile.jsonnet b/distros/opensuse/16.0/http/profile.jsonnet index d0dcd5b..a0a2597 100644 --- a/distros/opensuse/16.0/http/profile.jsonnet +++ b/distros/opensuse/16.0/http/profile.jsonnet @@ -1,3 +1,5 @@ +// For more docs, check out +// https://agama-project.github.io/docs/user/profile/dynamic // This is a Jsonnet file. Please, check https://jsonnet.org/ for more // information about the language. // For the schema, see @@ -62,8 +64,8 @@ local memory = agama.findByID(agama.lshw, 'memory').size; post: [ { name: 'configure-vagrant', chroot: true, - body: ||| - #!/bin/sh + content: ||| + #!/bin/bash # Configure the insecure Vagrant SSH key mkdir -p /home/vagrant/.ssh curl -o /home/vagrant/.ssh/authorized_keys https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant.pub @@ -77,7 +79,7 @@ local memory = agama.findByID(agama.lshw, 'memory').size; vagrant ALL=(ALL) NOPASSWD: ALL root ALL=(ALL) NOPASSWD: ALL EOF - ||| + |||, } ] }, } From bdccd7c5d2d192de7503ac72af694eb52cb8642b Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Aug 2025 01:13:04 -0500 Subject: [PATCH 12/25] Fix Debian 12 Virtualbox --- distros/debian/12/amd64.pkrvars.hcl | 4 ++-- distros/debian/default.nix | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/distros/debian/12/amd64.pkrvars.hcl b/distros/debian/12/amd64.pkrvars.hcl index 2e175e2..e70691f 100644 --- a/distros/debian/12/amd64.pkrvars.hcl +++ b/distros/debian/12/amd64.pkrvars.hcl @@ -1,8 +1,8 @@ distro = "debian" version = "12" iso = { - url = "https://cdimage.debian.org/cdimage/archive/12.11.0/arm64/iso-cd/debian-12.11.0-arm64-netinst.iso" - checksum = "5c050c495770ee9b076261cb8025a99a4866a15a4e3cdab2f59c49e8f69fb0ee" + url = "https://cdimage.debian.org/cdimage/archive/12.11.0/amd64/iso-cd/debian-12.11.0-amd64-netinst.iso" + checksum = "30ca12a15cae6a1033e03ad59eb7f66a6d5a258dcf27acd115c2bd42d22640e8" } boot_command = [ "e", diff --git a/distros/debian/default.nix b/distros/debian/default.nix index 5bbc53f..13a406e 100644 --- a/distros/debian/default.nix +++ b/distros/debian/default.nix @@ -18,9 +18,6 @@ version = "12"; arch = "amd64"; eol = false; - exclude = [ - "virtualbox-iso" - ]; } { version = "13"; From e11f90482a5a2742aca4d1e8548e1daee4d50131 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Aug 2025 01:19:00 -0500 Subject: [PATCH 13/25] Add Debian update scripts --- distros/debian/11/update.sh | 17 +++++++++++++++++ distros/debian/12/update.sh | 17 +++++++++++++++++ distros/debian/13/update.sh | 17 +++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100755 distros/debian/11/update.sh create mode 100755 distros/debian/12/update.sh create mode 100755 distros/debian/13/update.sh diff --git a/distros/debian/11/update.sh b/distros/debian/11/update.sh new file mode 100755 index 0000000..afdcac7 --- /dev/null +++ b/distros/debian/11/update.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +root="$(cd "$(dirname "$0")"; pwd)" +hcl="$root/amd64.pkrvars.hcl" + +base="https://cdimage.debian.org/cdimage/archive/latest-oldoldstable/arm64/iso-cd/" + +sums="$(curl -L "$base/SHA256SUMS")" + +sha="$(echo "$sums" | awk '{print $1}')" +file="$(echo "$sums" | awk '{print $2}')" + +echo "Found $file with sum $sha" + +sed -i "$hcl" -E \ + -e "s,( url *=).*$,\1 \"$base$file\"," \ + -e "s,( checksum *=).*$,\1 \"$sha\"," diff --git a/distros/debian/12/update.sh b/distros/debian/12/update.sh new file mode 100755 index 0000000..493738a --- /dev/null +++ b/distros/debian/12/update.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +root="$(cd "$(dirname "$0")"; pwd)" +hcl="$root/amd64.pkrvars.hcl" + +base="https://cdimage.debian.org/cdimage/archive/latest-oldstable/arm64/iso-cd/" + +sums="$(curl -L "$base/SHA256SUMS")" + +sha="$(echo "$sums" | awk '{print $1}')" +file="$(echo "$sums" | awk '{print $2}')" + +echo "Found $file with sum $sha" + +sed -i "$hcl" -E \ + -e "s,( url *=).*$,\1 \"$base$file\"," \ + -e "s,( checksum *=).*$,\1 \"$sha\"," diff --git a/distros/debian/13/update.sh b/distros/debian/13/update.sh new file mode 100755 index 0000000..43934d7 --- /dev/null +++ b/distros/debian/13/update.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +root="$(cd "$(dirname "$0")"; pwd)" +hcl="$root/amd64.pkrvars.hcl" + +base="https://cdimage.debian.org/cdimage/release/current/amd64/iso-cd/" + +sums="$(curl -L "$base/SHA256SUMS" | grep -v -e "-edu-" -e "-mac-")" + +sha="$(echo "$sums" | awk '{print $1}')" +file="$(echo "$sums" | awk '{print $2}')" + +echo "Found $file with sum $sha" + +sed -i "$hcl" -E \ + -e "s,( url *=).*$,\1 \"$base$file\"," \ + -e "s,( checksum *=).*$,\1 \"$sha\"," From 12c768cae183f234a8877619c695a61fe392de38 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Aug 2025 01:41:55 -0500 Subject: [PATCH 14/25] Fix shellcheck --- distros/debian/11/update.sh | 2 +- distros/debian/12/update.sh | 2 +- distros/debian/13/update.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/distros/debian/11/update.sh b/distros/debian/11/update.sh index afdcac7..01fcfc0 100755 --- a/distros/debian/11/update.sh +++ b/distros/debian/11/update.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -root="$(cd "$(dirname "$0")"; pwd)" +root="$(cd "$(dirname "$0")" || exit; pwd)" hcl="$root/amd64.pkrvars.hcl" base="https://cdimage.debian.org/cdimage/archive/latest-oldoldstable/arm64/iso-cd/" diff --git a/distros/debian/12/update.sh b/distros/debian/12/update.sh index 493738a..910fd7c 100755 --- a/distros/debian/12/update.sh +++ b/distros/debian/12/update.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -root="$(cd "$(dirname "$0")"; pwd)" +root="$(cd "$(dirname "$0")" || exit; pwd)" hcl="$root/amd64.pkrvars.hcl" base="https://cdimage.debian.org/cdimage/archive/latest-oldstable/arm64/iso-cd/" diff --git a/distros/debian/13/update.sh b/distros/debian/13/update.sh index 43934d7..79f45ee 100755 --- a/distros/debian/13/update.sh +++ b/distros/debian/13/update.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -root="$(cd "$(dirname "$0")"; pwd)" +root="$(cd "$(dirname "$0")" || exit; pwd)" hcl="$root/amd64.pkrvars.hcl" base="https://cdimage.debian.org/cdimage/release/current/amd64/iso-cd/" From 9c51853277d4013692a1b41dcb3501e1118ff470 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Aug 2025 01:43:27 -0500 Subject: [PATCH 15/25] Maybe do build now --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5094a7c..f8c83bf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,8 +11,11 @@ include: - local: .gitlab/build.yml rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" + when: always - if: $CI_PIPELINE_SOURCE == "tag" + when: always - if: $CI_COMMIT_BRANCH == "main" + when: always variables: PACKER_CONFIG_DIR: ./packer_config/ From e7fb45acf49965fa5f09f5f949e268e9e6b2de2d Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Aug 2025 01:50:28 -0500 Subject: [PATCH 16/25] Hopefully run merge now --- .gitlab-ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f8c83bf..dc356e8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,12 +10,9 @@ include: # done some of the time - local: .gitlab/build.yml rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - when: always + - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" - if: $CI_PIPELINE_SOURCE == "tag" - when: always - if: $CI_COMMIT_BRANCH == "main" - when: always variables: PACKER_CONFIG_DIR: ./packer_config/ From 17d94b766872e20de45669a11a0f4699d0b88294 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Aug 2025 01:53:02 -0500 Subject: [PATCH 17/25] This really should be running --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dc356e8..5094a7c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,7 @@ include: # done some of the time - local: .gitlab/build.yml rules: - - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" + - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_PIPELINE_SOURCE == "tag" - if: $CI_COMMIT_BRANCH == "main" From 147a7a7d560eb572a2f42e5ccb43d8e79b786e96 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Aug 2025 02:00:04 -0500 Subject: [PATCH 18/25] Add workflow rules --- .gitlab-ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5094a7c..558e58e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,16 @@ stages: - check - trigger +workflow: + rules: + # Run when a merge request event is open + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + # Do not run branch-specific pipeline if there is an open MR + - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS + when: never + # Run reduced pipeline for branches + - if: $CI_COMMIT_BRANCH + include: # Low-effort, we can always do lint checks, validations, and so forth - local: .gitlab/always.yml From 260a2711ebde38597e00c599076fb90699b481c0 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Aug 2025 10:28:53 -0500 Subject: [PATCH 19/25] Increase boot wait time for Alpine When a build host is under heavy load, the Alpine text can sometimes be entered before the boot has completed. So we increase the wait time to avoid this in the future. There is no real harm from increasing wait time, as there is no timeout on the login prompt --- distros/alpine/3.19.0/amd64.pkrvars.hcl | 2 +- distros/alpine/3.20/amd64.pkrvars.hcl | 2 +- distros/alpine/3.21/amd64.pkrvars.hcl | 2 +- distros/alpine/3.22/amd64.pkrvars.hcl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/distros/alpine/3.19.0/amd64.pkrvars.hcl b/distros/alpine/3.19.0/amd64.pkrvars.hcl index 6a7703b..80322aa 100644 --- a/distros/alpine/3.19.0/amd64.pkrvars.hcl +++ b/distros/alpine/3.19.0/amd64.pkrvars.hcl @@ -15,5 +15,5 @@ boot_command = [ "/bin/ash ./answers.cfg.sh 2>&1 | tee install.log", ] http_directory = "distros/alpine/3.19.0/http/" -boot_wait = "20s" +boot_wait = "40s" shutdown_command = "sudo poweroff" diff --git a/distros/alpine/3.20/amd64.pkrvars.hcl b/distros/alpine/3.20/amd64.pkrvars.hcl index 86d0d4a..27cf63e 100644 --- a/distros/alpine/3.20/amd64.pkrvars.hcl +++ b/distros/alpine/3.20/amd64.pkrvars.hcl @@ -15,5 +15,5 @@ boot_command = [ "/bin/ash ./answers.cfg.sh 2>&1 | tee install.log", ] http_directory = "distros/alpine/3.20/http/" -boot_wait = "20s" +boot_wait = "40s" shutdown_command = "sudo poweroff" diff --git a/distros/alpine/3.21/amd64.pkrvars.hcl b/distros/alpine/3.21/amd64.pkrvars.hcl index 45c7b72..c292a20 100644 --- a/distros/alpine/3.21/amd64.pkrvars.hcl +++ b/distros/alpine/3.21/amd64.pkrvars.hcl @@ -15,5 +15,5 @@ boot_command = [ "/bin/ash ./answers.cfg.sh 2>&1 | tee install.log", ] http_directory = "distros/alpine/3.21/http/" -boot_wait = "20s" +boot_wait = "40s" shutdown_command = "sudo poweroff" diff --git a/distros/alpine/3.22/amd64.pkrvars.hcl b/distros/alpine/3.22/amd64.pkrvars.hcl index 0ebb316..3ab3fde 100644 --- a/distros/alpine/3.22/amd64.pkrvars.hcl +++ b/distros/alpine/3.22/amd64.pkrvars.hcl @@ -15,5 +15,5 @@ boot_command = [ "/bin/ash ./answers.cfg.sh 2>&1 | tee install.log", ] http_directory = "distros/alpine/3.22/http/" -boot_wait = "20s" +boot_wait = "40s" shutdown_command = "sudo poweroff" From 8ac704a100409713cb7b9ef3acf32891674008a1 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Aug 2025 12:35:13 -0500 Subject: [PATCH 20/25] Hopefully fix Mint 22 install problems Mint 22 install was hanging on Virtualbox because it was not installing openssh-server at the end of the run. I do not know whether the `|| true` lines fixed this, or if it was the `d-i pkgsel/include` line getting fixed, but the result is that it now builds and installs for Virtualbox --- distros/mint/22/amd64.pkrvars.hcl | 3 ++- distros/mint/22/finalize.sh | 3 +++ distros/mint/22/http/preseed.cfg | 16 ++++++++-------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/distros/mint/22/amd64.pkrvars.hcl b/distros/mint/22/amd64.pkrvars.hcl index 3a5e1a5..36317ba 100644 --- a/distros/mint/22/amd64.pkrvars.hcl +++ b/distros/mint/22/amd64.pkrvars.hcl @@ -11,7 +11,8 @@ boot_command = [ "automatic-ubiquity ", #"only-ubiquity ", "url=http://{{.HTTPIP}}:{{ .HTTPPort }}/preseed.cfg ", + "video=VGA-1:1600x1200 ", "", ] http_directory = "distros/mint/22/http/" -vbox_os_type = "Debian12_64" +vbox_os_type = "Ubuntu24_LTS_64" diff --git a/distros/mint/22/finalize.sh b/distros/mint/22/finalize.sh index 9da84aa..8bdb3c0 100644 --- a/distros/mint/22/finalize.sh +++ b/distros/mint/22/finalize.sh @@ -10,6 +10,9 @@ UseDNS no PubkeyAcceptedKeyTypes +ssh-rsa EOF +apt update +apt upgrade -y + # Clean up after ourselves apt-get clean diff --git a/distros/mint/22/http/preseed.cfg b/distros/mint/22/http/preseed.cfg index d6a3b2a..7990043 100644 --- a/distros/mint/22/http/preseed.cfg +++ b/distros/mint/22/http/preseed.cfg @@ -70,7 +70,7 @@ ubiquity ubiquity/use_nonfree boolean false # Package selection tasksel tasksel/first multiselect -#d-i pkgsel/include string curl openssh-server sudo python3 network-manager +d-i pkgsel/include string openssh-server popularity-contest popularity-contest/participate boolean false @@ -83,10 +83,10 @@ ubiquity ubiquity/success_command string \ echo 'Defaults:vagrant !requiretty' > /target/etc/sudoers.d/vagrant; \ echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /target/etc/sudoers.d/vagrant; \ chmod 440 /target/etc/sudoers.d/vagrant; \ - sed -i -e 's/ens3/ens5/g' /target/etc/network/interfaces; \ - IF=$(ip -br a|grep DOWN|head -1|awk '{print $1}'); \ - ip link set up dev $IF; \ - dhclient $IF; \ - in-target apt-get update; \ - in-target apt-get upgrade -y; \ - in-target apt-get install -y openssh-server + sed -i -e 's/ens3/ens5/g' /target/etc/network/interfaces || true; \ + IF=$(ip -br a|grep DOWN|head -1|awk '{print $1}') || true; \ + ip link set up dev $IF || true; \ + dhclient $IF || true; \ + in-target apt update; \ + in-target apt upgrade; \ + in-target apt install -y openssh-server From 88e74c95ed0d13944842998768f4a270c290f64e Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Tue, 19 Aug 2025 20:13:08 -0500 Subject: [PATCH 21/25] Fix Tumbleweed (hopefully) Move Tumbleweed to using the Agama installer Change it from fully dynamic to using the update script --- distros/opensuse/16.0/amd64.pkrvars.hcl | 3 - .../opensuse/tumbleweed/amd64.pkrvars.hcl.sh | 37 ------ distros/opensuse/tumbleweed/http/autoinst.xml | 125 ------------------ .../opensuse/tumbleweed/http/profile.jsonnet | 88 ++++++++++++ distros/opensuse/tumbleweed/update.sh | 24 ++++ 5 files changed, 112 insertions(+), 165 deletions(-) delete mode 100755 distros/opensuse/tumbleweed/amd64.pkrvars.hcl.sh delete mode 100644 distros/opensuse/tumbleweed/http/autoinst.xml create mode 100644 distros/opensuse/tumbleweed/http/profile.jsonnet create mode 100755 distros/opensuse/tumbleweed/update.sh diff --git a/distros/opensuse/16.0/amd64.pkrvars.hcl b/distros/opensuse/16.0/amd64.pkrvars.hcl index 5eb5b1c..70e2752 100644 --- a/distros/opensuse/16.0/amd64.pkrvars.hcl +++ b/distros/opensuse/16.0/amd64.pkrvars.hcl @@ -1,8 +1,6 @@ distro = "opensuse" version = "16.0" iso = { - #url = "https://download.opensuse.org/distribution/leap/16.0/installer/iso/agama-installer.x86_64-Leap_16.0.iso" - #checksum = "d3e7a86c4ab7296480ad41a2ca30bde5cad0ff2210b145dd2011403f648f76cb" url = "https://download.opensuse.org/distribution/leap/16.0/installer/iso/agama-installer.x86_64-17.0.0-Leap_16.0-Build151.4.iso" checksum = "d3e7a86c4ab7296480ad41a2ca30bde5cad0ff2210b145dd2011403f648f76cb" } @@ -16,6 +14,5 @@ boot_command = [ "x" ] boot_wait = "8s" -cd_files = [ "distros/opensuse/16.0/http/" ] http_directory = "distros/opensuse/16.0/http/" vbox_os_type = "OpenSUSE_Leap_64" diff --git a/distros/opensuse/tumbleweed/amd64.pkrvars.hcl.sh b/distros/opensuse/tumbleweed/amd64.pkrvars.hcl.sh deleted file mode 100755 index b8eca9e..0000000 --- a/distros/opensuse/tumbleweed/amd64.pkrvars.hcl.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!env bash - -set -x - -name="${0%.sh}" - -base="https://download.opensuse.org/tumbleweed/iso/openSUSE-Tumbleweed-DVD-x86_64-Current.iso" - -# Working directory -tmp="$(mktemp -d)" -checksums="${tmp}/checksums" - -# Read the SHA256 sum value -sums="${base}.sha256" -until curl -f -L -o "${checksums}" "${sums}"; do - sleep 1 -done -sha="$(cut -d' ' -f 1 "${checksums}")" - -cat << EOF > "${name}" -distro = "opensuse" -version = "tumbleweed" -iso = { - url = "${base}" - checksum = "${sha}" -} -boot_command = [ - "e", - "", - " autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/autoinst.xml textmode=1", - "x" -] -http_directory = "distros/opensuse/tumbleweed/http/" -vbox_os_type = "OpenSUSE_Tumbleweed_64" -EOF - -rm -r "${tmp}" diff --git a/distros/opensuse/tumbleweed/http/autoinst.xml b/distros/opensuse/tumbleweed/http/autoinst.xml deleted file mode 100644 index 6df26a9..0000000 --- a/distros/opensuse/tumbleweed/http/autoinst.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - false - true - - - - - - wheel - vagrant - - - - true - external - - - public - - eth0 - - - ssh - - - - - - - all - - - /boot - 512MiB - - - / - max - - - - - - en_US - - - network_manager - - - - - sshd - - - - - - openssh - sudo - - true - false - - openSUSE - - - - UTC - UTC - - - - root - vagrant - false - - - vagrant - vagrant - false - - - - - - - - - - /etc/sudoers.d/vagrant - - - - 440 - root - - - /home/vagrant/.ssh/authorized_keys - 600 - vagrant - https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant.pub - - - diff --git a/distros/opensuse/tumbleweed/http/profile.jsonnet b/distros/opensuse/tumbleweed/http/profile.jsonnet new file mode 100644 index 0000000..9d32930 --- /dev/null +++ b/distros/opensuse/tumbleweed/http/profile.jsonnet @@ -0,0 +1,88 @@ +// For more docs, check out +// https://agama-project.github.io/docs/user/profile/dynamic +// This is a Jsonnet file. Please, check https://jsonnet.org/ for more +// information about the language. +// For the schema, see +// https://github.com/openSUSE/agama/blob/master/rust/agama-lib/share/profile.schema.json + +// The "hw.libsonnet" file contains hardware information from the "lshw" tool. +// Agama generates this file at runtime by running (with root privileges): +// +// lshw -json +// +// There are included also helpers to search this hardware tree. To see helpers check +// "/usr/share/agama-cli/agama.libsonnet" +local agama = import 'hw.libsonnet'; + +// Find the biggest disk which is suitable for installing the system. +local findBiggestDisk(disks) = + local sizedDisks = std.filter(function(d) std.objectHas(d, 'size'), disks); + local sorted = std.sort(sizedDisks, function(x) -x.size); + sorted[0].logicalname; + +// Find how much physical memory system has. +local memory = agama.findByID(agama.lshw, 'memory').size; + +{ + product: { + id: 'Tumbleweed', + }, + software: { + patterns: [ + ], + }, + user: { + fullName: 'vagrant', + userName: 'vagrant', + password: 'vagrant', + }, + root: { + password: 'vagrant', + }, + localization: { + language: 'en_US', + keyboard: 'us', + }, + bootloader: { + extraKernelParams: "nomodeset" + }, + storage: { + boot: { + configure: true, + device: "boot", + }, + drives: [{ + search: findBiggestDisk(agama.selectByClass(agama.lshw, 'disk')), + alias: "boot", + ptableType: 'gpt', + partitions: [{ + "search": "*", + "delete": true, + },{ + "generate": "default" + }], + }] + }, + scripts: { + post: [ { + name: 'configure-vagrant', + chroot: true, + content: ||| + #!/bin/bash + # Configure the insecure Vagrant SSH key + mkdir -p /home/vagrant/.ssh + curl -o /home/vagrant/.ssh/authorized_keys https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant.pub + chown -R vagrant /home/vagrant/.ssh + chmod 600 /home/vagrant/.ssh + # Start services + systemctl enable sshd + # Configure sudo access for the vagrant user + cat << EOF > /etc/sudoers.d/00_vagrant + Defaults:vagrant !requiretty + vagrant ALL=(ALL) NOPASSWD: ALL + root ALL=(ALL) NOPASSWD: ALL + EOF + |||, + } ] + }, +} diff --git a/distros/opensuse/tumbleweed/update.sh b/distros/opensuse/tumbleweed/update.sh new file mode 100755 index 0000000..23e02aa --- /dev/null +++ b/distros/opensuse/tumbleweed/update.sh @@ -0,0 +1,24 @@ +#!env bash + +set -exo pipefail + +dir="$(cd "$(dirname "${0}")"; pwd)" + +base="https://download.opensuse.org/repositories/systemsmanagement:/Agama:/Devel/images/iso/agama-installer.x86_64-17.0.0-openSUSE-Build6.13.iso" + +# Working directory +tmp="$(mktemp -d)" +trap "rm -rf '${tmp}'" EXIT +checksums="${tmp}/checksums" + +# Read the SHA256 sum value +sums="${base}.sha256" +until curl -f -L -o "${checksums}" "${sums}"; do + sleep 1 +done +sha="$(cut -d' ' -f 1 "${checksums}")" + +sed -E -i \ + -e "s,( checksum *=).*$,\1 \"$sha\"," + +rm -r "${tmp}" From ec0b87cee70c959e9e35166214f4becd4d7fe11d Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Tue, 19 Aug 2025 20:26:37 -0500 Subject: [PATCH 22/25] First attempt at auto update job --- .gitlab-ci.yml | 6 +++++ .gitlab/update.yml | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .gitlab/update.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 558e58e..abf38dd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,10 +12,16 @@ workflow: when: never # Run reduced pipeline for branches - if: $CI_COMMIT_BRANCH + - if: $CI_PIPELINE_SOURCE == "web" include: # Low-effort, we can always do lint checks, validations, and so forth - local: .gitlab/always.yml + rules: + - if: $CI_PIPELINE_SOURCE != "web" + - local: .gitlab/update.yml + rules: + - if: $CI_PIPELINE_SOURCE == "web" # Actual download of ISOs and building of images. This should only be # done some of the time - local: .gitlab/build.yml diff --git a/.gitlab/update.yml b/.gitlab/update.yml new file mode 100644 index 0000000..7902c33 --- /dev/null +++ b/.gitlab/update.yml @@ -0,0 +1,55 @@ +version_update: + stage: generate + image: "alpine/git:latest" + artifacts: + reports: + dotenv: update.env + script: + - |- + set -x + shopt -s globstar + for updater in distros/**/update.sh; do + bash "$updater" + done + - |- + if git diff --quiet; then + echo "No changes necessary" + else + echo "Found updates to make" + git checkout -b "autoupdate/$CI_PIPELINE_IID" + echo "BRANCH=autoupdate/$CI_PIPELINE_IID" >> update.env + git config set user.name "Greg Hellings - automation" + git config set user.email "greg@thehellings.com" + git stage . + git commit -m "Automatic update $CI_PIPEILNE_IID" + git push "https://${GITLAB_USER_LOGIN}:${CI_GIT_TOKEN}@${CI_REPOSITORY_URL#*@}" HEAD + fi + +create_pr: + image: + name: registry.gitlab.com/python-gitlab/python-gitlab:latest + entrypoint: [ '' ] + stage: trigger + needs: + - version_update + dependencies: + - version_update + variables: + GIT_STRATEGY: none + GITLAB_PRIVATE_TOKEN: $CI_GIT_TOKEN + script: + - test -z ${DO_UPDATE} && { echo "No updates required. Not creating PR"; exit 0; } + - >- + CREATE_MR=$(gitlab project-merge-request create + --remote-source-branch true + --project-id ${CI_PROJECT_ID} + --source-branch "${BRANCH}" + --target-branch "main" + --title "Update ISO checksums" + - IID=${CREATE_MR#* } + - >- + gitlab project-merge-request merge + --project-id ${CI_PROJECT_ID} + --iid ${IID} + --merge-when-pipeline-succeeds true + - echo "PR set to auto-merge if build succeeds" From 0f424e2e0cb2302ff8cfa0d68fa5a04aebfefeff Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Tue, 19 Aug 2025 20:32:22 -0500 Subject: [PATCH 23/25] Fix shellcheck --- distros/opensuse/tumbleweed/update.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/distros/opensuse/tumbleweed/update.sh b/distros/opensuse/tumbleweed/update.sh index 23e02aa..37f05e2 100755 --- a/distros/opensuse/tumbleweed/update.sh +++ b/distros/opensuse/tumbleweed/update.sh @@ -8,7 +8,7 @@ base="https://download.opensuse.org/repositories/systemsmanagement:/Agama:/Devel # Working directory tmp="$(mktemp -d)" -trap "rm -rf '${tmp}'" EXIT +trap 'rm -rf "${tmp}"' EXIT checksums="${tmp}/checksums" # Read the SHA256 sum value @@ -19,6 +19,5 @@ done sha="$(cut -d' ' -f 1 "${checksums}")" sed -E -i \ - -e "s,( checksum *=).*$,\1 \"$sha\"," - -rm -r "${tmp}" + -e "s,( checksum *=).*$,\1 \"$sha\"," \ + "${dir}/amd64.pkrvars.hcl" From 6bc3eb22f1fca23697f9e8a7149d085edfd9612d Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Tue, 19 Aug 2025 20:53:37 -0500 Subject: [PATCH 24/25] Actually update Tumbleweed --- .gitignore | 1 - distros/opensuse/tumbleweed/amd64.pkrvars.hcl | 15 +++++++++++++++ distros/opensuse/tumbleweed/update.sh | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 distros/opensuse/tumbleweed/amd64.pkrvars.hcl diff --git a/.gitignore b/.gitignore index 8fac0c1..0c22614 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,6 @@ packer_config/ distros/fedora/rawhide/*.hcl distros/nixos/**/*.hcl distros/centos-stream/**/*.hcl -distros/opensuse/tumbleweed/*.hcl __pycache__ *.pyc diff --git a/distros/opensuse/tumbleweed/amd64.pkrvars.hcl b/distros/opensuse/tumbleweed/amd64.pkrvars.hcl new file mode 100644 index 0000000..7ed5937 --- /dev/null +++ b/distros/opensuse/tumbleweed/amd64.pkrvars.hcl @@ -0,0 +1,15 @@ +distro = "opensuse" +version = "tumbleweed" +iso = { + url = "https://download.opensuse.org/repositories/systemsmanagement:/Agama:/Devel/images/iso/agama-installer.x86_64-openSUSE.iso" + checksum = "221f98ea042ad5f191eb7cc2c57811c5e3ba3dda49627f42bcec240868942447" +} +boot_command = [ + "e", + "", + " inst.auto=http://{{ .HTTPIP }}:{{ .HTTPPort }}/profile.jsonnet", + "x" +] +boot_wait = "8s" +http_directory = "distros/opensuse/tumbleweed/http/" +vbox_os_type = "OpenSUSE_Tumbleweed_64" diff --git a/distros/opensuse/tumbleweed/update.sh b/distros/opensuse/tumbleweed/update.sh index 37f05e2..e6da5c5 100755 --- a/distros/opensuse/tumbleweed/update.sh +++ b/distros/opensuse/tumbleweed/update.sh @@ -4,7 +4,7 @@ set -exo pipefail dir="$(cd "$(dirname "${0}")"; pwd)" -base="https://download.opensuse.org/repositories/systemsmanagement:/Agama:/Devel/images/iso/agama-installer.x86_64-17.0.0-openSUSE-Build6.13.iso" +base="https://download.opensuse.org/repositories/systemsmanagement:/Agama:/Devel/images/iso/agama-installer.x86_64-openSUSE.iso" # Working directory tmp="$(mktemp -d)" From ca4c0f61d0e08ebf36c8533e58a3aeff2bdf82f7 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Wed, 20 Aug 2025 10:11:39 -0500 Subject: [PATCH 25/25] Auto-retry for build jobs, because the real world is messy --- nix/continue.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/continue.nix b/nix/continue.nix index e4f3223..e70d23a 100644 --- a/nix/continue.nix +++ b/nix/continue.nix @@ -10,6 +10,7 @@ let general = { stage = "build"; + retry = 2; cache = [ { key = {