How to Upgrade to Fedora Core 3, Part 1

Teach Linux to do Windows, Part 1 Part 2

I have revisited the topic because a user who does installations and upgrades is likely to have problems; FC2 is that out-of-date. So if you want to run Win4Lin with Fedora Core 3 or 4, these instructions should work for you. You'll simply do an installation instead of an upgrade, and you won't have to worry about previously installed applications breaking. Note: The patch for FC5 is not available yet.

The good news is, anyone running a Linux FC2-based appliance installation—as described in my earlier Recipes, Building a Linux Appliance, Part 1, and Part 2—probably has no compelling need for the upgrade.

Like some other Open Source distributions, the Fedora Core upgrade cycle is only a few months out. So staying on top of this isn't like trying to keep up with the comparatively leisurely pace of Windows.

Red Hat's Fedora Core Linux desktop distribution has recently been upgraded to version 3, or FC3 for short. The FC2 to FC3 upgrade is basically the equivalent of going from Windows 95 to Windows 98SE, not from Win98 to Win2000. In other words, this is an incremental upgrade, not a radical change. Having said that, FC3's new features include an upgraded GNOME/KDE windows managers, a compiler upgrade, larger pool of drivers, and the Evolution 2.0 mail client.

id
unit-1659132512259
type
Sponsored post

That may not sound like much, so why bother to upgrade? For starters, Fedora Core 2 was legacy long ago. It's basically on life support via the Fedora Legacy project. New applications won't support FC2, and updates will be spotty at best. Personally, I've had continuing problems caused by my attempt to get a Palm PDA running with Linux. I was getting hundreds of iterations of an error message that occasionally interfered with an orderly shutdown.

Plus, I don't think we'll see a radical change in Linux desktop capability until at least Fedora Core 8 or so, when Xen/Windows emulation should be available on enhanced CPUs. I'm hoping that by then, GUI installers can be used by Windows power users—that is, people who install their own OS and apps instead of asking friends, relatives or tech support to do it for them—without external support.

If you're up for the challenge, be aware that it took me roughly 12 days to upgrade to Fedora Core 3, install the Win4Lin-enabled kernel, install Win4Lin, and clean up the mess afterwards. With this Recipe helping you, the same job should take you only about two days. Much of that, you can spend away from the computer while the system does what you've told it to do.

Win4Lin, if you don't know, is a virtual machine environment running on Linux that makes it possible to run a Windows session in a Linux window. Win4Lin works well enough to run the majority of Windows applications with far more stability than Windows running in native mode on the same computer.

Finally, the Fedora Core Project has made Fedora Core 4 legacy, and there is even a FC5 now available. But for me, the major consideration with respect to upgrading is downtime. I considered upgrading directly to FC4. But I didn't, because the bigger the jump between versions, the more problems can be expected. Since I'm upgrading my workhorse workstation, I had to keep downtime to an absolute minimum. Sound familiar?

If you're feeling more adventurous, what's here should also work on FC4. But the price could well be a greater number of broken applications, which you'll have to fix. As for FC5, my recommendation is that you forget about it for now, as a working patch to make the kernel Win4Lin 9.x-compatible is currently unavailable.

FC3 Installation

Before you begin the installation, it's important to do a complete image backup. Actually, you should do such a backup before you start any major OS change—no matter which one you're upgrading from or to.

For backup purposes, I recommend using the either the rsync (mirror drive) or dar (C/DVD archive) scripts you can find in my older TechBuilder Recipe: Cloning a Linux Hard Drive. When you write your user/data files back—which you'll have to do if your files are in the Win4Lin /home/username/win tree—copy them back using rsync (mirror drive) or dar if you've one backed up to DVD-Rs. If you're using a mirror drive, simply mount it and rsync /home/username/win back to the drive.

Below, I've provided a revised version of the rsync script, slightly rewritten to add top-level directories that don't exist in FC2—and which have been added to FC3. These directories have been added to the script below. Note: My drive setup is probably different from yours. On my system, hda is the windows drive; hdb is the Linux drive I actually boot from; hdc is a DVD burner; and hdd is the backup drive. Change the script to match your system before running it. Finally, note that in this context, a line starting with # means "comment line, computer must not read as part of program script." The comments add context for the user who might want to do different things with the script than I did.

