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 <>,
Jean-Yves Migeon  <> 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 
>                      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 
>                            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 
>                            format.)
>                      number
>                            Opaque number (as stored on the file 
>                      The following values for format are recognized: 
>                      386bsd, 4bsd, bsdos, freebsd, hpux, isc, linux, 
>                      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 
>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 
>- 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.


Home | Main Index | Thread Index | Old Index