Subject: Re: proposed change to src/etc/Makefile
To: Matthias Drochner <>
From: Luke Mewburn <>
List: current-users
Date: 12/07/2002 11:34:11
On Fri, Dec 06, 2002 at 03:28:36PM +0100, Matthias Drochner wrote:
  | I'm proposing two changes:
  | -call "mtree" with the -N option to get the actual/right UIDs
  |  (from the src tree, not from the build machine)

Your first change could bite people who build to DESTDIR=/ and have
different UIDs/GIDs for system users/groups.  I don't expect that to
be a large group of users, but this change should be noted in UPDATING
if it is performed.

However, this will still not help you for ${INSTALL} (it will use the
system permissions), or a few other places in the tree that don't use
${INSTALL} directly.

More changes are required to the build framework to support this
in a non UNPRIVED build system.  I can help you work on this, but
commiting your change as-is is not sufficient and will break things.

When *not* using UNPRIVED, the build assumes that you have the
privileges to install files, and uses the host's username
lookup routines, even when using the ${TOOLDIR}/bin versions of mtree,
install (et al).

When use UNPRIVED, the build system does not attempt to change
ownership, but logs it to ${DESTDIR}/METALOG, which is parsed
during the sets build (in distrib/sets) to ensure that the
generated tar files have the correct ownership & permissions.

So, in order to fully support what I think you want to do (which is
use the user databases in ${NETBSDSRCDIR}/etc for all user/group
lookups for the build/install, even if UNPRIVED is not in use),
we need to do one of:

    *	Only support UNPRIVED && DESTDIR builds, and get people
	to use a bit of hackery parsing ${DESTDIR}/METALOG and
	pumping that through pax to copy the files to /.
	Requires no change to the build system, but I can see
	a lot of (developers) disagreeing with the build paradigm

    *	Add a -N flag to install(8), and change ${MTREE}, ${INSTALL}
	${PAX} (et al) in the Makefiles to use -N.
	Audit the Makefiles for any other uses of user/group
	lookup in the build/install phase and ensure they lookup
	from ${NETBSDSRCDIR}/etc instead of get{pw,gr}*(3).
	I think this could be the best compromise solution, and
	I'm happy to work on this with you (since I did the majority
	of the METALOG and -N support in the other tools).

    *	Change the compat library for the $TOOLDIR programs to
	automatically use ${NETBSDSRCDIR}/etc for get{pw,gr}*()
	(et al).  Ugly, and not my preferred solution.

  | -don't overwrite the /sys symlink if already present, it might point
  |  to a non-standard place for good reasons

I know this is a separate debate, but I would argue that the need for
the /sys symlink *by default* is not necessary, and we shouldn't
bother installing it any more.

  | I'm wondering how people could cross-build or update after a
  | password file addition without the first one... Or am I
  | missing something?

By setting UNPRIVED; see above.