Rolling Your Own Fedora (Linux) DVD

There are several reasons why you would roll your own Fedora DVD. For me, it makes installation painless and easy with fully updated packages and third-party packages that Fedora dare not include in the distribution.

Here’s how I do it:

I usually would test a new distribution using a virtual machine. In the case of Fedora 12, I used KVM in Fedora 10 to test it.

During installation, I choose all the packages that I really care about. This includes the full GNOME and KDE, development tools, productivity tools, yum tools and some servers like Apache, PostgreSQL, MySQL, etc … After installation, I immediately add the rpm-fusion repository for multimedia codecs and other packages that don’t ship with Fedora. You can download the repo rpm from here: Download and install this rpm.

The next step is very important because it allows you to keep the packages that you have downloaded otherwise they would be automatically deleted by yum. Modify /etc/yum.conf and set “keepcache=1“. Once properly configured you can now install multimedia packages such as vlc, xine, mplayer and codecs that allow MP3, AVI, MP4, etc…  playback. You may also download packages without having to install them using the utility called yumdownloader. To download a package including it’s dependencies, the command is:

yumdownloader –resolve <package name>

This will download the packages into your current working directory. By the way, you probably want to download the latest version of the packages already installed in your system:

yum -y update

The packages get stored under /var/cache/yum. If you can’t find the packages in there then you probably missed the step above where you modify yum.conf.

So now we roll our custom DVD. Mount the original Fedora DVD first so that we can copy the entire contents into our “working directory” /tmp/build:

mkdir /tmp/build   /tmp/mnt

mount -o loop fedora-dvd.iso /tmp/mnt

cd /tmp/mnt && cp -r . /tmp/build

Take note of the solitary dot in the command above. It’s between the “-r” and “/tmp/build”, surrounded by white space. The dot means “this directory”.

Copy all the updates into the Packages directory:

cd /tmp/build/Packages

find /var/cache/yum -name ‘*.rpm’ -exec cp {} . \;

You might also want to copy your third-party packages into the same directory.

Then we delete the older packages. Make sure you are in /tmp/build/Packages when you execute this command:

repomanage -o . | xargs rm -f

Inside /tmp/build is a directory called repodata. Here you will find a comps.xml file. In Fedora 12 this looks something like 612934712396128341923471.comps.xml or something similar to that. The comps.xml file defines the package groupings. We will need this to recreate the repository database like so:

cd /tmp/build

createrepo -g repodata/*.comps.xml  .

Take note of the trailing dot in that command. This command takes a while. In Fedora 12, it will need to process more than 2500 packages. When the process has completed, we will now have an updated “repodata” directory.

Now we build a bootable DVD:

cd /tmp/build

mkisofs -r -J -T -joliet-long -o /tmp/fedora-dvd.iso -V ‘Fedora Custom’ -b isolinux/isolinux.bin -c isolinux/ -boot-load-size 4 -boot-info-table -no-emul-boot .

Again, please take note of the trailing dot. The command simply means, build a new DVD iso image with a volume label “Fedora Custom” using all the files in this directory taking care to map files with very very long names and make sure that the iso image is bootable. This command takes quite some time to finish so get yourself something to drink.

That last command should now have created a file called /tmp/fedora-dvd.iso. Optionally you can now embed and MD5 checksum of your iso image:

implantisomd5 /tmp/build/fedora-dvd.iso

If you can’t execute the utility, make sure that you have it in /usr/lib/anaconda-runtime.

So there we have it. Use your favorite DVD utility to burn the iso image. I use k3b.

Just a tip: Test your new DVD image using a virtual machine to make sure that it actually works. You don’t want another DVD coaster.


3 thoughts on “Rolling Your Own Fedora (Linux) DVD”

  1. Hi thankyou very much for the article.

    I ran through this procedure with Fedora 13 x86_64.

    I did a yum update before pulling across the rpms from the /var/cache/yum, what I’ve noticed is that the /tmp/build/Packages contains a mixture of i686 and x64_64.

    Can you clarify are the i686 packages needed on a x86_64 machine?

    The reason I ask is that the dependency check fails on installation complaining that glibc-2.12-1.i686.rpm has a missing dep: glibc-common-2.12-1.i686.rpm which is not in the Packages directory, yum cache or the original iso, though the x86_64 rpm is there.


    1. Some packages can have both the i686 and x86_64 versions installed at the same time while others are mutually exclusive. In your case it looks like there is a dependency problem. Try installing the i686 version manually using yum to confirm if it is conflicting with the x86_64 package. This can be done by downloading the package and running

      yum localinstall

      If that works then you will have to add that package in the Packages directory and re-execute createrepo to resolve the dependency.

  2. Just the sort of guide to I’ve been looking for, to just the sort of process I want to carry out. Thanks sincerely

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s