I started with one Raspberry Pi, now at four and counting. After I had the first one in 2019, a Pi 4 with 4GB, I ran only the vendor encouraged Raspian OS. After getting the second Pi 4 in 2020 (hey--8GB!) and reading docs on both NetBSD and FreeBSD I picked the latter as having made more progress in the install phase, if not more user friendliness.
I had used the first Pi for LibreOffice, VLC audio, web browsing, a bit of python, and at least 2 database platforms. The postgreSQL was my primary interest after not being as familiar as the gamut from Oracle to SQLServer to mysql with a smattering of DB2, Progress, and the OpenOffice-bundled HyperSQL. But I've been running NetBSD for decades, starting before that with 386BSD, and occasional FreeBSD, SUSE, and RedHat open source deployments.
As I moved from one OS to the next, backup and restore along with deploy from scratch techniques often changed incrementally. Honestly, the first 386BSD and NetBSD installations I brought up via floppy disk transfers. I've toasted more than one SSD drive, and struggled with boot sectors on some hand-me-down machines as I like to see how to bring a cast-off back into service. The last 2 major machines I used for NetBSD were an appliance-size 386 class, which has gone down “soft” due to fan noises that predict a future “hard” down. The newer platform is an AMD 64 bit NetBSD, last at 9.1; meanwhile I set up a NAS to keep backups and share a few file sets.
Back to the Pi story. FreeBSD 13, which was in "current" status when I first got it installed, started up on the Pi 4. It can access hardware primitives such as CPU clock frequency, and core temperature. Over the past year or so since I had the 2 pi 4s, FreeBSD has run with a growing set of apps, and is now at the 13-Release level. Each time I reinstalled the OS and deployed various packages, keeping note of the process (as Linux, NetBSD and FreeBSD use different deploy steps), and resolving conflicts whenever possible.
One such conflict involves mysql and LibreOffice (which I use instead of OpenOffice for docs, sheets, and database access panels). BSD would not handle both in the package matrix, but could deal with the alternate mariadb.
Package `mysql-client-5.7.34' is still required by other packages:
[4/11] Installing mysql57-client-5.7.32...
pkg: mariadb105-client-10.5.8 conflicts with mysql57-client-5.7.32 (installs files into the same place). Problematic file: /usr/local/bin/mysql
Installed packages to be REMOVED:
Reading up on NetBSD, I decided perhaps the Pi 3 series would work best (in early 2021) so I got 2 of them, hoping to have one wired and one wireless, perhaps relegating FreeBSD from Pi 4 to the Pi 3 level if I could get NetBSD to run.
Pi3 running NetBSD wireless
I'll skip the dead end installs other than to acknowledge how complex the stack is, and how an alternate OS could even boot on the machine much less get to the point of running Firefox and even xscreensaver. Meanwhile as I was burning microSD cards and watching boot light shows, NetBSD 9.2 came out. My successful installs of NetBSD were from the -current code base, and as it turns out, a few tweaks there aren't yet in the 9.x path. Will have to wait for 10 it seems.
What tasks did I put these machines to?
A primary use is database servers, clients, and SQL data crunchers. I put household projects on one, and nutrition views in another. Even recipes, though that doesn't use a mainstream database. Secondary use is music track storage and display, after converting decades of CD collections to either MP3 or Itunes file. Spreadsheets with LibreOffice is a change of pace from MS Office or the borg-ish Google calc.
One limit that's documented is the lack of "native" audio output. To me, that means I would have an audio server (minidlna) run on that pi but not use it for playback. I've learned DLNA players may be found in Roku sticks, BluRay/DVD players, and even on my Android phone and tablet. The phone has foobar2000 while the tablet can handle the perennial favorite VLC.
LibreOffice installs easily (other than the mysql conflict I found) and behaves well enough but as speedily as I'd like. Response time is good but startup, save, and shutdown not so good. Admittedly this is partly due to using an SD card only other than, so far, only NAS with slow but large spinning disks.
Hardware wise, I only played around a bit with connecting external disks through USB until I fried one SSD drive somehow. NFS makes that less of a local plug-in problem. I added a fan after looking at the temperature charts on the pi 4. When I tested FreeBSD on the pi 3, I saw a little heat relief with the case lid off, but as both of the pi 3 machines are now running NetBSD I left off getting more fans for the older and hopefully cooler boards,
I don't think there are drivers for the built-in Pi wifi yet, either 3 or 4. As I've gotten wireless to work on the pi3 with NetBSD, I didn't go further yet testing USB wifi on FreeBSD. I did get a couple USB sound "cards", one of which, happily, has a chip set that FreeBSD recognizes and I think it was the more expensive of the 2 ($25 instead of $10).
I have 2 primary music source: an MP3/M4A library, and streaming source URLs (or XMLs). These depend on the audio hardware working, which on Linux is assumed but on BSD not so much. As I have audio output working on both BSD flavors, one control of interest is the route, whether HDMI or the 1/8 inch (3.5mm) jack. For NetBSD, I did this:
mixerctl -w outputs.select=headphones
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:13:aarch64/quarterly, please wait…
# pkg install mariadb105-server
# pkg install scribus
# pkg install xscreensaver
My main stumbling block has been getting the right install image for the machines I have. In one case (9.2), I burned the compressed OS image onto the microSD card, using the Raspberry Pi install software on Windows. It happily recognizes .gz install files as viable, even if the code won't boot up that way. I only speculate this based on a few failures of other NetBSD images, including ebijun’s and at least one -current. I even managed to get one as far as noting that X was not there, making a valiant effort to build it from pkgsrc, and giving up after too many swap failures.
Pi3 wired running NetBD
Swap is apparently pretty important for doing any complex compute work on the Pi 3. (1GB main memory rather than the 4 or 8GB on the Pi 4). The good news is with an external drive, even though USB-connected, greater things are possible For example, running minidlna for the first time pointing at an audio library takes some time (reading the files, associating album artwork if found, and writing a usable sqlite3 database). Without swap defined, in 9.2, the library build only made it to the "B"s.
Jun 2 18:22:56 nib /netbsd: [ 558967.3390542] UVM: pid 12874 (dymaxionmap), uid 1000 killed: out of swap
Device 1K-blocks Used Avail Capacity Priority
/dev/sd0e 1931196 35064 1896132 2% 0
For the -current image, I was pleasantly surprised to find that audio output works (but it doesn't directly in 9.2). I put the cheaper USB sound chip in the Pi with 9.2, and a USB wifi chip in the -current board.
# pkg_add mysql-server
# pkg_add mariadb-server
# pkg_add rrdtool
# pkg_add xli
> pkg_add raspberrypi-userland
pkg_add: no pkg found for 'raspberrypi-userland', sorry.
pkg_add: 1 package addition failed
uaudio0: <Antlion Audio Antlion USB adapter, class 0/0, rev 1.10/1.00, addr 2> on usbus0
After adding an SSD disk with a SATA/USB adapter to the first NetBSD system I got running, I put the pkg and pkgsrc directories there, then started adding other directories that would benefit from the faster I/O (and larger headroom). A home directory was easy enough, so I also created db, log, run, and tmp folders. To get builds to use the tmp directory there, rather than the one on SD card, I set TMPDIR to /usr/pkgsrc/tmp/. And put into a dot profile for persistence.
I took a chance to re-host the SSD drive with an "unpowered" USB adapter. For spinning disks, there is unlikely to be sufficient power without a separate feed besides the Pi, but that adds hardware and wires. The SSD has been fine so far, though I had a few mysterious halts prior to setting up swap on the external drive.
See: wla_supplicant in the manuals.
[ 6.972019] ugen0: Realtek (0x2357) 802.11ac NIC (0x0138), rev 2.10/2.10, addr 5
Each OS has a top command, and while pretty similar, switching to view all 4 CPUs has different methods, or just didn't work for me.
By the way, I've only been able to build/compile/run "catclock" on NetBSD. It's a wily one.
Stock Linux Pi4
[ 1.000000] total memory = 933 MB
[ 1.000000] avail memory = 900 MB
[ 1.000000] simplebus0 at armfdt0: Raspberry Pi 3 Model B Plus Rev 1.3
[ 1.000000] cpu0 at cpus0: Cortex-A53 r0p4 (Cortex V8-A core)
[ 11.479420] mue0: vendor 0424 (0x424) product 7800 (0x7800), rev 2.10/3.00, addr 8
[ 11.769459] mue0: LAN7800 id 0x7800 rev 0x2
[ 11.779461] ukphy0 at mue0 phy 1: OUI 0x00800f, model 0x0013, rev. 2
[ 11.779461] ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
FreeBSD (pi4; wired)
|SKU||Description||Quantity||Price Per||Total Price|
|874834||TPLINK 150MBPS WRLSN NNO USB ADP||1||9.99||9.99|
|854281||ANTLION ANTLION USB SOUND ADAPTER||1||9.99||9.99|
|550509||SABRENT USB SOUND ADAPTER CMEDIA||1||9.99||9.99|
Example links (sometimes you can start further up the tree, sometimes not)
pkg_add -v http://cdn.netbsd.org/pub/NetBSD/misc/jun/aarch64/aarch64/2019-06-22/python37
FreeBSD on Pi
NetBSD on Pi
Besides watching the core temperature with an eye towards better heat dispersal, I'd planning on:
- Review log file growth, and control with "logrotate"
- Figure out how to delay starting mindlna until NFS comes online, particularly after a power outage.
- Wait for NetBSD 10
- Correlate xscreenxaver hacks with the resultant heat rejected
- Run benchmarks at different core frequencies
- Test USB-3 hubs, as even 4 ports fill up