freebsdzine.org
Any sufficiently advanced bug is indistinguishable from a feature. -- Rich Kulawiec

[ Home  · Latest BSD News  · Site Statistics  · Wanted Articles  · Request an Article  · Submit an Article ]

Search freebsdzine.org

FreeBSD 'zine Polls

How much wood could a woodchuck chuck if a woodchuck could chuck wood?

a little
a lot
4
what?
isn`t that a beaver?
pi
eleventeen
moses

Results  · More polls


Sections
· Wanted articles
· Request an article
· Contribute
· Mailing lists
· About the site
· The staff
· Copyright info
· Privacy policy
· Change log
· Contact us

Resources
· The FreeBSD Project
· The FreeBSD Diary
· BSD Today
· Daemon News
· Daily Daemon News
· Slashdot BSD
· FreshPorts
· The FreeBSD Mall
· BSDVault
· The FreeBSD Browser
· GreasyDaemon.com
· iso-nix.com

FreeBSD Books
· Complete FreeBSD
· FreeBSD Handbook
· FreeBSD Corporate
Networker's Guide


Runs on FreeBSD
Upgrading to XFree86 4.0.2
Lawrence Sica <[email protected]>

Introduction

Recently, in my move towards making FreeBSD my full-time desktop OS, I decided to upgrade to XFree86 4.0.2. FreeBSD includes X 3.3.6 as an optional part of the base system, however, I decided that 4.0.2 had a number of new features and enhancements that made it worth upgrading. There are a number of steps involved to properly upgrade X, mainly due to it's complexity and the number of other applications that require it as a dependency. Therefore, it is very import to be careful during the upgrade process.

Why Upgrade?

The first thing that comes to mind when upgrading is, "if it's not broke, don't fix it". Sure, X was working fine, but I thought it could work better. Like anything else, weigh the pros and cons, and then decide. X 4.0.2 has a number of enhancements, such as anti-aliased text, internationalization, better font support, changes to some libraries, and a unification of the X server drivers (this was introduced in 4.0.1, I believe), and some other things. The font and text improvements were my major reasons for upgrading. Anyone familiar with X knows that web browsing can become painful with some fonts using X 3.3.6. So began my upgrade process...

Steps to Upgrade

The first thing I did was outline the steps I would take during the upgrade. I decided from the start to "bite the bullet" and reinstall all of X in order to make sure no remnants were left behind. Here is a quick rundown of the steps I followed:

  1. Update the Ports Tree

  2. Remove Old X and Applications

  3. Install the X 4.0.2 port

  4. Configure X and FreeBSD

  5. Reinstall a Window Manager

  6. Reinstall the X Applications

Update the Ports Tree

I used CVSup to update my ports tree. I knew I would be removing and reinstalling a number of applications, so I decided to make sure I had the latest versions.

Remove Old X and Applications

Removing X and applications that depend on X was a two step process. First I removed any packages that depended on X. Overkill? Not really, since I wanted all of my apps to use the updated X libraries. After I finished that, I removed /usr/X11R6/bin. I was only worried about the bin directory since I knew that the libs would be overwritten, and I wanted to make sure no 3.3.6 binaries were left lying around.

Note: This will not remove any of your home directory's dotfiles, so the configuration stored in them should be safe. However, it is a good idea to keep a backup of those files just in case something goes wrong.

Install the X 4.0.2 Port

This is the most time-consuming portion of the process. The port is installed like any other:

# cd /usr/ports/x11/XFree-4
# make install

This may take quite a while depending on the speed of your system. Sit back and wait for it to finish installing :-)

Configure X and FreeBSD

You will need tell FreeBSD that X 4.0.2 is there and that it shouldn't attempt to install X 3.3.6 as a dependency. To do this, run the following command as root:

# echo 'XFREE86_VERSION=4' >> /etc/defaults/make.conf

If you don't do the above, every port you install that depends on X will attempt to install X 3.3.6.

When you configure X for the first time, keep in mind that you can't use /stand/sysinstall since that's for X 3.3.6. In fact, the configure program will no longer exist on your system. Instead you must run /usr/X11R6/bin/xf86config. This script will take you through all of the basic configuration steps.

When setting up your mouse, you must use /dev/mouse for the device and auto for the protocol (this will require hand-editing of the XF86Config file. This file will be found in /etc/X11. These settings work with both a LogicTech trackman marble and a Microsoft wheel mouse. If you have trouble, the XFree86 documentation isn't 100% clear, but the XF86Config(4/5) man page lists all of the possible options.

Video is somewhat easier. Monitor refresh rates are very important to know -- refer to the manual from your manufacturer or their web site if you're unsure. Video cards may have a database entry, like mind did. I am using an ATI All-in-Wonder Pro. The database entry for it was correct. You will need to know how much memory is on your video card. Run the SuperProbe command (while not in X), and you can get all of the information you need for your video card.

To test it, rename your .xsession file (if you have one) to something else, such as xsession.bak, so that TWM will start.

Finally, you must run X through xdm or install the xwrapper port. I decided to use xdm since it's a workstation. To turn on xdm, do the following:

# vi /etc/ttys

Find the entry for xdm and switch off to on. As a side note, I suggest you disable xdm temporarily by setting the tty to off while upgrading, since xdm was also upgraded.

After you edit the file, you must HUP init. You can do this by typing:

kill -1 1

1 is always the init pid. In a few moments, you should have the xdm login screen if all goes well. Log in, set your resolution, and if it launches, your configuration is correct.

Reinstall a Window Manager

Now reinstall your window manager, restore your .xsession file, and then log out and back in. Your window manager should start now, assuming you set it to do so.

Reinstall the X Applications

You can now reinstall all of you apps dependent on X. You can also do the following:

# cd /usr/ports/x11/XFree86-4
# make distclean

That will remove all the files and source tarballs left lying around by the port installation.

Pitfalls and Traps

You may be tempted to just let it overwrite old X and not reinstall your applications. Doing this runs the risk of version conflicts between libraries and binaries. It's safer and less of a potential headache to just do it all in one shot. I had initial trouble with physical version virtual screen size. X will let you scroll the desktop to fit a virtual screen size. You must change your resolution depth to get a properly sized screen since the option to run off this feature would not work (at least for me). I have heard of some mouse problems with X 4, so keep your old configuration file around in case you might need it.

For More Information

- Larry

Return to the January 2001 Issue



Issues
2001
· April
· March
· February
· January

2000
· December
· August
· July
· June
· May
· April
· March
· February

1999
· January

Other issues from 1999 are available in the attic for now.

Other News
· Slashdot
· FreeBSD Diary
· BSD Today
· FreshPorts
· Daemon News
· OS Online
· Rootprompt
· Maximum BSD

Miscellaneous
· Jim's site

IRC
#freebsdzine
If you'd like to hang out with us and talk about the site, join us in #freebsdzine on Undernet.

Backend
You can add a list of our latest issue's articles to your site by using our RDF/RSS file. You can also add it to your My Netscape page, or add our slashbox once you log in over at Slashdot.

[ Home  · Latest BSD News  · Site Statistics  · Wanted Articles  · Request an Article  · Submit an Article ]

Copyright © 1998-2001 · The FreeBSD 'zine · All rights reserved.