Making a bootable kickstart CD for Redhat 9.0

Updated: 27-December-2004
See section on Fedora below
One of the issues that came up with RedHat 9.0 is that you now need two boot diskettes to start a kickstart install. The first diskette (bootdisk.img) is booted, and from there you have have to load network drivers from the 2nd diskette (drvnet.img) before proceding with any sort of network install including kickstarts.

There are several drawbacks now to our diskette-based method of starting kickstarts:

  • diskettes are slow
  • diskettes will soon be provided only as an option
  • boot diskettes created on one machine are sometimes not readable on other machines due to drive head alignment
  • 1U servers do not often have diskette drives
While the boot diskette approach gave us an ability to put in one disk, start the kickstart, and then have the postinstall of that kickstart use the same diskette to create a bootable diskette, I think we should now go to a scheme whereby we boot from CD-ROM and then let the postinstall create the diskette.

Fortunately, Redhat provides a bootable CD image in /redhat/redhat90/images called "boot.iso". I created a CD-R disc from that, booted from it, entered "ks" at the resulting prompt, and successfully initiated a kickstart install.

Making a CD image

The next step was to edit the CD image to run "ks" automatically:

  • sudo mount -t iso9660 -o loop boot.iso /mnt
  • cd to /mnt and copy the isolinux directory to another location (such as $HOME/bootcd/cdimage)
  •  sudo umount /mnt
  • cd to where you copied "isolinux" -- for example
    cd /jo/fredrick/bootcd/cdimage/isolinux
  • sudo emacs isolinux.cfg
    .  We edit the isolinux.cfg file to
    change the first line "default linux" to "default ks".
    
  • cd ..
    (that is, cd to just above the isolinux subdirectory -- in our example, we are then in /jo/fredrick/bootcd/cdimage)
  • sudo mkisofs -o ../ks.iso -V 'RH9 Install' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -V -T .

Burning a CD

First we have to figure out our device mapping -- it will be 3 numerals separated by commas -- in my case "1,0,0". To find out, enter "cdrecord -dev ATAPI: -scanbus" like this:

acd-doctor:/jo/fredrick> sudo cdrecord -dev=ATAPI: -scanbus
Cdrecord-Clone 2.01-dvd (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling
Note: This version is an unofficial (modified) version with DVD support
Note: and therefore may have bugs that are not present in the original.
Note: Please send bug reports or support requests to http://bugzilla.redhat.com/bugzilla
Note: The author of cdrecord should not be bothered with problems in this version.
scsidev: 'ATAPI:'
devname: 'ATAPI'
scsibus: -1 target: -1 lun: -1
Use of ATA is preferred over ATAPI.
Warning: Using ATA Packet interface.
Warning: The related Linux kernel interface code seems to be unmaintained.
Warning: There is absolutely NO DMA, operations thus are slow.
Using libscg version 'schily-0.8'.
scsibus0:
        0,0,0     0) '' '' '' NON CCS Disk
        0,1,0     1) '' '' '' NON CCS Disk
        0,2,0     2) *
        0,3,0     3) *
        0,4,0     4) *
        0,5,0     5) *
        0,6,0     6) *
        0,7,0     7) *
scsibus1:
        1,0,0   100) 'TDK     ' 'CDRW401240B     ' 'Z7SB' Removable CD-ROM
        1,1,0   101) 'PHILIPS ' 'DVD+RW-D01      ' '1.41' Removable CD-ROM
        1,2,0   102) *
        1,3,0   103) *
        1,4,0   104) *
        1,5,0   105) *
        1,6,0   106) *
        1,7,0   107) *

Now if we have an image such as "ks.iso" we burn it with a command like this:


cdrecord -v speed=16 dev=ATAPI:1,0,0 ks.iso

For CD-RW media where we want to erase the existing image, add "blank=all"

Updating Boot CD for Fedora Core 3.0

Updated: 27-Dec-2004

I followed these steps to make my Fedora Core 3.0 kickstart CD

  • Copied our existing custom Fedora CD to /home/fredrick/bootcd/kickstart
  • cd kickstart/isolinux
  • sudo emacs ISOLINUX.CFG
  • Renumbered the other labels and added a label 1
    
    # Fedora 3 kickstart install
    label 1
      kernel vmlinuz
      append ks initrd=initrd.img ramdisk_size=8192
    
    
  • Also edited BOOTMSG.TXT to reflect the new changes.
  • Copied initrd.img from /redhat/fedora30/images/boot.iso like this:
    • cp /redhat/fedora30/images/boot.iso /tmp
    • mount -o loop /tmp/boot.iso /mnt
    • cd /home/fredrick/bootcd/kickstart/isolinux
    • cp /mnt/isolinux/initrd.img .
    • cp /mnt/isolinux/vmlinuz .
  • cd /home/fredrick/bootcd/kickstart
  • sudo mkisofs -o ../ks.iso -V 'Fedora30_ks' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -V -T .
  • cd ..
  • cdrecord -v speed=2 dev=ATAPI:1,0,0 ks.iso
  • Logged onto the dhcp server
  • cd /dns1/kickstart
  • Copied over a ks.cfg file created by running "redhat-config-kickstart" on a machine that already had Fedora installed on it. I called the file fedora30-ks
  • edited /etc/dhcpd.conf to point to the new "fedora30-ks" instead of the original "kickstart90-manualpartition"
  • sudo service dhcpd restart

DVD

The procedure for Fedora 3.0 above worked perfectly for creating a CD for Fedora Core 3.0. Additionally, we are using "yum" and so I verified that we are getting Fedora 3.0 RPMs in /web/htdocs/yum/fedora/core/2 and /web/htdocs/yum/fedora/core/updates/2. The script that downloads these yum RPMS is in /etc/cron.daily on acd called "build_yum2.sh".

The kickstart script is now generated by installing Fedora 3.0 from the original CD's. After the first reboot it appears is /root/anaconda-ks.cfg. This is what can be put into acd.ucar.edu:/redhat/kickstart/fedora20-ks. Then to enable kickstart, edit /etc/dhcpd.conf on dns1 and change the "filename" parameter. I actually went ahead and create a "-nowindows" version which can be put in the machine entry in /etc/dhcpd.conf for those systems that do not dual-boot a Windows operating system.

For Fedora 3.0, I slimmed down the RPMs being installed so that it would fit comfortably on a 30GB / partition. I also have firewall turned on by default, and am not installing web or other network servers. I might go ahead and create a "-everything" version for those systems which are really meant to be servers (which would include web, dhcpd, etc.).

To record the DVDimage use the "dvdrecord" command instead of cdrecord. Like this:


dvdrecord -v speed=2 dev=ATAPI:1,1,0 dvdimage.iso