#!/bin/sh #rsync_backup.sh echo "Mounting backup drive." mount -t ext3 /dev/hdd2 /mnt/linux_backup #change ext3 to match the backup drive filesystem #if not ext3 #change /dev/hdd2 to match your actual backup drive #/ partition assignment if different #change /mnt/linux_backup to match your actual mount #point (directory) #delete or comment out mount line above if backup drive #permanently mounted. echo "Executing incremental backup script" echo "copy java symlink" cp /libjavaplugin_oji.so /mnt/linux_backup/libjavaplugin_oji.so echo "Backing up /bin" rsync -aHlv --delete-after --progress /bin/ /mnt/linux_backup/bin/ echo "Backing up /dev" rsync -aHlv --delete-after --progress /dev/ /mnt/linux_backup/dev/ echo "Backing up /etc" rsync -aHlv --delete-after --progress /etc/ /mnt/linux_backup/etc/ echo "Backing up /home" rsync -aHlv --delete-after --progress /home/ /mnt/linux_backup/home/ echo "Backing up /initrd" rsync -aHlv --delete-after --progress /initrd/ /mnt/linux_backup/initrd/ echo "Backing up /lost+found" rsync -aHlv --delete-after --progress /lost+found/ /mnt/linux_backup/lost+found/ echo "Backing up /lib" rsync -aHlv --delete-after --progress /lib/ /mnt/linux_backup/lib/ echo "Backing up /misc" rsync -aHlv --delete-after --progress /misc/ /mnt/linux_backup/misc/ echo "do not back up /mnt" echo "Backing up /media" rsync -aHlv --delete-after --progress /opt/ /mnt/linux_backup/media/ echo "do NOT back up /proc" echo "Backing up /root" rsync -aHlv --delete-after --progress /root/ /mnt/linux_backup/root/ echo "Backing up /sbin" rsync -aHlv --delete-after --progress /sbin/ /mnt/linux_backup/sbin/ echo "Backing up /selinux" rsync -aHlv --delete-after --progress /selinux/ /mnt/linux_backup/selinux/ echo "Backing up /srv" rsync -aHlv --delete-after --progress /srv/ /mnt/linux_backup/srv/ echo "Backing up /sys" rsync -aHlv --delete-after --progress /sys/ /mnt/linux_backup/sys/ echo "Backing up /udev" rsync -aHlv --delete-after --progress /udev/ /mnt/linux_backup/udev/ echo "Backing up /usr" rsync -aHlv --exclude *.dar --delete-after --progress /usr/ /mnt/linux_backup/usr/ echo "Backing up /var" rsync -aHlv --delete-after --progress /var/ /mnt/linux_backup/var/ echo "Backing up /win4lin-data" rsync -aHlv --delete-after --progress /win4lin-data/ /mnt/linux_backup/win4lin-data/ #e2fsck /dev/hdb2 #the -c, (--checksum) option provides better security, but takes #several times as much time to run - recommended if the mirror drive #is your ONLY backup or if you don't have a lot to back up. #see rsync man file for more information (type man rsync from the #command line # remember to add /mnt/temp /mnt/temp1 /mnt/temp2 if bare metal restore echo "mounting /boot partition" mount -t ext3 /dev/hdb1 /mnt/temp mount -t ext3 /dev/hdd1 /mnt/temp1 echo "backing up /boot partition" rsync -aHlv --delete-after --progress /mnt/temp/* /mnt/temp1 umount /dev/hdb1 umount /dev/hdd1 echo "backup complete"

Obtaining Fedora Core 3

If you haven't done so already, I strongly recommend you get a DVD drive, preferably a burner. It's just another IDE drive, so simply replace your CD-ROM with it. Once you do, you can simply start the installation and then go do something else. The computer should be able to download and install the upgrade files unattended. Otherwise, you'll need to sit around waiting to change CDs.

