This patch makes it possible to boot a genkernel-based livecd as iso directly from grub2. Reproducible: Always The idea behind it is to have for example a gentoo-minimal-install.iso on a local drive as fallback... :-) I introduced a new boot-parameter called isoboot which holds the relative path on the partition to the iso like "isoboot=/home/user/isos/gentoo.iso". If this parameter is set, then it searches that file (during the normal find-cd-loop) and mounts the partition which holds the iso as /mnt/isodisk. The rest is like the old behavior (the iso gets mounted on /mnt/cdrom)... To boot a gentoo livecd, the grub2 config should look like the following: menuentry "Gentoo Linux minimal install cd x86" { loopback loop (hd0,3)/home/mad/install-x86-minimal.iso linux (loop)/isolinux/gentoo root=/dev/ram0 init=/linuxrc dokeymap looptype=squashfs loop=/image.squashfs cdroot initrd=gentoo.igz vga=791 isoboot=/home/mad/install-x86-minimal.iso initrd (loop)/isolinux/gentoo.igz } I've tested it via a homegrown gentoo livecd and it works at least for me (booted as .iso and as real-cd).
Created attachment 211005 [details, diff] patch against sys-kernel/genkernel-3.4.10.904 to let it boot as iso via grub2
What exactly does this do? I've been able to boot the CD as it is from grub-0.97 without anything extra (or maybe I'm thinking of liveusb...)
You need to have grub2 (i've got 1.97beta1) to boot a plain iso-file which is laying somewhere (could be usb or a normal partition). But the problem is, that grub just mounts it to start the kernel and get the initrd, but it is up to the linuxrc-script to actually do the rest. Therefore this patch! Without it, it just tries every block-device and searches for the recognition file (/livecd) on that device... but as an iso isn't really a blockdevice, it will fail to boot with the message "Media not found! Could not find CD to boot, something else needed!" (tested with the 20091103 minimal iso). The patch just mounts the partition with the iso-file on it to /mnt/iso and then loop-mounts the iso to /mnt/cdrom. Without the new bootparameter, it's the old behavior... Have a look at the forums-link... i've also got fooled around at first! ;-)
I've applied a modified version of this patch in git.
Included in 3.4.10.908, closing.