Skip to content

Instantly share code, notes, and snippets.

@unixfox
Last active November 3, 2024 13:06
Show Gist options
  • Save unixfox/58bdb24f6412579eeb1e26516eaf18c6 to your computer and use it in GitHub Desktop.
Save unixfox/58bdb24f6412579eeb1e26516eaf18c6 to your computer and use it in GitHub Desktop.
Install alpine linux on Scaleway stardust

Use this better tutorial: https://gist.github.com/karolba/a3f1c5f8d50c67f5a19e6c8f38e53e12


  1. Reboot into the rescue image
  2. 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
  1. nano /sbin/setup-disk
  2. Set return 1 to return 0 for is_efi
  3. nano /sbin/setup-alpine
  4. add -s 0 -k virt after setup-disk
  5. setup-alpine
  6. Then:
exit
mount /dev/vda2 /mnt
chroot /mnt /bin/ash
cd /boot/grub
nano grub.cfg
  1. Add console=ttyS0 for line linux /boot/vmlinuz-virt
  2. 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
  1. Add your key in /mnt/root/.ssh/authorized_keys
  2. umount /mnt
  3. Reboot

Extra for correct serial:

  1. Add this in /etc/default/grub:
GRUB_TERMINAL="serial console"
GRUB_SERIAL_COMMAND="serial --unit=0 --word=8 --parity=no --speed 38400 --stop=1"
  1. Add console=ttyS0,38400n8d to GRUB_CMDLINE_LINUX_DEFAULT
  2. grub-mkconfig -o /boot/grub/grub.cfg
  3. Add ttyS0::respawn:/sbin/getty -L ttyS0 38400 vt100 to /etc/inittab

Source: https://riedstra.dev/2019/09/alpine-gcp

@maki-chan
Copy link

Worked great! Thank you very much :)

@yanghuan
Copy link

yanghuan commented Jan 2, 2022

@unixfox
Copy link
Author

unixfox commented Jan 2, 2022

No idea, I had the option to boot into rescue mode back when I wrote my guide.

@yanghuan
Copy link

yanghuan commented Jan 3, 2022

Thank you very much, this guide helped me a lot,I tried to use other ways to bypass the first step

@1412031
Copy link

1412031 commented Jul 4, 2022

You're the man

@karolba
Copy link

karolba commented Aug 16, 2022

If anyone is interested in installing Alpine without a rescue image but with setup-alpine on scaleway, I have written a guide.

@destiny902
Copy link

I'm a Scaleway stardust Ipv6 only instance and I installed Alpine 3.20.3 with your tutorial but it told me

ens2 ...ip: ioctl 0x8913 failed: No such device
udhcpc: ioctl 0x8933 failed: No such device
ifup: failed to change interface ens2 state to 'up'

and stuck in " Starting sshd ... [ ok ]"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment