A experimental set-up for mdev -- Author Didier Kryn <kryn@in2p3.fr>
--------------------------------------------------------------------

These files have been installed on a powerpc-based single-board-computer to
use mdev as the hotplugger. The board lacks display/keyboard/mouse. It has
Ethernet connections, serial consoles, an USB port (and a high performance VME
interface).

It is running Debian Wheezy, but with kernel 2.6.27, which prevents Udev from
working. Mdev offered the possibility of a dynamic /dev.

The two neccesary files to run mdev are /etc/init.d/mdev and /etc/mdev.conf .

mdev.conf, initially copied from an example, has been modified so as to invoke
the command mdev-disk when a disk is inserted/removed. This is an experiment
which has been interrupted because I have been caught by other jobs at the
time (nov. 2016). It worked well in case of insertion but not in case of
removal.

Contents:
---------

README           -- This file
etc/init.d/mdev  -- The start/stop script for Sysvinit
etc/mdev.conf    -- The necessary configuration file for mdev
sbin/mdev-disk   -- An experimental script to manage /dev/disk/by-label
                 -- and /dev/disk/by-uuid

The last script has been explicitely written for Busybox's ash but should work
as well with Debian's Dash or with Bash. Modify the first line accordingly.

All the environment variables provided by the kernel to the hotplugger are
available to the script invoked by mdev, plus the variable MDEV.


Remarks on the serialization of events.
---------------------------------------

The file etc/init.d/mdev creates a
file named mdev.seq . When this file is present, mdev uses it to serialize the
events. This is necessary because several instances of mdev may be invoked
in a burst by the legacy hotplug mechanism.

If the legacy hotplug mechanism is disabled and one uses the applet uevent to
read the netlink and invoke mdev, then events are serialized and the file
mdev.seq isn't necessary.


Remarks on devtmpfs.
--------------------

If devtmpfs in in use, devices files are created/deleted by the kernel. The
only role of the hotplugger is then to manage their ownership and permissions
and goodies like symlinks eg /dev/disk/by-uuid.

Remarks on firmware.
--------------------

Firmware loading was originally done by the hotplugger but this has been taken
back by the kernel because of the malfunctionning of Udev. Therefore there
shouldn't be any request to mdev to load firmware.
