Linux: How to Update and Rebuild CentOS 4 Installation CDs
Question: I found your Fedora Core 2 update page. How can I create new installation CDs for CentOS 4 with the updates already included?@H_404_7@
Answer: As with Fedora Core 2,CentOS comes with all of the tools you need to accomplish this. To be consistent,we've provided our procedure broken down into 5 steps below. (This procedure assumes CentOS 4.1 since this is the latest release at the time of writing.)@H_404_7@
Since CentOS 4 seems to have the same problem with the DAC960 RAID controller as Fedora Core 2,we've also included a DAC drive fix in our procedure.@H_404_7@
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.@H_404_7@
To start,a proper build environment is required.@H_404_7@
You'll need a computer with CentOS 4 installed on it and 10GB of free hard disk space.@H_404_7@
You'll need to be the super user (root) to proceed from here. Commands are assumed to be executed from a bash shell.@H_404_7@
The following packages (As well as any packages these require.) will also need to be installed from the installation CD:@H_404_7@
anaconda-10.1.1.19-1 anaconda-help-10.1.0-1 anaconda-runtime-10.1.1.19-1
Find a location on your hard disk which has the necessary space and type the following commands:@H_404_7@
export PYTHONPATH=/usr/lib/anaconda export PATH="$PATH:/usr/lib/anaconda-runtime" export BUILDBASE='pwd' mkdir -p $BUILDBASE/linux/i386/SRPMS export ARCH=i386
These commands will create a scratchpad area to work from and setup some convenience environment variables.@H_404_7@
Next,download all four of the installation ISOs from the CentOS website into the $BUILDBASE/linux directory.@H_404_7@
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. (You should place these into a script and execute it.)@H_404_7@
#!/bin/bash for iso in CentOS-4.1-i386-bin1of4.iso CentOS-4.1-i386-bin2of4.iso CentOS-4.1-i386-bin3of4.iso CentOS-4.1-i386-bin4of4.iso; do mount -o loop $BUILDBASE/linux/$iso /mnt ; cd /mnt ; \ tar -cf - * | ( cd $BUILDBASE/linux/i386/ ; tar -xpf - ) ; \ cd $BUILDBASE ; umount /mnt done
If all went well,you can erase the installation ISO files. (You may need the space!)@H_404_7@
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 CentOS has a bug which does not allow CentOS 4 to be installed on some computers.)@H_404_7@
Proceed to Step 3 if you wish to skip this step.@H_404_7@
First,retrieve the latest CentOS 4 kernel source update from a CentOS mirror site. (At the time of writing this web page,it was: kernel-2.6.9-11.EL.src.rpm)@H_404_7@
Install the RPM by typing:@H_404_7@
rpm -i kernel-2.6.9-11.EL.src.rpm
Go to the /usr/src/redhat/SOURCES directory and modify the following line in the kernel-2.6.9-i586.config file:@H_404_7@
# CONFIG_X86_UP_APIC is not set
Change it to:@H_404_7@
CONFIG_X86_UP_APIC=y
Next,add the following line below this one and save the file:@H_404_7@
CONFIG_X86_UP_IOAPIC=y
Go to the /usr/src/redhat directory and rebuild all of the kernel RPMs by typing:@H_404_7@
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:@H_404_7@
/usr/src/redhat/RPMS/i586
Replace the kernel in the $BUILDBASE/linux/i386/CentOS/RPMS directory with the corresponding update from the /usr/src/redhat/RPMS/i586 directory. To do this,type the following command:@H_404_7@
cp /usr/src/redhat/RPMS/i586/kernel-2.6.9-11.EL.i586.rpm $BUILDBASE/linux/i586/CentOS/RPMS/.
Step 3: Other updates
If desired at this point,you can download any available updates from a CentOS mirror site and replace each RPM package in the $BUILDBASE/linux/i386/CentOS/RPMS directory with its update.@H_404_7@
Step 4: Build
First,we need to re-generate the hdlist file. Do so with the following command:@H_404_7@
genhdlist $BUILDBASE/linux/i386
Next,create our package order file by issuing the following command:@H_404_7@
pkgorder $BUILDBASE/linux/i386 i386 | tee $BUILDBASE/linux/pkgfile.'date +%Y-%m-%d'
Now,update the installation files by entering the following command:@H_404_7@
buildinstall --comp dist-4.1 --pkgorder $BUILDBASE/linux/pkgfile.'date +%Y-%m-%d' \ --version 4.1 --product 'CentOS' --release 'CentOS 4.1' \ $BUILDBASE/linux/i386
Step 5: 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:@H_404_7@
RELEASE="CentOS 4.1 with updates to $(date '+%Y-%M-%d %H:%m')" rm -rf $BUILDBASE/linux/i386-disc[1-8] splittree.py --arch=i386 --total-discs=8 --bin-discs=4 --src-discs=4 --release-string="$RELEASE" \ --pkgorderfile=$BUILDBASE/linux/pkgfile.'date +%Y-%m-%d' \ --distdir=$BUILDBASE/linux/i386 \ --srcdir=$BUILDBASE/linux/i386/SRPMS --productpath=CentOS rm -f $BUILDBASE/i386-disc1/CentOS/base/hdlist* genhdlist --withnumbers --fileorder \ $BUILDBASE/fedora/pkgfile.'date +%Y-%m-%d' \ $BUILDBASE/linux/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 CentOS Linux!@H_404_7@
(You will need to run the following script from the $BUILDBASE/linux directory.)@H_404_7@
#!/bin/sh myname="Joe Blow <joe@joe.blow>" bootimg="isolinux/isolinux.bin" bootcat="isolinux/boot.cat" distname="CentOS" distvers="4.1" mkisopts="-R -J -T" bootopts="-no-emul-boot -boot-load-size 4 -boot-info-table" mydate="$(date '+%d %b %Y')" mkisofs $mkisopts $bootopts \ -V "CentOS $distver ($distname) UPDATED Disk 1" \ -A "CentOS $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 "CentOS $distver ($distname) UPDATED Disk $i" \ -A "CentOS $distver ($distname) update created on $mydate" \ -P "$myname" \ -p "$myname" \ -x lost+found \ -o "$distname"-i386-disc${i}.iso \ i386-disc${i} done
@H_404_7@
@H_404_7@
https://www.techonthenet.com/linux/centos4_update.PHP @H_404_7@