totn Linux

Linux: How to Update and Rebuild Fedora Core 2 Installation CDs

Question: I found your RedHat 9 update page. How can I create new installation CDs for Fedora Core 2 with the updates already included?

Answer: As with RedHat 9, Fedora Core 2 comes with all of the tools you need to accomplish this. To be consistent, we've provided our procedure broken down into 6 steps below.

Since Fedora Core 2 seems to have the same problem with the DAC960 RAID controller as RedHat 9, we've also included a DAC drive fix in our procedure.

Step 1: Preparation

This procedure is not for the novice. If you find this document confusing, it would be best to find an experienced Linux user to help you through it.

To start, a proper build environment is required.

You'll need a computer with Fedora Core 2 installed on it and 12GB of free hard disk space.

The following packages will also need to be installed from the installation CD:

anaconda-10.0-5
anaconda-images-10-3
anaconda-help-9.92-1
anaconda-runtime-10.0-5

You'll need to be the super user (root) to proceed from here. Commands are assumed to be executed from a bash shell.

Find a location on your hard disk which has the necessary space and type the following commands:

export PYTHONPATH=/usr/lib/anaconda
export PATH="$PATH:/usr/lib/anaconda-runtime"
export FCBASE='pwd'
mkdir -p $FCBASE/fedora/i386

These commands will create a scratchpad area to work from and setup some convenience environment variables.

Next, download all eight of the installation ISOs from the Fedora Core project website into the $FCBASE/fedora directory.

Once the ISO files are downloaded, we will need to extract their contents into our working directory. You can do so with the following commands.

For each of the four installation CDs, do the following:

mount -o loop FC2-i386-disc1.iso /mnt ; cd /mnt ; tar -cf - * | ( cd $FCBASE/fedora/i386/ ; tar -xpf - ) ; cd $FCBASE ; umount /mnt
mount -o loop FC2-i386-disc2.iso /mnt ; cd /mnt ; tar -cf - * | ( cd $FCBASE/fedora/i386/ ; tar -xpf - ) ; cd $FCBASE ; umount /mnt
mount -o loop FC2-i386-disc3.iso /mnt ; cd /mnt ; tar -cf - * | ( cd $FCBASE/fedora/i386/ ; tar -xpf - ) ; cd $FCBASE ; umount /mnt
mount -o loop FC2-i386-disc4.iso /mnt ; cd /mnt ; tar -cf - * | ( cd $FCBASE/fedora/i386/ ; tar -xpf - ) ; cd $FCBASE ; umount /mnt

For each of the four source CDs do the following:

mount -o loop FC2-i386-SRPMS-disc1.iso /mnt ; cd /mnt ; tar -cf - * | ( cd $FCBASE/fedora/i386/ ; tar -xpf - ) ; cd $FCBASE ; umount /mnt
mount -o loop FC2-i386-SRPMS-disc2.iso /mnt ; cd /mnt ; tar -cf - * | ( cd $FCBASE/fedora/i386/ ; tar -xpf - ) ; cd $FCBASE ; umount /mnt
mount -o loop FC2-i386-SRPMS-disc3.iso /mnt ; cd /mnt ; tar -cf - * | ( cd $FCBASE/fedora/i386/ ; tar -xpf - ) ; cd $FCBASE ; umount /mnt
mount -o loop FC2-i386-SRPMS-disc4.iso /mnt ; cd /mnt ; tar -cf - * | ( cd $FCBASE/fedora/i386/ ; tar -xpf - ) ; cd $FCBASE ; umount /mnt

If all went well, you can erase the installation ISO files. (You may need the space!)

Step 2: DAC960 Fix

The following steps are required only if you are attempting to fix a booting issue with the DAC960 RAID controller. (The installation CD released by the Fedora Core project has a bug which does not allow Fedora Core 2 to be installed on some computers.)

Proceed to Step 3 if you wish to skip this step.

First, retrieve the latest Fedora Core 2 kernel source update from a Fedora Core mirror site. (At the time of writing this web page, it was: kernel-2.6.5-1.358.src.rpm)

Install the RPM by typing:

rpm -i kernel-2.6.5-1.358.src.rpm

Go to the /usr/src/redhat/SOURCES directory and modify the following line in the kernel-2.6.5-i586.config file:

# CONFIG_X86_UP_APIC is not set

Change it to:

CONFIG_X86_UP_APIC=y

Next, add the following line below this one and save the file:

CONFIG_X86_UP_IOAPIC=y

To maintain compatibility with RedHat's original boot disk, you need to edit the SPECS/kernel-2.6.spec file. Change the following line in the file:

