在hetzner的vps上运行archlinuxarm非常简单, 仅仅需要几个步骤
1.创建服务器,随便选一个操作系统,因为我们并不使用,然后进入救援模式(Rescue Mode)进行安装;
2.删除根分区,但是EFI的分区需要保留,这样可以重新使用
注意:一定在分区的时候要选择/dev/sda1为efi分区格式
root@rescue ~ $ mkfs.fat -F 32 /dev/sda1
root@rescue ~ $ mkfs.ext4 -L root /dev/sda2
root@rescue ~ $ mount -o noatime /dev/sda2 /mnt
root@rescue ~ $ mkdir -p /mnt/boot
root@rescue ~ $ mount /dev/sda1 /mnt/boot
3.解压缩系统镜像
root@rescue ~ $ wget "http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz"
root@rescue ~ $ bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt
4.chroot
进入ALARM:
root@rescue ~ $ mount --bind /dev /mnt/dev
root@rescue ~ $ mount -t proc proc /mnt/proc
root@rescue ~ $ mount -t sysfs sys /mnt/sys
root@rescue ~ $ chroot /mnt
5.使用systemd-boot
作为EFI加载器
[root@rescue /]$ bootctl install
6.创建启动文件
blkid
获取的udid替换下面的内容
nano -w /boot/loader/entries/arch.conf
title Arch Linux ARM
linux /Image
initrd /initramfs-linux.img
options root=UUID=07d0a7fd-2788-4c0d-8d82-d640268a0bd0 rw
7.设置网络
这里只设置ipv4通过dhcp获取,ipv6需要根据信息重新配置
root@rescue /]$ rm /etc/systemd/network/*
[root@rescue /]$ cat <<EOF > /etc/systemd/network/eth.network
[Match]
Name=enp*
[Network]
DHCP=ipv4
Address=2a01:4f8:c17:cd92::/64
Gateway=fe80::1
IPv6AcceptRA=no
EOF
8.设置密码
passwd
9.刷新key
pacman-key --init
pacman-key --populate archlinuxarm
10.设置主机名和时区
echo archlinux > /etc/hostname
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
9.设置字符集
取消 /etc/locale.gen 中的locale注释, 然后运行:
# locale-gen
10.设置语言
设置自己喜好的语言在 /etc/locale.conf 或者 $HOME/.config/locale.conf:
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_ALL=C
LC_COLLATE=C
LC_MESSAGES=C
LC_TIME=zh_CN.UTF-8
SUPPORTED=zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en
11.增加驱动
nano -w /etc/mkinitcpio.conf
MODULES=(virtio virtio_blk virtio_pci virtio_net)
mkdir /tmp/hwc/
mkinitcpio -p linux-aarch64
11.重新启动
root@rescue ~ $ umount -R /mnt
root@rescue ~ $ exit
root@rescue ~ $ reboot