We use a minimal CentOS booted from a Live USB stick. A kickstarter file that contains the root password, partition schema and more is included in this repository. You can either add it to the CentOS installation image as /ks.cgh
or use the pre-baked image on the BDR GDrive.
The root password is shared with those who need access via Lastpass.
Kickstarter file option documentation and more can be found at Redhat.
The steps below have been used successfully on a Ubuntu (17) machine. We have not been able to reproduce on Mac and Windows. Steps are taken from this Serverfault page.
- Download the CentOS 7 minimal image
- Create a temp dir:
mkdir /tmp/bootiso
- Loop mount the source ISO you are modifying:
mount -o loop /path/to/some.iso /tmp/bootiso
- Create a working directory for your customized media:
mkdir /tmp/bootisoks
- Copy the source media to the working directory:
cp -r /tmp/bootiso/* /tmp/bootisoks/
- Unmount the source ISO and remove the directory:
umount /tmp/bootiso && rmdir /tmp/bootiso
- Change permissions on the working directory:
chmod -R u+w /tmp/bootisoks
- Copy the kickstart file to the mounted iso:
cp /path/to/anaconda-ks.cfg /tmp/bootisoks/isolinux/ks.cfg
- Add kickstart to boot options:
sed -i 's/append\ initrd\=initrd.img/append initrd=initrd.img\ ks\=cdrom:\/ks.cfg/' /tmp bootisoks/isolinux/isolinux.cfg
- Create the new ISO file:
cd /tmp/bootisoks && mkisofs -o /tmp/boot.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -V "CentOS 7 x86_64" -R -J -v -T isolinux/. .
- Add an MD5 checksum (to allow testing of media):
implantisomd5 /tmp/boot.iso
- Isohybrid the file to prepare it for a bootable USB key:
isohybrid /tmp/boot.iso
- Copy the file to an USB stick using either
dd if=/tmp/boot.iso of=/dev/your-usb-dev
or an app like Etcher - (Optional) upload the new version of the image to the BDR GDrive for future use.