Updating and upgrading OpenBSD
From Wiki
Contents |
Packages
This is easy. Make sure your $PKG_PATH is set correctly and run:
# pkg_add -ui -F update -F updatedepends
Packages aside, as far as I can tell, the only way to keep and OpenBSD computer up to date is to build the -stable branch from source. This presents a problem for a Soekris board firstly because the sources need about 0.5GB and secondly because it takes too long to compile on an AMD Geode.
I handle this by using a VMWare OpenBSD install and use this to build a release on the host's 3GHz processor.
You'll need a good deal of free space on the /usr filesystem, at minimum 8GB, less if you don't need anything from the x*.tgz sets.
Getting the Latest -stable Sources
This is done through CVS. Fetch the source:
# cd /usr # cvs -qd anoncvs@mirror.osn.de:/cvs get -rOPENBSD_4_6 -P src
Note: it is only necessary to do this once. Updates to the source can be grabbed with:
# cd /usr/src # cvs -danoncvs@mirror.osn.de:/cvs -q up -rOPENBSD_4_6 -Pd
Compile and Install the New Kernel
Note: make install creates a copy of the old kernel as /obsd, if you don't trust it, make your own backup.
# cd /usr/src/sys/arch/i386/conf/ # config GENERIC # cd ../compile/GENERIC # make clean && make depend && make && make install
Now reboot. If it all goes a bit tits, tell the bootloader to load the obsd instead of the newly installed one and everything is back to how it was in the beginning.
Assuming your new kernel works, it's time to rebuild the userland:
# rm -rf /usr/obj/* # cd /usr/src # make obj # cd /usr/src/etc && env DESTDIR=/ make distrib-dirs # cd /usr/src # make build
This takes ages. It cleverly rebuilds all the binaries and installs them onto your system.
Now that your 'donor' system is up to date, it is time to build our very own release. To re-state, you must complete the build process above before you can create a release.
Creating a Release - *.tgz Sets
Define the DESTDIR and RELEASEDIR variables:
# export DESTDIR=/usr/dest # export RELEASEDIR=/usr/rel
We now backup up any existing DESTDIR, and create new directories:
# test -d ${DESTDIR} && mv ${DESTDIR} ${DESTDIR}.old && rm -rf ${DESTDIR}.old
# mkdir -p ${DESTDIR} ${RELEASEDIR}
The release is created like so:
# cd /usr/src/etc # make release
After much processing and output, check that it has succeeded:
# cd /usr/src/distrib/sets/ # sh checkflist
checkflist should produce no output. Your sets will be wherever you set $RELEASEDIR. Just in case you decide to use it as an HTTP or FTP repository, generate an index:
# cd $RELEASEDIR # ls -1 > index.txt
What About the x*.tgz Sets?
If you don't need any of the X sets, stop here. Else, you must build the X window server or xenocara sources:
# cd /usr <!-- # cvs -qdanoncvs@mirror.osn.de:/cvs checkout -P xenocara --> # cvs -qdanoncvs@mirror.osn.de:/cvs checkout -rOPENBSD_4_6 -P xenocara
This places the X sources in /usr/xenocara for some reason. Go ahead and build xenocara:
# cd /usr/xenocara # rm -rf /usr/xobj/* # make bootstrap # make obj # make build
Now build the release:
# export DESTDIR=/usr/dest
# export RELEASEDIR=/usr/rel
# test -d ${DESTDIR} && mv ${DESTDIR} ${DESTDIR}- && rm -rf ${DESTDIR}- &
# mkdir -p ${DESTDIR} ${RELEASEDIR}
# make release
You should now have your very own release sets in /usr/rel.
# ls -l /usr/rel total 502852 -rw-r--r-- 1 root wheel 97368 Dec 10 17:14 INSTALL.i386 -rw-r--r-- 1 root wheel 22356 Dec 10 16:55 INSTALL.linux -rw-r--r-- 1 root wheel 1632 Dec 10 17:15 SHA256 -rw-r--r-- 1 root wheel 48450596 Dec 10 16:55 base46.tgz -rwxr-xr-x 1 root wheel 7237701 Dec 10 16:55 bsd -rwxr-xr-x 1 root wheel 7257116 Dec 10 16:55 bsd.mp -rwxr-xr-x 1 root wheel 6059199 Dec 10 17:14 bsd.rd -rw-r--r-- 1 root wheel 6176768 Dec 10 17:14 cd46.iso -r-xr-xr-x 1 root wheel 44980 Dec 10 16:55 cdboot -r-xr-xr-x 1 root wheel 2048 Dec 10 16:55 cdbr -rw-r--r-- 1 root wheel 3012608 Dec 10 17:14 cdemu46.iso -rw-r--r-- 1 root wheel 90693146 Dec 10 16:56 comp46.tgz -rw-r--r-- 1 root wheel 515982 Dec 10 16:56 etc46.tgz -rw-r--r-- 1 root wheel 1474560 Dec 10 17:14 floppy46.fs -rw-r--r-- 1 root wheel 1474560 Dec 10 17:14 floppyB46.fs -rw-r--r-- 1 root wheel 1474560 Dec 10 17:14 floppyC46.fs -rw-r--r-- 1 root wheel 2619925 Dec 10 16:57 game46.tgz -rw-r--r-- 1 root wheel 265 Dec 10 17:29 index.txt -rw-r--r-- 1 root wheel 8239902 Dec 10 16:57 man46.tgz -rw-r--r-- 1 root wheel 2936131 Dec 10 16:57 misc46.tgz -r-xr-xr-x 1 root wheel 53532 Dec 10 16:55 pxeboot -rw-r--r-- 1 root wheel 10429611 Dec 10 16:19 xbase46.tgz -rw-r--r-- 1 root wheel 69162 Dec 10 16:19 xetc46.tgz -rw-r--r-- 1 root wheel 35581552 Dec 10 16:20 xfont46.tgz -rw-r--r-- 1 root wheel 20262347 Dec 10 16:19 xserv46.tgz -rw-r--r-- 1 root wheel 2931760 Dec 10 16:19 xshare46.tgz
Look at them. Just look at them.
To finish off, regenerate the index.txt and hash file:
# cd /usr/rel # ls -1 > index.txt # sha1 * > SHA256
