Adding new RPM packages to a fedora DVD with comps.xml

Adding packages to a custom fedora install is fairly easy, and well documented, with kickstart. But, kickstart is fairly inflexible. What if you wanted to add packages onto the install media and have them in the standard package selection dialog on install.

Disclaimer: I am sure there are better ways to do most of these steps. Please let me know what they are. This is simply what I did.

Make an updated dvd following the instructions from my blog, or using one of the scripts posted by others. Don’t remove your buildtree. To do this like me though, as stated there are probably better ways, a second computer or VMWare are going to make it easier.

Grab all of the new packages you want and their dependancies if they are not already on the dvd. To do this I actually made a stock install using an updated dvd. Then I grabbed the livna repo RPM (and kept it to place on the dvd) and installed it.

Install the yum-utils from extras

# yum install yum-utils

Use yumdownloader to grab the new packages you want. I wanted DVD playback, mp3 support, and the xine backend so I could use Windows codecs. This does not actually add the windows codecs, you could place them on the cd, though they are not available from livna.

# yumdownloader --resolve gstreamer-plugins-ugly totem-xine libdvdcss libdvdnav

This will download all the packages and there dependancies. Place the
packages in the RPMS direcotory in the build tree. I actually think they could
go anywhere on the CD, and perhaps an extras/RPMS and livna/RPMS directory would be sensible.

Now we need to edit the comps.xml file in Fedora/base/. The xml file is
massive. I found the most sensible way to edit was with a collapsable xml
editor. Netbeans can do this, and is a free download from Sun, I believe
there is an eclipse plugin as well.

Make a backup of comps.xml. After the last <group>, before the
first <category> add your new group entry. This is mine:

  <group>
    <id>livna-media</id>
    <name>Extra Media Support</name>
    <description>This group is selection of programs, out of the livna yum repository.  Livna contains packages whose patents stop them form being included in core or extras.</description>
    <default>true</default>
    <uservisible>true</uservisible>
    <packagelist>
      <packagereq type="default">gstreamer-plugins-ugly</packagereq>
      <packagereq type="default">totem-xine</packagereq>
      <packagereq type="default">mozilla-totem-xine</packagereq>
      <packagereq type="default">libdvdnav</packagereq>
      <packagereq type="default">libdvdcss</packagereq>
      <packagereq type="default">libdvdread</packagereq>
      <packagereq type="default">livna-release</packagereq>
    </packagelist>
  </group>

You also need to remove totem from comps.xml and the RPMS directory, it conflicts with totem-xine. In comps.xml you can replace each entry with an
entry for totem-xine

The type field can be: default, optional, mandatory or conditional. I
wanted them selected by default but not forced on the user, so defult was the
most sensible option.

I didn’t need to explicitly add the packages form extras to comps.xml, the
livna files depend on them, as long as they are in the repo, everything will
work.

You can add as many additional groups as you like, in fact livna-release
should probably be in a generic livna group.

Now this group will be installed by default, but to actually display it in
the menu and allow users to select or deselect it, we must add it to an
existing category or add a new category.

I chose to add a new livna category. At the end of the all of the category
entries, before </comps> add this:

  <category>
    <id>livna</id>
    <name>Livna</name>
    <description>Extra packages from the livna repository</description>
    <display_order>80</display_order>
    <grouplist>
       <groupid>livna-media</groupid>
    </grouplist>
  </category>

If you created additional extra groups add them to the grouplist. The
display_order I have set will make this the last category in the list.

Update the repo files:

# cd build_directory
# createrepo -u "media://1142397575.182477#1" -g Fedora/base/comps.xml .
# cd ..

Now we just need to make the ISO image, and embed the md5sum into it so it can be integrity checked on install

# mkisofs -R -J -T -v -no-emul-boot -boot-load-size 4 -boot-info-table \
-V "Fedora Core 5 (modified)" -b isolinux/isolinux.bin \
-c isolinux/boot.cat -x "lost+found" -o FC5-i386-dvd-modified.iso build_directory
# /usr/lib/anaconda-runtime/implantisomd5 FC5-i386-dvd-modified.iso

Now when you install select “Customize now” on Package selection, you
should see your custom category with all packages select.

1 Response to “Adding new RPM packages to a fedora DVD with comps.xml”


  • Awesome! This is exactly what I’ve been trying to do for days. Thanks for the great information! Last step for this customized RHEL5 iso I’m working on.

    Suggesting a few keywords for this page: remaster dvd build add rpms createrepo comps.xml rebuild

Leave a Reply