Subject: Re: Upgrading NetBSD Userland
To: Steve Brown <steve@daedilus.org>
From: Greg Troxel <gdt@ir.bbn.com>
List: netbsd-users
Date: 01/05/2007 13:51:05
I do this all the time, including on RAID-1.  My suggestion will be
somewhat complex the first time, and then I believe it will save you
time.

0) Back up your system, especially the contents of /etc.

1) Install sysutils/etcmanage from pkgsrc.  Make sure you get 0.4
   because I just now added (trivial) support for recognizing the
   netbsd-4 branch.

2) Read the documentation, such as it is, which is README in the
   sources and not installed.  Initialize the list of automatically
   maintained files via etcmanage --import from the provided
   manifests, and by adding files manually with --add after finding
   them with --unmanaged and thinking/checking each one.  You only
   have to do this once per system, and then can do upgrades almost
   totally automatically.

3) Get the sources (src and xsrc) along netbsd-4.

4) Make sure you can write in /usr/obj, and there's tons of space.  In
   the directory holding src, create file .tree with contents steve,
   to cause the build to end up in /usr/obj/steve-4.

   Run "BUILD-NetBSD -x all 2>&1 > B000.x-all" to build the world with
   build.sh.

5) Run "BUILD-NetBSD -x installkernel" as root to install the new
   kernel.  Fill in the file in / as the complaints indicated to
   select which kernel and repeat.  Reboot.  This is important when
   jumping branches as the new userland may use system calls not
   supported by the old kernel.

   Run "BUILD-NetBSD -x install" as root.  This installs kernel and
   userland and runs etcmanage.  It does not install new bootblocks.
   Reboot again.

Note that aside from using etcmanage, this is the standard advice,
except that BUILD-NetBSD wraps build.sh and gives arguments for
TOOLSDIR, OBJDIR, etc. to have a more pleasing (to me) layout.  And,
it has shortcuts for installing the kernel and saving the old one.  I
encourage you to read the script; it's intended to be commented to
also be a bit of a build.sh tutorial.

etcmanage will non-interactively replace or even delete files in /etc
that are registered as automatically managed (with a matching md5sum).
It will not touch other files.  People find this hard to follow, but
almost always like it when they understand.  This is an alternative to
etcupdate.

-- 
    Greg Troxel <gdt@ir.bbn.com>