Create customized RedHat 8 installation disk 

ls psyche-i386-disc* | xargs -n 1 /usr/lib/anaconda-runtime/checkisomd5
cd /mnt/iso1
mkdir -p /export/linux/8.0/en/os/i386
find . | grep -E '/(README|RELEASE-NOTES|fips[12]|images/|dosutils/|TRANS.TBL)'
find . | grep -Ev '/(README|RELEASE-NOTES|fips[12]|images/|dosutils/|TRANS.TBL)' | cpio -v pdm !$
cd /mnt/rpms-org
 ln -s ../iso1/RedHat/RPMS/*.rpm .
 ln -s ../iso2/RedHat/RPMS/*.rpm .
 ln -s ../iso3/RedHat/RPMS/*.rpm .

poldek —sdir=.

cd ../rpms-pck rpm -qa | sed 's|^|ln -s ../rpms-org/|; s/\s*$/*.rpm ./' !! | sh

# remove any none-existing rpms echo **.rpm rm !$

tar -h -czf ../rpms-pck.tgz *
cd /export/linux/8.0/en/os/i386/
cd RedHat/RPMS/
rm *
tar -xzf /mnt/rpms-pck.tgz
rpm -ivh anaconda-runtime-8.0-4.i386.rpm
cd /export/linux/8.0/en/os/i386
mk_iso
cdecord blank=fast
cdrecord dev=/dev/sg0 -multi -eject -v speed=4 ../RedHat-8.0.iso
cdrecord -msinfo dev=/dev/sg0
/usr/lib/anaconda-runtime/checkisomd5 /dev/cdrom
file ~/histories/kickstart/customize/ks8.cfg
cp ~/histories/kickstart/customize/ks8.cfg /dos/drv_a1/rh8/
cp ../RedHat-8.0.iso /dos/drv_a1/rh8/isoc/

Notes 

To check 
dumphdrlist.py /usr/share/comps/i386/hdlist | sort > /export/baks/hdlist.o1
dumphdrlist.py RedHat/base/hdlist | sort > /export/baks/hdlist.n1
comm -3 /export/baks/hdlist.o1 /export/baks/hdlist.n1
To see how RedHat made its boot CD 
strings /export/rh8/iso/psyche-i386-disc1.iso | grep 'mkisofs.*Red Hat Linux'

Comp group definition 

Sample text-internet group 

<group>
  <id>text-internet</id>
  <name>Text-based Internet</name>
  <name xml:lang="it">Internet text-based</name>
  <description>This group includes text-based email, Web, and chat clients.  These applications do not require the X Window System.</description>
  <description xml:lang="it">Questo gruppo include e-mail, Web e chat client text-based. Tali applicazioni non richiedono il sistema X Window.</description>
  <uservisible>true</uservisible>
  <default>true</default>
  <grouplist>
    <groupreq>base</groupreq>
  </grouplist>
  <packagelist>
    <packagereq type="default">fetchmail</packagereq>
    <packagereq type="optional">epic</packagereq>
    <packagereq type="optional">lynx</packagereq>
    <packagereq type="default">mutt</packagereq>
    <packagereq type="optional">ncftp</packagereq>
    <packagereq type="optional">pine</packagereq>
    <packagereq type="default">slrn</packagereq>
  </packagelist>
</group>

comps.xml Doc 

http://rhlinux.redhat.com/anaconda/comps.html

The comps file is then broken into several different sections. The first is the group lists, which describe the different groups (or components) available for selection during a Red Hat Linux installation. This includes group names, descriptions and lists of included packages. The second section is a group hierarchy. This defines an ordering of the groups by breaking them down into categories. Finally, there is a section with the list of packages included and their resolved dependencies.

The Group List 

A group has quite a few different attributes which are required for proper operation. The following is a list of attributes and what they're used for. Groups are defined within the <group></group> tag.

A simple group definition:

<group>
 <id>somegroup</id>
 <name>Sample Group</name>
 <default>true</default>
 <uservisible>false</uservisible>
 <description>This is a silly sample group</description>
 <packagelist>
   <packagereq type="mandatory">bash</packagereq>
   <packagereq type="default">cpio</packagereq>
 </packagelist>
</group>

Update comps.xml file with getfullcomps.py 

Newsgroups: comp.os.linux.setup
Date: 28 Nov 2002 02:44:49 -0800

I have copied several rpms to the RedHat 8.0 installation tree. Next i started genhdlist to update the hdlist and hdlist2 files. They were updated successfully. To update the comps.xml, i started getfullcomps.py and the script gave me the following errors:

[root@lnx024071144 comps]# /usr/share/comps-extras/getfullcomps.py
comps.xml \ /linux/redhat80 i386 >> comps-tmp.xml
Traceback (most recent call last):
  File "/usr/share/comps-extras/getfullcomps.py", line 187, in ?
    main()
  File "/usr/share/comps-extras/getfullcomps.py", line 39, in main
    hdlist = readAndMergeHeaderList(path, arch)
  File "/usr/share/comps-extras/getfullcomps.py", line 22, in
readAndMergeHeaderList
    hdlist = rpm.readHeaderListFromFile("%s/%s/RedHat/base/hdlist" %
rpm404.error: (2, 'No such file or directory')

I don't understand why i get the rpm404.error: (2, 'No such file or directory'), because the hdlist-file exists in the directory "/linux/redhat80/RedHat/base".

Is there anybody who has the same error or can me explain where the problem is?

Update comps.xml file with getfullcomps.py 

sorry, i have found the error. Getfullcomps.py expects a directorystructure like /absolute_path_to_toplevel_dir/i386/RedHat….!!! This is exact my error. We had no directorystructure with i386!!

Andi

packages associated with "server", "desktop", etc? 

Newsgroups: linux.redhat.install
Date: 2002-10-20 18:43:13 PST
>Is there an easy way, besides invoking the install process and writing
>them down, to discover exactly what packages are associated with the
>install type "laptop", "desktop", "server", etc?
>this is for Red Hat 8.0.

You can find this information in the /RedHat/base/comps.xml file on CD #1. It's a little harder to eyeball than the older format, but you should be able to parse it without too much trouble.

If you want to create a custom installation, you can install the redhat-config-kickstart package and use that program to make an anaconda script (to be used on a boot floppy or by an NFS server, for instance) that will perform the desired installation. If you need to add packages to that list you can add them to the %packages section after the groups you've selected. If you're unsure if the packages you're adding manually are going to work, you can try doing "rpm -qp —requires <file.rpm>" to see if you can resolve them.

I find that a good way of doing this is to get a box completely set up the way I like, with all the packages I want installed (you should keep to only packages contained on the CD's or install tree). Then go to a prompt and do:

rpm -qa --queryformat='%{NAME}\n' > /tmp/package-list

The contents of that package-list file can be substituted for the %packages part of the anaconda script and the dependencies should all work, since you were able to install them in the first place. You will find additional information about anaconda and Kickstart in the Red Hat Reference Guide in Part II, Chapters 6 and 7. Good luck and have fun.

Paul W. Frields, RHCE

genhdlist 

Newsgroups: linux.redhat.install
Date: 2002-10-27 17:21:53 PST
> Very good article indeed. I'm wondering, can you build the genhdlist in
> RH8.0? Mind you, I managed to get it compiled but failed when using it...

Hmm. I didn't try compiling genhdlist — I simply installed the anaconda-runtime RPM per usual, and the binary is installed in /usr/lib/anaconda-runtime/ for your use. See if that helps.

Paul W. Frields, RHCE

chroot or not 

http://www.advogato.org/person/thomasvs/diary.html?start=10

Now, %post executes in a chroot'ed environment equivalent to your newly installed system. So there's no way to get at the file you want to install. But you can run %post without the chroot'ed environment by using —nochroot. Only problem is, you cannot go back to the chroot'ed environment (I thought the chroot command might do the trick, but that either starts a new shell interactively, which is bad of course, or allows you to execute the one command you put behind it).

So what do you do when none of the solutions is aesthetically pleasing, and a little voice in the back of your head says : Wouldn't it be nice if you could just have two %post sections, one labeled "%post" and another labeled "%post —nochroot" and just put the right commands in the right section ?

And you think to yourself, yeah, that would be nice, but no way would that work. I'm sure the Red Hat engineers didn't code to allow that, and otherwise I would have come across that on Usenet and in the docs.

quick chroot question - ks.cfg 

https://listman.redhat.com/pipermail/valhalla-list/2002-August/011376.html

Fri, 2 Aug 2002 09:23:08 +0800

> Can you turn nochroot on and off during a post kickstart install? I am
> currently install from a custom 7.3 CD rom. I can't figure out what the
> cdrom is chroot to. I know /mnt/sysimage is already chrooted to /.
>
>
> # The following line will not work because /mnt/source will only work in a
> non-chrooted envirnment, /export is chrooted
> #cp -R /mnt/source/builder /export >>/mnt/sysimage/root/post.log
> # /dev/cdrom will not work, not sure what the cdrom is called in a chrooted
> environment
> #cp -R /dev/cdrom/builder /export >>/mnt/sysimage/root/post.log
>
> this section currently works,
> %post --nochroot
> cp -R /mnt/source/builder /mnt/sysimage/export  (/mnt/source is the cdrom)
>
>
> however, most the post install scripts work with the default chroot
> environment.
> ie:
> %post
> chgrp
> useradd

Try

 chroot /mnt/sysimage /bin/bash <<?
assorted commands
?

You can also chroot individual commands.

John valhalla-list at redhat.com

Generate MD5 for modified discs? 

http://www.geocrawler.com/archives/3/84/2002/5/50/8610709/

> How are the md5/whatever that the installer uses to check the Redhat
> discs generated an embedded in the ISO images?
> > For instance I want to generate an image with my own packages and then
> make sure the integrity checker succeeds.

Found my answer on the anaconda-devel list it's in the anaconda-src/utils/ with checkisomd5 and implantisomd5

Michael Best

mkCDrec 

http://mkcdrec.ota.be/project/installation.html

When mkCDrec has finished making the disaster recovey CD-ROM it implants a checksum into the ISO9660 image. To check the integrity of the ISO9660 image or CD-ROM use the following command (build in mediacheck/ directory):

# checkisomd5    CDrec.iso
or
# checkisomd5   /dev/cdrom
Read     0 MB
8852a5d88200444987f429bc527a8010
8852a5d88200444987f429bc527a8010
Md5sums match.

The advantage is there is no need to write down the md5 checksum anymore. It is always burned onto the image itself. This technique was first used on RedHat's installation CD-ROMs.

How do you make a Bootable DVD to install Linux? 

Newsgroups: linux.redhat.install
Date: 2002-10-25 10:24:38 PST
> 1.  Are there any documents that will help me creat a Bootable DVD?

One of my collegues forwarded me this. Just thought I would share:

RH 8.0 has changed some things.

> First is ISOLINUX,  this is what RedHat is using to boot from CD.
>
> Just found this...
> http://www.linuxcompatible.org/article.php?sid=252
> Explains how to step by step.  Looks like it is just what you need.

The Bluester

How to make your own RedHat 8.0 DVD 

http://www.linuxcompatible.org/article.php?sid=252

Date: 2002-10-03 12:37:52

Jay Berkenbilt has posted a guide on the Red Hat 8.0 mailinglist about making your own RedHat 8.0 DVD from the CD ISO images:

RedHat is not presently offering an ISO image of the DVD for download.

After reading some of the anaconda source code, I have figured out how you can make your own DVD from the CD ISO images. I've done this, written it to a DVD+RW disc, had it pass its Media check, and successfully installed from it.

The idea is simple, which is a testament to the flexibility of Red Hat's installation system. There's a file on the root of each CD called .discinfo that contains information including which discs' contents are represented. The CDs each contain only a single number here, but the installation software will accept a comma-separated list of numbers. The sequence of commands below will create an ISO image that consists of the combined contents of the five discs
the documentation disc (in a docs subdirectory) and is bootable and suitable for being installed from. If you don't care about docs, omit the docs/=Psyche-docs argument, and don't bother with the docs ISO. If you don't care about sources, omit the SRPMS/= arguments and dispense with discs 4 and 5.

These instructions require you to have enough disk space for the resulting ISO image, but if you have a DVD burner and don't care about installing the media checksum so that you can test the media from install (not really that important if you have verified the checksums of the original images, unless you're concerned about errors resulting from the actual DVD creation process itself), you can pipe the output of mkisofs directly to your burning software and not worry about the intermediate disk space.

So here are the steps. These steps create a DVD image that is usable from a Unix system. Add the -J and -T flags to the mkisofs command if you want something that you can read from Windows as well. Add -V "Label" if you want to create a volume label.

  1. Go to a place on your drive with about 3.5 GB free. This is needed for the final ISO image only. You'll need a 2.4 kernel to create a file> 2 GB. If you're running Red Hat, This works on a 7.1 system or newer.

  2. Create directories on which to mount the ISO images using loop device mounts:

    mkdir Psyche-i386-disc{1,2,3,4,5} Psyche-docs
  3. Mount the ISO images using a loop device mount:

    mount -o ro,loop .../Psyche-i386-disc1.iso Psyche-i386-disc1
    mount -o ro,loop .../Psyche-i386-disc2.iso Psyche-i386-disc2
    # etc. -- repeat for the remaining discs that you want
    # Replace ... with the path to your ISO images.
  4. Copy the isolinux directory and the .discinfo from disc1 to the current directory:

cp -a Psyche-i386-disc1/isolinux Psyche-i386-disc1/.discinfo .

  1. Edit the .discinfo file, replacing the fourth line with 1,2,3,4,5 if you are creating an image with all five discs or with 1,2,3 if you are just using the three install discs.

  2. Create the iso image. I'm separating this mkisofs command into multiple lines ending with for clarity. You can type it that way or as a long command. I explain this command at the end.

    mkisofs -o Psyche-i386-dvd.iso
    -b isolinux/isolinux.bin -c isolinux/boot.cat
    -no-emul-boot -boot-load-size 4 -boot-info-table
    -R -m TRANS.TBL
    -x Psyche-i386-disc1/.discinfo -x Psyche-i386-disc1/isolinux
    -graft-points Psyche-i386-disc1 .discinfo=.discinfo isolinux/=isolinux
    RedHat/=Psyche-i386-disc2/RedHat RedHat/=Psyche-i386-disc3/RedHat
    SRPMS/=Psyche-i386-disc3/SRPMS SRPMS/=Psyche-i386-disc4/SRPMS
    SRPMS/=Psyche-i386-disc5/SRPMS docs/=Psyche-docs
  3. (Optional) If you want to create a media checksum for the installation software to look at when you do a media test during install, then following these additional steps:

  4. Install the anaconda source rpm located on disc5 and cd /usr/src/redhat

  5. Comment out the BuildPreReq line in SPECS/anaconda.spec

  6. Run rpmbuild -bp SPECS/anaconda.spec

  7. Go to BUILD/anaconda-8.0/isomd5sum

  8. Run "make"

  9. Run ./implantisomd5 …/Psyche-i386-dvd.iso (where … is replaced with the path to your new ISO image). This step will take several minutes and not provide any feedback while it runs.

Now burn the resulting ISO image to a DVD.

Here's the mkisofs command explained:

# Write the output to Psyche-i386-dvd.iso
mkisofs -o Psyche-i386-dvd.iso

# Set up the DVD to be bootable using an El Torito boot image.
# This comes from the RELEASE_NOTES file on disc 1.
-b isolinux/isolinux.bin -c isolinux/boot.cat
-no-emul-boot -boot-load-size 4 -boot-info-table

# Use Rock ridge extensions (to support long file names, etc.).
# Exclude all TRANS.TBL files on the original disc. If you want
# to access this disc from Windows, add -J to create Joliet
# extensions and -T to create new TRANS.TBL files in place of
# the ones you're omitting.
-R -m TRANS.TBL

# Omit the .discinfo and isolinux files from disc1
-x Psyche-i386-disc1/.discinfo -x Psyche-i386-disc1/isolinux

# Use Psyche-i386-disc1 (minus above exclusions) as the root.
# Graft the .discinfo and isolinux directories from the current
# directory to .discinfo and isolinux on the new disc. Also
# graft in the RedHat and SRPMS directories from the remaining
# discs. Include the entire contents of the docs disc in the
# docs subdirectory.
-graft-points Psyche-i386-disc1 .discinfo=.discinfo isolinux/=isolinux
RedHat/=Psyche-i386-disc2/RedHat RedHat/=Psyche-i386-disc3/RedHat
SRPMS/=Psyche-i386-disc3/SRPMS SRPMS/=Psyche-i386-disc4/SRPMS
SRPMS/=Psyche-i386-disc5/SRPMS docs/=Psyche-docs

I'd be interested to find out if someone who has a DVD-R or DVD+R can comment on the relative performance of this DVD with the CD. If I boot off of the CD, it takes 50 seconds between hitting enter the first time and being at the RedHat 8.0 graphical install screen. If I boot from the DVD+RW that I created, it takes over two minutes.

Jay Berkenbilt http://www.ql.org/q/