The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
upgrading to 3.1-Release 21 February 1999
Need more help on this topic? Click here
This article has no comments
Show me similar articles
This work is now more-or-less complete.  I have upgraded to 3.1 and I've made mistakes along the way.  I suggest you read this carefully to make sure you don't do the same things.  Perhaps the best thing to do is read this from start to finish, then figure out which bits are best for you.

I will tidy this up (famous last words).

Why did I do this?
This morning I woke up and decided it was time to move to FreeBSD 3.1 [shudder].   There's no real reason to be nervous.  But any time I start to install a new version of the operating system, I am cautious.

For this upgrade, I used my original cvsup notes (which will show you how to install cvsup) and modified the procedure accordingly.

Getting the release
I run a cvsup site for FreeBSD, which means it already has the 3.1 files.  All I need to do is run cvsup and transfer the files.  It should be fairly fast.   I used /usr/share/examples/cvsup/release-supfile as my starting point.   I copied that file to /usr/home directory.  Then I modified that file to contain the following:
*default base=/usr/local/etc/cvsup
*default release=cvs tag=RELENG_3

In the above, I specified my favorite cvsup mirror, the directory into which the source should be placed, and the release I wanted to obtain.

Then I issued the following command:

cvsup -P - release-supfile

The "-P -" allows cvsup to work properly through my firewall.   Then I waited just a few hours until cvsup finished.  Actually, the cvsup started at 9:27am and finished at 20:55 (elapsed time - 11:28 - hmmm, I need to do something about my server...). 

1st compile failed
The first compile failed.  Here's the msg I posted to the -questions mailing list:
Subject:        	make buildworld for 3.1 fails
Date sent:      	Mon, 22 Feb 1999 17:35:32 +1300

I'm doing a make world for 3.1 after running cvsup to get it.  I did 
a "make world -j4 2>&1 > makeworld.log" to run it.  After about 333k,
I get the following at the end of the log.  It makes no sense to me.  

