1

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

Bovril
  • 59
  • 1
  • 9
  • 2
    I guess you already know this, but golden images (which this is, essentially) can be a pain to maintain. You might find doing a plain install and automating the customisation after installation is a lot easier in the long run. Combined with a kickstart file for the install is usually a much better solution than a custom iso. – Sirex Apr 22 '13 at 19:57
  • you say "grub just seems to fail".. surely isolinux is the binary that boots the OS here, not grub? unless you've got a system with EFI firmware then things are different. – Paul M Jul 19 '14 at 17:40

2 Answers2

1

There is a tool called ISO Master that you could use to add files to the original image instead of recreating it.

Adrian
  • 21
  • 1
1

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/
Aaron Copley
  • 12,345
  • 5
  • 46
  • 67