Re: [PATCH] udev: create empty regular files to represent net interfaces
From: dann frazier <hidden>
Date: 2009-10-28 15:09:13
On Wed, Oct 28, 2009 at 08:03:08AM -0500, Matt Domsch wrote:
On Wed, Oct 28, 2009 at 09:23:57AM +0100, Kay Sievers wrote:
[...]
quoted
That all sounds very much like something which will hit us back some day. I'm not sure, if udev should publish such dead text files in /dev, it does not seem to fit the usual APIs/assumptions where /sys and /dev match, and libudev provides access to both. It all sounds more like a database for a possible netdevname library, which does not need to be public in /dev, right?Right, it doesn't need to be in /dev. We could have udev rules that simply call yet another program to maintain that database, in yet another way.
Or have udev maintain them in a private directory (e.g., /var/lib/udev/netalias). Personally, I like the approach of having udev manage them as files - its an abstraction our users already get, and they don't have to learn two mechanisms when aliasing disks and nics (SYMLINK ftw). Plus there's obviously a lot of code reuse to be had (most of my patch was moving code into a common section). If we want to hide the file implementation - we could invent another udev construct that basically aliases SYMLINK (e.g. NETALIAS) that works iff the device is a netdevice. That would let us switch out implementations in the future, but would obviously be much more invasive. -- dann frazier