Upgrading to FreeBSD 5.3

by Dru Lavigne


I finally had a chance to upgrade my home systems to FreeBSD 5.3. Here's my working notes for both a fresh install and an upgrade from 5.2.1 to 5.3.

First, I started with my laptop which was running FreeBSD 4.10. For those who are looking for migration examples from 4.10 -> 5.3, I can't help you there as I chose to do a fresh install on purpose.

When I originally installed the laptop back in early October, I had planned on installing 5.2.1. However, the default kernel hung solid during its load, never getting me to the install screen. At the time, I started a thread on the freebsd-mobile mailing list and the concensus was either an IRQ conflict or a conflicting BIOS option. After fiddling with several CMOS settings, I settled for installing 4.10 as the 4.x install utility allows you to disable unneeded drivers.

I was now curious to see if that mysterious IRQ/BIOS setting had been resolved with 5.3. I was hopeful as the migration guide indicated that the initial floppies had been revamped from 2 to 3, allowing the addition of more features. (my laptop lacks a built-in CDROM so I have to start the install with floppies)

So, I went to the floppies section of the FTP site and downloaded boot.flp, kern1.flp, and kern2.flp. Once I had "dd"d the images onto 3 floppies, I inserted boot.flp and followed the directions. And, voila, the kernel loaded and the system installed flawlessly. Once the operating system had installed, I used the installation program to quickly install packages of all of my favourite software. As soon as I had rebooted into the new system, I fired up my trusty cvs-supfile and used portupgrade to ensure all of my software was up-to-date.

One thing I noticed missing from the install's post-configuration utility was the option to configure X. So, I went to the updated section of the
handbook
as this was my first time using Xorg instead of XFree86. I typed "Xorg -configure" and held my breath. The configuration script did its thing and I was very pleased when "startx" worked as expected. (I had already installed the kde package and had created an ~/.xinitrc with the line "exec startkde") All in all, the full install was a very painless procedure.

Now that my laptop was taken care of, I did a backup of my main system and used "scp" to copy the backup to my laptop. I didn't expect any problems but I wasn't going to take any chances with the data on my main system. I then changed the tag in my cvs-supfile from RELENG_5_2 to RELENG_5_3 and ran cvsup to download the sources for 5.3. Once the sources were on my main system, I ran this series of commands:

# cd /usr/src
# make buildworld
# make buildkernel KERNCONF=GENERIC
# make installkernel KERNCONF=GENERIC
# shutdown now (to go to single-user mode)
# cd /usr/src
# make installworld

That last command failed with an error regarding a missing user account. Those who use "mergemaster" would have already resolved this, but I don't like using "mergemaster". Instead, I took a closer look at "/usr/src/UPDATING". Aaah, I hadn't read back far enough as the info I needed went way back to 20040623 and 20040308.

Fortunately, my laptop had the correct user accounts and group so I used "vipw" to add the "proxy" and "_pflogd" accounts and used "vi" to add the "authpf" group to "/etc/group".

Once the "installworld" was successful, I rebooted into the GENERIC kernel. "uname -a" indicated that I was now at 5.3-RELEASE-p2. I was a bit worried about X, but "startx" worked flawlessly. It was now time to see if 5.3 liked my modified kernel:

# cd /usr/src
# make buildkernel KERNCONF=NEW

This quickly gave me an error that "device pcm" (for my soundcard) was not supported. I remembered reading something about that in the Release Notes . I remmed out that line in "/usr/src/sys/i386/conf/NEW", reissued the command and read through "man 4 sound".

The manpage suggested adding this line to "/boot/loader.conf":

snd_driver_load="YES" # All sound drivers

I double-checked my edit and saved my change. Once the kernel finished building, I then:

# make installkernel KERNCONF=NEW
# reboot

Everything seemed fine until I ran "startx" and it stopped cold with this error message:

xf86EnableIO: Failed to open /dev/io for extended I/O

I was glad I had my laptop nearby as it took less than a minute of Googling for that error message to indicate that I needed to add these lines to my kernel configuration file:

device io
device mem

So, I recompiled the kernel, rebooted and tried again. It worked, so I decided to push my luck by replacing XFree86 with Xorg. I followed the instructions in "/usr/ports/UPDATING" for 20040723 and ran this series of commands:

# cd /var/db/pkg
# portupgrade -o devel/imake-6 imake-4*
# portupgrade -o x11/xorg-libraries XFree86-libraries
# portupgrade -o x11/xorg-clients XFree86-clients
# portupgrade -o x11/xorg-manpages XFree86-manuals
# portupgrade -o x11/xorg-documents XFree86-documents
# portupgrade -o x11-fonts/xorg-fonts-truetype XFree86-fontScalable
# portupgrade -o x11-fonts/xorg-fonts-100dpi \ XFree86-font100dpi
# portupgrade -o x11-fonts/xorg-fonts-75dpi \ XFree86-font75dpi
# portupgrade -o x11-fonts/xorg-fonts-type1 \ XFree86-fontDefaultBitmaps
# portupgrade -o x11-fonts/xorg-fonts-cyrillic \ XFree86-fontCyrillic
# portupgrade -o x11-fonts/xorg-fonts-encodings \ XFree86-fontEncodings
# portupgrade -o x11-servers/xorg-server XFree86-Server
# portupgrade -o x11/xorg -f XFree86

