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:
- 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.
- 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/upgradeAs 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...
# cd /usr/upgrade
# fetch http://www.daemonology.net/freebsd-update/upgrade-to-6.2.tgz
upgrade-to-6.2.tgz 100% of 17 kB 14 MBps
# fetch http://www.daemonology.net/freebsd-update/upgrade-to-6.2.tgz.asc
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 http://www.gnupg.org/faq.html 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 <security-officer@FreeBSD.org>"
# tar -xzf upgrade-to-6.2.tgzAt 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 upgrade-to-6.2
# sh freebsd-update.sh -f freebsd-update.conf -d /usr/upgrade -r 6.2-RC1 upgrade
Looking up update.FreeBSD.org mirrors... 1 mirrors found.
Fetching public key from update1.FreeBSD.org... done.
Fetching metadata signature for 6.1-RELEASE from update1.FreeBSD.org... 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 update1.FreeBSD.org...
done.
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:
/etc/periodic/weekly/120.clean-kvmdb
/usr/include/c++/3.4/ext/demangle.h
[snip]
/usr/share/doc/en_US.ISO8859-1/books/porters-handbook/x906.html
/usr/share/zoneinfo/America/Coral_Harbour
The following files will be added as part of updating to 6.2-RC1-p0:
/bin/pgrep
/bin/pkill
[snip]
/usr/share/zoneinfo/Europe/Volgograd
/var/db/freebsd-update
The following files will be updated as part of updating to 6.2-RC1-p0:
/bin/[
/bin/cat
[snip]
/usr/share/zoneinfo/zone.tab
/var/yp/Makefile.dist
# sh freebsd-update.sh -f freebsd-update.conf -d /usr/upgrade install
Installing updates...
Kernel updates have been installed. Please
reboot and run "freebsd-update.sh install" again to
finish installing updates.
# cd /usr/upgrade/upgrade-to-6.2One 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.
# sh freebsd-update.sh -f freebsd-update.conf -d /usr/upgrade install
Installing updates... done.
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