:: Re: [DNG] Device naming: was Felker…
Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Didier Kryn
Ημερομηνία:  
Προς: dng
Αντικείμενο: Re: [DNG] Device naming: was Felker Init: was without-systemd.org not working
Le 16/05/2020 à 22:10, Rick Moen via Dng a écrit :
> Quoting Steve Litt (slitt@???):
>
>> If you're referring to the ethernet device being eno1 or enWhichUSB22
>> instead of eth0, or wxbd3 or wl21Poettering423 instead of wlan0, I
>> prefer the new way. Here's why:
> No, that's not what I meant (and network interfaces don't have device
> node files, being unique and peculiar, that way).
>
> I meant multiple subtrees of device node files classified in lots
> of different and overlapping ways, by-uuid, and on and on.


    The subdirs of /dev/disk contain symlinks produced by
udev/eudev/vdev and possibly mdev, in other words the "hotplugger"

    For an application to obtain labels and uuids of disks and
partitions, there are three ways:

1) interface with libudev, which is undocumented, convoluted and
probably perpetually evolving, not being designed to be a stable API for
the public, but rather a private tool for a group of developpers.

2) spawn processes to invoke /sbin/blkid or /bin/lsblk

3) browse and/or watch the subdirs of /dev/disk, which are stable
methods for the hotplugger to provide uuids and labels to user space.

    My little removable-disk-manager "hopman" uses the third method,
much simpler and faster than option 2.

    If you don't want this /dev/disk tree, I think you could work
without a hotplugger: provided your kernel is compiled with devtmpfs
enabled, /dev will be populated by the kernel. There might be other
things the hotplugger do and the kernel doesn't; I don't pretend to know
all of it. Note that with mdev, you can completely tailor the hotplugger
to your will.

    If you consider the tree under /sys, this is another story; the
team maintaining the Linux kernel claims that it isn't meant to be
stable, but they grant some stable properties, at least that each leaf
of the tree, representing the properties of a device, is unique - but
not that the path to it is unique nor that it is stable over versions of
the kernel. hopman browses the whole tree until it finds the device.

    Didier