Hi Ludo, On Thu, 14 Dec 2017 14:14:09 +0100 [email protected] (Ludovic Courtès) wrote:
> The code would be slightly simpler (no pipe, etc.), and the .devname > file might be more stable than the kmod output, being a kernel > interface. > > WDYT? That's true. The kernel interface definitely has Linus breathe down the neck of anyone who even thinks of changing it :) > >> What about having a ‘static-device-nodes’ procedure that would parse > >> that and return a list of <device-node>, where: > >> > >> ;; TYPE is 'char or 'block, MAJOR and MINOR are integers. > >> (define-record-type <device-node> > >> (device-node name type major minor module) > >> device-node? > >> …) > >> > >> and then: > >> > >> (define create-device-node > >> (match-lambda > >> (($ <device-node> name type major minor) > >> (mknod …)))) > >> > >> finally: > >> > >> (for-each create-device-node (static-device-nodes)) > >> > >> ? > > > > The kmod format has entries not only for mknod but also for mkdir (it > > actually mkdirs the same directory twice sometimes which is why there was > > another version of this patch...). > > OK, I had overlooked that. Hopefully the general approach remains > valid? Yeah. Apparently kmod autogenerates those when there's a slash in the name it got from the devname file. That's why it generates two mkdir entries for "snd" - there's a "snd/timer" and a "snd/seq" in the devname file...
