RSS feed logo RSS Feed | About Pantz.org
Updating OpenBSD to stable
Posted on 05-23-2007 23:34:00 EST | Updated on 05-23-2007 23:34:00 EST
Section: /software/openbsd/ | Permanent Link

I had a friend update his machine to -stable for OpenBSD here are the scripts he came up with. The one note he had is the cvs checkouts are a hit or miss event and you have to check to see if they completed or not. This example is for building -current on OpenBSD 4.1.

First part. If empty, you must populate /usr/src/ with src before trying a cvs update. Get the OpenBSD src.

cd /usr/src
wget ftp://ftp.openbsd.org/pub/OpenBSD/4.1/src.tar.gz

untar it in /usr/src/

tar xvzf src.tar.gz

Make sure the cvs value below matches your distribution. For OpenBSD 4.1 it is OPENBSD_4_.

#!/bin/csh

cd /usr/src/
setenv CVS_CLIENT_PORT -1
setenv CVSROOT anoncvs@anoncvs3.usa.openbsd.org:/cvs
cvs -d $CVSROOT up -rOPENBSD_4_1 -Pd
logger "patch_1_sync_cvs_source `date`"

You need to make sure the CVS download completes. CVS lacks any logic to restart or resume a failed download, so you need to verify before building the kernel (patch_2) or any binaries (patch_3). Cvs needs some type of rsync.

Second part. These lines will build the new kernel, then put it in place while backing up the old kernel.

#!/bin/csh

cd /usr/src/sys/arch/i386/conf
/usr/sbin/config GENERIC
cd /usr/src/sys/arch/i386/compile/GENERIC
make clean && make depend && make
cp /bsd /bsd.old
cp bsd /bsd
logger "patch_2_build_kernel `date`"

Make sure everything went ok and reboot!

Third part. This script will build all new binaries. After this step is done you may want to check if any new packages are available for your install. (pkg_add -un)

#!/bin/csh

cd /usr/src
rm -r /usr/obj/*
make obj && make build
logger "patch_3_build_binaries `date`"

Make sure everything went ok and reboot!

For more detailed info about cvs updates for OpenBSD check here.

Del.icio.us! | Digg Me! | Reddit!

Related stories