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 <