The "-o" switch tells "portupgrade" to upgrade an existing package with a different package. In this case, to replace XFree86 with Xorg. Some of the commands didn't work on my system as I hadn't installed that particular package--for example XFree86-fontCyrillic wasn't installed on my system.

I then ran "Xorg -configure" on my main system which appeared to work. However, when I ran "startx", it aborted with an error when X tried to load the default font. So, I looked at the first Font line in the configuration file:

# grep -m1 Font /root/xorg.conf.new
FontPath "/usr/X11R6/lib/X11/fonts/misc/"

Hmmm, I wondered if I was missing a necessary font?

# ls /usr/ports/x11-fonts |grep misc
xorg-fonts-miscbitmaps

That looked like a likely candidate and a search through "pkg_info" indicated it wasn't on my system. So:

# pkg_add -r xorg-fonts-miscbitmaps
# exit
$ startx

And, that seemed to do the trick. Once KDE was up and running, I opened up XMMS to test my soundcard and was pleased to have sound on the system.

I still have to tweak Xorg a bit. The default display of 1400x1050 was way too tiny for my myopic eyes, but a right-click on the KDE desktop->configure desktop->display let me change the default to something more reasonable. When I have more time, I'll have to play with the fonts as they look pretty crappy in Firefox.

If you've been following the 5.x series through cvsup, it won't be that difficult upgrading to 5.3. In fact, your upgrade will be even easier if you have already integrated the changes to PF and Xorg. You can decide to keep PF out of the 5.3 base by adding NO_PF to your make.conf BEFORE you issue your "make buildworld" command. You can also choose to continue to use XFree86 if you prefer not to switch to Xorg at this time. Do make sure those two options are in your kernel, though, as either version of X requires them on 5.3.




9 Comments

scottro
2004-12-07 19:01:18
This might show up twice but....
Thanks, as always, for an informative article. I have a page covering my own experiences that some folks also might find helpful at


http://home.nyc.rr.com/computertaijutsu/FreeBSD53.html


If this comment shows up twice, blame onlamp. :)


Scott

krion
2004-12-08 01:51:18
ports
Actually you better recompile all your ports or use libmap.conf(5) for libraries mappings.
UltimaGuy
2004-12-08 02:53:37
Thankk God I nuked FreeBSD
I tried installing FreeBSD on my system...and though it installed flawlessly X looked very ugly with the mouse pointer not visible but corrupting the display around it...


After reading this article I am happy that I nuked it as I don't have the inclination or time to do all this shit to just make my system work. This shows why FreeBSD is still in the servers and has not some into the Desktops.

raistphrk
2004-12-08 07:30:14
5.3 is running pretty well for me
I've installed 5.3 on several servers as well as my desktop system, and the process has been fairly painless. The boot loader has some major improvements over FreeBSD 4. ACPI has worked delightfully on all of my systems; when I hit the power button, FreeBSD unmounts my filesystems and shuts down. I did notice that a few of the sysctl commands that I was accustomed to in FreeBSD 4 are no longer available, but other than that, I give it a big thumbs up.


All that being said, this is a good time to plug Dru's book BSD Hacks. I've been using FreeBSD for about six years now, but even after all this time, her book had a few tips that I found both useful and interesting. Pick it up at your bookstore or over the O'Reilly website and give it a try.

sullven
2004-12-08 08:04:22
Small payback.
Many thanks for all your great articles they've helped to make my FreeBSD experience so much better.
I discovered, when trying to install 5.3 on an old laptop, a tool called "Smart Boot Manager" which lets you boot from CD even if the bios doesn't support it. It beats waiting for three floppies to do their thing.


Ken

sullven
2004-12-08 08:33:29
Smart Boot Manager URL
Here is the link for the tool to boot from CD.


http://btmgr.webframe.org/

candrade@gmail.com
2004-12-13 13:13:27
Laptop model?
I must be going blind (contact slightly help) or possibly you have mentioned it in the past, but what is your laptop's make and model?
alexp78
2005-01-07 02:10:22
Thankk God I nuked FreeBSD
Which version of FreeBSD were you installing ?
FreeBSD is more into desktops then you would
think. I run 5.3-REL + x.org X11R6.8.1 + kde3.3 with nvidia driver using twinview on two samsung 710N lcd displays and intel ICH sound drivers. Everything works flawlesly for me. This is my
primary workstation BTW.



alexp78
2005-01-07 02:17:47
ABI breakage
Just wanted to mention this in case you are considering an upgrade to 5.3.


Read /usr/src/UPDATING -> 20040728:


Basically the new gcc is not backward ABI
compatible, so you have to rebuild certain
programs with the new compiler, otherwise
face a slew of execution errors.