Subject: Re: Confused about how to build world
To: Kirk Strauser <>
From: None <>
List: netbsd-users
Date: 02/21/2005 16:48:54
Kirk Strauser wrote:
> I'm experimenting with NetBSD 2.0 on an older laptop.  I've used *Free*BSD 
> servers and desktops for years, but this is my first experience with 
> *Net*BSD.  The installation went perfectly (except that the kernel didn't 
> associate my PCMCIA network card with the correct driver; PR submitted) and 
> I now have a fully running system.  So far so good!
> Now, though, I want to rebuild my system.  I checked out a copy of the 
> source with "cvs checkout -rnetbsd-2-0 -P src" (that'll give me 2.0 + 
> security updates, won't it?).  Do I understand correctly that the "correct" 
> way to re-compile everything is as a crosscompile, as per chapter 25 of the 
> guide, even though I'm not really crosscompiling?
> If so, then the instructions look like I'm supposed to " build" and 
> then " release", but /usr/src/BUILDING doesn't make it sound like 
> the "release" target actually installs the newly-compiled binaries.
> Please forgive my ignorance and the fact that I haven't experimented too 
> heavily yet.  Said laptop is a K6-3/333 and the " build" step I 
> played with took overnight to finish, so it's kind of hard to try things 
> out to see what works.
> Many thanks!

Well, I think ' release' target will also run 'build' and 
'distribution' targets. To install newly built binaries, you need to run 
something like ' install=/' Have a look at my example below.

Personally, I use the following scripts to get bug fixes for 2.0, I 
think it's upcoming 2.0.1, I don't really understand the relationships 
between different branches.

# cat
export CVSROOT

cvs login
cvs checkout -P -rnetbsd-2 src
cvs checkout -P -rnetbsd-2 xsrc
#cvs checkout -P pkgsrc

# cat
export CVSROOT

cvs login
cd /opt/src \
&& cvs update -dP \
&& cd /opt/xsrc \
&& cvs update -dP \
&& cd /opt/pkgsrc \
&& cvs update -dP

I use the following script to set the location of mk.conf file and build 
the entire release. I have different scripts for cross-compiling for 
different architectures, they're done in a chroot jail:

# cat


cd /opt/src && ./ -u -m i386 -x -X /opt/xsrc \
         -O /opt/obj.i386_generic -T /opt/tools.i386_generic \
         release 2>&1 | tee /scripts/log.i386_generic

# cat mk.i386_generic.conf


#setting -O2 will produce larger binaries, which may require adding
#FLOPPYMAX=2 to various Makefiles under src/distrib/i386/floppies/*

.ifdef BSD_PKG_MK

And here is a script to create a bootable CD-ROM containing netbsd release:

# cat i386_generic.mkcd

mkisofs -U -R -o ./i386_generic.iso -b 
i386/installation/floppy/boot-big.fs \
         /opt/obj.i386_generic/releasedir \
&& cdrecord -v dev=/dev/cd0d ./i386_generic.iso

Below is a script I use to update the entire userland + X11 after a 
successful build of release of distribution targets by

# cat i386_generic.install


/opt/src/ -x -O /opt/sandbox/opt/obj.i386_generic \
     -D /opt/sandbox/opt/obj.i386_generic/destdir.i386 \
     -T /opt/sandbox/opt/tools.i386_generic install=/