Linux installs using kickstart and PXE


Copyright 2002, 2003 Andy Barclay
OpenContent License (OPL)

Here is what worked:
--------------------

Goals:
1) Create a linux build that could be used on
	-the laptops at work.
	-the servers at work.
2) No floppy should be required
3) Build should not trash a windows installation that co-exists on the laptop

Notes:
------
Although Kickstart is an RFC standard, it only seems to work with
redhat linux, fedora, suse and HPUX - not with Mandrake. Mandrake uses drakX.

Very Basic Usage of kickstart:
-For each iso image of the distribution
	-mount it (mount -o loop isoname.iso /mnt)
	-copy it to disk on a linux system somewhere
		(I use /opt/linux_distributions/distroname)
-In the root of the distribution, you will find a dir called isolinux
	-copy the files vmlinuz and initrd.img to /tftpboot
-Ensure that the syslinux rpm is installed on the server
	-copy the pxelinux.0 binary to /tftpboot
-Proceed to step 6 below

Solution Steps:
1) Spool Redhat 8.0 (this was on a solaris server)
	-mount the iso images
	for i in p*
	do
		lofiadm -a `pwd`/$i
		mount -F hsfs /dev/lofi/1 /mnt
		(cd /mnt; tar cf - .)|(cd redhat80; tar xpf -)
		umount /mnt
		lofiadm -d `pwd`/$i
	done
NOTE: on linux, you would use "mount -t iso9660 -o loop ...."
2) Copy vmlinuz to /tftpboot/vmlinuz.redhat80 on Solaris server)
3) Copy initrd.img to /tftpboot/initrd.img.redhat80
4) Upgrade the tftpd on blade to tftp-hpa (as PXE requires TSIZE option)
	-run binary standalone rather than through inetd.conf
		/usr/local/bin/tftpd -l -p -r blksize -r blksize2 -v /tftpboot
4.5) Disable PATH MTU DISCOVERY on the sparc
		ndd -set /dev/ip ip_path_mtu_discovery 0
5) Download pxelinux and copy the pxelinux.0 file into /tftpboot
6) Create the directory /tftpboot/pxelinux.cfg
7) Create a DHCP IP reservation for the machine in dhcpd.conf
-------
 # try pxeboot for laptop
        host latte {
               hardware ethernet 00:06:5b:bb:49:10;
               fixed-address 192.168.37.16;
               filename "/tftpboot/pxelinux.0";
               # tftp on solaris is broken, so put it on quake
               #next-server 192.168.37.18;
        }
-------
NOTE: you will need to use the next-server directive IFF the tftp server
is NOT the same machine as your DHCP server.

NOTE: NOTE: NOTE: As a short-cut, you can choose to return the filename and
next-server for all dhcp hosts. Then you only need to specify the
fixed-address if you want the pxe config to use a non-default file in
/tftpboot/pxelinux.cfg

8) Convert the IP address of the client to hex and create the file
by the hex name in /tftpboot/pxelinux.cfg
/tftpboot/pxelinux.cfg/C0A82510
------
default linux
        label linux
        kernel vmlinuz.redhat80
        append initrd=initrd.img.redhat80 ramdisk_size=32000 root=/dev/ram3 ks=nfs:blade.unixpeople.internal:/home/software/linux_distributions/kickstart/quake.
cfg
------

9) Create the nvidialaptop.cfg file:
---------
#System language
lang en_US

#Language modules to install
langsupport --default en_US en_US 

#System keyboard
keyboard us

#System mouse
mouse genericps/2

#System timezone
timezone --utc America/Los_Angeles

#Root password
rootpw p3dimenta

#Reboot after installation
reboot

#Use text mode install
text

#System bootloader configuration
bootloader --location=mbr 

#Install Red Hat Linux instead of upgrade
install

#Use NFS installation media
nfs --server blade.unixpeople.internal --dir /home/software/linux_distributions/redhat80/redhat80

#Clear the Master Boot Record
zerombr no

#Clear only linux partitions from the disk
clearpart --linux

#Disk partitioning information
part / 2000 --grow
part swap 1024

#Use DHCP networking
network --bootproto dhcp

#System authorization information
auth  --useshadow

#Firewall configuration
firewall --disabled 

#Do not configure the X Window System
skipx

# NOTE: components are groups of packages
# components are defined in $RHROOT/RedHat/base/comps.xml
# each component has a unique id, but you need to specify the
# name here, not the id
%packages --resolvedeps
@ Workstation Common
@ GNOME Desktop Environment
@ KDE Desktop Environment
# nmap, ethereal, vnc, screen
@ System Tools
# next includes development-tools which includes development libs
# also include strace, kernel-source
@ Kernel Development
pdksh
glibc-kernheaders
glibc-devel
openldap-clients

%post
cat >/etc/rc3.d/S99postinstall <