#! /bin/bash # grub-mkconfig helper script. prefix=/usr exec_prefix=${prefix} libdir=${exec_prefix}/lib . ${libdir}/grub/grub-mkconfig_lib cd /boot if ! [ -a mnt ]; then mkdir mnt 2>&1 > /dev/null fi ISO_IMAGES=$(ls *iso 2>/dev/null) for iso in $ISO_IMAGES do mount $iso mnt -o loop -t iso9660 if ! [ -a mnt/casper ]; then umount mnt continue fi echo "Found live CD file, ${iso}" >&2 echo >&2 echo "menuentry \"Live CD ${iso}\" {" echo " loopback loop $(convert_system_path_to_grub_path ${iso})" echo " linux (loop)$(make_system_path_relative_to_its_root mnt/casper/vmlinuz*) " \ "boot=casper iso-scan/filename=$(make_system_path_relative_to_its_root /boot/${iso}) " echo " initrd (loop)$(make_system_path_relative_to_its_root mnt/casper/initrd*)" echo "}" umount mnt done rmdir mnt