Subject: toolchain/20051: pax (as host tool) uses wrong macros for major/minor
To: None <gnats-bugs@gnats.netbsd.org>
From: None <uwe@netbsd.org>
List: netbsd-bugs
Date: 01/24/2003 17:51:19
>Number:         20051
>Category:       toolchain
>Synopsis:       pax (as host tool) uses wrong macros for major/minor
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 24 17:52:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Valeriy E. Ushakov
>Release:        1.6M
>Organization:
>Environment:
FreeBSD sampo.xxx.xxx.xx 4.6-STABLE FreeBSD 4.6-STABLE #0: Thu Jun 27 04:33:50 MSD 2002     toor@sampo.xxx.xxx.xx:/usr/obj/usr/src/sys/SAMPO  i386

>Description:
When doing an unprived build on a non-netbsd host pax will use netbsd
macros to construct netbsd dev_t when it reads the mtree spec file:

sbin/mknod/pack_dev.c:pack_netbsd()

However when an archive is written, pax will use host's native
major/minor macros to decompose that dev_t - which results in bogus
major/minor.

In my case (cross building for NetBSD/sparc on a FreeBSD/i386 host),
it chokes on the minor number for:

./dev/dtya type=char device=netbsd,12,524288 mode=0600 uname=uucp gname=wheel

with

pax: Ustar header field is too small for ./dev/dtya

because ustar_wr decomposes netbsd's dev_t value with native macros
and gets minor 2147483648 (2^31) instead of 524288 (2^19)

>How-To-Repeat:
try building an unprived release on a host with a dev_t internal structure that is different from the netbsd dev_t.

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted: