Issue
- How can we create a customized RHEL6 ISO with kickstart file included in the ISO?
- How to include a
kickstart
file in ISO image and create customized ISO?
Resolution
1. Download the RHEL installation dvd iso or minimal boot media boot.iso
2. Mount the ISO
# mount /path/to/rhel-dvd.iso /mnt/ -o loop
3. Copy the entire contents of the disk to another location.
# mkdir /rhel
# shopt -s dotglob
# cp -ai /mnt/* /rhel
4. Create a kickstart file.
This is an example:
5. Copy the kickstart file to the /rhel directory
# cp /path/to/ks.cfg /rhel
6. Change the file '/rhel/isolinux/isolinux.cfg', change the following lines :
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img
to
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img ks=cdrom:/ks.cfg
NOTE: For Red Hat Enterprise Linux 7, use the following append line:
append initrd=initrd.img inst.stage2=hd:LABEL=***Volume_ID*** quiet ks=cdrom:/ks.cfg
Replace Volume_ID by the same value as one specified in-V
option of the followingmkisofs
command. 7. Rebuild the DVD iso image
# cd /rhel
# mkisofs -o /tmp/new.iso -b isolinux/isolinux.bin -c isolinux/boot.cat --no-emul-boot --boot-load-size 4 --boot-info-table -J -R -V disks .
NOTE: In Red Hat Enterprise Linux 7, please make sure that you specify the volume id with -V option, and it's same as Volume_ID in step 6.
8. Boot the machine from this ISO