Subject: Re: updating netbsd
To: joerch <helix@mayn.de>
From: Joe Reed <jnr@po.cwru.edu>
List: netbsd-help
Date: 12/31/2002 11:20:45
what i do is:
1) compile and boot a new kernel
2) build new system binaries
3) unpack them onto your system

if you are using -current you can use build.sh which will take care of nearly 
everything for you.  from /usr/src:

build a new kernel
$./build.sh -k GENERIC  # compiles a GENERIC kernel  you can replace \
#GENERIC with any config file in sys/arch/i386/conf where i386 is your arch.

make a backup of the old kernel and copy the new one and reboot
$cp /netbsd /netbsd.old ; cp /usr/src/sys/arch/i386/compile/GENERIC/netbsd /
$reboot

now you're ready to rebuild your system binaries.  you should never build 
right to / to ensure that you have a consistant system if your build fails 
for some reason.  so create a destination directory, and a directory to hold 
the binary tarballs.  i use /home/build/DEST and /home/build/RELEASE 
respectively.  then from /usr/src

$ ./build.sh -D /home/build/DEST -R /home/build/RELEASE
#this will build all your system binaries into /home/build/DEST and create 
#install tarballs into /home/build/RELEASE

After that, you just have to install those binaries. i use the following shell 
command executed from / as root (don't unpack etc.tgz or you'll lose all your 
configuration data)

$ for i in `ls /home/build/RELEASE/*.tgz | grep -v etc | grep -v kern`; do
tar -zxvpf $i
done

now you only have to update your config files using etcupdate as follows:
$ mkdir /tmp/tmproot ; cd /tmp/tmproot
$ tar -zxvfp /home/build/RELEASE/etc.tgz
$ etcupdate -b /tmp/tmproot

etcupdate will give you diffs of all your config files and let you select what 
you want to do.  

i think you can use postinstall for some of this too.  but i've not had time 
to play with it.

i think the 1.6 branch is similiar, but i've not really played with it much.

--joe


hmm... maybe i'll write this down in a howto sometime when i've got the time.


On Tuesday 31 December 2002 11:15 am, joerch wrote:
> > This usually works on NetBSD also unless the change is big
> > enough i.e. see previous paragraph.
>
> hmm ok, looks like with freebsd.
>
> > The definitive explanation of how releases are archived
> > and where the INSTALL documentation is buried is here:
> > http://netbsd.gw.com/cgi-bin/man-cgi?release++NetBSD-current
> >
> > The INSTALL document for NetBSD 1.6 is here:
> > ftp://ftp.at.netbsd.org/pub/NetBSD/NetBSD-1.6/i386/
>
> after a little more searching, i found this:
>
> http://www.bsdtoday.com/2001/December/Features605.html
>
> can someone tell me is that a clean and safe way to update ?
>
> it looks ok, nearly same procedure like on freebsd.
> only the lines:
>
>
> # cd /usr/src
> # make build
>
> does this the whole build of the system binaries, like ls ... !?
>
> i hope so ;) because it is not to difficult ;) so i can do it
> without thinking to much.