FreeBSD 6.1 to 6.2 binary upgrade

I've posted here before about a script I wrote for performing binary upgrades of FreeBSD 6.0 system to FreeBSD 6.1; seeing that one of the greatest difficulties of the FreeBSD release cycle is convincing people to install and test all of the -BETA and -RC (release candidate) snapshots produced, I have put (most of) this code together with the new FreeBSD Update code to produce a version of FreeBSD Update which can be used for upgrading between FreeBSD releases (and beta releases, and release candidates). I haven't committed this new version to the FreeBSD src tree yet; I'll do that once it has been more completely tested and once I've had time to upgrade the manual page.

A couple of important caveats:

  1. Unlike my earlier upgrade script, this version will not attempt to merge changes to modified configuration files; instead, it will print "The following files are affected by updates, but no changes have been downloaded because the files have been modified locally:" and output a list of such files (if any exist -- there haven't been many configuration file changes between 6.1 and 6.2, so this won't affect many people). If this message appears, you must manually update those configuration files (FreeBSD's cvsweb is very useful for figuring out what changes need to be merged). I'm planning on adding code for automatically merging configuration files changes, but I haven't done this yet.
  2. FreeBSD Update only updates parts of FreeBSD which (a) exist on your system, and (b) are distributed on the released ISO images. This means that if you do not have a GENERIC or SMP kernel installed, FreeBSD Update will not install any kernel updates. In this case, you must update your kernel before installing updates which FreeBSD Update has downloaded (having a userland which is newer than the kernel is liable to render a system inoperative).

Without further ado, here's a "walkthrough" of upgrading a FreeBSD 6.1-RELEASE system to 6.2-RC1:

# mkdir /usr/upgrade
# cd /usr/upgrade
# fetch
upgrade-to-6.2.tgz 100% of 17 kB 14 MBps
# fetch
upgrade-to-6.2.tgz.asc 100% of 187 B 686 kBps
# gpg --verify upgrade-to-6.2.tgz.asc upgrade-to-6.2.tgz
gpg: WARNING: using insecure memory!
gpg: please see for more information
gpg: Signature made Sat Nov 25 08:35:31 2006 PST using DSA key ID CA6CDFB2
gpg: Good signature from "FreeBSD Security Officer <>"
As FreeBSD Security Officer, I have signed the tarball containing my script. I recommend verifying the signature with gpg, but I know that most people won't...
# tar -xzf upgrade-to-6.2.tgz
# cd upgrade-to-6.2
# sh -f freebsd-update.conf -d /usr/upgrade -r 6.2-RC1 upgrade
Looking up mirrors... 1 mirrors found.
Fetching public key from done.
Fetching metadata signature for 6.1-RELEASE from done.
Fetching metadata index... done.
Fetching 2 metadata files... done.
Inspecting system... done.

The following components of FreeBSD seem to be installed:
kernel/generic world/base world/dict world/doc world/manpages

The following components of FreeBSD do not seem to be installed:
kernel/smp src/base src/bin src/contrib src/crypto src/etc src/games
src/gnu src/include src/krb5 src/lib src/libexec src/release src/rescue
src/sbin src/secure src/share src/sys src/tools src/ubin src/usbin
world/catpages world/games world/info world/proflibs

Does this look reasonable (y/n)? y

Fetching metadata signature for 6.2-RC1 from
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Preparing to download files... done.
Fetching 2638 patches.....10....20.. [snip] ..2630.... done.
Applying patches... done.
Fetching 243 files... done.

The following files will be removed as part of updating to 6.2-RC1-p0:

The following files will be added as part of updating to 6.2-RC1-p0:

The following files will be updated as part of updating to 6.2-RC1-p0:
# sh -f freebsd-update.conf -d /usr/upgrade install
Installing updates...
Kernel updates have been installed. Please
reboot and run " install" again to
finish installing updates.
At this point, the system has a 6.2-RC1 kernel installed along with the 6.1-RELEASE userland. At this point, rebooting is essential, in order to get into the new kernel before installing the userland updates. After rebooting...
# cd /usr/upgrade/upgrade-to-6.2
# sh -f freebsd-update.conf -d /usr/upgrade install
Installing updates... done.
One more reboot (to start the updated sshd and other daemons), and the system has been fully updated to FreeBSD 6.2-RC1. When -RC2 is released, I'll repeat this process -- taking no more than 10 minutes per system -- and again when 6.2-RELEASE comes out.

Go upgrade some systems and help make FreeBSD 6.2 the best-tested FreeBSD release ever!

Posted at 2006-11-26 13:30 | Permanent link | Comments
blog comments powered by Disqus

Recent posts

Monthly Archives

Yearly Archives