If you are running a stable NetBSD release (such as NetBSD 1.6.1 ), in a production environment, you should occasionally update your sources and rebuild the system or the kernel, in order to incorporate any security fixes that have been applied to the branch since its release.
You can retrieve or update the sources for your release using anoncvs over ssh by specifying the correct branch tag. For example, to checkout the sources for the NetBSD 1.6.1 release, you could use:
$ cd /usr $ env CVS_RSH=ssh cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot co -r netbsd-1-6 -P src |
To update an existing source tree:
$ cd /usr/src $ env CVS_RSH=ssh cvs update -dP |
Building a new kernel pretty much follows the steps
as described in
this
document
, but please note the differences in the syntax of the
build.sh
script.
build.sh
has changed significantly between NetBSD 1.6 and -current;
if you are not using -current, you can
not
use
build.sh
to build the new kernel!
Please always refer to
build.sh -h
and the files
UPDATING
and
BUILDING
for details -- it's worth it, there are
many
options that can be set on the command line or in
/etc/mk.conf
. In the end, it all boils down to a single command:
build.sh -d
.
Note that this will update the entire userland!
If a security advisory has been issued, and you want to just rebuild the necessary libraries and applications, your best bet is to follow the instructions provided in the advisory. An example is given below:
$ cd src $ env CVS_RSH=ssh cvs update -d -P -r netbsd-1-6 gnu/dist/sendmail/sendmail $ cd gnu/usr.sbin/sendmail $ make USETOOLS=no cleandir dependall $ su # make USETOOLS=no install |
Update the sources:
$ cd /usr/src $ env CVS_RSH=ssh cvs update -dP |
Build a new kernel:
$ cd /usr/src/sys/arch/<ARCH>/conf $ config <KERNEL> $ cd /usr/src/sys/arch/<ARCH>/compile/<KERNEL> $ make depend all $ su # mv /netbsd /netbsd.old # mv /usr/src/sys/arch/<ARCH>/compile/<KERNEL>/netbsd / |
Update the userland:
$ cd /usr/src $ ./build.sh -h $ su # ./build.sh -d <other options> |
See this document for our documentation on how to track -current.
(contact us) Generated from %NetBSD: updating.xml,v 1.2 2005/05/05 08:08:57 hrs Exp %