Linux – RHEL 6.4 custom dvd boot issue

grubkickstartlinuxredhat

I'm creating a custom RHEL 6.4 iso to save myself time while rebuilding standalone hosts.

Before I customize the menus and add the extra kickstart files in I have tried a simple unpack -> repack to make sure the iso image actually works.

All of my builds fail to load the grub menu and just leave me at the prompt instead of loading the grub menu.

boot:

I'm using the following script to dump and recreate the iso

ISOFILE="/home/matt/isobuild/rhel-server-6.4-x86_64-dvd.iso"
STAGEDIR="/home/matt/isobuild/rhel6.4/"
FINALISOFILE="/tmp/autoiso.iso"
TMPMOUNT="/mnt/dvd"


mkdir $TMPMOUNT
mount -o loop,ro $ISOFILE $TMPMOUNT
rsync -av --progress $TMPMOUNT $STAGEDIR
umount $TMPMOUNT

cd $STAGEDIR
chmod a+w isolinux/isolinux.bin
mkisofs -o /tmp/rhel6.4.iso \
-b isolinux/isolinux.bin -c isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-r -T -J -V "RHEL 6.4 Custom Install DVD" .

It leaves me with the iso file /tmp/rhel6.4.iso as expected, however grub just seems to fail.

Any ideas on why this is, or can you suggest how I can go about debugging it ?

Thanks!

Matt

Best Answer

I bet your problem is the sub-directories in the mkisofs step. I have used these steps for creating custom boot media a number of times.

  1. Create a directory to mount your source.
    mkdir /tmp/bootiso.
  2. Loop mount the source ISO you are modifying. (Download from Red Hat / CentOS.)
    mount -o loop /path/to/some.iso /tmp/bootiso
  3. Create a working directory for your customized media.
    mkdir /tmp/bootisoks
  4. Copy the source media to the working directory.
    cp -r /tmp/bootiso/* /tmp/bootisoks/
  5. Unmount the source ISO and remove the directory.
    umount /tmp/bootiso && rmdir /tmp/bootiso.
  6. Change permissions on the working directory.
    chmod -R u+w /tmp/bootisoks
  7. Copy your Kickstart script which has been modified for the packages and %post to the working directory.
    cp /path/to/someks.cfg /tmp/bootisoks/isolinux/ks.cfg
  8. Copy any additional RPMs to the directory structure and update the metadata.
    cp /path/to/*.rpm /tmp/bootisoks/Packages/.
    cd /tmp/bootisoks/Packages && createrepo -dpo .. .
  9. 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 -R -J -v -T isolinux/
Related Topic