Redhat "Linux" kickstart procedures for NCAR/ACD
"Kickstart" allows us to automate a Redhat Linux install in a way
that removes a lot of manual steps in the process. Manual steps
that we previously had to do but which are now automated by kickstart
include:
- Saving off /etc/passwd, nrnet, product license files, etc.
- Manually adding users after an install
- Configuring X-Windows after an install
- Creating a boot sector for the Windows NT boot loader
- Creating gnome configurations for users
- Partitioning the disk
- Many post-install operations to get a workstation up and running
Now, with kickstart, we've largely automated the above leaving only
a few steps after installation. A kickstart can happen within a half
hour, giving us an excellent form of disaster recovery. Moreover, a
diskette can be inserted, a kickstart started, and the Sysadmin can
just walk away, return a half hour later, press ENTER and the machine
boots off of that same diskette (the kickstart has overwritten the
kickstart boot image with an image that can boot the machine).
The basic kickstart design in ACD involves these steps:
- We have pre-prepared kickstart boot diskettes. These diskettes
contain the bootnet.img and pcmcia.img from the Redhat distribution. The
diskettes are prepared as follows:
- dd if=bootnet-RHEA-1999_044.img of=/dev/fd0H1440
- mount -t vfat /dev/fd0H1440 /mnt
- cd /mnt
- vi syslinux.cfg and change the prompt to 0, the default to "ks" and
remove the timeout field.
- umount /mnt
- dd if=/dev/fd0H1440 of=bootnet.img
- copy the bootnet.img file to /redhat/61
- Repeat for pcmcia-RHEA-1999_044.img to acd:/redhat/61/pcmcia.img
- Now to manufacture diskettes (we recommend making lots), just dd those
images from acd:/redhat/61/bootnet.img or acd:/redhat/61/pcmcia.img onto
floppies (that is, dd if=bootnet.img of=/dev/fd0H1440). The bootnet floppy is
for a standard desktop and the pcmcica floppy is for a laptop with PCMCIA and
3COM ethernet on a PC card.
- Prepare a system for a Kickstart upgrade if needed
- Use fdisk to change the partition types of any Linux partition you
want to preserve. Change those types to FAT32 and then after the install
is complete, you can change them back to EXT2.
- Insert diskette
- boot computer
- The floppy image initiates the kickstart. The actual kickstart script is
acquired from the DHCP server (net.acd.ucar.edu).
The DHCP daemon informs the kickstart process where to find the kickstart
script. The kickstart scripts are named by IP address and obtained from
net:/jp/kickstart. For example net:/jp/kickstart/128.117.32.140-kickstart.
- Control is passed to the kickstart script (e.g., 128.117.32.140-kickstart)
which then installs Redhat Linux on a system
- Once Redhat Linux is installed, the script passes control to a postinstall
script which is located on acd:/redhat/61/kickstart.postinstall.sh. The postinstall script
creates NCAR-specific files such as /etc/group, /etc/automounter, /etc/printcap, etc.,
and installs additional RPMS, both RPMS local to NCAR like NCAR Graphics, and RPMS
that we need such as LPRng and SSH.
- The last steps of the kickstart.postinstall.sh script involve creating a bootsect.lnx
file in case the machine uses an NT boot loader. That bootsect.lnx file is uuencoded and
mailed to the Sysadmins. And also stored in /root so that explore2fs on the NT side can read
it. The explore2fs explorer for Windows NT can be obtained at
http://uranus.it.swin.edu.au/~jn/linux/explore2fs.htm.
The kickstart takes over from the floppy disk image and installs Redhat Linux.
- The kickstart diskette is still in the drive. When the kickstart script
is nearly complete, it overwrites that diskette with a LILO bootable floppy
image so that we
have something off of which to boot the machine. The Sysadmin only has to press
RETURN and the system will reboot off of the new diskette.
- After rebooting, there's a few things to be done which include
- Verify everything of course :-) Especially test licensed products such as IDL and
the Portland compiler.
- Edit /etc/inittab and change "id:3:initdefault:" to "id:5:initdefault:" if
you want the gdm splash screen at login time.
- Change the root password (the kickstart uses a simple easily guessable password)
- If you saved Linux partitions in the first step, go ahead and change their
partition types back to EXT2 and change /etc/fstab to mount them.
- Go into NT and modify the boot loader so that we can boot. test.
- Grab the bootsect.lnx file using explore2fs or what have you.
- Turn off read-only on boot.ini
Machine Requirements
Kickstarts involve standardizing our machine configurations over what we have now.
And initially, there's probably going to be work involved to accomplish the following:
- Both NT and Linux must be on the primary disk. If the disk is too small for that,
we'll need to swap disks around to make this happen. Roughly disk requirements are
minimally 3GB as shown below. Of course more is better, especially with modern IDE
drives being so inexpensive.
- NT: 2GB
- Linux /usr: 1.5GB
- Linux swap: 0.2GB+
- Linux /home: 0.5GB+
- A machine must also be on the network. Our environment makes doing a CD-ROM
kickstart impractical because too many things change too quickly. By maintaining
net:/jp/kickstart and acd:/redhat/61/kickstart.postinstall.sh, we can continuously
upgrade the environment which will be installed when the next kickstart takes
place.
Preinstall procedures
To prepare a machine for kickstart, there's a few things we have to do
to make it ready.
- Configure DHCP and add an entry for the machine. Be sure
to restart dhcpd to reread the /etc/dhcpd.conf file. To add an entry,
we'll need to know the Ethernet MAC address of the machine. The entry in
/etc/dhcpd.conf on net.acd will look something like this entry for babbage:
host babbage {
hardware ethernet 0:10:4b:64:19:3e;
fixed-address 128.117.32.140;
next-server 128.117.32.210;
filename "/jp/kickstart/";
}
- Create a link in /jp/kickstart. There are currently two possibilities.
Link to kickstart-autopartition if you want kickstart to do all of the disk partitioning.
This is the preferred link if you can possibly arrange it. Or create a link
to kickstart-manualpartition if you want to go in and create your own partitions as
part of the kickstart install. For example:
cd /jp/kickstart
ln -s 128.117.32.140-kickstart kickstart-autopartition
- Create a directory for the machine in acd:/redhat/machines. Within that directory
you can place files that are asked for by acd:/redhat/61/kickstart.postinstall.sh. For
example, we put the IDL license file in
acd:/redhat/machines/babbage.acd.ucar.edu/rsi/license.dat. User logins go in
acd:/redhat/machines/babbage.acd.ucar.edu/user/. They are shellscripts which in turn
invoke "useradd" to install the account. The encrypted password follows the -p flag and
can be obtained from the user's current account on the machine or from another source.
Currently this directory contains these files (keeping in mind this web page may be
far older than the kickstart.postinstall.sh script which determines what files go here):
Some notes and the future...
Some notes that I've found on kickstart with Redhat 6.1...
- The rootpw -iscrypted option doesn't work
- Currently the /kickstart directory from which kickstart files are read
must be on the same server (as an exported NSF directory) as the DHCP
server. Not sure whether this is a DHCP problem or a kickstart problem.
The DHCP option in /etc/dhcpd "next-server 128.117.32.211;" seems to be
ignored.
- As part of the user login installation it would be nice to automate
the creation of a .netscape directory for the user which would set them
up automatically to use IMAP email from ACD, set the default home page, etc.
- A failure of kickstart can be hard to diagnose because python script
error messages just get dumped randomly on the screen along with Redhat
graphics. If you pay careful attention, however, it's usually possible to
figure out where the problem was. Changes to the kickstart files should
be done cautiously and backing up working versions when possible.
- It would be nice to incorporate StarOffice or WordPerfect into this
scheme.