Hi erwan.l, thanks for taking a look at this.
I like your 1st menuitem. I've often wondered if that would work.
I don't create ISOs, I download them. And while I have installed a couple to USB drives I boot most them directly from my Windows 10 harddrive using grub2.
Here are some of my grub2 menuitems.
menuentry " LIVESLAK ISO" --class debian --class icon-linux {
set iso='/ISOs/slackware64-live-xfce-current.iso'
set bootparms='load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 kbd=us '
search -f $iso --set=root
loopback loop $iso
linux (loop)/boot/generic livemedia=/dev/sda6:/$iso $bootparms
initrd (loop)/boot/initrd.img
}
menuentry " Ubuntu ISO" --class ubuntu --class icon-ubuntu {
set iso='/ISOs/ubuntu-18.04.1-desktop-amd64.iso'
set bootparms='boot=casper iso-scan/filename='$iso' splash -- '
search -f $iso --set=root
loopback loop $iso
linux (loop)/casper/vmlinuz $bootparms
initrd (loop)/casper/initrd.lz
}
menuentry " RunTime DriveImage ISO" --class other --class icon-unknown {
set iso='/ISOs/runtimelivecd.iso'
set bootparms='lang=us bootfrom=(loop)'
set bootdrv=$root
search -f $iso --set=root
if [ $root != $bootdrv ]; then
loopback loop ($root)$iso
# chainloader (loop)$bootmgr
echo
echo '(root)iso ' ($root)$iso
echo 'bootfrom ' $loop
echo
sleep -i -v 10
linux (loop)/KNOPPIX/KNOPPIX $bootparms
initrd (loop)/KNOPPIX/KNOPPIX1
else
echo "----------------------------------------"
echo ISO NOT found.
echo
sleep -v -i 10
fi
set root=$bootdrv
}
The last one is the one I'm struggling with.
The ISO has a /KNOPPIX folder and a /boot/isolinux folder. I've tried both with no success so far. And I've tried a lot of different boot file combinations.
If you download the Runtime Live CD ISO you will see what I'm using. I'm sure it's designed to be installed to a USB drive or a CD and would boot with Grub2 but I've booted ISOs directly before.