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

An error occurred while trying to update the package:

[root@bpir64 ~]# pacman -S bpir64-mkimage
warning: bpir64-mkimage-2021.10-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) bpir64-mkimage-2021.10-1

Total Download Size:   0.11 MiB
Total Installed Size:  0.28 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 bpir64-mkimage-2021.10-1-aarch64.pkg.tar.xz failed to download
error: failed retrieving file 'bpir64-mkimage-2021.10-1-aarch64.pkg.tar.xz' from ftp.woudstra.mywire.org : Given file does not exist
error: failed retrieving file 'bpir64-mkimage-2021.10-1-aarch64.pkg.tar.xz' from github.com : The requested URL returned error: 404
warning: failed to retrieve some files
error: failed to commit transaction (failed to retrieve some files)
Errors occurred, no packages were upgraded.
[root@bpir64 ~]#

also tried

[root@bpir64 ~]# pacman -Scc

Cache directory: /var/cache/pacman/pkg/
:: Do you want to remove ALL files from cache? [y/N] y
removing all files from cache...

Database directory: /var/lib/pacman/
:: Do you want to remove unused repositories? [Y/n] y
removing unused sync repositories...
[root@bpir64 ~]#


[root@bpir64 ~]# pacman -S bpir64-mkimage
warning: bpir64-mkimage-2021.10-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) bpir64-mkimage-2021.10-1

Total Download Size:   0.11 MiB
Total Installed Size:  0.28 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 bpir64-mkimage-2021.10-1-aarch64.pkg.tar.xz failed to download
error: failed retrieving file 'bpir64-mkimage-2021.10-1-aarch64.pkg.tar.xz' from ftp.woudstra.mywire.org : Given file does not exist
error: failed retrieving file 'bpir64-mkimage-2021.10-1-aarch64.pkg.tar.xz' from github.com : The requested URL returned error: 404
warning: failed to retrieve some files
error: failed to commit transaction (failed to retrieve some files)
Errors occurred, no packages were upgraded.
[root@bpir64 ~]#

You need to use the y also, to make sure you get the newest database of files to download. Then it knows the filename of the newest version is bpir64-mkimage-2021.10-2-aarch64.pkg.tar.xz mind the -2-.

So please use:

pacman -Sy bpir64-mkimage

My mywire.org site is down at the moment, it will give an error, but it should get it from the backup location.

Thanks again for working on this image and helping, thanks to your answers. Now the kernel is 6.0.10-bpi-r64-1

The image is really good, fast and easily and understandably configurable, unlike Ubuntu, where the network could not be configured at all, no matter how hard I tried.

Everything works out of the box here, but I had an idea to turn off and turn on WiFi AP and green Led for clarity using the WPS button. I was looking for information on how to do this and found that it is necessary to handle the interrupt via LKM, and for compilation, kernel headers are needed.

After the current update, I found something similar here :

ls /usr/lib/modules/6.0.10-bpi-r64-1/build/include/linux

I hope this is what need.

I have not done something with the LEDs myself but there was some info shared about it in this post, starting at nr 27. if you scroll up. Maybe also there is more info about LEDs in another topic.

You can start/stop AP simply be starting and stopping the hostapd service.

Edit:

I think you should be able to get gpio-keys events and/or status by using evtest in a script… Make sure it has enough permission, run as root for trying out.

If it turns out you need a kernel module (lkm) which is not present in the bpir64 archlinux kernel, then let me know and I could include it in the next build.

I tried to compile and load LKM using examples. The “Hello World” project is ok, but the example with an interrupt from gpio could not be implemented.

I was trying to figure out what the reason might be and noticed that :

ls: cannot access '/sys/class/gpio/': No such file or directory

I don’t understand this, but maybe the kernel is built without kernel-option CONFIG_GPIO_SYSFS but with LEDS_GPIO [=y], because ls /sys/class/leds/ shows leds

Check of this post:

It’s probably different here. I have a difficulty in the issue with the button. There are no issues with LED, they are visible in the sysfs file system. But there is no GPIO for buttons in the sysfs file system in this kernel.

ls: cannot access '/sys/class/gpio/': No such file or directory

Try building with CONFIG_GPIO_SYSFS like you mentioned above

Next build available for download will be with GPIO_SYSFS=y.

However, It will be quite easy to use the command evtest, you do not need GPIO_SYSFS.

First install evtest

pacman -Sy evtest

Then execute it:

