After taking a little time away from Zig to finish a Rust project (at least to get the 1.0 release done), I came back to this yesterday. This time I started with blkid, which is inherently not going to be portable beyond Linux. So I made the decision to a. put it into a separate repo and b. relax my restriction that the code can’t call into or link to C libraries. This was pretty necessary to avoid reinventing too many wheels.
Anyway, the second repo is here. I’m nowhere near done with this one, but I’m going to leave it at this stage for today. Some things to note:
- I’m not going to try to exactly copy the command line options of the util-linux version of this utility, both because I think that many of the options are unneccessary and I want to maintain some consistency in interface between the other tools I write. I’m hugely not a fan of the util-linux project, and find it painful to even use one of their libraries, but reducing the need for the package is part of why this was one I wanted to tackle.
- Right now the interface options that I intend to offer are mostly unimplemented. At this point you can only pass one or more block devices as parameters, which are not themselves partitions, and output the result with default formatting.
- I’ve yet to figure out how to get the PARTUUID field.
I have a little toy distro that I’ve been working on for a while, and I’m using a mix of BSD userland that I’ve ported to Linux, suckless tools from sbase and ubase, and a number of my own userland tools. A deficiency of using either BSD or suckless
mount on Linux is that you lose the ability to mount a partition using the UUID or to specify the partition that way in fstab. So that’s the longer reason that I started on blkid, so that I can learn this API a little bit and eventually translate that into a more functional