You can buy a decent CD or DVD set with FC3 for roughly $10. Two good sources are Cheapbytes and xplinux. If you don't have anything faster than dialup access, buy a disk or find somebody willing to make a copy for you (legal, since FC3 is open source). With a faster broadband connection, you can download the CD or DVD isos from here and burn it as .iso files for a set of CDs—or for a single DVD iso. If you don't know how to burn C/DVD iso images, read this LinuxISO.org page first. It explains the various ways to burn isos to C/DVDs, including how to do it from Windows.

Once you've got FC3, I recommend an upgrade installation, not a fresh install/copy over. If you simply install the program and copy your old FC2 install back over it, configuration files that work with FC2 are very likely not to work with FC3.

Next, open your BIOS and tell your computer to boot from the CDROM drive. Then do the media check to make sure your installation media is okay, if you haven't already. Assuming the installation media passes, go on to the upgrade. Simply follow the on-screen instructions once you've booted, then go on to install. Choose upgrade mode.

Possibly, the installation may blow out at this prompt: "The following files are absolute symbolic links, which we do not support during upgrade. Please change them to relative symbolic links and restart upgrade

/usr/tmp

". If so, you'll have to set up a relative symbolic link between your nonexistent usr/tmp to var/tmp. Creating /usr/tmp doesn't help, and the ordinary

ln "s target symlink

method of creating a symlink doesn't work. (Note: A symlink, or "symbolic link," is a file that points to a file or directory somewhere else in the computer directory tree. For example, a symlink showing as /home/filename in the home directory can point to a file that's really at /home/username/win/filename. For more information, open a terminal and type in

$ man ln

where ln is the program that creates symlinks.) In other words, instead of doing this

ln -s /var/tmp /usr/tmp

you have to do this:

# cd /usr # rm -f tmp # ln -s ../var/tmp

Why do FC2 and FC3 have a problem with a /usr/tmp directory which doesn't exist in an FC2 installation? I don't know. An evil leftover from FC1 or the Red Hat Linuxes, perhaps? Whatever the cause, this was the only actual problem I had with the installation part of the upgrade.

In fact, the FC3 installation was the easy part. The hardest part was getting a Win4Lin-enabled kernel working, mainly because there are preconfigured kernels that don't work out there. Unfortunately, I tried them first, under the delusion that they'd be easier to work with.

Since your upgrade will be based on your old configuration, you should be able to simply step through the installation screens and select the defaults. Having said that, be sure to take a look at each of the installation screens as they display during the installation process to make sure there are no surprises.

Once the installer starts pulling files off the DVD drive, go away for an hour. When you return, you should have the final installation screen up. Follow the instructions, and you're done. If you're installing from CD media, check your computer every 20 minutes or so to change discs. Fixing Post-Installation Problems

After the FC3 installation, I ran into a problem: My modem suddenly stopped working. If this happens at your end, go to Network Device Control, and change /dev/modem0 to point at /dev/ttyS0. Note that I'm using a real modem, not a Winmodem card that uses the CPU for processing. If your Winmodem driver quits working after the upgrade, all I can suggest for Winmodem users is go to linmodems.org/, and I wish you luck in trying to find a driver compatible with your kernel version.

To avoid all this, I recommend you look for a good price on a real external modem that connects via the serial port instead of a Winmodem that uses a CPU driver to do its signal processing. Saving $20 to $30 isn't worth the trouble, in my opinion. In fact, I ditched my Winmodem just before I got started with Linux.

To change the Network Device Control device entry, open Network Device Control, push the Configure screen button, and put the root password in at the prompt. Then, at the Network Configuration screen, go to the Hardware tab. Push Edit on the top Toolbar, and pull down /dev/ttyS0 on the top Modem Device drop-down menu. Save, get out of configuration, and log into the net.

My research has come up with no comparable Ethernet problem specifically relating to Fedora Core 3.

