BSD Newsletter.com
   Front | Info | Lists | Newsfeeds | Study Guide | What is BSD?
Advertisement: The OpenBSD PF Packet Filter Book: PF for NetBSD, FreeBSD, DragonFly and OpenBSD

BSD Links
·New Links
·Advocacy
·Drivers
·Events
·Flavours
·FAQs
·Guides
·Programming
·Security
·Software
·User Groups

This is the BSDA Study Guide Book written via a wiki collaboration. This is a work in progress. You may contribute to or discuss this specific page at http://bsdwiki.reedmedia.net/wiki/Recognize_which_commands_are_available_for_upgrading_the_operating_system.html.

Recognize which commands are available for upgrading the operating system

Concept

Recognize the utilities which are used to keep the operating system up-to-date. Some utilities are common to the BSDs, some are specific to certain BSD operating systems and some are third-party applications.

Introduction

Binary vs. from-source TODO

NetBSD

There are several ways to upgrade your NetBSD system. The easiest method is to boot the installation CD-ROM and follow the steps in sysinst for upgrading your system. But this may not be possible on all NetBSD platforms, therefore the best way is to recompile a full release from the sources and upgrade your system. When done, you need reboot into your new system.

FreeBSD

As of FreeBSD 6.2, FreeBSD offers methods for upgrading both its kernel and userland either through binary upgrades or by compiling directly from source code. As is often the case with Open Source operating systems, upgrading FreeBSD using binary packages is much easier and less time consuming than compiling from source code. However, what binary packages don't offer you is the ability to customize your kernel or modify the source code using third-party or in-house patches. As a result, upgrading from binary packages only permits you to apply a GENERIC kernel to your system, allowing no room for modifications. By compiling from source code, you are able to make changes to your kernel configuration file, adding or removing additional features and hardware modules that you may or may not need for your system. With the source code, you are able to make any changes you wish and then compile them into your system.

FreeBSD 6.2 introduces a new utility into its base system for upgrading via binary updates, appropriately called freebsd-update(8). freebsd-update has a very simple and straightforward argument set meant to make keeping FreeBSD systems updated with minimal fuss. Using this utility, you are able to download compressed binary images of both the kernel and/or userland, and install them when ready - all without interrupting your system. Then, when ready, a simple reboot is all that is required to load your newly installed kernel. freebsd-update also comes with a "rollback" feature in the event that your system doesn't take well to your newly installed binaries, in which case you can easily revert back to your previous kernel and userland, again, with minimal fuss.

Prior to FreeBSD 6.2, the only way for administrators to upgrade their systems (outside of a complete reinstall) was to compile everything from source code. Even with the introduction of freebsd-update, compiling the system from source is still the preferred method for many system administrators. To compile from source, you must first download the source code. Traditionally, this is done using a utility called CVSup, which can be found in the ports collection or added as binary package using pkg_add(1). Using CVSup and a simple text file or command line arguments specifying, among other parameters, the CVS server to retrieve the source code from, directory to store the files in and a release tag (e.g. 'RELENG_6_2_0' for FreeBSD 6.2-RELEASE), the entire FreeBSD source tree can be downloaded at whim.

As an additional note, future versions of FreeBSD are also likely include a utility called CSup. CSup is nothing more than a rewrite of the current CVSup utility in the C programming language. CSup is expected to contain the same feature set as CVSup, but since it is to be rewritten in C, it will be much easier for future developers to maintain and for cross-platform compatibility.

OpenBSD

The safest and easiest way to upgrade an OpenBSD machine is to boot from install media, and follow the upgrade steps, this process is similar to the install process. This can be achieved quickly on a running OpenBSD system by copying the upgrade version of bsd.rd kernel image to the / directory of the system, then rebooting the system, and typing boot bsd.rd at the boot> prompt, and then choosing the Upgrade script.

The upgrade process is detailed in the FAQ at http://www.openbsd.org/faq/upgrade40.html

The system can be built from source as described at http://www.openbsd.org/faq/faq5.html but this is for following the stable branch. Upgrading via source is NOT supported.

TODO: summarize faq here

DragonFly BSD

The upgrade from source process is documented in the build(7) manual page on DragonFly. Basically, the upgrade via source steps are first check out a copy of the latest release sources and then do:

cd /usr/src
make buildworld 
make buildkernel KERNCONF=YOURCONF
make installkernel KERNCONF=YOURCONF
make installworld
make upgrade

TODO: show common way to checkout/update sources

TODO: should the rest of this topic have steps for other BSDs too?

Examples

Practice Exercises

More information

make(1) including the 'buildworld', 'installworld', and 'quickworld' and similar targets; mergemaster(8); cvs(1) and the third-party utilities cvsup and cvsync; build.sh, build(7), etcupdate(8), postinstall(8) and afterboot(8); src/UPDATING and src/BUILDING.

TODO: for these more information sections, organize by BSD flavour as needed



Front | Information | Lists | Newsfeeds