tech-kern archive

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

Re: (Semi-random) thoughts on device tree structure and devfs

    Date:        Wed, 10 Mar 2010 15:41:44 +0100
    From:        Joerg Sonnenberger <>
    Message-ID:  <>

  | The only property of dev_t that userland really cares is that it is a
  | number and that it is unique per device. 

For the vast majority of userland that's right (and what's more,
temporally unique - the same number can mean something entirely
different tomorrow, and generally nothing will care).

That is, except for cpio (and similar) - that actually has a portable
(ie: defined) format that includes the ability to store devices.

Now no-one sane would expect to be able to take a device from one
system to another (that is, a name of a device and its dev_t) and have
it work (usefully) on another system, so the sole practical use of
this ability is backup/restore (a function for which cpio is particularly
useless, but for which it is used nevertheless).  A shorter term
variant of the same thing is "cpio -p" to make a backup copy of a
filesystem (and all its device nodes, etc) - a function for which cpio
is not quite so useless.

For dump/restore we could alter the format in which devices are
represented, so that they could be correctly restored, no matter
what we do with them, but for cpio we don't really have that option,
and people do want to be able to get back their owner/modes for
device files, and have the right names apply to the right devices with
the right access permissions for the appropriate users - and (aside
from the name, used id, and modes) all that's available to indicate
what device is the dev_t.


Home | Main Index | Thread Index | Old Index