The FreeBSD 'zine

June 2000 : Upgrading FreeBSD

Upgrading from 4.0-RELEASE to 4.0-STABLE
by Dan Langille <[email protected]>


This article discusses how I upgraded from 4.0-RELEASE to 4.0-STABLE by using make world. I did the initial install from a CDROM. I don't go into much detail about the actual install, but what I do provide may help with your upgrade. Of special note is a Makefile I obtained from Jim Mock, the founder and one of the editors of the site you're at right now. I've found it very useful, so I am including it.

Why Did I Upgrade to -STABLE?

The first thing I tried to do after installing 4.0-RELEASE was to install the Apache mega port. I failed. Here's what it failed with:

	# make all install
	===>  Extracting for apache-1.3.12
	>> Checksum OK for apache_1.3.12.tar.gz.
	>> Checksum OK for powerlogo.gif.
	===>  Patching for apache-1.3.12
	This port requires the OpenSSL library, which is part of
	the FreeBSD crypto distribution but not installed on your
	machine. Please see Chapter 6.5 in the handbook for
	instructions on how to obtain and install the FreeBSD
	OpenSSL distribution.
	*** Error code 1

I tried to install OpenSSL, but I couldn't because it was part of the base install. I was confused as to what to do, but I knew that doing a cvsup would pull in all the code I needed and I wanted to upgrade to -STABLE anyway. So I upgraded.

To summarize, I decided to upgrade from 4.0-RELEASE to 4.0-STABLE. I was going to use cvsup. But wait. How do I cvsup without the ports collection installed? Easy. I used the package. I installed it like so:

	# pkg_add -r cvsup-bin

The Make World

make world refers to the process of rebuilding the entire operating system, literally. Sometimes this confuses people as to what to do, and when. I know I've missed out steps and had to redo it a few times, but Jim's Makefile comes to the rescue.

For more detail on make world, please refer to the Using make world section of the FreeBSD Handbook. If you don't read that first, and bugger up your system, you only have yourself to blame. Actually, even if you do read it, you still only have yourself to blame :-)

The Makefile

Here is the Makefile I use to upgrade my boxes. Please note the following:

  • Rename the file to Makefile
  • If you get strange errors when you use this file, make sure there are tabs, not spaces after each label. For example, the line after "build:" must contain a tab, not spaces.

I put this script in /root/make, which means I can get to it as root by doing:

	# cd ~/make

Using the Makefile

Here are the steps I go through to build my world. But first, here are some assumptions:

  • You are doing this as root.
  • The Makefile resides in /root/make.
  • The file is named Makefile.
  • /home/4.x-stable-supfile and /home/4.x-secure-stable-supfile exist.
  • The directory /usr/tmp exists.
  • Make sure that you change the Makefile so that YOURKERNEL is actually the name of your kernel's configuration file.
  1. cd ~/make
  2. make update - updates (via cvsup) your source tree
  3. make build - runs a make buildworld
  4. make install - runs a make installworld
  5. make kernel - builds and installs a new kernel
  6. make merge - runs mergemaster
  7. shutdown -r now

If each step succeeds, go on to the next. There is a make all, but I've disabled it. Feel free to play with that aspect of it though.

Note that the make merge is automated and not all changes will be incorporated into your new system. I actually do the merge manually. I modify the Makefile by changing the -a option from the mergemaster line to a -w 120. This makes mergemaster run in interactive mode and display both new and old versions of the files. It makes the merge process quite simple.

Using Mergemaster

mergemaster is a most awesome piece of code. It simplifies the process of merging system file changes to a level which is quite simple. Without it, I would not like to do a make world.

mergemaster looks at the files in an existing system and compares them to the new files, which are temporarily located in another directory. For each new file which differs from the existing one, it prompts you for instructions. The options are generally:

  • merge (take the bits from each file and merge them together)
  • delete (ignore the new and keep the existing file)
  • insert (replace the existing file with the new file)

During the merge, you are presented with left and right images of the before and after images. You may have to scroll back up to figure out which is the new file and which is the old file. Quite often, the first line mergemaster shows you contains a version number. That will differentiate the new file from the old file. It may take a while to get used to, but it's definitely worth it in the long run.

- Dan

Current Issue
. Issue #06 : July 2000

Old Issues
. Issue #01 : February 2000
. Issue #02 : March 2000
. Issue #03 : April 2000
. Issue #04 : May 2000
. Issue #05 : June 2000

Quick Links
. Table of Contents
. Mailing Lists
. FreeBSD Events
. User Group Calendar
. Site Statistics
. Old Articles
. Latest News
. Press Releases
. Contribute
. Send us Feedback
. Other Resources
. Submit an Article
. Submit an Event

Today's Fortune
Katz' Law: Man and nations will act rationally when all other possibilities have been exhausted.

FreeBSD 'zine Poll
Are you going to BSDCon?
What the hell is BSDCon?
Results More polls

. VicFUG

. Issue #01 : Download
. Issue #02 : Download
. Issue #03 : Download
. Issue #04 : Download
. Issue #05 : Download
. Issue #06 : Download


Runs on FreeBSD

Add Channel to My Netscape


Contact: <[email protected]>
This site and the tarballs are built every 6 hours.
Copyright � 1998-2000, The FreeBSD 'zine
Code revision: 07/24/2000��All rights reserved.