diary @ telent

We've got mail#

Sun 26 Mar 2023 11:19:45 AM UTC

Topics: liminix

As you'll see if you're reading this on www.liminix.org (but not if you're using the RSS feed) we're now on version 0.2 of the web site. I've starting to add a bit more structure beyond the blog entries and would draw your attention particularly to:

In development news - yes, there was also a little bit of development -

At your command

The problem is this: many devices have hacked-up or restricted versions of U-boot installed which hardcode the kernel command-line parameters instead of letting the user configure them. These hardcoded parameters are most likely wrong for Liminix, but luckily we can configure the kernel to ignore the bootloader command line and use a builtin command line or refer to the embedded DTB.

However, this creates another problem: when we are hacking away on an open device with a serial cable, or when we are booting with kexecboot, or when running emulated Liminix with QEMU, we want to change the bootloader kernel command line.

So we needed one kernel with CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER and one with CONFIG_MIPS_CMDLINE_FROM_DTB. Because kernel configuration is a property of the configuration not of the "output", this meant editing the configuration.nix to comment-out or uncomment the kexecboot or flashable module depending on which output was needed - a reliable source of strange behaviour whenever I forgot to.

Our solution is to add an option for "ignore the bootloader command line unless it contains a magic string", and then ensure that the tooling for tftpboot and kexecboot adds that string. The bootloader hardcoded command line doesn't, so we have the desired behaviour in both use cases.

This does require a small kernel patch but hopefully that's not a huge maintenance burden to carry.

(Fixing vendor U-boot on all devices is most certainly not within scope for Liminix.)

Next week

Next week we are moving on to "Task 2":

NixWRT used a self-designed module system (instead of Nixos modules) to allow us to easily express the configuration of multiple instances of the same module – for example when two differently configured copies of the same service are running on different network interfaces. But it had no validity checking or type checking of module options, making it painfully easy to generate and install a bad image. In this phase we revisit this decision, and figure out how to gain the advantages of the Nixos options/type system while still allowing multiple instances of the same module

See you then.