Creating the Distribution
Now that you have all of the RPMs you want installed, updated and free of dependency issues, we are now ready to create our distribution. First, we stored the contents of RHEL WS CD1 in /home/ublinux/i386 (for the architecture of the machine). When we copied it we made sure to include every file, especially a .discinfo file which is necessary for the installer to load. Adding CDs 2-4 is unneccesary, as the only pertinent information they contain is additional RPMs. We then remove the following:
We will also copy the following files out to edit at a later time. These are the Anaconda image and the Bootdisk image files. If you do not wish to alter these, it is safe to ignore this step.
We are now ready to begin. First, we need to install anaconda-runtime and its packages. These will provide the scripts we need to build our own distro. These RPMS are included in RHEL WS 3 Update 2.
anaconda-9.1.2-2.RHEL.i386.rpm (Disc 4)
Make sure these are all installed on the build system.
cp /mnt/iso3/RedHat/RPMS/anaconda-* /home/ublinux/
Now, let's copy all the RPMs we want to install in our distro.
To prevent any errors with the subsequent scripts, we'll run the anaconda-runtimes scripts as root.
Then, to prepare to run the anaconda-runtime scripts, we'll need to set the PYTHONPATH variable. If we don't do this, some scripts (such as pkgorder) will not be able to load required modules.
The first step in running these scripts is to regenerate the hdlist files from our current set of RPMS.
Please note the script requires the FULL path of the build directory. Using a relative path (such as /usr/lib/anaconda-runtime/genhdlist i386) will cause the script to fail with a "No such file or directory" error.
Next, we run a script to determine the order in which the packages will be installed, and we store that information in a file for later use.
Please note that if you forget to set the PYTHONPATH variable, you will receive the following error:
If we wanted to generate our own Anaconda, we could do so with anaconda-runtime's buildinstall script. However, we had some trouble doing that, namely we'd get an error stating
even though the PYTHONPATH variable was already set. It was later concluded that the reason we received this error was that buildinstall believed that we were trying to build a non-WS3 distro on a WS3 machine. While this was not the case, it's possible that because we used a different RPM list than WS3, the script became confused and failed. Without proper documentation for these anaconda-runtime scripts, we were unable to resolve this issue. Instead, we opted to modify stage2.img directly. This is documented in "Customizing Anaconda".
Next, we need to split the distro into sizes friendlier for CD media. With UBLinux 2, we used the splitdistro script in conjunction with build_distro. However, with this version of anaconda-runtime, splitdistro has made way for splittree.py, and has made the build_distro obsolete. To use splittree.py, we run the command
Please note that you need to specify the --src-discs and --srcdir even if you don't intend to have any source discs in your distro.
We also received an error occasionally (though I was unable to replicate it for the purposes of this documentation). Most errors I received were due to extra carriage returns created by cutting and pasting the command, which were resolved by typing it out instead.
Please note that UBLinux 3.0 is on three CDs. If your distribution is on fewer (or more) CDs, please keep this in mind for the following commands, which are executed on every CD.
The CDs will be in folders inconveniently marked as -disc1, -disc2, -discX, etc, which makes them slightly difficult to target (often being misinterpreted as command line arguments). So it's a good idea to resolve this first
The last command that needs to be done is to regenerate the hdlist files one more time, now that the RPMS are spread across multiple CDs. This will also allow hdlist to take into account the current package order.
There you have it. You should now have a working customized distro of RHEL WS 3, if you have no intention of altering the bootdisk and anaconda. If this is the case, move forward to "Creating the Kickstart".
For UBLinux 3, however, we wanted to change all of the Red Hat images. We started first with "Editing the Boot Disk".
Back to Technical Documentation index
Send Questions and comments to firstname.lastname@example.org.Last Modified 9/02/04 1:16pm