Add Alpine

This commit is contained in:
Greg Hellings
2024-01-09 11:45:17 -06:00
parent cd9a2cbec1
commit 8fb4466090
10 changed files with 147 additions and 1 deletions
+60
View File
@@ -0,0 +1,60 @@
#!/bin/ash
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