Bend Source is the Best place in Oregon for weekly updates. : OpenBSDUpgrade

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

This document describes upgrading an OpenBSD

In this document I will show you the process that I used to upgrade my servers running the Openbsd operating system. The official upgrade documentation can be found here.

I have performed this step on various versions including: 4.1 to 4.3, 4.3 to 4.5, 4.5 to 4.9, and finally now (with a little surprise) 4.9 to 5.0-current.

The reason I say surprise on that last one is because I didn't realize that they introduced some /etc/rc.d/* scripts into the mix of starting things. I had to make a site visit when I didn't copy the ./etc/rc.d/* files from the etc50.tgz package into the /etc/ folder. Lets just say, the only thing the box did was respond to ping and allow me to log in at the console. I made one more copy (cd /usr/src/snapshots/etc/; cp -rp rc.d/ /etc/) and then rebooted. All was good.

Create a place to store upgrade files...

cd /usr/src/
mkdir snapshots
cd snapshots
ftp ftp.usa.openbsd.org
anonymous
guest
prompt
cd /pub/OpenBSD/<version>/packages/i386
mget bsd *.tgz
quit

Install the kernel and the userland

mv /bsd /bsd-<old_version>
mv ./bsd /bsd
tar xzvpf etc<version>.tgz
mv etc<version>.tgz etc<version>.tgz.old
cd /
for i in /usr/src/snapshots/*<version>.tgz; do tar xzvpf $i; done

Compare your /etc/* with the new /usr/src/snapshots/etc/* files

I start first by simply copying over all files and directories that I know I have never modified. You might have, so prune the list as needed. Don't just cut/paste here, you might kick yourself later.
cd /usr/src/snapshots/etc/
rm -r /etc/afs/ /etc/mail/ /etc/mtree/ /etc/systrace/
cp -rp afs/ mail/ mtree/ systrace/ rc.d/ bgpd.conf changelist daily dhclient.conf disktab ksh.kshrc man.conf moduli monthly netstart ospf6d.conf pf.os protocols rc rc.conf remote security services sysctl.conf weekly /etc

Now, create a diff of what is left. Copy any relevant lines from the new etc/* files to your existing /etc/* files.
cd /usr/src/snapshots/etc
for i in *; do diff -ur /etc/$i $i >> /usr/src/snapshots/etc.diff; done
less /usr/src/snapshots/etc.diff

Finally, you should manually compare your current /etc/rc.local and the new one in /usr/src/snapshots/etc/rc.local Make sure to move over all your custom changes from your existing /etc/rc.local file. Upgrade other parts of /etc as needed
reboot

once your machine is upgraded, you can update both your ports tree and installed packages very easily:

upgrade installed packages

export PKG_PATH=ftp://ftp5.usa.openbsd.org/pub/OpenBSD/`uname -r`/packages/`uname -m`/
pkg_add -u -F update,alwaysupdate,updatedepends

update ports tree

If you do not have a ports tree, you have two options to obtain a copy of the current ports tree
cd /usr/
cvs -d anoncvs@anoncvs.openbsd.org:/cvs -q co ports

or
cd /usr/
wget ftp://ftp5.usa.openbsd.org/pub/OpenBSD/`uname -r`/ports.tar.gz
tar zxf ports.tar.gz

and/or
cd /usr/ports
cvs -d anoncvs@anoncvs.openbsd.org:/cvs -q up -Pd

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 0.1108 seconds