Linux – Customize Red Hat installation – /mnt/runtime directory

anacondainstallationkickstartlinuxredhat

I am installing a RHEL 5.5. I have seen one DVD that have a complex %pre script in ks.cfg and it used some customized python scripts in /mnt/runtime. It's cool and I wish to customize installation like that. I believe /mnt/runtime and its files are provided by anaconda, but how to add customized files in it (or some other directories that exist during installation)?

I read about anaconda / kickstart manuals but don't find much information regarding this.

Please comment

Thanks! XM

Best Answer

Procedure for custom install DVD:

  1. Create a custom kickstart file. (You can install the OS on a system interactively, once, then harvest the anaconda-ks.cfg file from /root to get started. You can modify that file to suit your needs.
  2. Copy the RHEL/CentOS install DVD to a working folder (we will call it /tmp/dvdroot), and don't forget the hidden .treeinfo and .diskinfo files.
  3. Copy your customized kickstart file (we will assume it's called ks.cfg) to /tmp/dvdroot.
  4. Edit /tmp/dvdroot/isolinux/isolinux.cfg. There are several blocks of label/kernel/append. Duplicate one, and edit one to resemble this:

label special

kernel vmlinuz

append ks=cdrom:/ks.cfg initrd=initrd.img

Run the following commands

cd /tmp/dvdroot

mkisofs -quiet -r -T -J -V "Special Install Disk" -b isolinux/isolinux.bin \ -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \ -boot-info-table -o ../special-dvd.iso .

Do not forget that last dot on the previous command.

Now burn /tmp/special-dvd.iso to blank DVD media:

cdrecord -dao /tmp/special-dvd.iso

When you use the DVD to install a system and you get to the install prompt, enter special.