sudo evtest /dev/input/event0 
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "gpio-keys"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 256 (BTN_0)
    Event code 529 (KEY_WPS_BUTTON)
Properties:
Testing ... (interrupt to exit)
Event: time 1670922556.516171, type 1 (EV_KEY), code 529 (KEY_WPS_BUTTON), value 1
Event: time 1670922556.516171, -------------- SYN_REPORT ------------
Event: time 1670922556.848191, type 1 (EV_KEY), code 529 (KEY_WPS_BUTTON), value 0
Event: time 1670922556.848191, -------------- SYN_REPORT ------------

The output is easy to use in a script.

Execute this script:

#!/bin/bash
evtest /dev/input/event0 | \
while read line
do
  if [[ "$line" == *"(KEY_WPS_BUTTON), value 1"* ]]; then
    echo "WPS BUTTON PRESSED!"
  fi
done

This is a nice solution, because it is waiting for the event. This is better then continuously polling the state of the button.

Anyway, if you upgrade now to linux 6.0.12, GPIO_SYSFS will be enabled. (if you are already on this version then delete it from cache and re-install)

[root@bpir64 ~]# ls /sys/class/gpio/
export	gpiochip405  gpiochip409  unexport

After running the build script with -a I receiving the following error.

./x86_64_qemu-aarch64-static.tar.gz: Permission denied Cannot write to ‘./x86_64_qemu-aarch64-static.tar.gz’ (Success). tar: x86_64_qemu-aarch64-static.tar.gz: Cannot open: No such file or directory tar: Error is not recoverable: exiting now :qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-aarch64-static:CF Job for systemd-binfmt.service failed because the control process exited with error code. See “systemctl status systemd-binfmt.service” and “journalctl -xeu systemd-binfmt.service” for details.

systemctl status systemd-binfmt.service × systemd-binfmt.service - Set Up Additional Binary Formats Loaded: loaded (/lib/systemd/system/systemd-binfmt.service; static) Active: failed (Result: exit-code) since Tue 2023-01-24 16:59:43 ACDT; 3mi> Docs: man:systemd-binfmt.service(8) man:binfmt.d(5) https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems Process: 15046 ExecStart=/lib/systemd/systemd-binfmt (code=exited, status=1> Main PID: 15046 (code=exited, status=1/FAILURE) CPU: 6ms

Edit:

Didn´t realize there was a link to a build version in the first post.

The build version is a bit old, but you could use it to try out.

I thought I had all quirks ironed out of the script by now, but somehow there is still one.

Perhapse you can help me to find out what’s going wrong over there:

cd buildR64arch
git pull
./build.sh -a

and post what it echo’s for

BASH_SOURCE:
Current dir:

You can XXX out your username…

(It seems the script does not have permission to the current directory, which should have been set by the script to the directory the script is located. Since it is created by the user with git clone, it should have permission. So something unexpected happens, which does not happen on any of my systems)

You can find Arch Linux packages in:

https://archlinuxarm.org/packages

or if it is not there, you need to build it from the AUR.

https://aur.archlinux.org/packages

Building from the AUR you can do manually, or choose to use yay.

Which package you are looking for?

I just used the built image in the first post.

If you like, I have updated the downloadable image to v1.2.

It has kernel 6.1.7 and is build with latest version of script. Have not tested it yet…

I receive trying to update the pacman database! This is my first time exploring Arch Linux. : : Synchronizing package databases… core.db failed to download error: failed retrieving file ‘core.db’ from de.mirror.archlinuxarm.org : Could not resolve host: de.mirror.archlinuxarm.org warning: too many errors from de.mirror.archlinuxarm.org, skipping for the remainder of this transaction error: failed to synchronize all databases (invalid url for server)

Did you connect wan port to internet?

Try

ping 8.8.8.8

ping www.google.com

Oh! So there is no wireless by default. I will try that in the morning.

There is a wireless AP to connect clients. Internet connect to wan. This is how the standard router setup is.

With the script you can change from router setup to access point setup. Then all ports will become lan ports. Anyway, from this point you can setup as you like…

Is it possible to include a sd card resize script or code such as that included on the Raspberry Pi Operating System to resize the sd card to use the total amount of space on the sd card. That is if there is not an option to do this already?

Can´t connect to access point the router won´t acknowledge the password. Tried both with and without the . on the end but the authorization dialog kept popping up. Is it possible to have it wireless connect to the main router? I need it to connect to my desktop via Ethernet which is in another room to the main router.