Subject: Re: Upgrading NetBSD Userland
To: Greg Troxel <gdt@ir.bbn.com>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: netbsd-users
Date: 01/05/2007 19:49:20
On Fri, 05 Jan 2007 13:51:05 -0500
Greg Troxel <gdt@ir.bbn.com> wrote:

> 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.
> 
I recently tried and failed at upgrading a 3.0 RAID-1 system to 3.1 by
booting a 3.1 INSTALL CD.  I didn't have time to try to figure out why,
so I simply did more or less what you suggest above, except for the
etcmanage part.  I have my own collection of shell scripts that I use
that make all this simpler for me, but they boil down to the same
things: build.sh, build.sh kernel=, install the new kernel, reboot,
install the new userland.



		--Steve Bellovin, http://www.cs.columbia.edu/~smb