You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These documents describe my experiences and experiments running FreeBSD 10.2-STABLE on the Raspberry Pi Model B.
Eventually, they might be reorganized into one or more sets of documents to be published somewhere under https://www.nordstroem.no/en-US/.
Replace /dev/xxx above with the device path of your SD card. On Linux, the lsblk command may help you identify the device path of your SD card. Once dd has completed, eject the SD card and remove it from your computer.
Insert network cable and SD card into Raspberry Pi, hook it up to a monitor with HDMI and plug in the power cable of the Pi.
Default usernames and passwords:
root/root
freebsd/freebsd
Log in as root on the console.
Networking and Services
Where I live, me and the other tennants share a common internet connection through a WiFi router in the living room. The distance from that router to my own room is greater than the longest ethernet cable I have, so I have my main computer -- an ODROID XU-3 single-board computer -- connect via WiFi using a Blueway BT-N9500 18dBi USB-connected antenna.
The WiFi router place us behind a NAT as is common among Norwegian ISPs. We have IPv4 but no IPv6 connectivity.
The ethernet port of my ODROID is connected to a generic 8-port gigabit dumb-switch I bought on eBay, which has model number TH-1008G but no distinguishable brand, though it does also say Tian Hao Wang Luo on the box. To the same switch, I have connected the Raspberry Pi. The Raspberry Pi Model B onboard ethernet port is attached via the USB 2.0 bus and as such supports 100M only. This in turn makes the switch I am using carry all traffic across every port at 100M only, but I'm fine with that.
My ODROID is running Lubuntu 14.04.3 LTS. Using the nm-applet GNOME front-end to NetworkManager, I have configured IPv4 network sharing. This effectively means that the Raspberry Pi resides behind double NAT. In general, NAT is not something I am much of a fan of, but for now it doesn't matter all that much.
I like to turn off my main computer when I'm not using it. If I'd left the FreeBSD default of using DHCP, I'd be seeing spurrious failures to connect from the ODROID to the Pi after having turned the ODROID back on, due to the DHCP lease of the Pi having expired while the ODROID was off and not having been renewed since the ODROID came back up. Rather than mucking about with DHCP, which makes little sense for such a small network, I opt to assign a static IP address to the Pi and tell it what the default route is. Furthermore, rather than setting up a name server for my network, I just maintain the /etc/hosts files on the ODROID and on the Pi.
Using the text editor vi, I edit /etc/rc.conf on the Pi to hold the following:
In addition to having set a static IP and a default route, I also asked to enable ntpd(8). This because the Raspberry Pi Model B does not have a Real-Time Clock (RTC), so every time it boots, the correct time must be set. ntpd takes care of that by querrying a set of time-servers online. ntpd could also be used as a time server for other computers on the local network but I do not have any need for that. It used to be that one would enable the ntpdate(8) daemon if one wanted to be a client only but according to the man page of ntpdate(8), ntpdate is to be retired from FreeBSD now that the functionality is avilable in ntpd. However, that alone did not set my clock right so for now I'll be using ntpdate.
In order to apply these specific changes without reboot, we run the following commands:
/etc/rc.d/netif restart
/etc/rc.d/ntpd start
Building and Installing Packages
TODO: Rewrite this section to build packages on the Raspberry Pi using Poudriere.
Packages are not available for FreeBSD on Raspberry Pi, so ports must be built from source.
This can be done either of the two following ways:
The eternally slow way by building them on the Pi itself, as described below.
The default tmpfs configuration included in the image of FreeBSD 10.2 for the Raspberry Pi Model B is too small to hold intermediate files generated during certain builds (e.g. that of the devel/llvm36 port). Perhaps a bigger size could be found which would allow the builds to be performed but also without the tmpfs eating too much RAM? I opt to unmount the tmpfs and outcomment the /etc/fstab line for it, taking the performance hit writing to the SD instead of in RAM might introduce in trade for not having future builds fail randomly because some intermediate file of some port was suddenly larger than anticipated. I might later want to have my SD card mounted read-only in order to reduce wear but since mounting the SD read-only would lead to a bunch of other things needing to be configured accordingly anyway, for now we'll do like this.
umount /tmp
sed -i -e 's/^tmpfs/#&/' /etc/fstab
Fetch ports tree, install portmaster, fetch distfiles, then install core Xorg ports and the suckless surf web browser.
portsnap fetch extract && \
cd /usr/ports/ports-mgmt/portmaster/ && make fetch-recursive install BATCH=yes && \
cd /usr/ports/x11/xorg-minimal/ && make fetch-recursive BATCH=yes && \
cd /usr/ports/x11-drivers/xf86-video-scfb/ && make fetch-recursive BATCH=yes && \
cd /usr/ports/x11/xorg-apps/ && make fetch-recursive BATCH=yes && \
cd /usr/ports/www/surf/ && make fetch-recursive BATCH=yes && \
portmaster -G -D --no-confirm x11/xorg-minimal x11-drivers/xf86-video-scfb x11/xorg-apps www/surf
Wait a million years for compilation of Xorg, surf and dependencies to finish.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters