:: Re: [DNG] What is an init system?
Forside
Slet denne besked
Besvar denne besked
Skribent: Ralph Ronnquist
Dato:  
Til: dng
Emne: Re: [DNG] What is an init system?
On Thu, May 30, 2024 at 11:01:07AM +0200, Didier Kryn wrote:
> Le 28/05/2024 à 20:51, karl@??? a écrit :
> > > ...
> > ...
>
>     I would personnally recommend to rely on the kernel to create/delete
> device files, since this is the most difficult. Then, if you don't want to
> use any existing hotplugger, write, in some sense, your own, not as general
> as the existing ones, but just fitting your needs. mdev seems to me the
> simplest way: it is just made for customization.


Unfortunately one con't fully rely on the kernel as it will not
actually load the required modules even for disk drives. Rather it
installes /dev devnodes when modules are loaded, where the modules do
the hardware detection and decide whether or not that are able to
insantiate adapters (i.e. whether or not the hardware they handle is
available.

So one option is to force-load "all possible" modules and then unload
those that faile to find their appropriate hardware. Or, like the
"preamble initrd" of the Devuan installer, load "all possible" modules
first, then mount the media, and then try to unload everything while
the media is mounted; in that way modules still in use will not be
unloaded, but all the extra ones will be.

The more targeted approach is to use a hotplugger to traverse the /sys
tree and (re)act upon the available kernel uevents by loading the
associated modules. In fact right now I'm gettting help from Aitor to
make a minimalistic vdevd (not udevd) variant to serve as such module
loading hotplugger (for use in the installer preamble).

It also kind of work with udevd + udevadmin but is too large in Mb to
fit within the 32 Mb El Torrito demand of the hybrid ISO boot image,
which is quite apart from any other considerations regarding udev.

Ralph.