I’ve updated my cvsupgrade and makeworld scripts to automatically check the version of OpenBSD running. I’ve personally tested this on 5.0 and 5.1-release.
The process to update from release to stable is as easy as running cvsupgrade as root, rebooting, then running makeworld as root and rebooting.
WordPress seems to format text in a weird way, so I’ve uploaded this scripts to pastebin.com.
#!/bin/sh
#variables
KERNEL=$(uname -v | sed -e ‘s/#.*//’)
VERSION=”OPENBSD_”$(uname -r | sed ‘s/[.]/_/g’)
ARCH=$(uname -m)
CVSROOT=anoncvs@anoncvs.comstyle.com:/cvs
echo “Fetching OpenBSD “$(uname -r)”-stable source code…”
#checkout OpenBSD stable source code
cd /usr
cvs -d$CVSROOT checkout -r$VERSION -P src ports xenocara
#update OpenBSD stable source code
cd /usr/src
cvs -d$CVSROOT up -r$VERSION -Pd
cd /usr/ports
cvs -d$CVSROOT up -r$VERSION -Pd
cd /usr/xenocara
cvs -d$CVSROOT up -r$VERSION -Pd
echo “Done.”
echo “”
echo “Please press ENTER to start building “$KERNEL” kernel, or CTRL C to quit.”
read ENTER
#build the correct kernel
cd /usr/src/sys/arch/$ARCH/conf
config $KERNEL
cd ../compile/$KERNEL
make clean && make
echo “”
echo “Please press ENTER to install new kernel, or CTRL C to quit.”
read ENTER
#install the new kernel
make install
echo “”
echo “New kernel has been installed. The machine must be rebooted.”
echo “Once rebooted log in as root and run the ‘makeworld’ script.”
echo “”
echo “Please press ENTER to reboot the system.”
read ENTER
reboot
#!/bin/sh
echo “Rebuilding userland and Xenocara.”
echo “Please be patient this will take a while…”
#rebuild userland utilites
rm -rf /usr/obj/*
cd /usr/src
make obj
cd /usr/src/etc && env DESTDIR=/ make distrib-dirs
cd /usr/src
make build
#rebuild Xenocara
rm -rf /usr/xobj/*
cd /usr/xenocara
make bootstrap
make obj
make build
echo “”
echo “Rebuild complete.”
echo “”
echo “Please press ENTER to reboot the system.”
read ENTER
reboot