User Tools

Site Tools


rebuild_a_cent_alma_rocky7_iso_to_include_a_kickstart_file

Rebuild a Cent/Alma/Rocky7 iso to include a Kickstart file

Before starting this, you need to have some extra software installed, run yum install -y genisoimage rsync vim syslinux


Get the ISO file of CentOS 7.x onto an existing CentOS7 machine.

export DiscID="CentOS-7-KS-x86_64"   # This will be the name of the media and volumeID
mount -o loop CentOS-7.*.iso /mnt/
mkdir -p /CentOS-7-ISO-respin/{CentOS-7-unpacked,CentOS-7-iso}
rsync -avz /mnt/ /CentOS-7-ISO-respin/CentOS-7-unpacked
#  Put your kickstart file into /CentOS-7-ISO-respin/CentOS-7-unpacked
# Add a new stanza to /CentOS-7-ISO-respin/CentOS-7-unpacked/isolinux/isolinux.cfg (this way you can use the ISO also from a DVD) 
#   label linux_ks 
#   menu label Install CentOS 7 with ^Kickstart
#   menu default 
#   kernel vmlinuz 
#   append initrd=initrd.img inst.stage2=hd:LABEL=CentOS-7-KS-x86_64 ks=hd:LABEL=CentOS-7-KS-x86_64:/ks.cfg
#  Change all the instances of LABEL=CentOS%207%20x86_64 to LABEL=CentOS-7-KS-x86_64 and remove any other instance of 'menu default' within isolinux.cfg
#  Create the ISO with: 
cd /CentOS-7-ISO-respin/CentOS-7-unpacked
 
genisoimage -untranslated-filenames -volid "${DiscID}" -J -joliet-long -rational-rock -translation-table -input-charset utf-8 -x ./lost+found -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -o /CentOS-7-ISO-respin/"${DiscID}".iso -T /CentOS-7-ISO-respin/CentOS-7-unpacked/
 
isohybrid -u /CentOS-7-ISO-respin/"${DiscID}".iso
 
dd if=/CentOS-7-ISO-respin/"${DiscID}".iso of=/dev/XXX
# (where XXX is the Device Name of your USB drive without the partition number e.g. /dev/sdb) (Careful, that command destroys all data on the Stick)
rebuild_a_cent_alma_rocky7_iso_to_include_a_kickstart_file.txt · Last modified: by steve