yubikey-agent on FreeBSD

Some time ago Filippo Valsorda wrote yubikey-agent, seamless SSH agent for YubiKeys. I really like YubiKeys and worked on the FreeBSD support for U2F in Chromium and pyu2f, getting yubikey-agent ported looked like an interesting project. It took some hacking to make it work but overall it wasn’t hard. Following is the roadmap on how to get it set up on FreeBSD. The actual details depend on your system (as you will see) ...

June 4, 2020 · 3 min · 517 words · Oleksandr Tymoshenko

Netbooting FreeBSD with PXE/UEFI

Dear Future Me, I guess you came here googling for “FreeBSD PXE UEFI” trying to find out how to netboot your x86 dev box. Or arm64 box. Who knows what you’re hacking on in the future. To do that you need follow these simple steps: Put loader.efi to tftpboot dir Configure dhcpd along these lines: host amd64 { hardware ethernet b8:ae:ed:77:88:99; filename "loader.efi"; option root-path "/src/FreeBSD/tftproot/amd64"; fixed-address 192.168.10.102; option routers 192.168.10.1; } Make sure root-path is in /etc/exports. If you use MINIMAL-derived config add your NIC driver to /boot/loader.conf: if_re_load="YES" That’s pretty much it. ...

September 29, 2016 · 1 min · 96 words · Oleksandr Tymoshenko

VirtualBox Shared Folders: progress report

I spent Labor Day weekend laboring on VBox shared folders support for FreeBSD. It’s been some time since I worked on it last time so I had to refresh my memory first. Things have moved on since then - VBox in ports was updated to version 5, but fortunately Li-Wen synced up freebsd-vboxfs repo to the latest version. After three days of laid-back hacking I am glad to announce that following VOPs are kind of implemented (in no particular order): lookup, access, readdir, read, getattr, readlink, remove, rmdir, symlink, close, create, open, write. “Kind of implemented” means that I was able to mount directory, traverse it, read file, calculate md5 sums and compare with host’s md5sum, create/remove directories, unzip zip file, etc but I doubt it would survive stress-test. Locking is all wrong at the moment and read/write VOPs allocate buffers for every operation. ...

September 12, 2016 · 2 min · 216 words · Oleksandr Tymoshenko

Jetson TK1, FreeBSD, and SSD

Looks like my attempt to cheap out on SSD for TK1 has backfired. I went for the cheapest SSD available in local store (Toshiba Q300) but when I tried to checkout FreeBSD sources to the drive I got bunch of WRITE_FPDMA_QUEUED timeouts and system locked up. The same thing happened when I tried to perform checkout on Linux. The drive itself was OK, it survived “svn co …/head” and dd when connected using USB-to-SATA adapter. ...

August 19, 2016 · 1 min · 111 words · Oleksandr Tymoshenko

FreeBSD on Jetson TK1

I finally got around to BSDify my Jetson TK1. Here is short summary of what is involved. And to save you some scrolling here are artifacts obtained from whole ordeal: https://people.freebsd.org/~gonzo/arm/jetson-tk1/ U-Boot First of all - my TK1 didn’t have U-Boot. Type of bootloader depends on the version of Linux4Tegra TK1 comes with. Mine had L4T R19, with some kind of “not u-boot” bootloader. My first attempt was to use tegrarcm tool, it uses libusb, so it’s possible to build it on FreeBSD with some elbow grease, but once I tried to run it - it gave me cryptic errors and USB is not my strong skill so I took low road and installed Ubuntu VM. For what is’s worth I got the same kind of error on Ubuntu. ...

June 28, 2016 · 4 min · 820 words · Oleksandr Tymoshenko

bsdfb platform plugin merged to Qt dev branch

Few weeks back Ralf Nolden, who is *BSD champion in Qt community, urged me to clean-up and submit my Qt5-related projects to upstream and scfb platform plugin was picked as a test dummy. It took 12 iterations to get things right, along the way plugin was renamed to bsdfb, but eventually patch has been merged. Next two candidates are bsdkeyboard and bsdsysmouse input plugins.

June 13, 2016 · 1 min · 64 words · Oleksandr Tymoshenko

VirtualBox Shared Folders: One VOP at a Time

Two months ago I tried to setup dev environment using FreeBSD Vagrant box just to find out that FreeBSD does not support VirtualBox shared folders. After some googling I found Li-Wen Hsu’s github repository with some work in this area. Li-Wen and Will Andrews has already done major chunk of work: patches to VirtualBox build system, skeleton VFS driver, API to talk to hypervisor but hit a block with some implementation details in VirtualBox’s virtual-memory compatibility layer. Will provided very comprehensive analysis of the problem. ...

June 12, 2016 · 1 min · 195 words · Oleksandr Tymoshenko

gpiokeys support committed

To those who do not track FreeBSD commit messages: I committed gpiokeys driver to -CURRENT as r299475. The driver is not enabled in any of the kernels but can be built as a loadable module. For now it stays disconnected from main build because it breaks some MIPS kernel configs. Configs in question include “modules/gpio” as part of MODULES_OVERRIDE variable and since gpiokeys can be built only with FDT-enabled kernel the build fails. ...

May 20, 2016 · 1 min · 143 words · Oleksandr Tymoshenko

Qt5 for FreeBSD/Pi

Build SD card image using crochet-freebsd with option VideoCore enabled. Mount either SD card itself of image to build host mount /dev/mmcsd0s2a /pi Checkout Qt5 sources and patch them cd /src git clone git://gitorious.org/qt/qt5.git qt5 cd qt5 git checkout 5.4.0 MODULES=qtbase,qtdeclarative,qtgraphicaleffects,qtimageformats,qtquick1,qtquickcontrols,qtscript,qtsvg,qtxmlpatterns ./init-repository --module-subset=$MODULES fetch -q -o - http://people.freebsd.org/~gonzo/arm/rpi/qt5-freebsd-pi.diff | patch -p1 Configure, build and install Qt5 to SD card ./configure -platform unsupported/freebsd-clang -no-openssl -opengl es2 -device freebsd-rasp-pi-clang -device-option CROSS_COMPILE=/usr/armv6-freebsd/usr/bin/ -sysroot /pi/ -no-gcc-sysroot -opensource -confirm-license -optimized-qmake -release -prefix /usr/local/Qt5 -no-pch -nomake tests -nomake examples -plugin-sql-sqlite gmake -j `sysctl -n hw.ncpu` sudo gmake install You need BSD-specific plugins to enable mouse and keyboard input in EGLFS mode ...

January 14, 2015 · 2 min · 267 words · Oleksandr Tymoshenko

Audio on Raspberry Pi

With stable VCHIQ driver next obvious target was to add VCHIQ-based audio support. So let me introduce to you: vchiq_audio, first take. It’s part of vchiq-freebsd repo so if you use Crochet to build SD card image just enable option VideoCore in config file and module will be automatically included. From shell run kldload vchiq_audio and you’re good to do. I believe that audio output is picked up automatically by VideoCore so if you have HDMI connected it’s probably going to be HDMI. I do not have device to confirm this. Adding knob to control audio output (auto, headphones, HDMI) is on my ToDo list. ...

January 9, 2015 · 1 min · 195 words · Oleksandr Tymoshenko