Subject: Re: UNPRIVED & DESTDIR
To: David Laight <david@l8s.co.uk>
From: Luke Mewburn <lukem@wasabisystems.com>
List: tech-toolchain
Date: 05/03/2002 18:47:50
On Fri, May 03, 2002 at 09:09:38AM +0100, David Laight wrote:
  | On Fri, May 03, 2002 at 11:16:09AM +1000, Luke Mewburn wrote:
  | > 
  | > If you've built UNPRIVED into a DESTDIR, you can use something like
  | > the following to copy all the files under DESTDIR into / except for
  | > those in ./etc and ./var, retaining the privileges:
  | > 
  | > 	# cd $DESTDIR
  | > 	# ( cat etc/mtree/NetBSD.dist $MAKEOBJDIRPREFIX/usr/src/METALOG ) | \
  | > 	    sed -e "s,^.$DESTDIR,.,' | \
  | > 	    egrep -v '^./(etc|var)/' | \
  | > 	    nbpax -rwMvpe /
  | 
  | That won't work - the privileges are not set during an UNPRIVED
  | build.
  | 
  | You need to use the contents of the METALOG file to set them.
  | Also (unless it has been fixed since last time I updated my source)
  | you will find that all the .a libraries have the wrong permissions.
  | (Which stops any further builds...)

I *know* that we need to use the contents of the METALOG file to
set the appropriate privileges because the files in $DESTDIR don't
have them.  That is what the snippet above does.  Who do you think
got most of the UNPRIVED and METALOG support working in "make release" ? 
(Hint: I did).  Please read the manual page in NetBSD-current for pax(1),
specifically the section about what '-M' does.

I understand that you're trying to be helpful, but please check your
facts before jumping in and making authoratitive statements about what
NetBSD can and can not do, because on more than one occasion you have
been wrong, and incorrect information delivered in an authoratitive
manner misleads other users.

(For what it's worth, rather than writing a script to parse the
METALOG, you can use mtree(8) -D with a little bit of awk magic to
replace the majority of what you've done.)

Luke.