Arch Linux ARM on Orange Pi 5 Max: Part 2
The journey continues with getting some of the base packages installed and getting things configured to a good state.
The goal is to keep the bloat off, install what I need to meet the requirements and try not to break the OS before updating the kernel.
Yesterday, the install was successful, and everything seemed to flow smoothly. There will be rough waters ahead, so the goal is to keep it simple, and focus on the requirements. Today might be a good day to get a backup of the EMMC once all of the packages are installed. (I’ve never done that before, but I don’t imagine it could be too terribly difficult).
–
Requirements
-
CIFS for mounting samba shares (the S30 uses samba as its main file‐sharing capability).
If this falls short, you have options. There were reports of mtpfs working as well. Research is always an option if things go south.
-
Hailo M.2 module support for AI processing / offloading the workload of the RK3588 processor.
-
Wifi and Bluetooth support (not for any particular reason, but just to have it.)
Of note, if the onboard AP6611s wifi/bluetooth module doesn’t work, the alternative is to use the TP‐Link AC1300 USB wifi dongle.
–
Phase 2
Install the packages needed for this project to be successful.
Starting fresh, access to the AUR will be an absolute requirement. Most of the good stuff is in the AUR, and for adventurous people who want to strap the Hailo M.2 module onto the Orange Pi 5 Max; that is where all of the supported packages are.
Let’s get these packages installed. A simple Google search (and Grok) identified two packages that are an absolute for the Hailo. There might be more, but starting small is the right choice.
- hailo‐pci – (Hailo’s PCIe driver and matching firmware)
- hailort – (Hailo’s accelerator runtime)
Both packages aren’t in base repo, so installation requires AUR from the start. I chose yay for my AUR helper because it’s simple to use and has always ‑just‐ worked.
-
Update
pacman
.sudo pacman ‑Syyuu
-
Install
yay
.sudo pacman ‑S yay
Right off the bat, there are issues. These are small though. There doesn’t appear to be linking requirement to the devel packages needed for compiling and installing AUR packages. These will need to be manually installed (should probably throw some other packages that might be helpful too; git, wget, p7zip).
sudo pacman ‑S gcc make fakeroot binutils patch pkgconf autoconf automake git base‐devel bison flex gettetxt m4 git wget 7zip
-
Once installed, start installing the other packages that are needed for the project. In this case; python, pip, cifs‐utils, smbclient, flask, etc.
yay ‑S python python‐pip cifs‐utils smbclient python‐flask python‐astropy python‐opencv python‐pyusb usbutils python‐onnx python‐scikit‐image python‐wand imagemagick
-
Then get the latest Hailo packages from the AUR to be able to use that accelerator chip.
yay ‑Syua hailo‐pci hailort
-
While going through the logs to see what was happening on the system, it appears that the stupid AP6611 module isn’t fully operational yet. This is frustrating, and because power is precious in this build, it would be best to disable the module altogether.
Disable the brcmfmac:sudo echo “blacklist brcmfmac” > /etc/modprobe.d/blacklist.conf sudo echo “blacklist brcmfmac_sdio” > /etc/modprobe.d/blacklist.conf
Rebuild the kernel:sudo mkinitcpio ‑P
Reboot and ensure that it’s off and the card isn’t detected.
dmesg | grep WLAN_RFKILL ifconfig nmclidevice
Next, there needs to be a place that can be accessed across the network. Setting up a samba ‘drop box’ is probably the best solution. This coupled with inotify to monitor a folder for any activity and then trigger a script to get things going!
Edit the
/etc/samba/smb.conf
file and add the following:[fits_incoming] path = /home/astro/space/fits‐incoming writable = yes guest ok = yes valid users = astro create mask = 0775 directory mask = 0775
Even though guests are allowed, still had to add the user to get it working:
sudo smbpasswd ‑a astro
Then, start the servers to get samba up and running.
sudo systemctl start smb nmb
Now it’s time to setup the monitor and notification system using inotify and a service file.
pacman ‑S inotify‐tools
Next is a small monitoring script to leverage
inotifywait
to look forfit
andfits
files that enter thefits‐incoming
folder (from the samba share), and ignore Mac._
files.It’s a little premature, but add the PROCESS_SCRIPT in there because, well, that’s where it’s going to be eventually.
#!/bin/bash INCOMING_DIR=”/home/astro/space/fits-incoming” PROCESS_SCRIPT=”/home/astro/space/process.py” inotifywait ‑m ‑e create ‑e moved_to ‑e close_write –format ‘%w%f’ “$INCOMING_DIR” | while read ‑r file; do if [[ “$file” =~ \.fit(s)?$ && ! “$file” =~ \._ ]]; then echo “New FITS file detected: $file” python “$PROCESS_SCRIPT” “$file” fi done
Then, the service file to run this script as a system service in the background.
[Unit] Description=FITS file monitor After=network.target smbd.service [Service] ExecStart=/home/astro/space/monitor.sh Restart=always User=astro WorkingDirectory=/home/astro/space [Install] WantedBy=multi-user.target
This should be a good stopping point. So far, the system has been configured, and the basic monitoring system has been incorporated automate the file management and script execution when
fit
files are added to the samba share. The Hailo drivers have been added, and there doesn’t appear to be any issues with the Orange Pi 5 Max running with the Hailo module or other issues.