How to prepare anaconda updates image for Red Hat Enterprise Linux and Fedora

Anaconda is the installer tool for Red Hat Enterprise Linux and Fedora. This tutorial is applicable for their derivatives like CentOS and Scientific Linux also. This tutorial empowers you to fix the bugs or missing features in installer without waiting for Red Hat. The update image you generated is used while installing.

Anaconda update image involves updated files from anaconda itself and/or its dependents. In my case I take kudzu as dependent. BTW kudzu is a hardware detection tool. i.e., I am going to patch two files, one from anaconda package and another one from kudzu package. In your case instead of anaconda/kudzu it may be some thing else. My system is Red Hat Enterprise Linux 5.7


1. Development packages should have been installed
2. The machine should be registered with RHN (Red Hat Network) using “rhn_register” tool.
3. To install build dependency, we need to install yum-utils.

# yum install yum-utils

1. Identify the version of anaconda and kudzu

# yum info anaconda
# yum info kudzu

Note down the version number.

2. Download the corresponding version of source RPMs from Red hat official repository and install the build dependency with following commands.

# yum-builddep anaconda-
# yum-builddep kudzu-

Install the source rpms as shown below

# rpm -ivh anaconda-
# rpm -ivh kudzu-

3. Here is how to build the anaconda with your code changes. The same step is to be repeated for kudzu also.

# cd /usr/src/redhat/SOURCES
# tar jxvf anaconda-
# cp -R anaconda-
# cd anaconda-

—— Edit the source code as you want to patch. Don’t forget to upload this patch to upstream  ——-

# cd /usr/src/redhat/SOURCES
# mv anaconda-
# tar jcvf anaconda- anaconda-
# rpmbuild -ba ../SPECS/anaconda.spec

Build should be successful here. We are interested in object files which has our changes. The file may be shared object (.so) file, binary or python script. Let us assume that in my case it is It should be available under BUILD/anaconda- directory. I assume that in is from kudzu build.

It is good to have a patch of what you have changed. Here is how I generated a patch file.

# diff -rup anaconda- > anaconda-

4. Creating anaconda update disk image

# dd if=/dev/zero of=anaconda-update.img bs=512 count=2880
# losetup `losetup -f` anaconda-update.img

# losetup -a

From the the above command identify the loop device for update image, let us say it is /dev/loop1. It is time to format it.

# mkfs.ext2 /dev/loop1

# mount -o loop anaconda-update.img /mnt
# cp /mnt
# cp /mnt
# umount /mnt

You can use floppy or USB pen drive to prepare this image disk. In my case it is /dev/sdb.

# dd if=anaconda-update.img of=/dev/sdb bs=512 conv=sync
# eject /dev/sdb

5. Using update disk

Plug in this update pen drive or floppy in your installation target machine. Append “linux updates” to grub’s kernel command line while booting from Live CD to install. If you a third party driver disk also, then it is “linux dd updates”.





Share this post

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *