[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#698012: debian-policy: Please update 10.6 "Device files" for udev and the like



Package: debian-policy
Severity: normal

Hi,

recently I stumbled over the following paragraph in 10.6:

    If a package needs any special device files that are not
    included in the base system, it must call MAKEDEV in the
    postinst script, after notifying the user.

and I think it needs an improvement.

Mostly, this sentence smells like it predates the times of dynamically
populated /dev like udev, or formerly devfs. Today, creating the
device files in postinst is often skipped if udev is running, for
example in fuse. Therefore, technically fuse violates 10.6 but that's
of course silly. The demand above is mostly historic.

More important, at least on systems running udev, is to ensure the
device files do exist after a reboot, or the latest if programs are
started that rely on them.


Aside: Although there's no other dynamically populated /dev in Debian
at the moment but udev, all rules should be in a neutral wording so
they will still fit any successors. I'll use "/dev manager" as a
generalized term.

    A /dev manager is a subsystem that creates device dynamically as
    come into existance.

As far as I can see, the following cases must be covered:

* static /dev

This is an opportunity to to legalize fuse's behaviour by stating that
device files should (or must?) not be created if a /dev manager is
running. A more flexible approach was any /dev manager must provide a
policy whether static device files should be created, with "not at
all" for udev, and a package's postinst must act accordingly.

So the old sentence might we worded like

    If a package needs any special device files that are not
    included in the base system, and there's no /dev manager
    running, it must call MAKEDEV in the postinst script, after
    notifying the user.

On a second thought, this opens an interesting question if there's a
need to catch the case when a package is configured while udev is
running, hence no static devices files created, but udev is later
disabled, thus not device files present, likely causing breakage.
But that's for another day.

* /dev manager used

This clarifies support for udev and the like to re-create devices
during reboot. So it's about /lib/udev/rules.d/ sniplets.

    If a /dev manager needs additional information to create the
    device files, the package must provide according control data.

A clarification for udev, nothing needs to be done if udev ...
- somehow already knows how to create a device.
- cannot create the device due to missing sysfs support in the underlying
  kernel module.

The latter case does exists, is the reason for ...

* fallback

    If any /dev manager cannot create device files needed by the
    package for reasons out of its domain, the package must create
    them in due time.[0]

    [0]preferably in an init script.


Thanks in advance for comments, I probably missed a few points.

    Christoph

Attachment: signature.asc
Description: Digital signature


Reply to: