Subject: Re: make install and stuff
To: None <current-users@NetBSD.ORG>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: current-users
Date: 04/09/1997 18:33:06
Someone mentioned something on port-hp300 which provoked this thought.

I recently had occasion to want to do a rebuild-and-reinstall with as
little as possible.  (I wanted to do a chrooted install onto a new
disk, _without_ all my private patches, so I wanted to drop in an
unpatched /usr/src and as little else as possible, then chroot to the
mount point and rebuild everything.)

In case anyone's interested, here's what I had to install to get the
build to work:

- The following executables, and the directories necessary to contain

	/bin/cat              /usr/bin/cpio         /usr/bin/rpcgen
	/bin/chmod            /usr/bin/cpp          /usr/bin/sed
	/bin/cp               /usr/bin/ctags        /usr/bin/size
	/bin/csh              /usr/bin/egrep        /usr/bin/sort
	/bin/date             /usr/bin/find         /usr/bin/strip
	/bin/dd               /usr/bin/flex         /usr/bin/tbl
	/bin/echo             /usr/bin/g++          /usr/bin/tr
	/bin/expr             /usr/bin/gencat       /usr/bin/troff
	/bin/hostname         /usr/bin/grep         /usr/bin/tsort
	/bin/ln               /usr/bin/groff        /usr/bin/uname
	/bin/mv               /usr/bin/grotty       /usr/bin/wc
	/bin/pax              /usr/bin/install      /usr/bin/which
	/bin/rm               /usr/bin/join         /usr/bin/xargs
	/bin/sh               /usr/bin/ld           /usr/bin/yacc
	/bin/test             /usr/bin/lex          /usr/libexec/cpp
	/bin/\[               /usr/bin/lint         /usr/libexec/cc1
	/dev/null             /usr/bin/lorder       /usr/libexec/cc1plus
	/usr/bin/ar           /usr/bin/m4           /usr/libexec/
	/usr/bin/as           /usr/bin/make         /usr/libexec/lint1
	/usr/bin/awk          /usr/bin/mkdep        /usr/libexec/lint2
	/usr/bin/basename     /usr/bin/nm           /usr/sbin/chown
	/usr/bin/bc           /usr/bin/nroff        /usr/sbin/mtree
	/usr/bin/cap_mkdb     /usr/bin/paste        /usr/sbin/pwd_mkdb
	/usr/bin/cc           /usr/bin/printf
	/usr/bin/cmp          /usr/bin/ranlib

- The following libraries in /usr/lib:

- The following directories and their contents.  (Not all of these may
   have been strictly necessary - for example, only a couple of the
   files in /usr/share/mk are truly _needed_ - but I was lazy. :-)


- In addition, I had to created /etc and /usr/games in the chroot area
   (I don't understand why /usr/games didn't get created by mtree - I
   need to look into that), install an /etc/group, and copy in an
   /etc/master.passwd and then run a chrooted pwd_mkdb.

Having done those, I could then build by chrooting and running the
following script:

	#! /bin/sh -e
	cd /usr/src/etc
	DESTDIR=/ make distrib-dirs
	cd /usr/src
	make build
	cd /usr/src/etc
	DESTDIR=/ make distribution

This left only the kernel and bootblocks to do by hand.  Because my
patches include increasing the number of partitions per disk, the /dev
directories were incompatible, so I couldn't do anything chrooted that
required access to disk partitions other than the first 8 on sd0.

This was under 1.2; I assume current is pretty similar.  :-)

I am somewhat discouraged at how large the list of necessary
executables is.  It would be Really Nice (tm) if someone could come up
with a sane scheme for doing such builds with a much smaller set.
(Much of the work would probably benefit cross-builds as well, though
cross-builds have to contend with not being able to run the just-built
binaries, which was not a problem for me.)

					der Mouse

		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B