0

So I have a fully functional .img file created using grub-mkstandalone. I put this on a CD and it boots fine, the ISO loads great in a VM, etc...

Now, what I want to do is link an existing grub.cfg to this .img file as if it is a regular boot. Does that make sense? So for instance, I have a USB pendrive with grub installed. I have several loop devices configured to boot ISOs. All Linux. However, in this case I want to load the .img file instead (which has its own grub.cfg). So I would like to see the menu from that grub.cfg once the .img is loaded amd then boot the OS from that.

Ive been searching for the answer for days and reading the documentation but I wasn't able to find the answer.

Let me know if the question wasn't clear and I will clarify. Thanks in advance.

EDIT:

So for instance, lets say I have this menu entry:

menuentry 'My OS' {
    set isofile="/iso/os_5.1.1_amd64.iso"
    loopback loop (hd0,msdos1)$isofile
    linux (loop)/vmlinuz boot=live toram nomodeset
    initrd (loop)/initrd
}

This works fine. However, I want to load the .img file I created instead of loading linux like this so that I can see the grub menu that's inside the ISO.

So something like this?

menuentry 'My OS' {
    set isofile="/iso/os_5.1.1_amd64.iso"
    loopback loop (hd0,msdos1)$isofile
    .... (loop)/boot/grub/my.img
}

The dots represent some magic I don't know about to make this work (if it is possible at all).

0

For EFI images, you can use chainloader (but I suspect you were using BIOS at the time; don't know if it works for that):

menuentry 'My OS' {
    chainloader (hd0,msdos1)/BOOT/EFI/somedir/somebin.efi
}

So, I would have tried (untested!!):

menuentry 'My OS' {
    set isofile="/iso/os_5.1.1_amd64.iso"
    loopback loop (hd0,msdos1)$isofile
    chainloader (loop)/boot/grub/my.img
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.