Files
vms/distros/alpine/3.20/http/answers.cfg.sh
T

62 lines
1.0 KiB
Bash
Raw Normal View History

2024-06-30 00:20:12 -05:00
#!/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
2024-11-18 23:42:28 -06:00
reboot