From f256eb583c6b6bec05a865353a6e7c1079d41ab4 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Nov 2024 11:11:45 -0600 Subject: [PATCH 01/12] Update for Ubuntu 24.04.01 CDs --- distros/ubuntu/24.04/amd64.pkrvars.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distros/ubuntu/24.04/amd64.pkrvars.hcl b/distros/ubuntu/24.04/amd64.pkrvars.hcl index e99de25..0e2ae1b 100644 --- a/distros/ubuntu/24.04/amd64.pkrvars.hcl +++ b/distros/ubuntu/24.04/amd64.pkrvars.hcl @@ -1,8 +1,8 @@ distro = "ubuntu" version = "24.04" iso = { - url = "http://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.iso" - checksum = "8762f7e74e4d64d72fceb5f70682e6b069932deedb4949c6975d0f0fe0a91be3" + url = "http://releases.ubuntu.com/24.04/ubuntu-24.04.01-live-server-amd64.iso" + checksum = "e240e4b801f7bb68c20d1356b60968ad0c33a41d00d828e74ceb3364a0317be9" } boot_command = [ "e", From 83a3a9e9cbe981ec2fde6056b43b02f6dfb0ea60 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Nov 2024 11:13:03 -0600 Subject: [PATCH 02/12] Add Ubuntu 24.10 --- distros/ubuntu/24.10/amd64.pkrvars.hcl | 19 +++++++++++ distros/ubuntu/24.10/disc/meta-data | 0 distros/ubuntu/24.10/disc/user-data | 47 ++++++++++++++++++++++++++ distros/ubuntu/24.10/finalize.sh | 16 +++++++++ distros/ubuntu/24.10/qemu.sh | 6 ++++ distros/ubuntu/24.10/virtualbox.sh | 4 +++ distros/ubuntu/24.10/vmware.sh | 4 +++ distros/ubuntu/default.nix | 4 +++ 8 files changed, 100 insertions(+) create mode 100644 distros/ubuntu/24.10/amd64.pkrvars.hcl create mode 100644 distros/ubuntu/24.10/disc/meta-data create mode 100644 distros/ubuntu/24.10/disc/user-data create mode 100644 distros/ubuntu/24.10/finalize.sh create mode 100644 distros/ubuntu/24.10/qemu.sh create mode 100644 distros/ubuntu/24.10/virtualbox.sh create mode 100644 distros/ubuntu/24.10/vmware.sh diff --git a/distros/ubuntu/24.10/amd64.pkrvars.hcl b/distros/ubuntu/24.10/amd64.pkrvars.hcl new file mode 100644 index 0000000..40100e1 --- /dev/null +++ b/distros/ubuntu/24.10/amd64.pkrvars.hcl @@ -0,0 +1,19 @@ +distro = "ubuntu" +version = "24.10" +iso = { + url = "http://releases.ubuntu.com/24.10/ubuntu-24.10-live-server-amd64.iso" + checksum = "4fce7c02a5e5dbe3426da4aa0f8b7845e9a36aff29c5884d206a08e51b2c4c47" +} +boot_command = [ + "e", + "fsck.mode=skip ", + "locale=en_US ", + "auto=true ", + "priority=critical ", + "autoinstall", + "", +] +cd_files = [ + "distros/ubuntu/24.10/disc/*" +] +vbox_os_type = "Ubuntu24_64" diff --git a/distros/ubuntu/24.10/disc/meta-data b/distros/ubuntu/24.10/disc/meta-data new file mode 100644 index 0000000..e69de29 diff --git a/distros/ubuntu/24.10/disc/user-data b/distros/ubuntu/24.10/disc/user-data new file mode 100644 index 0000000..4b96996 --- /dev/null +++ b/distros/ubuntu/24.10/disc/user-data @@ -0,0 +1,47 @@ +#cloud-config +# vim: set ft=yaml: +autoinstall: + version: 1 + network: # Should disable networking, workaround for unattended-updates failing in install + version: 2 + ethernets: + eth0: + match: + name: e* + dhcp4: yes + dhcp6: no + refresh-installer: + update: no + keyboard: + layout: us + toggle: null + variant: '' + locale: en_US.UTF-8 + identity: + hostname: vagrant + username: vagrant + password: $6$rounds=4096$mJTRlY/vwPMquLe0$s4Ld3ZnvF.pM86xzbAgQD7Xpi/NMVgyQNb5CEfabFgL6nLRsP56WtwA.o.Jg/xC6HaJmM2p5fCGIo37jmKVRI0 + ssh: + install-server: yes + authorized_keys: + - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key + allow-pw: yes + user-data: + disable_root: false + package_update: false + package_upgrade: false + late-commands: + - 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 + - >- + curtin in-target --target=/target -- + bash -c 'if [ "$(systemd-detect-virt)" == "microsoft" ]; then + apt-get update; + apt-get install -y linux-azure; + fi' + - curtin in-target --target=/target -- logger "finished late-commands" + packages: + - ca-certificates + - curl + - sudo diff --git a/distros/ubuntu/24.10/finalize.sh b/distros/ubuntu/24.10/finalize.sh new file mode 100644 index 0000000..f79a717 --- /dev/null +++ b/distros/ubuntu/24.10/finalize.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -ex + +apt remove cloud-init -y + +apt update +apt upgrade -y + +# Make sshd 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 diff --git a/distros/ubuntu/24.10/qemu.sh b/distros/ubuntu/24.10/qemu.sh new file mode 100644 index 0000000..4ef2dee --- /dev/null +++ b/distros/ubuntu/24.10/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/ubuntu/24.10/virtualbox.sh b/distros/ubuntu/24.10/virtualbox.sh new file mode 100644 index 0000000..2813d68 --- /dev/null +++ b/distros/ubuntu/24.10/virtualbox.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -ex + +apt install -y virtualbox-guest-utils diff --git a/distros/ubuntu/24.10/vmware.sh b/distros/ubuntu/24.10/vmware.sh new file mode 100644 index 0000000..9560300 --- /dev/null +++ b/distros/ubuntu/24.10/vmware.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -ex + +apt install -y open-vm-tools diff --git a/distros/ubuntu/default.nix b/distros/ubuntu/default.nix index c823abf..e86e7ca 100644 --- a/distros/ubuntu/default.nix +++ b/distros/ubuntu/default.nix @@ -18,4 +18,8 @@ version = "24.04"; arch = "amd64"; eol = false; +} { + version = "24.10"; + arch = "amd64"; + eol = false; } ] From bd64aeda1813150a8319ba3d4c37940bc75b3bdd Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Nov 2024 11:23:16 -0600 Subject: [PATCH 03/12] Updated alpine ISO to 3.20.3 --- distros/alpine/3.20/amd64.pkrvars.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distros/alpine/3.20/amd64.pkrvars.hcl b/distros/alpine/3.20/amd64.pkrvars.hcl index 42369d8..ec3b780 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 = "http://dl-cdn.alpinelinux.org/alpine/v3.20/releases/x86_64/alpine-standard-3.20.1-x86_64.iso" - checksum = "c3043af6421b6e0ab22994b01d10785728888b37d976a754f12f23b42aecd95e" + url = "http://dl-cdn.alpinelinux.org/alpine/v3.20/releases/x86_64/alpine-standard-3.20.3-x86_64.iso" + checksum = "c66fc1e0470781f8ecbab8eb9cc8d906066171a5e0c6c1ab20aedc7061836d27" } boot_command = [ "root", From c5b6a5b08e26229ec4028bb9d90bf5cf20528301 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Nov 2024 11:29:25 -0600 Subject: [PATCH 04/12] Update Alpine image to 3.19.4 --- distros/alpine/3.19.0/amd64.pkrvars.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distros/alpine/3.19.0/amd64.pkrvars.hcl b/distros/alpine/3.19.0/amd64.pkrvars.hcl index b475795..b339fbf 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 = "http://dl-cdn.alpinelinux.org/alpine/v3.19/releases/x86_64/alpine-extended-3.19.2-x86_64.iso" - checksum = "508944822217be4c2c7b947a64220271055b1883a025e5cb351950b27f046a15" + url = "http://dl-cdn.alpinelinux.org/alpine/v3.19/releases/x86_64/alpine-extended-3.19.4-x86_64.iso" + checksum = "1b7efcb485ec5ce6f662782ba318a8a75b33be07188b6da0e005e03744afe3c1" } boot_command = [ "root", From 2a30976578f87c779fc972e96cd5f0a4ea4586d5 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Nov 2024 11:29:42 -0600 Subject: [PATCH 05/12] Update Debian 11 to 11.11 image --- distros/debian/11/amd64.pkrvars.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distros/debian/11/amd64.pkrvars.hcl b/distros/debian/11/amd64.pkrvars.hcl index 795b6cb..a8f591d 100644 --- a/distros/debian/11/amd64.pkrvars.hcl +++ b/distros/debian/11/amd64.pkrvars.hcl @@ -1,8 +1,8 @@ distro = "debian" version = "11" iso = { - url = "https://cdimage.debian.org/cdimage/archive/11.9.0/amd64/iso-cd/debian-11.9.0-amd64-netinst.iso" - checksum = "01c540225250d42cda3809d7130d0c27e934c8aca260d01a86d33dee19623b0f" + url = "https://cdimage.debian.org/cdimage/archive/11.11.0/amd64/iso-cd/debian-11.11.0-amd64-netinst.iso" + checksum = "cd5b2a6fc22050affa1d141adb3857af07e94ff886dca1ce17214e2761a3b316" } boot_command = [ "e", From 798c53ac5bf551ac272feb5e00240aea8f5d3b19 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Nov 2024 11:29:58 -0600 Subject: [PATCH 06/12] Update Debian 12 to Debian 12.8 image --- distros/debian/12/amd64.pkrvars.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distros/debian/12/amd64.pkrvars.hcl b/distros/debian/12/amd64.pkrvars.hcl index e77c0b5..b0b833f 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 = "http://cdimage.debian.org/cdimage/release/12.6.0/amd64/iso-cd/debian-12.6.0-amd64-netinst.iso" - checksum = "ade3a4acc465f59ca2496344aab72455945f3277a52afc5a2cae88cdc370fa12" + url = "http://cdimage.debian.org/cdimage/release/12.8.0/amd64/iso-cd/debian-12.8.0-amd64-netinst.iso" + checksum = "04396d12b0f377958a070c38a923c227832fa3b3e18ddc013936ecf492e9fbb3" } boot_command = [ "e", From 3d4d82d130351e149982998835d784b3254c0e92 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Nov 2024 14:31:16 -0600 Subject: [PATCH 07/12] Add Fedora 41 --- distros/fedora/41/amd64-ks.cfg | 182 ++++++++++++++++++++++++++++ distros/fedora/41/amd64.pkrvars.hcl | 14 +++ distros/fedora/41/finalize.sh | 6 + distros/fedora/41/qemu.sh | 6 + distros/fedora/41/virtualbox.sh | 6 + distros/fedora/41/vmware.sh | 4 + distros/fedora/default.nix | 4 + 7 files changed, 222 insertions(+) create mode 100644 distros/fedora/41/amd64-ks.cfg create mode 100644 distros/fedora/41/amd64.pkrvars.hcl create mode 100644 distros/fedora/41/finalize.sh create mode 100644 distros/fedora/41/qemu.sh create mode 100644 distros/fedora/41/virtualbox.sh create mode 100644 distros/fedora/41/vmware.sh diff --git a/distros/fedora/41/amd64-ks.cfg b/distros/fedora/41/amd64-ks.cfg new file mode 100644 index 0000000..9e19b81 --- /dev/null +++ b/distros/fedora/41/amd64-ks.cfg @@ -0,0 +1,182 @@ +user --name=vagrant --password=vagrant +rootpw --plaintext vagrant + +text # don't use cmdline -- https://github.com/rhinstaller/anaconda/issues/931 +lang en_US.UTF-8 +keyboard us +timezone --utc Etc/UTC + +selinux --enforcing + +firewall --disabled + +# We pass net.ifnames=0 because we always want to use eth0 here on all the cloud images. +bootloader --timeout=1 --location=mbr --append="no_timer_check net.ifnames=0 console=tty1 console=ttyS0,115200n8 biosdevnames=0" + +services --enabled=sshd + +# Configure for gpt with bios+uefi +clearpart --all --initlabel --disklabel=gpt +part prepboot --size=4 --fstype=prepboot +part biosboot --size=1 --fstype=biosboot +part /boot/efi --size=100 --fstype=efi +part /boot --size=1000 --fstype=ext4 --label=boot +part btrfs.007 --size=2000 --fstype=btrfs --grow +btrfs none --label=fedora btrfs.007 +btrfs /home --subvol --name=home LABEL=fedora +btrfs / --subvol --name=root LABEL=fedora + +repo --name=fedora --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch +repo --name=updates --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch +url --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch + +reboot + +##### begin package list ############################################# +%packages --instLangs=en + +# Include packages for the cloud-server-environment group +@^cloud-server-environment + +# Install the tracer dnf plugin to enable automatic reboots +# IF the user requests package updates +# AND requests a reboot +# AND the packages updated require a reboot. +# https://fedoraproject.org/wiki/Changes/Automatic_Cloud_Reboot_On_Updates +python3-dnf-plugin-tracer + +# Don't include the kernel toplevel package since it pulls in +# kernel-modules. We're happy for now with kernel-core. +-kernel +kernel-core + +# Don't include dracut-config-rescue. It will have dracut generate a +# "rescue" entry in the grub menu, but that also means there is a +# rescue kernel and initramfs that get created, which (currently) add +# about another 40MiB to the /boot/ partition. Also the "rescue" mode +# is generally not useful in the cloud. +-dracut-config-rescue + +# Plymouth provides a graphical boot animation. In the cloud we don't +# need a graphical boot animation. This also means anaconda won't put +# rhgb/quiet on kernel command line +-plymouth + +# Install qemu-guest-agent https://pagure.io/cloud-sig/issue/319 To +# improve the integration with OpenStack and other VM management +# systems (oVirt, KubeVirt). +qemu-guest-agent + + +# No need for firewalld for now. We don't have a firewall on by default. +-firewalld + +# Don't include the geolite2 databases, which end up with 66MiB +# in /usr/share/GeoIP +-geolite2-country +-geolite2-city + +# Specific to vagrant +rsync +fuse-sshfs +%end +##### end package list ############################################### + + +##### begin kickstart post ########################################### +%post --erroronfail +#!/bin/bash +set -x +if [ -e /dev/vda ]; then + device="/dev/vda" +elif [ -e /dev/sda ]; then + device="/dev/sda" +else + echo "No device found" + exit 1 +fi + +virt="$(systemd-detect-virt)" +if [ "${virt}" == "microsoft" ]; then + dnf install -y hyperv-daemons + systemctl enable hpervfcopyd + systemctl enable hypervkvpd + systemctl enable hypervvssd +fi + +if [ "$(arch)" = "x86_64" ]; then +# Set up legacy BIOS boot if we booted from UEFI +grub2-install --target=i386-pc "${device}" +fi + +# Blivet sets pmbr_boot flag erroneously and we need to purge it +# otherwise it'll fail to boot +parted "${device}" disk_set pmbr_boot off + +# linux-firmware is installed by default and is quite large. As of mid 2020: +# Total download size: 97 M +# Installed size: 268 M +# So far we've been fine shipping without it so let's continue. +# More discussion about this in #1234504. +echo "Removing linux-firmware package." +rpm -e linux-firmware + +# See the systemd-random-seed.service man page that says: +# " It is recommended to remove the random seed from OS images intended +# for replication on multiple systems" +echo "Removing random-seed so it's not the same in every image." +rm -f /var/lib/systemd/random-seed + +echo "Import RPM GPG key" +releasever=$(rpm --eval '%{fedora}') +basearch=$(uname -i) +rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch + +echo "Zeroing out empty space." +# Create zeros file with nodatacow and no compression +touch /var/tmp/zeros +chattr +C /var/tmp/zeros +# This forces the filesystem to reclaim space from deleted files +dd bs=1M if=/dev/zero of=/var/tmp/zeros || : +echo "(Don't worry -- that out-of-space error was expected.)" +# Force sync to disk (Cf. https://pagure.io/cloud-sig/issue/340#comment-743430) +btrfs filesystem sync / +rm -f /var/tmp/zeros +btrfs filesystem sync / + +# When we build the image a networking config file gets left behind. +# Let's clean it up. +echo "Cleanup leftover networking configuration" +rm -f /etc/NetworkManager/system-connections/*.nmconnection +#*/ + +# Truncate the /etc/resolv.conf left over from NetworkManager during the +# kickstart. This causes delays in boot with cloud-init because the +# 192.168.122.1 DNS server cannot be reached. +truncate -s 0 /etc/resolv.conf + +# Clear machine-id on pre generated images +truncate -s 0 /etc/machine-id + +# Vagrant setup +sed -i 's,Defaults\\s*requiretty,Defaults !requiretty,' /etc/sudoers +echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant-nopasswd +sed -i 's/.*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config + +cat > /etc/ssh/sshd_config.d/10-vagrant-insecure-rsa-key.conf <e ", + "net.ifnames=0 biosdevnames=0 inst.ks=cdrom:/amd64-ks.cfg inst.notmux " +] +cd_files = [ + "distros/fedora/41/*.cfg" +] +vbox_os_type = "Fedora_64" diff --git a/distros/fedora/41/finalize.sh b/distros/fedora/41/finalize.sh new file mode 100644 index 0000000..c30e5a8 --- /dev/null +++ b/distros/fedora/41/finalize.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -ex + +dnf -y update + +dnf clean all diff --git a/distros/fedora/41/qemu.sh b/distros/fedora/41/qemu.sh new file mode 100644 index 0000000..569dc7c --- /dev/null +++ b/distros/fedora/41/qemu.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -ex + +dnf install -y qemu-guest-agent +systemctl start qemu-guest-agent +systemctl enable qemu-guest-agent diff --git a/distros/fedora/41/virtualbox.sh b/distros/fedora/41/virtualbox.sh new file mode 100644 index 0000000..209dab5 --- /dev/null +++ b/distros/fedora/41/virtualbox.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -ex + +dnf install -y virtualbox-guest-additions +systemctl start vboxservice +systemctl enable vboxservice diff --git a/distros/fedora/41/vmware.sh b/distros/fedora/41/vmware.sh new file mode 100644 index 0000000..058afc2 --- /dev/null +++ b/distros/fedora/41/vmware.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -ex + +dnf install -y open-vm-tools diff --git a/distros/fedora/default.nix b/distros/fedora/default.nix index 17da572..1df116d 100644 --- a/distros/fedora/default.nix +++ b/distros/fedora/default.nix @@ -14,6 +14,10 @@ version = "40"; arch = "amd64"; eol = false; +} { + version = "41"; + arch = "amd64"; + eol = false; } { version = "rawhide"; arch = "amd64"; From 3ca62bcd2eb42b63542bef5d38773e7f504ee5ff Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Nov 2024 14:31:43 -0600 Subject: [PATCH 08/12] Use STORAGE_URL from the environment --- flake.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flake.nix b/flake.nix index 21924ed..5aa1987 100644 --- a/flake.nix +++ b/flake.nix @@ -87,6 +87,9 @@ } { name = "PACKER_CONFIG_DIR"; value = "./packer_config"; + } { + name = "STORAGE_URL"; + value = "http://s3.thehellings.lan:9000"; } ]; }; From c03db23fa3d6a9bbc739640da0a4495358ae0c89 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Nov 2024 18:26:48 -0600 Subject: [PATCH 09/12] Prepare Leap 16 for eventual release --- distros/opensuse/16.0/amd64.pkrvars.hcl | 16 +++ distros/opensuse/16.0/finalize.sh | 4 + distros/opensuse/16.0/http/autoinst.xml | 125 +++++++++++++++++++++ distros/opensuse/16.0/http/profile.jsonnet | 101 +++++++++++++++++ distros/opensuse/16.0/qemu.sh | 6 + distros/opensuse/16.0/virtualbox.sh | 2 + distros/opensuse/16.0/vmware.sh | 2 + distros/opensuse/default.nix | 4 + 8 files changed, 260 insertions(+) create mode 100644 distros/opensuse/16.0/amd64.pkrvars.hcl create mode 100644 distros/opensuse/16.0/finalize.sh create mode 100644 distros/opensuse/16.0/http/autoinst.xml create mode 100644 distros/opensuse/16.0/http/profile.jsonnet create mode 100644 distros/opensuse/16.0/qemu.sh create mode 100644 distros/opensuse/16.0/virtualbox.sh create mode 100644 distros/opensuse/16.0/vmware.sh diff --git a/distros/opensuse/16.0/amd64.pkrvars.hcl b/distros/opensuse/16.0/amd64.pkrvars.hcl new file mode 100644 index 0000000..b905ff0 --- /dev/null +++ b/distros/opensuse/16.0/amd64.pkrvars.hcl @@ -0,0 +1,16 @@ +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-Build49.1.iso" + checksum = "e930c07476556481fbe15c1e471c20a04bb06f3daea6e2431b0a77a852261dc9" +} +boot_command = [ + "e", + "", + "", + " agama.auto=http://{{ .HTTPIP }}:{{ .HTTPPort }}/profile.jsonnet", + "x" +] +boot_wait = "8s" +http_directory = "distros/opensuse/16.0/http/" +vbox_os_type = "OpenSUSE_Leap_64" diff --git a/distros/opensuse/16.0/finalize.sh b/distros/opensuse/16.0/finalize.sh new file mode 100644 index 0000000..b29f91f --- /dev/null +++ b/distros/opensuse/16.0/finalize.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -ex + +zypper clean -a \ No newline at end of file diff --git a/distros/opensuse/16.0/http/autoinst.xml b/distros/opensuse/16.0/http/autoinst.xml new file mode 100644 index 0000000..65753c6 --- /dev/null +++ b/distros/opensuse/16.0/http/autoinst.xml @@ -0,0 +1,125 @@ + + + + + + + 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 + + + \ No newline at end of file diff --git a/distros/opensuse/16.0/http/profile.jsonnet b/distros/opensuse/16.0/http/profile.jsonnet new file mode 100644 index 0000000..c21f3ab --- /dev/null +++ b/distros/opensuse/16.0/http/profile.jsonnet @@ -0,0 +1,101 @@ +// 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: 'Leap_16.0', + }, + software: { + patterns: [ + ], + }, + user: { + fullName: 'vagrant', + userName: 'vagrant', + password: 'vagrant', + }, + root: { + password: 'vagrant', + }, + localization: { + language: 'en_US', + keyboard: 'us', + }, + storage: { + boot: { + configure: true, + device: findBiggestDisk(agama.selectByClass(agama.lshw, 'disk')), + }, + drives: [{ + search: findBiggestDisk(agama.selectByClass(agama.lshw, 'disk')), + ptableType: 'gpt', + partitions: [{ + search: '*', + delete: true + },{ + id: 'esp', + size: '512 MiB', + filesystem: { + type: 'vfat', + path: '/boot', + mountBy: 'label', + label: 'boot', + mountOptions: [ "noatime" ] + }, + },{ + id: 'linux', + size: { + min: '9 GiB', + }, + filesystem: { + type: 'ext4', + path: '/', + mountBy: 'label', + label: 'root', + mountOptions: [ "noatime" ] + } + }] + }] + }, + scripts: { + pre: [], + post: [ { + name: 'configure-vagrant', + body: ||| + # 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/sudoers.d/00_vagrant + Defaults:vagrant !requiretty + vagrant ALL=(ALL) NOPASSWD: ALL + root ALL=(ALL) NOPASSWD: ALL + EOF + ||| + } ] + }, +} diff --git a/distros/opensuse/16.0/qemu.sh b/distros/opensuse/16.0/qemu.sh new file mode 100644 index 0000000..8bc20c1 --- /dev/null +++ b/distros/opensuse/16.0/qemu.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -ex + +zypper install -y qemu-guest-agent +systemctl start qemu-guest-agent +systemctl enable qemu-guest-agent diff --git a/distros/opensuse/16.0/virtualbox.sh b/distros/opensuse/16.0/virtualbox.sh new file mode 100644 index 0000000..087d718 --- /dev/null +++ b/distros/opensuse/16.0/virtualbox.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +set -ex \ No newline at end of file diff --git a/distros/opensuse/16.0/vmware.sh b/distros/opensuse/16.0/vmware.sh new file mode 100644 index 0000000..4cfad53 --- /dev/null +++ b/distros/opensuse/16.0/vmware.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +set -ex diff --git a/distros/opensuse/default.nix b/distros/opensuse/default.nix index d8245ba..d44b945 100644 --- a/distros/opensuse/default.nix +++ b/distros/opensuse/default.nix @@ -6,6 +6,10 @@ version = "15.6"; arch = "amd64"; eol = false; +} { + version = "16.0"; + arch = "amd64"; + eol = true; # Not yet released, and bugged at the moment } { version = "tumbleweed"; arch = "amd64"; From 9408bef2e3dcd1104f36ec0226e594f2e6fbde98 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Nov 2024 18:50:35 -0600 Subject: [PATCH 10/12] Update Ubuntu 22.04 to 22.04.5 --- distros/ubuntu/22.04/amd64.pkrvars.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distros/ubuntu/22.04/amd64.pkrvars.hcl b/distros/ubuntu/22.04/amd64.pkrvars.hcl index e4f5b04..5e53573 100644 --- a/distros/ubuntu/22.04/amd64.pkrvars.hcl +++ b/distros/ubuntu/22.04/amd64.pkrvars.hcl @@ -1,8 +1,8 @@ distro = "ubuntu" version = "22.04" iso = { - url = "https://releases.ubuntu.com/22.04/ubuntu-22.04.4-live-server-amd64.iso" - checksum = "45f873de9f8cb637345d6e66a583762730bbea30277ef7b32c9c3bd6700a32b2" + url = "https://releases.ubuntu.com/22.04/ubuntu-22.04.5-live-server-amd64.iso" + checksum = "9bc6028870aef3f74f4e16b900008179e78b130e6b0b9a140635434a46aa98b0" } boot_command = [ "e", From db7980101fb55968d43787c88cf04bb0c7ccd6cc Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Nov 2024 18:50:54 -0600 Subject: [PATCH 11/12] Update to latest 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 f825524..13e2db3 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 = "http://mirror.rackspace.com/archlinux/iso/2024.06.01/archlinux-2024.06.01-x86_64.iso" - checksum = "4cc7e1c9f4e97b384f0d8731f317b5995bde256fcc17160d32359cab923c5892" + url = "http://mirror.rackspace.com/archlinux/iso/2024.11.01/archlinux-2024.11.01-x86_64.iso" + checksum = "bceb3dded8935c1d3521c475a69ae557e082839b46d921c8b400524470b5c965" } boot_command = [ "e net.ifnames=0 biosdevnames=0 ", From 1e27b9027f92d9d54af24ff52a444d13cafa508f Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Mon, 18 Nov 2024 18:51:12 -0600 Subject: [PATCH 12/12] Add needed tools to build commands --- flake.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 5aa1987..287801c 100644 --- a/flake.nix +++ b/flake.nix @@ -97,10 +97,12 @@ packages = let base = { runtimeInputs = with pkgs; [ + cdrtools + findutils packer - findutils - qemu_full - vagrant + qemu_full + vagrant + xorriso ]; }; build = d: let