Friday 4 April 2014

RHEL 6 Custom Installation DVD

The following procedure will create a custom RHEL 6 DVD ISO image file with the following attributes:
  • based on the original Red Hat installation DVD with all its features including rescue mode and the default Red Hat installation
  • changes the default boot menu  to "local boot" so you don't accidentally blow away a server!
  • adds a your own custom boot menu to the top of the list
  • adds your own custom kickstart script to the custom boot menu
I have added my "Core" kickstart file which:
  • installs on the first hard disk, virtual or physical
  • partition 1:  /boot ext4 512MB
  • partition 2: LVM VG "vg0" 2560MB
  • vg0/ROOT ext4 2048MB
  • vg0/SWAP swap 512MB
The idea is that the partitions, LVM volume group(s) and logical volumes as created/expanded by a later configuration script.  I purposely wanted to make this first installation generic but practical.  I am providing my configuration via a second DVD which will be mounted after the first reboot. 

There is no networking.  Packages are "core" plus a few more.  Please enjoy.

 Files

 Instructions

cd ISOs/

mkdir rhel6-dvd
mount -o loop,ro rhel-server-6.5-x86_64-dvd.iso rhel6-dvd/

mkdir rhel-server-6.5-x86_64-core-dvd
cp -av rhel6-dvd/. rhel-server-6.5-x86_64-core-dvd
umount rhel6-dvd  && rmdir rhel6-dvd

cp <.../ks-core-nonetwork.cfg> rhel-server-6.5-x86_64-core-dvd
sed -i -e '/menu default/d' \
   -e '/^label local/ a \
  menu default' rhel-server-6.5-x86_64-core-dvd/isolinux/isolinux.cfg
awk '/^label / && !found {print "label core\nmenu label ^Core installation of RHEL 6.5. First disk, no network.\nmenu default \nkernel vmlinuz \nappend initrd=initrd.img ks=cdrom:/ks-core-nonetwork.cfg"; found=1} 1' rhel-server-6.5-x86_64-core-dvd/isolinux/isolinux.cfg > /tmp/isolinux.cfg
mv -vf /tmp/isolinux.cfg rhel-server-6.5-x86_64-core-dvd/isolinux/isolinux.cfg

yum install genisoimage
mkisofs -r -T -J -V "RHEL Server 6.5-x86_64 Core" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o rhel-server-6.5-x86_64-core-dvd.iso rhel-server-6.5-x86_64-core-dvd