Alpine Linux on ARM64
Here are the steps to install Alpine linux on Scaleway ARM64 servers.
Bootstrap Alpinelinux on Scaleway ARM64
Installation
- Boot to rescue mode
- Format hard drive
# mkfs.ext4 /dev/vda - Mount hard drive
# mount /dev/vda /mnt - Download and extract apk-tools-static for aarch64
# cd /dev/shm
# wget
# tar xvzf apk-tools-static-2.8.2-r0.apk - Bootstrap Alpine Linux
# ./sbin/apk.static --arch aarch64 -X -U --allow-untrusted --root /mnt --initdb add alpine-base - Download and copy dynamic-getty to Alpine
# wget
# mkdir /mnt/usr/local/sbin
# mv dynamic-getty /mnt/usr/local/sbin/
# chmod +x /mnt/usr/local/sbin/dynamic-getty - Edit /etc/inittab
# vi /mnt/etc/inittab
> # /etc/inittab
>
> ::sysinit:/sbin/rc sysinit
> ::wait:/sbin/rc default
>
> ::respawn:/usr/local/sbin/dynamic-getty
>
> ::shutdown:/sbin/rc shutdown - Copy resolv.conf to Alpine
# cp /etc/resolv.conf /mnt/etc/ - Setup apk repositories
# echo > /mnt/etc/apk/repositories - Chroot into Alpine
# chroot /mnt /bin/sh - Set correct permissions on folders
# chmod 0755 /etc /usr /usr/local /usr/local/bin /usr/local/sbin - Setup root password and SSH key
# passwd
# mkdir /root/.ssh
# vi /root/.ssh/authorized_keys
# chmod 0600 /root/.ssh/authorized_keys
# chmod 0750 /root - Reboot
# reboot
- Login and run setup-alpine
# setup-alpine - Setup Scaleway stuffs
# apk add bash curl tar wget
# wget -qO - | FLAVORS=common,docker-based,openrc bash -e
# rc-update add scw-hostname
# rc-update add scw-ssh-keys
# rc-update add scw-sshd-keys
# rc-update add scw-swapfile
# rc-update add scw-sync-kernel-extra
# rc-update add scw-initramfs-shutdown shutdown - Set correct permissions on folders
# chmod 0755 /etc /usr /usr/local /usr/local/bin /usr/local/sbin
# chmod 0600 /root/.ssh/authorized_keys
# chmod 0750 /root