Use this better tutorial: https://gist.github.com/karolba/a3f1c5f8d50c67f5a19e6c8f38e53e12
- Reboot into the rescue image
- Then execute these commands:
cd /dev/shm
mkdir alpine
cd alpine
wget https://dl-cdn.alpinelinux.org/alpine/v3.16/releases/x86_64/alpine-minirootfs-3.16.0-x86_64.tar.gz
tar xzvf alpine*
mount -t proc /proc proc/
mount -t sysfs /sys sys/
mount --rbind /dev dev/
cp /etc/resolv.conf etc/resolv.conf
chroot . ash -l
apk add alpine-conf nano
nano /sbin/setup-disk
- Set return 1 to return 0 for is_efi
nano /sbin/setup-alpine
- add
-s 0 -k virt
aftersetup-disk
setup-alpine
- Then:
exit
mount /dev/vda2 /mnt
chroot /mnt /bin/ash
cd /boot/grub
nano grub.cfg
- Add
console=ttyS0
for linelinux /boot/vmlinuz-virt
- Then execute this commands for having a proper boot:
rc-update add modules boot
rc-update add hostname boot
rc-update add dmesg sysinit
rc-update add devfs sysinit
rc-update add acpid boot
rc-update add bootmisc boot
rc-update add hwclock boot
rc-update add sysctl boot
rc-update add syslog boot
rc-update add mount-ro shutdown
rc-update add mdev sysinit
rc-update add killprocs shutdown
rc-update add hwdrivers sysinit
rc-update add crond
rc-update add local
- Add your key in /mnt/root/.ssh/authorized_keys
umount /mnt
- Reboot
Extra for correct serial:
- Add this in
/etc/default/grub
:
GRUB_TERMINAL="serial console"
GRUB_SERIAL_COMMAND="serial --unit=0 --word=8 --parity=no --speed 38400 --stop=1"
- Add
console=ttyS0,38400n8d
toGRUB_CMDLINE_LINUX_DEFAULT
grub-mkconfig -o /boot/grub/grub.cfg
- Add
ttyS0::respawn:/sbin/getty -L ttyS0 38400 vt100
to/etc/inittab
No idea, I had the option to boot into rescue mode back when I wrote my guide.