a memo

Updating FreeBSD Using cvsup

Some background and resources on keeping your FreeBSD current (I mean, er, stable). The idea is that you don't have to download and burn an ISO to CD-ROM, you can use cvsup to download diffs and patch against your current source files, which is much less expensive bandwidthwise, especially if you do it with every release.

Note that this is for the base system only, and not any of the installed packages. That will be covered elsewhere, because it should happen more often.

Official Resources:
Upgrading Section of the 4.6 release notes.

From the FreeBSD Handbook, Using make world -- well, it's actually make buildworld then make installworld, but whatever.

If you're new to this, read up on the difference between stable and current and releases in the Handbook and be sure to join the freebsd-stable mailing list so you know what to expect. It's high traffic, but VERY educational.

Steps
0) backup your /etc data and subscribe to the freebsd-stable mailing list.
1) make sure your source tree is up-to-date using cvsup
2) update any necessary config files using mergemaster -p
# cd /usr/src/usr.sbin/mergemaster
# ./mergemaster.sh -p
3) delete everything in /usr/obj
4) cd /usr/src
5) turn on scriptlogging: script /root/mw.out
6) make buildworld
7) turn off scriptlogging: exit
8) build and install a new kernel (Kernel Section of the Handbook)
I use sdiff to merge the updated GENERIC config with my existing MYKERNEL config.
9) Reboot into Single User Mode (fun!)
# shutdown now
Alternatively, reboot the system, and at the boot prompt, enter the -s flag. The system will then boot single user. At the shell prompt you should then run:

# fsck -p
# mount -u /
# mount -a -t ufs
# swapon -a
# adjkerntz -i

This checks the filesystems, remounts / read/write, mounts all the other UFS filesystems referenced in /etc/fstab, turns the swapfile on, and adjusts your clock to the correct time.
10) cd /usr/src
11) make installworld
12) mergemaster -v -i
I don't like this step, it's kinda complex. Get a cup of coffee before you get started here.
You're basically telling the sytem which settings to keep and which to update.
This doesn't seem so bad, except this is Unix and you're dealing with startup scripts and firewalls and stuff that could really break things if you're not careful. So be careful and take some time to read the help files up front.
13) update /dev (mergemaster shoulda done this...)
14) update /stand
 # cd /usr/src/release/sysinstall
# make all install
15) fastboot

Congratulations, you should now have a shiny new Berkeley(style) Software Distribution at your fingertips! If you don't, well something went wwwrong and now you get to learn more.

Next step: Upgrade all of your installed packages.

By Chris Snyder on July 30, 2002 at 9:31pm

jump to top