Juggler's RedHat CD Kit, v1.2 ----------------------------- Overview: This is a set of shell scripts designed to make it easier for Virtually Anybody to create their own home-brew RedHat-style Linux CDs. I've been doing this myself for about 8 months now, and this is a summary of what I've learned in the process. The scripts and this documentation are in the public domain, use them as you please (but I do like getting credit, cash and/or feedback from my work, hint hint). The only difference between this release (1.2) and 1.1 is that this release is based on RedHat 6.2 and the Anaconda installer. It may work with RedHat 7.x as well, since they also use Anaconda. The scripts: mkcd This is the main script, it will write a bootable RedHat installation CD if you run it from the root directory of a CD image tree. It does not create an ISO image, but pipes output directly from mkisofs to cdrecord. Note that this is (supposedly) more error prone, but has always worked well for me and lets me make more efficient use of my HDD space. If you want an ISO image, do "man mkisofs" and modify the script. This script will automatically try to run update-cat from the /misc/ directory of the CD if it thinks the contents of the /RedHat/RPMS/ directory have changed. update-cat This updates the RedHat installer's package catalog, and does some other misc. housecleaning. You'll need to run this each time you update a package on your CD (e.g. by downloading an update). This script also generates MD5 sums of all files contained on the CD, for verification purposes. If you aren't interested in that feature (it's slow), just edit the script to disable it. check-md5s This program verifies the contents of a directory against MD5 sums contained in a named text file. Getting started: Get your CD writer all installed and working with cdrecord. People with IDE writers will need to use the Linux Kernel's SCSI-over-IDE emulation. Copy your RedHat CD to a directory on your hard drive, e.g. /cdimage/. Copy the three scripts to /cdimage/misc/. Take a look at them with a text editor, read the comments, ... Create your first CD: cd /cdimage ./misc/update-cat ./misc/mkcd 0,0,0 Requirements: The scripts use bash, awk, sed, md5sum, mkisofs and cdrecord. Make sure you're using a recent version of each. In addition, they assume the CD image has the following files and directories: /RedHat/RPMS/ /RedHat/base/hdlist /images/boot.img /misc/src/anaconda/utils/genhdlist This shouldn't be a problem if you're basing your CD on RedHat 6.2. If you're using something else your milage may vary. RedHat 5.2 and 6.0 kept genhdlist in /misc/src/install/. Simply edit update-cat if you need to change the path. How to update packages: To update packages on your CD image, simply delete the old one from /RedHat/RPMS/, and copy the new one into place. Then either run "misc/update-cat" manually, or trust that it will be done for you next time you create a CD with mkcd. Please note that this will only work if the packages have the same base-name, e.g. am-utils-6.0-3.i386.rpm can be replaced this way with am-utils-6.0.1s11-1.6.0.i386.rpm, but if you want to replace wu-ftpd with proftpd you'll also need to edit the /RedHat/base/comps file. Read the next section for more info. A few words about the RedHat installer: (Note: The following was discovered by expiramentation - I didn't ask RedHat or even bother to read their source code. But it seems to work anyway.) The RedHat installer uses files found in the /RedHat/base/ directory to determine what packages are available, and how to group them together by functionality (which packages are needed for e.g. "The X Window System", "Printer Support" or GNOME). The two files that seem to matter are /RedHat/base/comps and /RedHat/base/hdlist. The former groups packages by functionality, and the latter tells the installer what packages are available and contains some general information about each. The hdlist file is generated by the "genhdlist" program, which is located under /misc/src/anaconda/utils/. This is done automatically by the update-cat script. The comps file is a text file, which can be modified by any text editor. In 6.0, the file looked a bit like this: 0.1 0 Fun stuff gnome-games kdegames fortune 1 Base perl rhs-hwdiag This example defined two groups, "Fun Stuff" and "Base". The number preceding each group's name should be 0 or 1, depending on whether the group should be selected by default or not (0 = unselected, 1 = selected). Note: This seems to be more-or-less still valid for RedHat 6.2 and up - the idea is the same, but the format has changed a little bit. Groups can also look like this: 0 --hide Server xmailbox xrn trn This defines a group that is hidden - it doesn't show up on the list presented to the user during Custom installation. This is how RedHat defines what is installed in Server or Workstation installations. I'm not sure if just adding new groups like this to comps is enough for them to show up in the installer during the "Workstation/Server/Custom" dialog - let me know if you try it! One thing to take care of when defining groups, is to include all required packages (except perhaps for the ones in the Base group) - not just the ones directly related to the group's purpose. If any packages are missing, the user will get "unsatisfied dependancies" when he tries to install your group without manually selecting it's prerequisites. The "Fun stuff" group defined above is therefore quite broken - it should have included all the packages needed for the X window system, GNOME and KDE. In short, this knowledge should allow you to add or remove packages from the lists presented by the default RedHat installer, thus customizing your Homebrew RedHat CD even further. Hints: It's always a good idea to keep a changelog, describing what modifications you make to the CD. That way if something breaks you'll have a better chance of finding out what. It also gives the recipients of your CD a rough idea of what makes your CD different from RedHat's. Please respect peoples licenses. If your CD recorder has trouble fixating the CD after writing the data (this happens to me occasionally with CD-ROMs that are over 650MB), try fixating it manually by calling cdrecord again with the "-fix" argument. Don't just throw the CD away! Last time I checked, the genhdlist program was really stupid, and would crash if it saw any files in /RedHat/RPMS/ which weren't valid rpms. So keep that directory clean! This script creates a bootable CDROM, but that doesn't mean all computers will boot it - some will and some won't. This seems to depend mainly on how well (if at all) your BIOS supports the El Torito spec. The CD drive itself may also have something to do with it. It should be possible to enhance these scripts to allow upgrading a CD that has already been written, using cdrecord's multisession feature. Please let me know if you get this to work! It should be trivial to write a script that copies the contents of one RedHat CD to another, without using any hard-drive space (assuming you have both a CD-ROM drive and a CD writer in the same machine). Send me a copy if you do! RedHat (up to version 7, at any rate) is missing basic crypto tools such as ssh, pgp, gpg, Apache-SSL, lynx-ssl etc. Consider adding those to your distribution. Suggested reading: /usr/doc/HOWTO/CD-Writing-HOWTO Everything under /usr/doc/cdrecord-X.X/, man cdrecord. Everything under /usr/doc/mkisofs-X.X/, man mkisofs. Jussi's homebrew RedHat CD page has useful information and links to other pages with useful info. URLs for his page are: http://www.mpoli.fi/~jussi/homebrew_redhat_cd.html http://www.iwn.fi/~jt/cd Thanks: Big thanks to RedHat for a great distribution! Thanks to Jussi Torhonen (jt@iti.fi) for his "bootable homebrew RedHat CD-ROM" instructions (see above), which got me started. Thanks to all the people who helped with or bought copies of my mini-distro. Without their support I would never have gotten around to writing these scripts or this documentation. Author: Bjarni R. Einarsson (a.k.a. Juggler) Email: bre@netverjar.is WWW: http://bre.klaki.net/ The newest version of these scripts should always be available from http://bre.klaki.net/programs/. This is version 1.2. Feel free to let me know about any problems you run into. I don't promise to reply, but I might release a fixed version. :-) Disclaimer: These scripts come with no warantee or guarantee of any kind. Use them at your own risk. If they break you get to keep both pieces.