I was able to boot my system from a DVD using GRUB 2. I got the GRUB 2 menu and attempted to use the kernel in "huge.s". GRUB complains about booting in blind mode and then displays random garbage. I can't tell if Slackware has booted or not.
My suspicion is that there might be a size limit on the El-Torito boot image supported by UEFI. The GRUB 2 image is less than the size of a floppy disk. Due to the way ELILO works, it's image has to include the kernel and initrd, and that makes the image about 36 MB.
Here is how I was able to make a UEFI boot DVD with GRUB 2.
Code:
#!/bin/sh
#
# Script to create a UEFI bootable Slackware DVD
#
SLACKFILES="slackware64-current" # Slackware files to go on DVD
ESP="/tmp/esp" # Temporary mount point for EFI System Partition
ESPIMG="boot/grub/efi.img" # Relative to root of DVD (do not put in EFI directory!)
# Create the EFI System Partition filesystem file
# NOTE: Adjust count= if file-system becomes full
dd if=/dev/zero of="$SLACKFILES/$ESPIMG" bs=2k count=720
mkfs -t vfat -n "EFIBOOT" "$SLACKFILES/$ESPIMG"
# Mount the EFI System Partition filesystem
if [ ! -d "$ESP" ] ; then
mkdir "$ESP"
fi
modprobe nls_iso8859-1
mount -t vfat -o loop "$SLACKFILES/$ESPIMG" "$ESP"
# Copy GRUB boot file to EFI System Partition
mkdir -p "$ESP/EFI/BOOT"
cp "$SLACKFILES/boot/grub/grub.efi" "$ESP/EFI/BOOT/BOOTx64.EFI"
# Unmount EFI System Partition
umount "$ESP"
if [ -d "$ESP" ] ; then
rmdir "$ESP"
fi
# Create the ISO image for the DVD
# NOTE: -m "$SLACKFILES/boot/grub/grub.efi" for testing.
# The "grub.efi" file should not be required on the DVD
# since EFI reads that file from the El-Torito boot image
# not the ISO-9660 file-system on the DVD.
# NOTE: -x "$SLACKFILES/EFI" for testing.
# The EFI directory should not be required on the DVD
# since EFI reads the files from the El-Torito boot image
# not the ISO-9660 file-system on the DVD.
# Although some EFI systems can read ISO file-systems
# that is not a required part of EFI and should not be
# required for booting a DVD.
mkisofs -o "slackuefi.iso" \
-R -J -A "Slackware 64-bit Install" \
-hide-rr-moved \
-v -d -N \
-eltorito-catalog "boot.catalog" \
-eltorito-platform x86 -no-emul-boot -boot-load-size 4 -boot-info-table \
-eltorito-boot "isolinux/isolinux.bin" \
-eltorito-alt-boot -eltorito-platform efi -no-emul-boot \
-eltorito-boot "$ESPIMG" \
-sort "$SLACKFILES/isolinux/iso.sort" \
-m "$SLACKFILES/boot/grub/grub.efi" \
-x "$SLACKFILES/EFI" \
"$SLACKFILES"
I had to include the required GRUB 2 files in "boot/grub" on the DVD. Essentially those are the configuration file and modules for GRUB. The GRUB program is loaded from "boot/grub/efi.img" since that is specified as the El-Torito image.
When you start GRUB from a CD or DVD on a UEFI system it sets the "root" a little bit differently than with a hard disk. The root is set to the ISO file-system and NOT the EFI system partition on the optical disc. So, there is no point in putting other files besides the GRUB program in the El-Torito image. GRUB will load the configuration file and any modules from the ISO file-system, not the EFI system partition in the El-Torito image. GRUB finds the ISO file-system using the parent device of the EFI system partition (I.E. the parent of the El-Torito image file-system device). The name assigned to the device in GRUB 2 is (cd0). I think that the only way to read other files from the El-Torito image would be to have GRUB mount it as a loop file-system.
For UEFI file-systems on other devices such as hard disks, GRUB sets the "root" to the file-system device for the EFI system partition (I.E. the partition) not the parent disk device. For regular hard disks you DO have to put the rest of the GRUB modules and files in the EFI system partition.
Although UEFI supports partitioned optical disks (using El-Torito images for partitions), GRUB does not recognize the EFI system partitions on the optical disks. I'm not suggesting that GRUB should recognize those partitions. The actual UEFI implementations seem to be quite limited in what they can do with EFI system partitions on optical disks. The only purpose for an EFI system partition on an optical disc is to contain a "/EFI/BOOT/BOOTx64.EFI" file or other boot program for EFI to boot the disc.
If you start up an EFI system with a boot DVD in the drive, but do not boot from the DVD, you will see that the El-Torito image on the DVD is handled by EFI as a partition. Start an EFI command prompt and you will see a file-system device, such as "FS2:" that allows you to access the files in the El-Torito image.
I have not looked at the ELILO source yet, so I can't say how EILLO handles EFI system partitions on optical discs. ELILO may be able to load files from an EFI system partition on an optical disc. That would allow ELILO to be used as the boot loader on an optical disc. However, the El-Torito image will be large, since it must contain the kernel and initrd files. Having a separate copy of those files in the El-Torito image wastes space on the optical disc.