grub2 loopback feature

Hi!
I'd like to use the loopback feature of grub2 to boot a grml iso-image that resides on a USB drive.
Is there a way to make grub jump to the existing /boot/grub/grub.cfg in the ISO and show its contents as a submenu?
I am thinking about something like:
/boot/grub/grub.cfg on USB drive: -------------------- 8< -------------------- menuentry 'GRML' { iso_path=/iso/grml_2010.04.iso bootid=grml201004 export iso_path export bootid
loopback loop $iso_path set root=(loop) configfile /boot/grub/grub.cfg } -------------------- 8< --------------------
Unfortunately, when selecting the menuantry above, my box reboots.
When trying the same on the grub commandline, it reboots at "set root=(loop)". So root=loop doesn't seem to be supported...
On the other hand, "configfile (loop)/boot/grub/grub.cfg" perfectly jumps to grmls boot menu. But when using this approach, I guess some support in grml's grub.cfg would be needed so that grub can correctly locate the image files. (Maybe a $loop variable prepended to all filenames in grmls grub.cfg, which is conditionally set to "(loop)"?)
Any other hints?
Cheers, --leo

On Tue, 15 Jun 2010 17:38:59 +0200, Alexander 'Leo' Bergolth wrote:
I'd like to use the loopback feature of grub2 to boot a grml iso-image that resides on a USB drive.
IIRC, mika wrote about it in his blog, http://grml.supersized.org/
Hmm..., no, maybe somewhere else, 'cause searching loopback didn't help.

* T o n g mlist4suntong@yahoo.com [Thu Jun 17, 2010 at 05:14:40PM +0000]:
On Tue, 15 Jun 2010 17:38:59 +0200, Alexander 'Leo' Bergolth wrote:
I'd like to use the loopback feature of grub2 to boot a grml iso-image that resides on a USB drive.
IIRC, mika wrote about it in his blog, http://grml.supersized.org/ Hmm..., no, maybe somewhere else, 'cause searching loopback didn't help.
I wrote:
http://michael-prokop.at/blog/2009/05/25/boot-an-iso-via-grub2/
And for the german speaking people, Marc Haber wrote about it as well:
http://blog.zugschlus.de/archives/825-grml-als-eigenes-Rescuesystem.html
HTH && regards, -mika-

On 06/17/2010 07:22 PM, Michael Prokop wrote:
- T o n g mlist4suntong@yahoo.com [Thu Jun 17, 2010 at 05:14:40PM +0000]:
On Tue, 15 Jun 2010 17:38:59 +0200, Alexander 'Leo' Bergolth wrote:
I'd like to use the loopback feature of grub2 to boot a grml iso-image that resides on a USB drive.
IIRC, mika wrote about it in his blog, http://grml.supersized.org/ Hmm..., no, maybe somewhere else, 'cause searching loopback didn't help.
I wrote: http://michael-prokop.at/blog/2009/05/25/boot-an-iso-via-grub2/
And for the german speaking people, Marc Haber wrote about it as well: http://blog.zugschlus.de/archives/825-grml-als-eigenes-Rescuesystem.html
I know about those articles but my question was another one:
Is there a way to make grub jump to the existing /boot/grub/grub.cfg in the ISO and show its contents as a submenu?
I am trying to branch to grmls own grub configuration: -------------------- 8< -------------------- loopback loop $iso_path set root=(loop) configfile /boot/grub/grub.cfg -------------------- 8< --------------------
... which seems to fail because of a bug in grub. (set root=(loop) fails) See http://savannah.gnu.org/bugs/?30143 for the bug report.
As a workaround, I suggested to prepend a variable like ${loop} to all paths in grmls grub.conf, which could be set to loop="(loop)" by the calling grub.cfg on the usb drive. Besides a variable like ${kernelopts} at the end of each kernel commandline would allow passing custom boot options from the calling grub.cfg.
Cheers, --leo

* Alexander 'Leo' Bergolth leo@strike.wu.ac.at [Thu Jun 17, 2010 at 09:46:28PM +0200]:
Is there a way to make grub jump to the existing /boot/grub/grub.cfg in the ISO and show its contents as a submenu?
I am trying to branch to grmls own grub configuration: -------------------- 8< -------------------- loopback loop $iso_path set root=(loop) configfile /boot/grub/grub.cfg -------------------- 8< --------------------
... which seems to fail because of a bug in grub. (set root=(loop) fails) See http://savannah.gnu.org/bugs/?30143 for the bug report.
As a workaround, I suggested to prepend a variable like ${loop} to all paths in grmls grub.conf, which could be set to loop="(loop)" by the calling grub.cfg on the usb drive. Besides a variable like ${kernelopts} at the end of each kernel commandline would allow passing custom boot options from the calling grub.cfg.
Jordan Uggla pointed out on #grml that it's working for him with grub 1.98 compiled from source.
Instead of working around I'd prefer to see this bug fixed in Grub. I've just updated templates/boot/grub/ to the most recent Grub2 version from Debian/unstable and also added support for "${kernelopts}" (what a lovely idea! :)):
http://git.grml.org/?p=grml-live.git;a=commit;h=07ca6d5
The daily ISOs (http://daily.grml.org/) by tomorrow (2010-06-26) will include this update. Would be great to get know whether this fixes your issue.
regards, -mika-
participants (3)
-
Alexander 'Leo' Bergolth
-
Michael Prokop
-
T o n g