tech-userlevel archive

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

mtree(8) keyword clarification: "device"

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:

                           A device with major and minor fields, for an
operating system specified with format. See below
                           for valid formats.

A device with major, unit, and subunit fields, for
                           an operating system specified with format.
(Currently this is only supported by the bsdos

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


Jean-Yves Migeon

Home | Main Index | Thread Index | Old Index