[BPI-R3] [BPi-R3-Mini] Imagebuilder R3 ArchlinuxArm, linux-rolling-stable

This is fantastic! Thanks!

@ericwoud it would be worth considering including hostapd-wifi6 and JustN’s configs in your build.

I will put it on the to do list But bear in mind the goal is a minimal Arch linux where the user can customize any way he/she wants.

For now I am working on proper support of the OEM 2.5g SFP module. Then anyone can use the SFP cages, without spending too much money on it

I tinkered a little bit more. Guess i found why i couldn’t set 160Mhz Bandwidth. The issue is the hostapd-wifi6 aur package. It strips too much out. I now use the original Arch Packagebuild here and use my config file ( config (14.2 KB) ), wich basically just uncomments some things like the one to use getrandom() and Wireless AX. Now all DFS channels work with 160Mhz.

Using the Master Branch of hostapd and this config, the latency is even better and speeds are more consistent. In this config are several options activated which are flagged as experimental, so you may or may not want to use this config file.

1 Like

So guess we need to find another package, or create one… .

Btw, what is missing from the original hostapd package for wifi6?

I have not done so much on wifi on R3 yet, most I did was on R64.

CONFIG_HW_RANDOM_MTK=y

Is already set…

In my defconfig the following are not set:

CONFIG_WIREGUARD=y
CONFIG_CRYPTO_LIB_CURVE25519=y
CONFIG_CRYPTO_LIB_CHACHA20POLY1305=y

Are these all necessary?

Answer I found already:

Setting CONFIG_WIREGUARD=y should set the others.

I think its the Wireless N flag. hostapd-wifi6 does remove the CONFIG_IEEE80211N flag completely. And for good measures, i use the getrandom() flag, which does fallback to /dev/random if there is no support for getrandom (glibc2.25>) .

Regarding Wireguard, if one wants to use wg-quick (which sets nftable rules automatically) you have to set:

Summary
CONFIG_NET_CORE=y
CONFIG_WIREGUARD=y
CONFIG_IPV6=y
CONFIG_NET_UDP_TUNNEL=y
CONFIG_DST_CACHE=y
CONFIG_CRYPTO=y
CONFIG_CRYPTO_LIB_CURVE25519=y
CONFIG_CRYPTO_LIB_CHACHA20POLY1305=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IP6_NF_RAW=m
CONFIG_IP_NF_RAW=m
CONFIG_NFT_FIB=m
CONFIG_NFT_FIB_IPV4=m
CONFIG_NFT_FIB_IPV6=m
CONFIG_NETFILTER_XT_MATCH_CONNMARK=y
NETFILTER_XT_TARGET_CT=y

Otherwise /dev/fd63 is not present and nftable will fail to set the rules.

Thanks for the tip. I recompiled hostapd without the internal randomness pool, which it looks like made it a bit better. But i found a different issue. With Intel, Realtek and MediaTek wireless cards, wireless works like expected with low latency and high throughput. But when using a MacBook Air M2 or an iPad Air M1, the throughput and latency get unstable. In fact, most of the times with these devices i only get about 30 Mbit throughput and the ping randomly skyrockets. On the other Wireless Cards/Devices its fine. And also on my phone, an iPhone XS, its totally fine. Guess that’s either a Bug in the MediaTek driver/firmware or the Apple driver/firmware?!

EDIT: I restored the MacBook and iPad with idevicerestore using the same firmware version they where running before the restore (Macos 14 Dev Beta 5 and iPad OS 14 Beta 6). And this seems to have fixed the issue for now?! Why and how, i do not know. But, it works now.

Hello, have my brand new BPI3 for which I would like to use Archlinux, but need AP mode installation. Can I still use the pre-built “v1.3 SD card version Router setup” image and somehow re-configure it to AP mode? Don’t have other Linux servers available except BPI3 with latest Openwrt 23.05.rc4 installed to SD/NAND so I probably can’t use the building script for special(AP-mode) image.

You can use the image, the only difference is the contents of /etc/systemd/network…Check the repo roots/etc/systemd/network-* folders for possible options (some are symlinks to another). Further for accesspoint disable nftables.service.

Thanks, I managed to change the local IP and started testing archlinux :+1: But now have bigger problem which needs help of someone more experienced :slight_smile:

Have a special armv7(32-bit) compiled application which I would like to run on the BPI3. It’s working on old RPi 3B Raspbian but not on this ArchLinux image. Is there a chance that some extra kernel parameter could enable running Aarch32 applications? or should I try my luck with other distro (Debian/Ubuntu) image that could have the compatibility enabled?

It is possible, not so difficult, but can you not compile for aarch64?

No I don’t have a source, it’s private. Only compiled version is available…

The arm64 can run armv7 without any emulator, as if it is native code.

Then it depends if the executable is compiled statically, or does it depend on libraries. You can check with the tool ldd

No dependances, you can just run it.

Otherwise, you can copy an armv7 root filesystem (Bootstrap). I use

GitHub - tokland/arch-bootstrap: Bootstrap a base Arch Linux system

Be sure to specify armv7h.

Then use arch-chroot to go in to this with chroot. From there, if all correct versions of libraries are installed, you can run your armv7 executable.

I have done this on my rk3588 board, also aarch64 running Archlinux, and I think you can do the same on the R3.

Thanks a lot man for help :+1: Used arch-chroot script you suggested and despite some errors the application seems to work :slight_smile:

The OEM SFP2.5G-T realtek driver is now added to the pre-build linux.

So is the eeprom loading from file for mt76xx wifi driver (thanks to Frank for this patch)

ATF using FAT32 boot partition is now default for new installations. At least it is for sdmmc and emmc. I’ll add nand for R3/R3mini, so this should still be using a fip partition.

Changing from the default option can be done with a command line switch to the install script, see readme.

First image available for R3-MINI setup as RouTer and as AccessPoint, also avaiable as prebuild .img.gz:

www.woudstra.mywire.org/images/

The path includes images for R64 and R3, also for different setups.

Instructions for R3-MINI:

Copy the bpir-xxx-yyy.img.gz to a FAT formatted usb-stick and plug it in to the R3-MINI.

Boot the R3-MINI in NAND mode with UART connected. Boot to Openwrt Busybox command prompt.

echo 0 > /sys/block/mmcblk0boot0/force_ro

gunzip -c /mnt/sda1/bpir-xxx-yyy.img.gz | dd of=/dev/mmcblk0 bs=4M conv=fsync

dd if=/dev/mmcblk0 of=/dev/mmcblk0boot0 bs=17K skip=1 count=16 conv=fsync

mmc bootpart enable 1 1 /dev/mmcblk0

Switch boot-switch to EMMC and reboot.

1 Like

Have Bpir3 with older Archlinux ver. 6.3 installed to SD and working as AP. Would like to test eMMC and install the new Archlinux AP version there. OpenWrt in NOR & NAND, eMMC is empty. What is the correct installation procedure (without UART if possible)? Thanks in advance

See here: R64/R3 Build/Install emmc version using image

Assuming you have a bootable SD image on SD card.

First build a emmc image, or download a pre-build image, copy it to the /tmp/ folder on the SD card, name it bpir.img.xz.

Boot the R64/R3 with the SD card with UART connected. When kernel starts keep ‘shift E’ keys pressed. When finised, you can reboot.

Just follow the instructions you get, during install, about setting the dipswitch

This is however with UART.

On R64 it could be possible without UART, but because R3 can only acces SD or EMMC one at a time, it is not possible without UART.

So it is however possible without using anything on NAND.