There is current no support for the NanoPi R2S in ArchLinuxArm, but it's possible to run it using the generic aarch64 installation.
- Copy bootloader and uBoot from an armbian image using for the NanoPi R2S using
dd
(sectors 32 to 32767) everything before the partition, except the partition table). - Create an ext4 partition on
/dev/mmcblk0p1
at offset of 32768 sectors (16384 KiB):
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 32768 15523839 15491072 7.4G 83 Linux
- Create the ext4 file system and extract
ArchLinuxARM-aarch64-latest.tar.gz
to the new partition. - Copy the contents of
/boot
from the armbian image to/boot
on the new patition. - Edit the
/boot/armbianEnv.txt
to point to the new partition either by UUID or device name (rootdev=/dev/mmcblk0p1
) - Boot and follow ArchLinuxArm standard procedures for installation.
You can boot with the armbian kernel (currently 5.7.15), or chose to install the arch linux stock aarch64 kernel (linux-aarch64). If you install the stock kernel, a new DTB is needed or USB 3.0 and the secondary ethernet won't work. It works with the rock64 DTB since it has the same Ethernet controller:
ln -sf /boot/dtbs /boot/dtb
Change /boot/armbianEnv.txt
to have fdtfile=rockchip/rk3328-rock64.dtb
.
Create an uBoot image of the initramfs:
pacman -S uboot-tools
mkimage -A arm64 -T ramdisk -n uInitrd -d /boot/initramfs-linux.img /boot/uInitrd-initramfs-linux.img
ln -sf /boot/uInitrd-initramfs-linux.img /boot/uInitrd
And install a pacman hook to ensure that this is done every time the kernel is upgraded:
mkdir -p /etc/pacman.d/hooks
[Trigger]
Operation = Install
Operation = Upgrade
Type = Package
Target = linux-aarch64
[Action]
Description = Generate uInitrd
Exec = /usr/bin/mkimage -A arm64 -T ramdisk -n uInitrd -d /boot/initramfs-linux.img /boot/uInitrd-initramfs-linux.img
When = PostTransaction
Depends = uboot-tools
systemctl enable serial-getty@ttyGS0
echo g_serial > /etc/modules-load.d/g_serial.conf
Sector | Purpose |
---|---|
0 | MSDOS partition table |
64 | Loader |
16384 | uBoot |
32768 | ext4 partition |
Thanks - it worked for me! I had a bit of trouble working out how to dd the exact sectors, but I got it close enough that I could delete the incomplete partition from the Armbian image and make a new ext4 partition. For now, I think I'll stay on the Armbian kernel and get on with configuring the system.