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 |
Thank you, that part is now working for me. I am still stuck though. I prepare the micro SD card on my Ubuntu laptop. Then I insert it into the NanoPi R6C. At startup I get some red error messages, they scroll by too fast to see. Then it prompts me for the alarm login. Then it hangs.
Edit: I connected to the serial port to see the error messages which appear at startup, the first one is:
Below are the steps that I take on the Ubuntu laptop to prepare the micro SD card. If anyone has any insights I would be grateful.
$ sudo dd if=/dev/zero of=/dev/mmcblk0 bs=1M
$ sudo dd if=Armbian_23.11.1_Nanopi-r6s_bookworm_legacy_5.10.160.img of=/dev/mmcblk0 skip=31 seek=31 bs=512 count=32736
$ sudo mkfs.ext4 /dev/mmcblk0p1
-> NanoPi R6C startup displays errors (which scroll by too fast to see), then it prompts me for the alarm login, then it hangs.