%define rhbsys %([ -r /etc/beehive-root ] && echo || echo .'whoami')

to:

%define rhbsys %([ -r /etc/beehive-root ])

Go to the /usr/src/redhat directory and rebuild all of the kernel RPMs by typing:

rpmbuild -ba --target=i586 SPECS/kernel-2.6.spec

This will take a while, but if all goes well, there should be a new set of kernel RPMs in this directory:

/usr/src/redhat/RPMS/i586

Replace the BOOT kernel in the $FCBASE/fedora/i386/Fedora/RPMS directory with the corresponding update from the /usr/src/redhat/RPMS/i386 directory. To do this, type the following command:

cp /usr/src/redhat/RPMS/i386/kernel-2.6.5-1.358.i586.rpm $FCBASE/fedora/i386/Fedora/RPMS/.

Step 3: Other updates

If desired at this point, you can download any available updates from a Fedora Core mirror site and replace each RPM package in the $FCBASE/fedora/i386/Fedora/RPMS directory with its update.

Step 4: Cleanup

Many files will have been left around by the original CD creation process. These files will need to be removed with the following command:

find $FCBASE/fedora -name TRANS.TBL -exec rm -f {} \;

Step 5: Build

Fedora Core 2's anaconda utilities are somewhat broken, so you will need to download the following updated scripts and place them in the $FCBASE directory. (The remaining steps rely on these being present.)

If all has gone without a hitch, it's time to proceed to the build phase.

First, we need to re-generate the hdlist file. Do so with the following command:

$FCBASE/genhdlist $FCBASE/fedora/i386

Next, create our package order file by issuing the following command:

$FCBASE/pkgorder $FCBASE/fedora/i386 i386 | tee $FCBASE/fedora/pkgfile.'date +%Y-%m-%d'

Now, update the installation files by entering the following command:

$FCBASE/buildinstall \
--pkgorder $FCBASE/fedora/pkgfile.'date +%Y-%m-%d' \
--version 2 --product 'Fedora Core' --release 'Fedora Core 2' \
$FCBASE/fedora/i386

Step 6: CD creation

Now that we have completed the build, it's time to split up the files into their CDs and make new ISOs. The following commands will do the split and re-create the hdlist files for each CD:

RELEASE="Fedora Core 2 (Tettnang) with updates to $(date '+%Y-%M-%d %H:%m')"

rm -rf i386-disc[1-9]
splittree.py --arch=i386 --total-discs=8 --bin-discs=4 --src-discs=4 --release-string="$RELEASE" \ --pkgorderfile=$FCBASE/fedora/pkgfile.'date +%Y-%m-%d' \ --distdir=$FCBASE/fedora/i386 \ --srcdir=$FCBASE/fedora/i386/SRPMS --productpath=Fedora

rm -f $FCBASE/i386-disc1/Fedora/base/hdlist*
$FCBASE/genhdlist --withnumbers --fileorder \ $FCBASE/fedora/pkgfile.'date +%Y-%m-%d' \ $FCBASE/fedora/i386-disc[1234]

Finally, create a bash script with the commands listed below and execute it. This will create brand new modified ISO images, which you can use to install Fedora Core Linux!

#!/bin/sh

myname="Joe Blow <joe@joe.blow>"
bootimg="isolinux/isolinux.bin"
bootcat="isolinux/boot.cat"
distname="Tettnang"
distvers="2"
mkisopts="-R -J -T"
bootopts="-no-emul-boot -boot-load-size 4 -boot-info-table"
mydate="$(date '+%d %b %Y')"
mkisofs $mkisopts $bootopts \
-V "Fedora Core $distver ($distname) UPDATED Disk 1" \
-A "Fedora Coret $distver ($distname) update created on $mydate" \
-P "$myname" \
-p "$myname" \
-b "$bootimg" \
-c "$bootcat" \
-x lost+found \
-o "$distname"-i386-disc1.iso \
i386-disc1

for i in 2 3 4 ; do
mkisofs $mkisopts \
-V "Fedora Core $distver ($distname) UPDATED Disk $i" \
-A "Fedora Core $distver ($distname) update created on $mydate" \
-P "$myname" \
-p "$myname" \
-x lost+found \
-o "$distname"-i386-disc${i}.iso \
i386-disc${i}
done

for i in 1 2 3 4 ; do
mkisofs $mkisopts \
-V "Fedora Core $distver ($distname) UPDATED Disk $i" \
-A "Fedora Core $distver ($distname) update created on $mydate" \
-P "$myname" \
-p "$myname" \
-x lost+found \
-o "$distname"-SRPMS-disc${i}.iso \
i386-disc$(( $i + 3 ))
done