diff --git a/.gitignore b/.gitignore index 211b1c5..104b1e3 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ Vagrantfile distros/fedora/rawhide/*.hcl distros/nixos/**/*.hcl distros/centos-stream/**/*.hcl +distros/opensuse/tumbleweed/*.hcl __pycache__ *.pyc diff --git a/.gitlab-ci-build.yml.in b/.gitlab-ci-build.yml.in index c652e2f..3495756 100644 --- a/.gitlab-ci-build.yml.in +++ b/.gitlab-ci-build.yml.in @@ -32,7 +32,7 @@ stages: variables: &variables PACKER_CONFIG_DIR: ./packer_config/ PACKER_CACHE_DIR: ./packer_cache/ - PACKER_LOG: 0 + PACKER_LOG: 1 COMMAND: > packer build ${only} -var-file="${distro}" @@ -45,7 +45,6 @@ stages: - packer init sources - echo $COMMAND script: - - export EFI_DIR="$(dirname "$(find /nix/store -name OVMF_VARS.fd | head -1)")/" - echo $COMMAND > build.sh - bash build.sh || exit 1 diff --git a/TODO.txt b/TODO.txt index e1c2995..b34fc50 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,19 +1,19 @@ Distros: * Arch -- Done * NixOS -- Done -* Alpine -* SuSE +* Alpine -- Done +* SuSE -- Done * PopOS * Mint -* Rocky -* Alma +* Rocky -- Done +* Alma -- Done * Oracle * Gentoo * Elementary OS * Manjaro Providers: -* VMWare -- Done +* VMWare -- Done, but can't seem to automate install * Parallels -- Requires money * Hyper-V -- Done diff --git a/build.xsh b/build.xsh index 152d80a..81919ee 100755 --- a/build.xsh +++ b/build.xsh @@ -47,13 +47,13 @@ def process_distro(distro): process_builds(distro.builds) def process_builds(builds): - for build in builds: - if args.build: - name, arch = args.build.split(".") - if build.provider.name == name and build.provider.arch == arch: - do_build(build) - else: + for build in builds: + if args.build: + name, arch = args.build.split(".") + if build.provider.name == name and build.provider.arch == arch: do_build(build) + else: + do_build(build) def do_build(build): if args.headless: diff --git a/del_boxes.xsh b/del_boxes.xsh index ce0816b..79cb6ed 100755 --- a/del_boxes.xsh +++ b/del_boxes.xsh @@ -2,5 +2,5 @@ virsh -q vol-list default | awk '{print $1}' | xargs -r -L 1 virsh vol-delete --pool default sudo virsh -q vol-list default | awk '{print $1}' | sudo xargs -r -L 1 virsh vol-delete --pool default -vagrant box list | grep virtualbox | awk '{print $1}' | sort -u | xargs -l vagrant box remove --provider virtualbox --force -vagrant box list | grep libvirt | awk '{print $1}' | sort -u | xargs -l vagrant box remove --provider libvirt --force +vagrant box list | grep virtualbox | awk '{print $1}' | sort -u | xargs -r -l vagrant box remove --provider virtualbox --force +vagrant box list | grep libvirt | awk '{print $1}' | sort -u | xargs -r -l vagrant box remove --provider libvirt --force diff --git a/distros/almalinux/8/amd64.pkrvars.hcl b/distros/almalinux/8/amd64.pkrvars.hcl new file mode 100644 index 0000000..cca8a7f --- /dev/null +++ b/distros/almalinux/8/amd64.pkrvars.hcl @@ -0,0 +1,14 @@ +distro = "almalinux" +version = "8" +iso = { + url = "https://mirrors.kernel.org/almalinux/8.9/isos/x86_64/AlmaLinux-8.9-x86_64-boot.iso" + checksum = "ab861d80c8b68634f3c16d414a4141759a082548ad7b251d8924675fa09decab" +} +boot_command = [ + "e", + "", + " inst.text inst.ks=cdrom:/ks.cfg", + "x" +] +cd_files = [ "distros/almalinux/8/disc/*" ] +vbox_os_type = "RedHat8_64" diff --git a/distros/almalinux/8/disc/ks.cfg b/distros/almalinux/8/disc/ks.cfg new file mode 100644 index 0000000..ab98110 --- /dev/null +++ b/distros/almalinux/8/disc/ks.cfg @@ -0,0 +1,158 @@ +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" +zerombr +clearpart --all +autopart --type=plain + +user --name=vagrant --plaintext --password=vagrant + +%packages --instLangs=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 + +# 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/8/vmware.sh b/distros/almalinux/8/vmware.sh new file mode 100644 index 0000000..058afc2 --- /dev/null +++ b/distros/almalinux/8/vmware.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -ex + +dnf install -y open-vm-tools diff --git a/distros/almalinux/9/amd64.pkrvars.hcl b/distros/almalinux/9/amd64.pkrvars.hcl new file mode 100644 index 0000000..0aaffa1 --- /dev/null +++ b/distros/almalinux/9/amd64.pkrvars.hcl @@ -0,0 +1,14 @@ +distro = "almalinux" +version = "9" +iso = { + url = "https://mirrors.kernel.org/almalinux/9.3/isos/x86_64/AlmaLinux-9.3-x86_64-boot.iso" + checksum = "af5377a1d16bbe599ea91a8761ad645f2f54687075802bdc0c0703ee610182e9" +} +boot_command = [ + "e", + "", + " inst.text inst.ks=cdrom:/ks.cfg", + "x" +] +cd_files = [ "distros/almalinux/9/disc/*" ] +vbox_os_type = "RedHat9_64" diff --git a/distros/almalinux/9/disc/ks.cfg b/distros/almalinux/9/disc/ks.cfg new file mode 100644 index 0000000..043cd64 --- /dev/null +++ b/distros/almalinux/9/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/9/vmware.sh b/distros/almalinux/9/vmware.sh new file mode 100644 index 0000000..058afc2 --- /dev/null +++ b/distros/almalinux/9/vmware.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -ex + +dnf install -y open-vm-tools diff --git a/distros/almalinux/supports.yml b/distros/almalinux/supports.yml new file mode 100644 index 0000000..533b6df --- /dev/null +++ b/distros/almalinux/supports.yml @@ -0,0 +1,10 @@ +8: &supp + - arch: amd64 + provider: qemu + - arch: amd64 + provider: virtualbox-iso + - arch: amd64 + provider: vmware-iso + - arch: amd64 + provider: hyperv-iso +9: *supp diff --git a/distros/alpine/3.19.0/amd64.pkrvars.hcl b/distros/alpine/3.19.0/amd64.pkrvars.hcl new file mode 100644 index 0000000..47936c3 --- /dev/null +++ b/distros/alpine/3.19.0/amd64.pkrvars.hcl @@ -0,0 +1,19 @@ +distro = "alpine" +version = "3.19.0" +iso = { + url = "https://dl-cdn.alpinelinux.org/alpine/v3.19/releases/x86_64/alpine-standard-3.19.0-x86_64.iso" + checksum = "4cf7cd3bad64122a8a2423e78369a486a02334d4d88645aab9d08120bb76b0f9" +} +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.19.0/http/" +boot_wait = "20s" +shutdown_command = "sudo poweroff" \ No newline at end of file diff --git a/distros/alpine/3.19.0/finalize.sh b/distros/alpine/3.19.0/finalize.sh new file mode 100644 index 0000000..5a01809 --- /dev/null +++ b/distros/alpine/3.19.0/finalize.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +set -ex \ No newline at end of file diff --git a/distros/alpine/3.19.0/http/answers.cfg.sh b/distros/alpine/3.19.0/http/answers.cfg.sh new file mode 100644 index 0000000..a430023 --- /dev/null +++ b/distros/alpine/3.19.0/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 \ No newline at end of file diff --git a/distros/alpine/3.19.0/http/in-chroot.sh b/distros/alpine/3.19.0/http/in-chroot.sh new file mode 100644 index 0000000..4300f7d --- /dev/null +++ b/distros/alpine/3.19.0/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 < net.ifnames=0 biosdevnames=0", @@ -13,3 +13,4 @@ boot_command = [ ] http_directory = "distros/archlinux/rolling/http/" boot_wait = "10s" +vbox_os_type = "ArchLinux_64" diff --git a/distros/centos-stream/8/amd64.pkrvars.hcl.sh b/distros/centos-stream/8/amd64.pkrvars.hcl.sh index 28dadf3..5b617f1 100755 --- a/distros/centos-stream/8/amd64.pkrvars.hcl.sh +++ b/distros/centos-stream/8/amd64.pkrvars.hcl.sh @@ -25,4 +25,5 @@ boot_command = [ "x" ] cd_files = [ "distros/centos-stream/8/disc/*" ] +vbox_os_type = "RedHat8_64" HERPDERP diff --git a/distros/centos-stream/9/amd64.pkrvars.hcl.sh b/distros/centos-stream/9/amd64.pkrvars.hcl.sh index 63cdc08..565a37e 100755 --- a/distros/centos-stream/9/amd64.pkrvars.hcl.sh +++ b/distros/centos-stream/9/amd64.pkrvars.hcl.sh @@ -27,4 +27,5 @@ boot_command = [ "x" ] cd_files = [ "distros/centos-stream/9/disc/*" ] +vbox_os_type = "RedHat9_64" HERPDERP \ No newline at end of file diff --git a/distros/centos/7/amd64.pkrvars.hcl b/distros/centos/7/amd64.pkrvars.hcl index f35f2fd..b553bb1 100644 --- a/distros/centos/7/amd64.pkrvars.hcl +++ b/distros/centos/7/amd64.pkrvars.hcl @@ -11,3 +11,4 @@ boot_command = [ "x" ] cd_files = ["distros/centos/7/disc/*"] +vbox_os_type = "RedHat7_64" diff --git a/distros/debian/10/amd64.pkrvars.hcl b/distros/debian/10/amd64.pkrvars.hcl index 8117cce..7a1aeb1 100644 --- a/distros/debian/10/amd64.pkrvars.hcl +++ b/distros/debian/10/amd64.pkrvars.hcl @@ -19,3 +19,4 @@ boot_command = [ "" ] http_directory = "distros/debian/10/http/" +vbox_os_type = "Debian10_64" diff --git a/distros/debian/11/amd64.pkrvars.hcl b/distros/debian/11/amd64.pkrvars.hcl index ecac4dd..6a63922 100644 --- a/distros/debian/11/amd64.pkrvars.hcl +++ b/distros/debian/11/amd64.pkrvars.hcl @@ -19,3 +19,4 @@ boot_command = [ "" ] http_directory = "distros/debian/11/http/" +vbox_os_type = "Debian11_64" diff --git a/distros/debian/12/amd64.pkrvars.hcl b/distros/debian/12/amd64.pkrvars.hcl index 8cf1a0e..d65e049 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.4.0/amd64/iso-cd/debian-12.4.0-amd64-netinst.iso" - checksum = "64d727dd5785ae5fcfd3ae8ffbede5f40cca96f1580aaa2820e8b99dae989d94" + url = "http://cdimage.debian.org/cdimage/release/12.5.0/amd64/iso-cd/debian-12.5.0-amd64-netinst.iso" + checksum = "013f5b44670d81280b5b1bc02455842b250df2f0c6763398feb69af1a805a14f" } boot_command = [ "e", @@ -19,3 +19,4 @@ boot_command = [ "" ] http_directory = "distros/debian/12/http/" +vbox_os_type = "Debian12_64" diff --git a/distros/fedora/37/amd64.pkrvars.hcl b/distros/fedora/37/amd64.pkrvars.hcl index 2be02d2..c220338 100644 --- a/distros/fedora/37/amd64.pkrvars.hcl +++ b/distros/fedora/37/amd64.pkrvars.hcl @@ -11,3 +11,4 @@ boot_command = [ cd_files = [ "distros/fedora/37/*.cfg" ] +vbox_os_type = "Fedora_64" diff --git a/distros/fedora/38/amd64.pkrvars.hcl b/distros/fedora/38/amd64.pkrvars.hcl index 78b1318..8d83d4a 100644 --- a/distros/fedora/38/amd64.pkrvars.hcl +++ b/distros/fedora/38/amd64.pkrvars.hcl @@ -11,3 +11,4 @@ boot_command = [ cd_files = [ "distros/fedora/38/*.cfg" ] +vbox_os_type = "Fedora_64" diff --git a/distros/fedora/39/amd64.pkrvars.hcl b/distros/fedora/39/amd64.pkrvars.hcl index 75d2dfe..2a25ab1 100644 --- a/distros/fedora/39/amd64.pkrvars.hcl +++ b/distros/fedora/39/amd64.pkrvars.hcl @@ -11,3 +11,4 @@ boot_command = [ cd_files = [ "distros/fedora/39/*.cfg" ] +vbox_os_type = "Fedora_64" diff --git a/distros/fedora/rawhide/amd64.pkrvars.hcl.sh b/distros/fedora/rawhide/amd64.pkrvars.hcl.sh index ffb98f5..874b969 100755 --- a/distros/fedora/rawhide/amd64.pkrvars.hcl.sh +++ b/distros/fedora/rawhide/amd64.pkrvars.hcl.sh @@ -40,6 +40,7 @@ boot_command = [ cd_files = [ "distros/fedora/rawhide/*.cfg" ] +vbox_os_type = "Fedora_64" EOF rm -r "${tmp}" diff --git a/distros/opensuse/15.5/amd64.pkrvars.hcl b/distros/opensuse/15.5/amd64.pkrvars.hcl new file mode 100644 index 0000000..8b80ad3 --- /dev/null +++ b/distros/opensuse/15.5/amd64.pkrvars.hcl @@ -0,0 +1,15 @@ +distro = "opensuse" +version = "15.5" +iso = { + url = "https://download.opensuse.org/distribution/leap/15.5/iso/openSUSE-Leap-15.5-NET-x86_64-Media.iso" + checksum = "a2f7f2f1b6b3d3ef96f5c8f804d87ebd01e5cf982357c533f4c39c33cd20ec56" +} +boot_command = [ + "e", + "", + "", + " autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/autoinst.xml textmode=1", + "x" +] +http_directory = "distros/opensuse/15.5/http/" +vbox_os_type = "OpenSUSE_Leap_64" diff --git a/distros/opensuse/15.5/finalize.sh b/distros/opensuse/15.5/finalize.sh new file mode 100644 index 0000000..b29f91f --- /dev/null +++ b/distros/opensuse/15.5/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/15.5/http/autoinst.xml b/distros/opensuse/15.5/http/autoinst.xml new file mode 100644 index 0000000..65753c6 --- /dev/null +++ b/distros/opensuse/15.5/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/15.5/qemu.sh b/distros/opensuse/15.5/qemu.sh new file mode 100644 index 0000000..8bc20c1 --- /dev/null +++ b/distros/opensuse/15.5/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/15.5/virtualbox.sh b/distros/opensuse/15.5/virtualbox.sh new file mode 100644 index 0000000..087d718 --- /dev/null +++ b/distros/opensuse/15.5/virtualbox.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +set -ex \ No newline at end of file diff --git a/distros/opensuse/15.5/vmware.sh b/distros/opensuse/15.5/vmware.sh new file mode 100644 index 0000000..4cfad53 --- /dev/null +++ b/distros/opensuse/15.5/vmware.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +set -ex diff --git a/distros/opensuse/15.6/amd64.pkrvars.hcl b/distros/opensuse/15.6/amd64.pkrvars.hcl new file mode 100644 index 0000000..64a74be --- /dev/null +++ b/distros/opensuse/15.6/amd64.pkrvars.hcl @@ -0,0 +1,15 @@ +distro = "opensuse" +version = "15.6" +iso = { + url = "https://download.opensuse.org/distribution/leap/15.6/iso/openSUSE-Leap-15.6-NET-x86_64-Media.iso" + checksum = "4631636c43297951f1a0a3a2a804e30f4bf1790f892d0f0ac46f62ec82ac2075" +} +boot_command = [ + "e", + "", + "", + " autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/autoinst.xml textmode=1", + "x" +] +http_directory = "distros/opensuse/15.6/http/" +vbox_os_type = "OpenSUSE_Leap_64" diff --git a/distros/opensuse/15.6/finalize.sh b/distros/opensuse/15.6/finalize.sh new file mode 100644 index 0000000..b29f91f --- /dev/null +++ b/distros/opensuse/15.6/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/15.6/http/autoinst.xml b/distros/opensuse/15.6/http/autoinst.xml new file mode 100644 index 0000000..65753c6 --- /dev/null +++ b/distros/opensuse/15.6/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/15.6/qemu.sh b/distros/opensuse/15.6/qemu.sh new file mode 100644 index 0000000..8bc20c1 --- /dev/null +++ b/distros/opensuse/15.6/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/15.6/virtualbox.sh b/distros/opensuse/15.6/virtualbox.sh new file mode 100644 index 0000000..087d718 --- /dev/null +++ b/distros/opensuse/15.6/virtualbox.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +set -ex \ No newline at end of file diff --git a/distros/opensuse/15.6/vmware.sh b/distros/opensuse/15.6/vmware.sh new file mode 100644 index 0000000..4cfad53 --- /dev/null +++ b/distros/opensuse/15.6/vmware.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +set -ex diff --git a/distros/opensuse/supports.yml b/distros/opensuse/supports.yml new file mode 100644 index 0000000..a709f30 --- /dev/null +++ b/distros/opensuse/supports.yml @@ -0,0 +1,11 @@ +15.6: &supp + - arch: amd64 + provider: qemu + - arch: amd64 + provider: virtualbox-iso + - arch: amd64 + provider: vmware-iso + - arch: amd64 + provider: hyperv-iso +15.5: *supp +tumbleweed: *supp diff --git a/distros/opensuse/tumbleweed/amd64.pkrvars.hcl.sh b/distros/opensuse/tumbleweed/amd64.pkrvars.hcl.sh new file mode 100755 index 0000000..a9b1640 --- /dev/null +++ b/distros/opensuse/tumbleweed/amd64.pkrvars.hcl.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +name="${0%.sh}" + +base="https://download.opensuse.org/tumbleweed/iso/openSUSE-Tumbleweed-NET-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}" \ No newline at end of file diff --git a/distros/opensuse/tumbleweed/finalize.sh b/distros/opensuse/tumbleweed/finalize.sh new file mode 100644 index 0000000..b29f91f --- /dev/null +++ b/distros/opensuse/tumbleweed/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/tumbleweed/http/autoinst.xml b/distros/opensuse/tumbleweed/http/autoinst.xml new file mode 100644 index 0000000..68f4eec --- /dev/null +++ b/distros/opensuse/tumbleweed/http/autoinst.xml @@ -0,0 +1,123 @@ + + + + + + + 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 + + + \ No newline at end of file diff --git a/distros/opensuse/tumbleweed/qemu.sh b/distros/opensuse/tumbleweed/qemu.sh new file mode 100644 index 0000000..8bc20c1 --- /dev/null +++ b/distros/opensuse/tumbleweed/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/tumbleweed/virtualbox.sh b/distros/opensuse/tumbleweed/virtualbox.sh new file mode 100644 index 0000000..087d718 --- /dev/null +++ b/distros/opensuse/tumbleweed/virtualbox.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +set -ex \ No newline at end of file diff --git a/distros/opensuse/tumbleweed/vmware.sh b/distros/opensuse/tumbleweed/vmware.sh new file mode 100644 index 0000000..4cfad53 --- /dev/null +++ b/distros/opensuse/tumbleweed/vmware.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +set -ex diff --git a/distros/rockylinux/8/amd64.pkrvars.hcl b/distros/rockylinux/8/amd64.pkrvars.hcl new file mode 100644 index 0000000..12688a4 --- /dev/null +++ b/distros/rockylinux/8/amd64.pkrvars.hcl @@ -0,0 +1,14 @@ +distro = "rockylinux" +version = "8" +iso = { + url = "https://download.rockylinux.org/pub/rocky/8/isos/x86_64/Rocky-8.9-x86_64-boot.iso" + checksum = "88baefca6f0e78b53613773954e0d7c2d8d28ad863f40623db75c40f505b5105" +} +boot_command = [ + "e", + "", + " inst.text inst.ks=cdrom:/ks.cfg", + "x" +] +cd_files = [ "distros/rockylinux/8/disc/*" ] +vbox_os_type = "RedHat8_64" diff --git a/distros/rockylinux/8/disc/ks.cfg b/distros/rockylinux/8/disc/ks.cfg new file mode 100644 index 0000000..8e17c57 --- /dev/null +++ b/distros/rockylinux/8/disc/ks.cfg @@ -0,0 +1,158 @@ +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" +zerombr +clearpart --all +autopart --type=plain + +user --name=vagrant --plaintext --password=vagrant + +%packages --instLangs=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 + +# 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/rockylinux/8/vmware.sh b/distros/rockylinux/8/vmware.sh new file mode 100644 index 0000000..058afc2 --- /dev/null +++ b/distros/rockylinux/8/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 new file mode 100644 index 0000000..fd49627 --- /dev/null +++ b/distros/rockylinux/9/amd64.pkrvars.hcl @@ -0,0 +1,14 @@ +distro = "rockylinux" +version = "9" +iso = { + url = "http://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.3-x86_64-boot.iso" + checksum = "eb096f0518e310f722d5ebd4c69f0322df4fc152c6189f93c5c797dc25f3d2e1" +} +boot_command = [ + "e", + "", + " inst.text inst.ks=cdrom:/ks.cfg", + "x" +] +cd_files = [ "distros/rockylinux/9/disc/*" ] +vbox_os_type = "RedHat9_64" diff --git a/distros/rockylinux/9/disc/ks.cfg b/distros/rockylinux/9/disc/ks.cfg new file mode 100644 index 0000000..74978d4 --- /dev/null +++ b/distros/rockylinux/9/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/9/vmware.sh b/distros/rockylinux/9/vmware.sh new file mode 100644 index 0000000..058afc2 --- /dev/null +++ b/distros/rockylinux/9/vmware.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -ex + +dnf install -y open-vm-tools diff --git a/distros/rockylinux/supports.yml b/distros/rockylinux/supports.yml new file mode 100644 index 0000000..533b6df --- /dev/null +++ b/distros/rockylinux/supports.yml @@ -0,0 +1,10 @@ +8: &supp + - arch: amd64 + provider: qemu + - arch: amd64 + provider: virtualbox-iso + - arch: amd64 + provider: vmware-iso + - arch: amd64 + provider: hyperv-iso +9: *supp diff --git a/distros/ubuntu/20.04/amd64.pkrvars.hcl b/distros/ubuntu/20.04/amd64.pkrvars.hcl index 0472927..5c49cad 100644 --- a/distros/ubuntu/20.04/amd64.pkrvars.hcl +++ b/distros/ubuntu/20.04/amd64.pkrvars.hcl @@ -17,3 +17,4 @@ boot_command = [ cd_files = [ "distros/ubuntu/20.04/disc/*" ] +vbox_os_type = "Ubuntu20_LTS_64" diff --git a/distros/ubuntu/22.04/amd64.pkrvars.hcl b/distros/ubuntu/22.04/amd64.pkrvars.hcl index a15717d..96f325b 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.3-live-server-amd64.iso" - checksum = "a4acfda10b18da50e2ec50ccaf860d7f20b389df8765611142305c0e911d16fd" + url = "https://releases.ubuntu.com/22.04/ubuntu-22.04.4-live-server-amd64.iso" + checksum = "45f873de9f8cb637345d6e66a583762730bbea30277ef7b32c9c3bd6700a32b2" } boot_command = [ "e", @@ -17,3 +17,4 @@ boot_command = [ cd_files = [ "distros/ubuntu/22.04/disc/*" ] +vbox_os_type = "Ubuntu22_LTS_64" diff --git a/distros/ubuntu/23.10/amd64.pkrvars.hcl b/distros/ubuntu/23.10/amd64.pkrvars.hcl index 04f1b55..3c8832a 100644 --- a/distros/ubuntu/23.10/amd64.pkrvars.hcl +++ b/distros/ubuntu/23.10/amd64.pkrvars.hcl @@ -17,3 +17,4 @@ boot_command = [ cd_files = [ "distros/ubuntu/23.10/disc/*" ] +vbox_os_type = "Ubuntu23_64" diff --git a/scripts/vagrant.sh b/scripts/vagrant.sh index a56e40b..7ffa9fc 100644 --- a/scripts/vagrant.sh +++ b/scripts/vagrant.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh set -ex # Configure vagrant user's SSH key diff --git a/sources/build.pkr.hcl b/sources/build.pkr.hcl index 78d6dbf..653f54f 100644 --- a/sources/build.pkr.hcl +++ b/sources/build.pkr.hcl @@ -2,18 +2,14 @@ packer { required_plugins { qemu = { source = "github.com/hashicorp/qemu" - version = "~> 1" - } - ansible = { - source = "github.com/hashicorp/ansible" - version = "~> 1" + version = "= 1.0.10" } vagrant = { source = "github.com/hashicorp/vagrant" version = "= 1.1.1" } vmware = { - version = ">= 1.0" + version = "= 1.0.11" source = "github.com/hashicorp/vmware" } hyperv = { @@ -22,7 +18,7 @@ packer { } virtualbox = { source = "github.com/hashicorp/virtualbox" - version = "~> 1" + version = "= 1.0.5" } } } diff --git a/sources/inputs.pkr.hcl b/sources/inputs.pkr.hcl index 68300c4..711ff8e 100644 --- a/sources/inputs.pkr.hcl +++ b/sources/inputs.pkr.hcl @@ -104,6 +104,11 @@ variable "efi_dir" { default = env("EFI_DIR") } +variable "vbox_os_type" { + type = string + default = "Linux_64" +} + locals { name = "${var.distro}-${var.version}" description = templatefile("../README.box.md", { diff --git a/sources/virtualbox-iso.pkr.hcl b/sources/virtualbox-iso.pkr.hcl index eefa28c..efee8c1 100644 --- a/sources/virtualbox-iso.pkr.hcl +++ b/sources/virtualbox-iso.pkr.hcl @@ -19,13 +19,15 @@ source "virtualbox-iso" "amd64" { memory = local.memory headless = var.headless firmware = "efi" - guest_os_type = "Linux_64" + 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" + nic_type = "virtio" + gfx_vram_size = 128 vboxmanage = [ ["modifyvm", "{{ .Name }}", "--uart1", "0x3F8", "4"], #["modifyvm", "{{ .Name }}", "--uartmode1", "file", "output/vritualbox/serial-${var.arch}-${var.distro}-${var.version}"], - ["modifyvm", "{{ .Name }}", "--nat-localhostreachable1", "on"], + ["modifyvm", "{{ .Name }}", "--nat-localhostreachable1", "on"] ] http_content = var.http_files diff --git a/test.xsh b/test.xsh index 64c2e5f..7259672 100755 --- a/test.xsh +++ b/test.xsh @@ -72,8 +72,8 @@ def main(): with open("Vagrantfile", "w") as fw: fw.write(content) if not dry_run: - vagrant box add @(box) --name @(p.name) --force if str(p.parent.name) in ["virtualbox", "libvirt", "vmware", "hyperv"]: + vagrant --provider @(p.parent.name) box add @(box) --name @(p.name) --force vagrant up --provider @(p.parent.name) else: print(f"Now whatcha wanna go and do that for? {box}") diff --git a/vagrant/amd64.rb b/vagrant/amd64.rb index 4bcc976..0e2f765 100644 --- a/vagrant/amd64.rb +++ b/vagrant/amd64.rb @@ -1,4 +1,5 @@ Vagrant.configure('2') do |c| + c.ssh.shell = "/bin/sh" # Set some basic overrides c.vm.provider :libvirt do |v, override| v.driver = 'kvm'