The biggest problem for a person using the Fedora Core/Win4Lin combination is that your installation will break your Win4Lin installation, as the stock kernel provided with FC3 can not work with Win4Lin without modification. Win4Lin Inc., in an attempt to encourage users to upgrade to the inferior Win4Lin Pro, has stopped supplying pre-patched kernels for various Linux distributions. For this reason, you'll need to obtain a generic kernel, get the two patches, install them onto the kernel, and then rebuild the kernel. While all that is not terribly difficult, it is time-consuming.

Don't bother with any pre-patched kernels you might find on the Net, such as: kernel-2.6.12-1.1398_FC4.1.kuba win4lin.src.rpm—rather, just look for kuba_win4lin. Even after several days of trying, I couldn't get the one I cited to work.

Next, download the latest W4L kernel patches here. Then grab the matching kernel version as per my instructions below. I got win4lin_kernel_patch-2.6.12.6.tgz, which contained both patch files.

Now, download a generic Linux kernel from Kernel.org into a directory you create for that purpose. Put the directory somewhere convenient. You'll want the latest stable kernel that matches your kernel patch revision number. For me, that was linux-2.6.12.6.tar.bz2 " de-archive using tar xfvj linux-2.6.12.6.tar.bz2 .

Next, follow the steps at How to Install Win4Lin on FC3 exactly to step 11, which is the configuration utility. You might want to print a copy of the article before you start the process for easy reference. There are several kernel configuration utilities available for the Linux user. Use the GUI xconfig kernel configuration utility, not the alternatives presented:

# cd /path/to/kernel # xconfig

While the required kernel configuration changes can be done from any kernel configurator, finding where you have to make the changes discussed below is easiest in xconfig. That's because you can display all the available options as a tree display. Click the three vertical lines located to the right of the save (disk) icon to display everything. You only have to find this one option: "Use Register Arguments (EXPERIMENTAL)" REGPARM), which is depicted in the CPU section of this screenshot:


When you find the checkbox, click it OFF. If you don't, W4L will not work. Since the REGPARM option is at the end of a branch, I had to open the entire tree to find it. The above illustration should save you that trouble. The following options should also be set. Though in the kernel I worked with, they were set by default. In any event, just check them to make sure they are enabled. They were easy enough to find:

Make as few other changes as possible to increase the odds in your favor that the W4L-patched kernel will work. Activating the Athlon option (assuming you have an Athlon processor) does work. I used it, and there were no resulting problems. Now, follow the rest of the kernel installation instructions from step 12 on. Once the kernel creation procedure starts, go find something else to do for an hour or so. To save you some trouble, here's what my grub.conf file looks like. When you complete the kernel modification and installation process, yours should look a lot like mine. Modifying the grub configuration file if the automated installer defaults aren't adequate is a painful experience. Unless you've got somebody else's similar installation to work with. Note where your installation probably differs from mine. On my system, hda is the Windows drive, hdb is the Linux boot drive, hdc is the DVD burner, hdd is the backup drive mirror. Modify the grub.conf file below to suit your needs.

---------------------- start file # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/hdb2 # initrd /initrd-version.img #boot=/dev/hdb timeout=10 splashimage=(hd0,0)/grub/splash.xpm.gz title Win4Lin-new4 (2.6.12W4L-FC3) kernel /bzImage-2.6.12W4L-FC3 ro rhgb quiet acpi=on root=LABEL=/ initrd /initrd-2.6.12W4L-FC3.img title Fedora Core (2.6.9-1.667) root (hd0,0) kernel /vmlinuz-2.6.9-1.667 ro rhgb quiet acpi=on root=LABEL=/ initrd /initrd-2.6.9-1.667.img ---------------------- end file

Note that the new menu entry has been moved to the top menu entry (just below the splashimage line), so the computer will boot to it by default. Note: Splashimage is the image that goes with "welcome to this operating system" during the boot process.

Next, change the title to something you'll recognize. The kernel ID enclosed in parenthesis in the title line under splashimage should match whatever you put in the EXTRAVERSION—a label inserted after the kernel version number—that you added during in step 9 from the list at the how-to page I referenced.

Updating yum

