tech-userlevel archive

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

Re: mtree(8) keyword clarification: "device"



In article <65e764d604d052579521bd726b749a6c%helkyn.dyndns.org@localhost>,
Jean-Yves Migeon  <jeanyves.migeon%free.fr@localhost> wrote:
>Hi lists,
>
>I am actually working on making libarchive's mtree format and our 
>NetBSD's mtree(8) interchangeable, but I am facing a documentation issue 
>that dates back /a priori/ to 2001, and that concerns the "device" 
>keyword. Copy paste from NetBSD's mtree(8):
>
>
>[...]
>      device          The device number to use for block or char file 
>types.
>                      The argument must be one of the following forms:
>
>                      format,major,minor
>                            A device with major and minor fields, for an
>                            operating system specified with format.  See 
>below
>                            for valid formats.
>
>                      format,major,unit,subunit
>                            A device with major, unit, and subunit 
>fields, for
>                            an operating system specified with format.
>                            (Currently this is only supported by the 
>bsdos
>                            format.)
>
>                      number
>                            Opaque number (as stored on the file 
>system).
>
>                      The following values for format are recognized: 
>native,
>                      386bsd, 4bsd, bsdos, freebsd, hpux, isc, linux, 
>netbsd,
>                      osf1, sco, solaris, sunos, svr3, svr4, and ultrix.
>
>
>The actual implementation in C never goes beyond the point of printing 
>(long long)st_rdev from stat(2) in %llx, and use it "as-is" for 
>mknod(8).
>
>Libarchive does it differently and log it as 
>"device=native,<major>,<minor>" format.
>
>Questions arise:
>- what was the intent of this keyword, especially the format part? 
>mtree(8) was expected to receive some kind of "-k device=netbsd" 
>parameter? Or does it only specify the argument of the resulting mtree 
>evaluation?
>- the actual code in libarchive does not follow NetBSD's format, it 
>prints "device" by default as "native,<major>,<minor>". Would it be 
>acceptable for libarchive to accept raw, opaque number with the 
>convention that it starts with "Ox"?
>
>Thanking you in advance for your clarifications

NetBSD's mtree understands different encodings for major,minor (how
many bits are used for major and minor). See the mknod(8) sources.
Native means NetBSD, as well as it can understand a single number
which is interpreted as raw.

christos



Home | Main Index | Thread Index | Old Index