UML Builder Logo
Home Page/News
Running it
Known problems
Future plans
Help wanted

Command line
Developer - General
Developer - Profile

Useful stuff
Making your own UML RPMs

UML Builder

Making your own UML RPMs

Here is an easy way of making your User Mode Linux RPMs. Two reasons why you may want to do this:

  • you want to try UML versions inbetween or more recent than those on the normal rpm release cycle - for example if an important bug is fixed for you
  • you want a tailored configuration - for example particular file systems compiled in, or not as modules


You need to download uml-custom.spec (last modified 7th December 2003). You can edit the file to request any version of UML (2.4.x, 2.5.x and 2.6 based releases).

Your system needs to be able to build rpms and C programs. This generally means you need to have the rpm-build and gcc packages already installed.

You need to have the developer libraries available that UML depends on to compile. This is currently readline-devel.

First time setup

You should do your building as a non-root user. You will need to tell rpm where to do stuff. In this example I am going to use a subdirectory of my home directory - /home/rogerb/rpm

Create $HOME/.rpmmacros like the following, replacing the directory with where you want the output files to appear, and putting your own details in as the packager.

%_topdir /home/rogerb/rpm
%packager Roger Binns <>

Now create the rpm directory structure:

   $ cd /home/rogerb
   $ mkdir rpm
   $ cd rpm

Building the RPM

You need to decide how you want your UML kernel configured. In particular, options need to be chosen for what filesystems are included, if they are built as modules, some networking configuration etc. Use this table to decide:
To do this Use this option
Default configuration No options
Copy the configuration from a file CONFIGFILE=filename
Copy the configuration from your currently installed UML (requires UML 2.4.18-16um or greater - uses linux --showconfig to obtain the configuration) CONFIGCOPY=yes
Interactively define the configuration yourself CONFIG=xconfig - this will give you a gui configuration. You can use menuconfig instead if you don't have X running.

Note: These options can be combined. For example if you would like to copy your existing UML configuration, but also edit it, you can use CONFIGCOPY=yes CONFIG=xconfig.

You can now build the rpm. Using the above example, you can build your rpm like this:

    $ CONFIGCOPY=yes CONFIG=xconfig rpmbuild -ba uml-custom.spec

Installing it

When the rpm is fully built, it will appear below $HOME/rpm/RPMS or whatever directory you defined in $HOME/.rpmmacros.

If you already have a standard UML rpm installed, it must be uninstalled first as root.

   # rpm -e user_mode_linux

You can now install your new UML rpm as root.

   # rpm -i /home/rogerb/RPMS/i386/UML-2.4.18.custom.23um-1.i586.rpm

The last part of the filename will match the versioning information in the uml-custom.spec file.

Making changes and updates

If you want to produce another RPM with configuration changes, you should increment release in the spec file. This will then change the number on the end of the rpm version (for example the above one will become UML-2.4.18.custom.23um-2.i586.rpm


If you don't increment the release number, then rpm will refuse to upgrade. You can force rpm to install a new rpm even if it has the same release number, or even if it is a downgrade by supplying the --force flag. For example:

    # rpm -U --force rpm

I recommend you change host filesystem (hostfs) configuration setting to be yes or no, not a module (module is the default setting for some UML versions).

You may wish to change the configuration control settings in the spec file instead of supplying environment variables.

This spec file will automatically download the kernel and required sources files if they are not already in the sources directory. The kernel source is 25MB so it will take a long time over a modem.

When newer versions of UML come out, simply change the version numbers as appropriate in the .spec file.

You should change the customname setting in the spec file to be your login or similar name. This is so you can distinguish who made that particular RPM or UML (or why it was made). The value of the setting becomes part of the RPM filename, as well as the kernel version. You can see the kernel version by running linux --version on the host or uname -r inside a UML session.

A source rpm is also produced and will be below .../rpm/SRPMS. If you want to rebuild it using the exact same settings, use

   $ rpmbuild --rebuild UML-2.4.18.custom.23um-1.src.rpm

You can't do two concurrent builds of the same rpm (even different if they are different versions) as they will use the same build directory and stomp on each other.

SourceForge Logo         Valid HTML 4.01!