Subject: Re: John Klos HOW-TO ?
To: Ken Hughes <hughes@interchange.ubc.ca>
From: John Klos <john@sixgirls.org>
List: port-mac68k
Date: 02/10/2002 04:24:25
> > Email me if you would like a quick HOW-TO for compiling your tree from
> > scratch.
>
> Could you post this to the list or give us a URL.

Sure. Here goes...

I'll break this down into sections: getting the source tree, editing
/etc/mk.conf, and then building the tree.

The first section is about getting the source tree. The easiest, and
probably the best for occasional users of the source tree, would be to use
sup. sup has documentation at ftp://ftp.netbsd.org/pub/NetBSD/README.sup

In a nutshell, one would do the following steps to set up sup:

Create /etc/supfiles
Copy sup config file to /etc/supfiles/coll.list
Edit the /etc/supfiles/coll.list file to suit your needs
Run sup

That can be done like this:

mkdir /etc/supfiles
cp /usr/share/examples/supfiles/sup.netbsd.org /etc/supfiles/coll.list
(or sup.au.netbsd.org for Australia, sup.de.netbsd.org for Germany - you
get the idea; just look in /usr/share/examples/supfiles/)
vi (or pico, or emacs) /etc/supfiles/coll.list

Then change the following:

current release=allsrc host=sup.netbsd.org hostbase=/ftp/pub \
base=/usr prefix=/usr backup use-rel-suffix compress delete

would have the "current" in the first line changed to "release-1-5", since
you want the release source tree. Unless you have a need for the xsrc and
doc trees, just put "#" in the beginning of those lines. You may want
pkgsrc, so decide if you want to leave that or if you want to comment it
out.

Then, to run sup, simply run:
sup -s
Or, if you prefer to watch the progress (long and boring), do:
sup -s -v

The first time it runs it will literally take hours as it transfers lots
of small files.


Next, edit /etc/mk.conf to suit your processor. This helps a lot with ssh,
since ssh uses assembly that is tailored for specific processors. 68040s
see a nice improvement because of the use of 64 bit integer multiply, and
68060s are faster because no emulated instructions are used.

All you need to do is add one of:
M68020=YES
M68030=YES
M68040=YES
M68060=YES
to /etc/mk.conf. You might also like to add:
COPTS+=-O2 or COPTS+=-O3
CFLAGS+=-m68060 (or whatever processor)
if you'd like all your binaries to be compiled with optimisation on and
processor specific code generation turned on.


Now that that's done, you can compile your tree. One of the nice things
about compiling your tree, aside from getting optimised binaries, is that
you'll have the very latest stable versions of all of the software that
comes with NetBSD as a result. So BIND, sendmail, OpenSSH, and all of the
other system software will be the latest.

To do this, just:
cd /usr/src
make build

This will take a LONG time. My 25 MHz 68030 Amiga 3000 with 16 megs of
memory took more than 5 days with NetBSD 1.5; a 40 MHz 68040 takes between
32 and 40 hours; a 66 MHz 68060 takes between 16 and 18 hours.

If it stops with an error, paste it to an email to the list, as release is
the stable tree and is always supposed to work.

If it doesn't, then restart your computer and all the new daemons and
programs will be in use!

John Klos
Sixgirls Computing Labs