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

Indeed that saves a lot of debugging…

Hey, thank you for the Image Builder and the work done. After some tweaking i got WIFI up to OpenWRT speeds and love Arch on the BananaPI R3.

One thing I’m still missing is Wireguard. Would it be possible to add support back into the kernel? Sadly the old DKMS module no longer works with the new linux-headers and it would be nice to be able to use your precompiled kernel :smiley:

Opened a Issue on frank-w’s Kernel Repo:

Wireguard is availible in linux some time so dkms is not needed anymore. It only needs to be enabled.

My kernel repo is independ of arch builder. Eric uses its own config

1 Like

Which kernel options do you need enabled?

You can clone the linux-bpir64-git package and add the options. Then build and test it.

Or let me know what needs enabling and have some patients.

1 Like

Thank you for the quick reply to both of you. I’m just compiling the kernel with wireguard flags set, I will test and report back.

The flags I have set are

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

Wireguard itself works with the flags i posted before. If you want to use nftables or wg-quick you need to set extra kernel options. With the new kernel options everything regarding wireguard/nftables with wg-quick is flawless and the startup of the interface even works more reliable and faster than using OpenWRT.

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

Could you share the tweaks you used to improve wifi speed?

I have compiled hostapd with WIFI 6 support. You can use hostapd-wifi6 from the AUR. Afterwards it was just trial and error with the hostapd config. Today i booted a SD-Card with OpenWRT and enhanced my configs more, because for example the power saving features from Wireless AX have to be activated explicitly. They are now in my configs. And one thing i observed is, if you are running a newly installed version of Arch, it takes time for the wireless to get some speed. I guess that’s because of the needed entropy for hostapd and the cryptographic. It takes about 24 Hours to get the speed reliably and constantly.

My configs: wlan0.conf (2.0 KB) wlan1.conf (2.4 KB)

1 Like

MT7986 comes with a hardware true random number generator (TRNG), so make sure to have CONFIG_HW_RANDOM_MTK=y in your kernel config, that should resolve any issue related to missing entropy.

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?