The first thing you'll want to fix is the yum automated installer program, which will stop working after the FC3 installation. The specific problem is the config file. The new distribution splits the file into the configuration file itself at /etc/yum.conf and the /etc/yum.repos.d/ repository directory; each repository gets a separate configuration file in the new directory. A repository in the Linux context means a site in which applications are kept in a format that a specific automated installer can download the applications and sufficient data. This way, dependencies can be analyzed and then downloaded from the repository, along with the application one intended to install.

You may have to do some things to clear out the deadwood and persuade the yum program to properly pull the information it requires to do the upgrades from the repository sites. To start with, if your installer kept the old yum.conf, replace it with this:

[main] cachedir=/var/cache/yum debuglevel=2 logfile=/var/log/yum.log pkgpolicy=newest distroverpkg=fedora-release tolerant=1 exactarch=0 # Added this because some mirrors go down and then retying takes forever. retries=1 timeout=300 # Basic Repos are in /etc/yum.repos.d/

In FC2, the repository information was part of the yum.conf file; each repository had its own section below the [main] section in the above yum.conf file. In FC3, each repository section has its own file in the /etc/yum.repos.d directory. The following is a sample section:

[base] name=Fedora Core $releasever - $basearch - Base #baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/ mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever enabled=1 gpgcheck=1

Take each section from yum.conf describing a specific repository and copy/paste it into a separate repository file in /etc/yum.repos.d/. In the case of the above section, one would paste it into the new file /etc/yum.repos.d/fedora.repo. After you've fixed the configuration and repository files:

#yum clean all

Clean out: If you get "file does not match checksum error:" for a particular repository, use the wget command line non-interactive file downloading utility to grab the following files:

# wget --cache=off http://apt.sw.be/fedora/3/en/i386/dag/repodata/filelists.xml.gz # wget --cache=off http://apt.sw.be/fedora/3/en/i386/dag/repodata/primary.xml.gz % wget --cache=off http://apt.sw.be/fedora/3/en/i386/dag/repodata/repomd.xml

Each wget is one line up to the filename at the repository (in this case, apt.sw.be) site. If you have problems with other repositories, find the corresponding files for your distro at the repository site and grab them the same way. Note: RPM keys are cryptographic site keys that permit manual or automated verification of the program content. This ensures that the program you're installing is, in fact, a legitimate download from the repository you downloaded the file from, rather than malware added to the site. In this case, one adds them to the yum environment so that yum will do the automatic verification. Next, here's how to add the rpm keys:

# rpm --import http://download.fedora.redhat.com/pub/fedora/linux/extras/RPM-GPG-KEY-Fedora-Extras

The above is one line starting with rpm. If that's not what you see, the line wrapped in your web browser. Repeat as necessary for any other repository keys you need from any sites/directories you don't have. For example:

# rpm --import http://rpm.livna.org/RPM-LIVNA-GPG-KEY # rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt

While I've read warnings for years about "mixing repositories" between Fedora/Livna and dag/atrpms, I had to mix them anyway. Each has apps the other didn't. I have had no significant problems so far as a result. Your mileage may vary. The basic "mixing repositories" problem is that there are two Fedora Core developer communities. One maintains fedora / fedora extras repositories (default installations), and the other maintains the dag and atrpms repositories. They are largely duplicate, but as I said, each has applications the other doesn't. The main problem this causes for users is that applications / dependencies from the two are not guaranteed to be interoperable (even though they mostly are). It's an unnecessary nuisance for users caused by developer-community politics. If you do have a problem, with mixed repositories you can disable a repository like so:

# yum --disablerepo=repo_name_here

Once you've finished fixing yum, upgrade udev to the latest version. Udev is the program in FC3 that manages communications with external devices. Do it like this:

# yum update udev

Congratulations, you've completed a Fedora Core 3 installation—with the major program components that broke during the upgrade all fixed. You also have a Win4Lin-prepared kernel installed.

This is Part 1 of a two-part Recipe. Part 2 will show how to install Win4Lin/ Windows over FC3, update the FC3 installation, and finish the post-installation cleanup.

A. LIZARD is an Internet consultant in the San Francisco Bay Area. He has been writing for technology magazines and Web sites since 1987.