Last week I said I was going to spend this week on fixing the 5GHz wireless suport and then put the GL-AR750 away and start working on some other device. Some of that happened …

Radio

Getting the ath10k driver running was mostly a similar process to the ath9k that provides 2.4GHz wifi: I’d already done the work for building and loading modules from the backports tree, so just had to load more of them. The only extra fillip is that the ath10k driver requires “calibration data” (for the full handwavey explanation see my NixWRT blog on the subject) which lives in a separate partition of the flash.

I don’t want to extract this binary blob from my device and check it into the Liminix source repo because (1) it’s not source, and (2) probably that ends up with having to do the same for everybody’s device. So I wrote a service to extract it at boot time and made the module depend on it.

This and some reflection led to a rearrangement of responsibilities in the module structure. Given that the function, whereabouts and labelling of network ports on a particular hardware device are properties of that device, Liminix device modules are now expected to provide config.hardware.networkInterfaces.{lan,wan,wlan,whatever} services that correspond to whatever actual connections the board offers. For hardware ethernet the name should follow whatever’s printed on the case, or whatever the device manufacturer calls that port; for wireless I don’t have a good pattern yet so we still need to use judgement.

The other thing that ath10k made apparent is that an insmod call can return before the device is ready for use, so my insmod ath10k_pci && ip link set up dev wlan was failing because the second command ran too soon. To accommodate this I have evolved (and simplified) waitup into ifwait, which doesn’t just wait for a device to be running but can also wait for it to exist.

Everything else

Before I put this device down and start work on another, I want it to boot unattended and without a serial connection. This meant:

  • adding outputs.flashable target to make a flashable image. This has slightly different kernel config from the TFTP-bootable image we’re using in development, because it needs to have its kernel command line hardcoded into the image (actually the DTB) instead of getting it from the bootloader.

  • enabling ssh service, provided by dropbear. This needs to be cleaned up and moved from rotuer.nix into Liminix proper.

  • defining the config.users type properly so that an end-user configuration.nix can set the root password

  • improving the logging somewhat so that each line is tagged with the name of the service it came from

Sorting these little niggles out took most of the rest of the week. Maybe next week I’ll get to Hardware Device Number Two.