[BPI-R64] Imagebuilder R64 ArchlinuxArm, linux-rolling-stable

No, only plug in, the router already has DHCP server running.

I need

Router BananaPi Wireless ------ Wireless

Then you need to setup the wifi as client.

I have only provided 2 network setups: RouTer and AccessPoint.

Basically what you need to do is:

Disable hostapd and setup wpa_supplicant. You can find documentation on the internet how to setup wpa_supplicant.

Maybe it would be easier to use NetworkManager. You will then also need to disable systemd-networkd and systemd-resolved.service. Then you need the entire setup through NetworkManager, including the bridge (lan ports).

See: NetworkManager - ArchWiki (archlinux.org)

Depending from which setup you start with, disable nftables.service too if you start with the RouTer setup. But in your case I would start with AccessPoint setup.

Anyway, you need some way to communicate with the BPIR64, so then connect to the BPIR64 via UART and setup the wireless connection with nmcli. Then you will not lose connection to the BPIR64 when you try to share the lan ports with the wifi connection.

You can also still choose between cascading setup or setup within the same subnet.

Then if this is all successful and you want to extend to wireless repeater, you will need to setup the wifi in STA+AP mode. As described here:

https://wiki.archlinux.org/title/software_access_point

See: 1.2 Wireless client and software AP with a single Wi-Fi device

Butā€¦ Have you considered using OpenWRT?

What should Setup be if I need it to be wireless to wireless?

Yes, I considered using OpenWRT but it would not allow for resizing of the sd card on R64 without extreme difficulty. There were other problems too. The other problems mainly centred around wifi dropping out but other than those problems OpenWRT was great.

I do not have a ready made setup for the configuration you want. The script will help you solve many issues in getting ArchLinux running on the R64, but after getting OS running everybody wants something different, so there is where the support of the script stops. You will need to figure out yourself. In the readme it also says:

After this, you are on your own. It is supposed to be a minimal installation of Arch Linux.

The configuration of network is not R64 specific anymore and you can follow many different online guides. I would start with ArchWiki. I have found much usefull information that I could not find in Ubuntu wiki for example.

I think the easiest path would be to solve the problems you mentioned with OpenWRT.

If you want to continue with Archlinux and NetworkManager, you can start with making SD card in AP setup as before. Then connect to R64 via UART serial port. Login as root and execute:

systemctl stop systemd-networkd
systemctl stop systemd-resolved
systemctl disable systemd-networkd
systemctl disable systemd-resolved
pacman -Syu networkmanager

Then connect the wifi to your router with the nmcli command as here

https://wiki.archlinux.org/title/NetworkManager

And then use nmcli to setup bridge with lan and wlan0 ports inside. As here in chapter 1.5:

https://wiki.archlinux.org/title/network_bridge

The details you need to figure out. I need my R64 running with systemd-networkd as it also hosts the pre-built kernel and atf packages for use with the script. I also use it as my PVR (tvheadend) to record my favourite tv series. I do not want to miss any episode.

Ok, since I just burned up a SD card, Iā€™ve added backup and restore functions to the script. Just insert SD card in host computer and run

./build.sh -b

And you will have a backup .tar of the entire root filesystem. Restore it using:

./build.sh -B

And yes, burning the SD card is totally my badā€¦ I donā€™t know how many kernel builds I ran on itā€¦ Does not surprise me the card ran out. It was however quite easy to backup from the broken card and restore it to a new card. Just in case, I ran an Arch Linux command to re-install all packages (found in the archlinux wiki).

The ATF package can now be upgraded to v2.8. Iā€™ve contructed a new fork that will reboot with a brand new version of ATF.

pacman -Sy bpir64-atf-git

Eric, do you have any idea why such an error might occur?

Segmentation fault

Here are some examples. The script you proposed for processing the event at the click of a button works well (post 54 - evtest KEY_WPS_BUTTON). For visual control, I switched the LED to them. But when I tried to put it into startup (systemd unit, cron), the system stopped functioning. Operability was restored only after bringing the micro SD card to the previous state. I thought this was the reason for my incompetent actions. However, the other day I decided to try other options and it turned out that even executing the command causes the system to crash.

[root@bpir64 gpio]# echo 495 > /sys/class/gpio/export  # 495 == (86+409)
[root@bpir64 gpio]# ls
Segmentation fault

