Subject: Re: 4.4BSD.dist
To: None <current-users@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: current-users
Date: 02/10/1996 04:34:25
> Subject: 4.4BSD.dist

> Rather than using this particular mtree file when installing, perhaps
> it would be better to create a custom install mtree config file which
> will create only the required directories and not touch things such
> as, say, /usr/src?  I'm sick of having to restore permissions once I
> do a ``make build''

Me too; I also got ticked off at it gratuitously deciding for me that I
wanted /altroot, /home, and one other (/stand, I think).

I submitted a PR on the subject (misc/1956); someone (mycroft, I think)
closed it without action, saying basically "this isn't a bug, make
install in etc/ is supposed to create directories for a distribution".
In a private reply, I remarked that it seemed to me that in that case,
the real bug was that "make build" ran that.  (No reply to that yet.
Perhaps I should generate another PR.)

What I did about it for my own use is, I changed etc/Makefile thusly:

	--- OLD/etc/Makefile	Thu Jan  1 00:00:00 1970
	+++ NEW/etc/Makefile	Thu Jan  1 00:00:00 1970
	@@ -111,6 +111,11 @@
	 	-mtree -def mtree/4.4BSD.dist -p ${DESTDIR}/ -u
	 	cd ${DESTDIR}; rm -f sys; ln -s usr/src/sys sys
	 
	+install-dirs:
	+	install -d -o root -g wheel -m 755 ${DESTDIR}
	+	-mtree -def mtree/installdirs -p ${DESTDIR}/ -u
	+	cd ${DESTDIR}; rm -f sys; ln -s usr/src/sys sys
	+
	 snapshot: distribution snap_pre snap_tar snap_md
	 	cd ${DESTDIR}/snapshot && cksum * > CKSUMS
	 

and then patched the top-level Makefile with

	--- OLD/Makefile        Thu Jan  1 00:00:00 1970
	+++ NEW/Makefile        Thu Jan  1 00:00:00 1970
	@@ -25,7 +25,7 @@
	 
	 beforeinstall:
	 .ifndef DESTDIR
	-       (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs)
	+       (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ install-dirs)
	 .endif
	 
	 afterinstall:

and added etc/mtree/installdirs, which was a copy of 4.4BSD.dist with
the things I didn't want removed and things that produced complaints
fixed.  Specifically, I removed /altroot, /home, /mnt, and /stand, and
changed the mode bits from 0555 to 0755 for /usr/include,
/usr/include/arpa, /usr/include/g++, /usr/include/g++/gen,
/usr/include/kerberosIV, /usr/include/protocols, /usr/include/rpc, and
/usr/include/rpcsvc.

Now, the only things the mtree run complaints about are four
directories that it says are missing (which is false) and it then tries
to create and complains "File exists".  I haven't bothered tracking
down what's wrong there; it doesn't do any filesystem damage, and the
noise messages haven't annoyed me enough yet.

					der Mouse

			    mouse@collatz.mcrcim.mcgill.edu