You are not logged in.

#1 2016-05-17 21:12:31

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

The Grub Custom Menu Entries

Hi all. I was going to try to cleverly disguise this bunch of questions in the form of a tutorial post, but I don't know enough to pull that off.   The post by  pepemopap here sort of got my wheels turning and soon I was lost in a midst of questions which usually happens.
I've been trying to parse through : Grub Manual
but...damn..it's pretty thick and very vague at times for certain parameters and when to use them.

So Grub is pretty large and messy honestly and I'm not sure where to begin. So far to my knowledge a typical grub2 menu entry looks like this:

#!/bin/sh -e
echo "Adding Custom Linux...."

menuentry "My custom Linux" {
set root=(hd0,1)
linux /boot/vmlinuz
initrd /boot/initrd.img
}

This is obviously a very simple, bare bones entry.

I suppose the easiest way to get this started is to just describe what I"m trying to do.  I'm using VirtualBox, and I'm trying to get a dos program (SpinRite) to be listed and booted from grub2.  So my main question is this...  I have the .exe program mounted on /media/cdrom0/
it appears as SPINRITE.EXE

1. Can the .exe be booted from? I see that many refer to booting from a cdrom as booting from an iso, and therefore need to use the loopback loop  syntax.  Does using the loopback parameter because it's mounted from a cdrom?

2. Because the spinrite.exe file is located inside of my bunsen's /media/cdroom0/  directory, how does that affect the boot parameters, do I need to specify the linux /boot/<kernel version> and the initrd /boot/initrd.img   lines?

3. What about the set root  parameter?  Would the path to /media/cdrom0/spinrite.exe be the root, or would hd0,1?


4. Another main question I pose is...When can/do you need to specify the linux and initrd lines? These lines point grub to find the linux kernel and initial ramdisk. So when you have an OS or iso mounted on the OS (for instance, if it's mounted to /mnt/ ) do you then still need to point grub to the linux kernel ? I guess what I'm asking is... when do you need to load the kernel for booting an image, and when do you bypass it, and boot what you want directly? 



There's so many options and parameters I feel completely lost in this, and what to include and what not to include when it comes to booting. Then I saw the whole search --no-floppy  etc.. and completely lost it.

I tried following the syntax here by pepemopap in post #8

Post #8

But it seems that it uses an older syntax of menulst..

So I don't even know if this post makes any sense anymore at this point, I hope it hasn't turned into random babble.


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#2 2016-05-17 21:18:38

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: The Grub Custom Menu Entries

GRUB can only boot Linux and {Free,Net,Open}BSD directly, for other operating systems see https://www.gnu.org/software/grub/manua … 02dloading & https://www.gnu.org/software/grub/manua … 02fWindows

The loopback function is for ISO images and suchlike, see https://www.gnu.org/software/grub/manua … ck-booting

Offline

#3 2016-05-19 18:32:01

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: The Grub Custom Menu Entries

If I'm running this in Virtualbox, and I have an iso mounted as an inserted DVD. And I mount that iso to the bunsen filesystem on /mount/iso_example/  Would that require the use of the loopback function in the menuentry?  Whenever I mount it, it appears in my filesystem as a .exe   so i'm not sure if the loopback function would still apply?


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#4 2016-05-19 18:38:18

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: The Grub Custom Menu Entries

The loopback function serves to mount an ISO image so that the filesystem contained within can be accessed and the kernel (be it Linux or BSD) can be booted.

Your .exe file does not contain a Linux or BSD kernel image so cannot be booted directly by GRUB.

If the .exe file has it's own bootloader then you could try using chainloading, see the link I provided in my other post.

EDIT: See boot(7)

Last edited by Head_on_a_Stick (2016-05-19 18:49:32)

Offline

Board footer

Powered by FluxBB