You could try looking into dmesg after segfauld happened if possible. Or change the console loglevel before

echo "6" > /proc/sys/kernel/printk
cat /proc/sys/kernel/printk

If not kernel itself crashes it will be differentā€¦there are tools like strace which can give a hint whats going wrongā€¦

unfortunately, dmesg canā€™t be viewed. after this error, the system does not respond to commands. only if turn off the power and turn it on again.

Then it looks like a kernel-crashā€¦change console loglevel or running dmesg as background-process before running the command

dmesg -Tw &
...

frank, thank you for your responsiveness! after the command , the following messages begin to be output to the console : journal: Input/output error

[Fri Feb 24 08:59:28 2023] systemd-journald[105]: Failed to rotate /var/log/journal/17c18f57d227437dbda6439989abb878/system.journal: Input/output error
ls
Segmentation fault
[root@bpir64 ~]# [Fri Feb 24 08:59:37 2023] systemd-journald[105]: /var/log/journal/17c18f57d227437dbda6439989abb878/system.journal uses an outdated header, suggesting rotation.

[Fri Feb 24 08:59:52 2023] systemd-journald[105]: Failed to rotate /var/log/journal/17c18f57d227437dbda6439989abb878/system.journal: Input/output error
reboot
Segmentation fault

it seems like there is a border between the normal log:

[Fri Feb 24 08:56:34 2023] Bluetooth: hci0: Failed to query firmware status (-110)
[Fri Feb 24 08:56:35 2023] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[Fri Feb 24 08:56:35 2023] brlan: port 7(wlan0) entered blocking state
[Fri Feb 24 08:56:35 2023] brlan: port 7(wlan0) entered forwarding state
[root@bpir64 ~]# [Fri Feb 24 08:57:49 2023] F2FS-fs (mmcblk1p1): Inconsistent segment (1) type [1, 0] in SSA and SIT
[Fri Feb 24 08:57:49 2023] systemd-journald[105]: /var/log/journal/17c18f57d227437dbda6439989abb878/system.journal: IO error, rotating.
[Fri Feb 24 08:57:49 2023] systemd-journald[105]: Failed to write entry to /var/log/journal/17c18f57d227437dbda6439989abb878/system.journal (10 items, 306 bytes), rotating before retrying: Input/output error

this starts a few seconds after the command is executed :

dmesg -Tw & echo 495 > /sys/class/gpio/export

Is your system running from sd or emmc? You should try a fsck and badblocksā€¦

F2FS-fs (mmcblk1p1): Inconsistent segment (1) type [1, 0] in SSA and SIT

This looks like damaged filesystem

Are you sure you are using the correct gpio number? Maybe something is switched in the MMC controller.

How about controlling leds like this:

echo 1 > /sys/class/leds/bpi-r64\:pio\:green/brightness

Like it says on Franks site

Directly poking in the gpio you need to be very carefull. You might even perminantly damage something on the board if you get the wrong gpio. I suggest using /sys/class/leds/

I havenā€™t done this myself though.

He uses gpio 86 which is pin37 of gpio header,so this should be right. But maybe the wps-button is tried to be mapped at boot time and one access is rejected. Anywayā€¦filesystem message is strange.

Anyway, it would not hurt to use /sys/class/leds/ and see if this way it also segfaultsā€¦

He only uses the echo command (which would be frequently used anyway) and then it segfaults.

Anyway, if the led is already used by /sys/class/leds/ is it still okay to export it on /sys/class/gpio/ ? I donā€™t knowā€¦

Did it work switching the led before?

You could put the SD card in your computer/laptop and check the root partition with fsck (I havenā€™t added this to initrd yet as I have not needed to use it. f2fs seems to deal quite well with errors normally with CONFIG_F2FS_CHECK_FS=y).

I would normally only get input/output errors if I removed the sd-card. One time I worn out a card, and it was impossble to write on it, but this was perminantly. Otherwise it could be a power issue, with the sd card the first one to fail, but in your case I do not have any info pointing to this.

Yes, I use a microSD card. The problem is not in the LEDs, it switched from the button well if i run the script manually via ssh. Problems arose if I tried to register the same script in the startup. I gave this command with an echo just as an example that even this action leads to this result. Iā€™ll try tomorrow with another card.

If the led switches on/of then that command is correct. Then I do not see any link with MMC I/o errors. There must be something else going on.