cc -fpic -DPIC -O -pipe -elf -Wall -Wno-unused -
I/usr/obj/usr/src/tmp/usr/include -c 
/usr/src/lib/csu/i386-elf/crtbegin.c -
o crtbegin.So
/usr/src/lib/csu/i386-elf/crtbegin.c:30: section attributes are not 
supported for this target
/usr/src/lib/csu/i386-elf/crtbegin.c:31: section attributes are not 
supported for this target
/usr/src/lib/csu/i386-elf/crtbegin.c:30: section attributes are not 
supported for this target
/usr/src/lib/csu/i386-elf/crtbegin.c:31: section attributes are not 
supported for this target
{standard input}: Assembler messages:
{standard input}:73: Error: Unknown pseudo-op:  `.section'
*** Error code 1
{standard input}: Assembler messages:
{standard input}:95: Error: Unknown pseudo-op:  `.section'
*** Error code 1
{standard input}: Assembler messages:
{standard input}:77: Error: Unknown pseudo-op:  `.previous'
*** Error code 1
3 errors
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2
1 error
*** Error code 2

It was suggested I not use the -j4 option.  So I tried again.   This time I got the following error:

cc -O -pipe -elf -Wall -Wno-unused 
-I/usr/obj/usr/src/tmp/usr/include -c 
/usr/src/lib/csu/i386-elf/crtbegin.c -o crtbegin.o
*** Error code 1

*** Error code 1

*** Error code 1

*** Error code 1

*** Error code 1

2nd compile failed
This time, I'm doing a make clean. Then I'll try a make depend and see what happens this time.  I'll also post the above to the questions mailing list.
As pointed out to me in a post on the -questions mailing list, there is a tutorial to guide you through the process.  Here are the references I've found by searching the -stable mailing list archives:

3.0-STABLE transition process

Upgrading to FreeBSD 3.0-STABLE (this site was unavailable on 2001.03.02)

The key point is that you need to do a make aout-to-elf-build.  That's running now.

My make world started at Tue Feb 23 10:23:37 1999 and finished at Feb 26 23:33.

I'm now on 3.1-stable, but I'm having some trouble with the login.  Here's what I just posted to questions:

From:           	Self >single-user mode>
Subject:        	login fails after 2.2.8 => 3.1 upgrade
Date sent:      	Sun, 28 Feb 1999 23:37:56 +1300

I've recently upgraded from 2.2.8-stable to 3.1-stable.  The system 
startup seems OK until it starts loading applications such as 
dhcpclient, etc.  The error displayed is:

/usr/libexec/ warning: /usr/lib/ minor version -1 
older than expected 1, using it anyway. failed: bad magic number in "/usr/lib/"

The same error message occurs when I attempt to login from the 
console during multi-user mode (single user mode seems to be OK).

I'm lost with this.  thanks.

We'll see what happens. In the meantime, the box is down.

1 March 7:25 am
Ahhh, OK.  /etc/rc wasn't replaced.  Once I copied /var/temp/root/etc/rc to /etc/rc, all was well.  Well, not everything.  But I was able to boot into single user mode.

I notice that things which use /dev/lkm are failing with "device not configured".

Sendmail is using 8.9.2 config file.

6:17 pm
Well, I'm having trouble with named and with my cd-rom.  Bind 8 has been installed over top of bind 4.  And I'm trying to get my CD-ROM mounted so I can go back to bind 4 for a while.  However, when I do:
mount -t cd9660 /dev/wcd0c /cdrom

I keep getting

cd9660: device not configured

Life goes on.

7:08 pm
In a stroke of brilliance (it wasn't me, it was someone else), we've noticed that wcd has been replaced by acd under 3.1.  Checking my kernel, I see that acd doesn't exist.  So I've renamed wcd to acd and I've started to create a new kernel.  By the way, under 3.1, you should to a make clean, a make depend and then a make when compiling your kernels.
10:04 pm
Well, the kernel compile worked.  It was the device name which was missing.   Now I'll install bind4.  I could just modify the existing bind4 database files to work with bind8, but I actually want to create an article for upgrading bind4 to bind8.

On second thought, I'll convert to bind8 now.  As I don't yet have net contact with my FreeBSD box, I'll give up on getting bind4.

10:44 pm
Well, the convert of bind4 to bind8 was pretty easy.  But I noticed that I had not copied /var/tmp/root/etc correctly.  I had a /etc/etc directory.  I moved everything in that directory to where it should have been.  I'm sure I'll have some things to clean up there.  A good resource for converting to bind8 is but that link has recently been down.

Note: /usr/src/contrib/bind/bin/named/ will convert your named.boot file to a named.conf file.  I haven't tried and tested this myself, but I'm told it works well.

named didn't start that time.  Something is wrong there.  Ahhh.   /etc/defaults/rc.conf didn't have named_enable="YES".

2 March 6:42 am
I'm having trouble creating a new kernel for use with ipfilter.  I suspect it's because of the LKM issues associated with 3.1 (see   I've now removed the IPFILTER_LKM option from my kernel.  We'll see how that goes for creating a new kernel.

Also, during the make depend for the kernel, I was getting warnings saying that ioctl.h shouldn't be included in the kernel, use xxxio.h instead.

3 March 5:17 pm
Now I'm having touble compiling ipfilter.  I'm getting duplicated definitions of fr_checkp in netinet/ip_input.c.  I used the www interface to the CVS server at to retrieve the files in_proto.c, ip_output.c, and ip_input.c.   Then I had to use FTP to upload them from my NT box to a third site and then download them to my FreeBSD box.  I was unable to communicate directly between the two.  I'm not at all sure why.

[insert pause while I go next door to fix my neighbour's computer...]

At present, I'm rebuilding ipfilter from scratch.  Here's what I did, in brief (these instructions can be found in full if you get them from the ipfilter archives so please read them first as it talks about possible missing files):

[/usr/src/sys/i386/conf] # config IPFILTER3    // this is my kernel
[/usr/src/sys/i386/conf] # cd /usr/ports/net/ipfilter
[/usr/ports/net/ipfilter] # make freebsd30
[/usr/ports/net/ipfilter] # make install-bsd
[/usr/ports/net/ipfilter] # FreeBSD-2.2/kinstall

Then I did the kernel config again, not sure why or if it was necessary.  Then I did a make depend; make ;make install for the IPFILTER3 kernel.   For instructions on how to create a new kernel, refer to Configuring the FreeBSD Kernel section in the FreeBSD handbook.   Pay special attention to the section on Building and Installing a Custom Kernel

11:16 pm
The above approach worked.  It seems I had some corrupted files again.  I think what I did was attempt to just do a make on ipfilter instead of the full and proper install as outlined above.

I still have to reconcile some of my /etc files.  But the gateway is basically up and running.  I'll check all that out tomorrow night.  In the meantime, sendmail is recompiling.  Don't forget to regen your file as well.

Later.  It's gone past midnight now.  I'll be back tomorrow.

4 March 1999 7:25 am
I found a problem with named last night which seems to have affected others as well.   I've found that named must be started with the name of the configuration file.   Otherwise, it doesn't pick up the zone files.  Basically, I had to do:
named -b /etc/named.conf

I'll check this out later.

8:47 am
[root@ns:/usr/ports/net/cvsup-mirror] # make clean
"/usr/share/mk/", line 2: Could not find 
make: fatal errors encountered -- cannot continue
cvsup -P m ports-supfile

I did an FTP session to and retrieved the following files:

I put them in /usr/ports/Mk.  I was then able to make cvsup-mirror.

7:05 pm
I'm now going to finish off the merge/install process for my 3.1 upgrade.  And the first thing I'm going to do is install and run mergemaster which is a great tool to use when upgrading.
10:10 pm
Well, I've got the stuff running.  Mind you, I wasn't full time on this project tonight.  I was also installing race timing software for The Kennett Bros.  They're running The Karopoti Classic this Sunday.

I was having trouble with named.  For some reason, it wasn't starting up.   I found it was because of the startup parameters.  I was specifying "-u bind -g bind".  But neither that user nor that group exists.  I'll have to look into that.

10:32 pm
The named problem was related to the password database.  I did not rebuild it after merging back in my old password file.  So I did this:
[root@ns:~] # vipw [I didn't actually change anything, just 
typed <esc> wq]
/etc/pw.yrM370: 21 lines, 1381 characters.
vipw: rebuilding the database...
pwd_mkdb: warning, unknown root shell
vipw: done  

That warning relates to the /etc/shells.  It means the shell specifed for root is not listed in that file.  So I added the following line to /etc/shells:


where that was the shell specified for root in /etc/master.passwd ( Note that you should not edit /etc/master.passwd directly.  You should use vipw if you want to make any changes.  If you don't, the database will not be rebuilt.).  Then I ran vipw and pressed <ESC>wq.   Here's the result of that process:

/etc/pw.GoU377: 21 lines, 1381 characters.
vipw: rebuilding the database...
vipw: done

Then I did this to restart named:

[root@ns:~] # killall named
[root@ns:~] # /usr/sbin/named -u bind -g bind -b /etc/named.conf  
[root@ns:~] # ps -auwx | grep named
root     388 36.0  3.8   944  512  p1  S+   10:31PM   0:00.35 
               grep named
bind     386  2.7  6.6  1512  900  ??  Ss   10:31PM   0:00.35 
               /usr/sbin/named -u bind -g bind -b /etc/named.conf  

The above options are specified in my rc.conf file as follows:

# named.  It may be possible to run named in a sandbox, man security for    
# details.                                                                  
named_flags="-b /etc/named.conf -u bind -g bind"
10:45 pm
What's next?  Well, I don't have qpopper running yet.  I think my /etc/inetd.conf needs to be reconciled.  I don't think I did the merges right.  That's for the weekend I think.
5 March 1999 7:41 am
I reconciled /etc/inetd.conf this morning.  I found that the changes for TPC Wrappers had been lost.  But after reinstating the missing lines, I found that the libraries for tcp_wrappers were missing.  I was getting this message when I tried to telnet in: failed: Can't find shared library ""

So I remade the port following my original instructions for tcp_wrapper.  Don't forget to do a "make deinstall" before the "make install".

getting somewhere now! the new version of tcp_wrapper was installed at /usr/local/libexec/tcpd whereas it was at /usr/local/sbin/tcpd. after changing inetd.conf, things are looking better. more checking...

I'll have to remember to remove the old libraries.

I've also restored my old /etc/syslog.conf

5 March 1999 4:06 pm
Well, I consider I've upgraded to 3.1 now.  I'm sure I messed something up during my merge, but I'm not sure what.  With luck, I'll come back to this article later and create a condensed version.  Hope this helps.

One more thing I will be doing is modifying my /etc/rc.conf file.  You may notice that /etc/defaults/rc.conf has appeared.  Well, here's the extracr

6 March 5:32 pm
I also think I have to recompile cvsupd because I'm getting this message during startup:

cannot determine the prefix..

After rebuilding, I was starting cvsupd, but I found it wouldn't stay running.   After playing with my /usr/local/etc/rc.d/ file, I eventually noticed that my cvsup user was missing.  So I copied and pasted it from my /etc.old/etc/master.passwd into vipw.  I guess I messed up when I merged this file.

11:20 pm
I've just realised that screen may also require a rebuild.  I think I'll create a page containing a list of the ports which I've had to rebuild after my 2.2.8 => 3.1 upgrade.

Need more help on this topic? Click here
This article has no comments
Show me similar articles