Multiple bootloader menus.

News and discussion about development of the Debian OS itself

Multiple bootloader menus.

Postby edbarx » 2010-06-03 18:46

Note:
This thread is based on the premise that a single bootloader should be enough to boot any number of operating systems residing in the same system.

I would like to suggest that grub be modified to allow multiple menus. On my system, I have four bootloaders installed. The purpose for this complexity, is to allow a master menu appear first, then the other menus according to what is selected. The secondary menus, can also link to the first menu allowing me to go back to main menu.

A modification in grub to allow for menus to load other secondary menus and vice versa, can eliminate the need of using several small partitions each with grub installed. Moreover, using symlinks for the kernel and initrd.img, should solve the problem caused when a particular kernel is updated.
Debian == { > 30, 000 packages }; Debian != systemd
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.
User avatar
edbarx
 
Posts: 5399
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E

Re: Multiple bootloader menus.

Postby refracta » 2010-06-03 18:58

(deja vu)

Doesn't grub already work that way?

Doesn't debian already provide symlinks in / to the kernel and initrd?
refracta
 
Posts: 1235
Joined: 2008-10-26 01:46

Re: Multiple bootloader menus.

Postby edbarx » 2010-06-03 19:14

I don't want or intend to go into polemics, but grub, irrespective of its version, doesn't allow multiple menu pages to appear. Moreover, it doesn't allow a menu to load another one. In fact, the menu list is found in only one file and it doesn't allow for multiple pages.

The coding for this functionality is already there, only a little modification to allow for a master menu is needed.
Debian == { > 30, 000 packages }; Debian != systemd
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.
User avatar
edbarx
 
Posts: 5399
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E

Re: Multiple bootloader menus.

Postby refracta » 2010-06-03 19:21

uh....okay then.....you should probably file a bug report and include your patch to provide this functionality.
refracta
 
Posts: 1235
Joined: 2008-10-26 01:46

Re: Multiple bootloader menus.

Postby edbarx » 2010-06-03 19:36

I don't think it is fair to file a bug report for this. Adding more functionality to software has nothing to do with bugs.

I think, your suggestion to attempt writing a path is worth trying. The only hurdle is that the coding for grub is not that easy. Nevertheless, it should be a nice challenge and maybe, a fork is more appropriate. The only problems are time and energy.
Debian == { > 30, 000 packages }; Debian != systemd
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.
User avatar
edbarx
 
Posts: 5399
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E

Re: Multiple bootloader menus.

Postby bugsbunny » 2010-06-03 21:24

You would file it as a wishlist bug.

It may be possible (I don't know for sure - a guess would be "no you can't", but I'd have to look at exactly what's available and I haven't) to include this type of functionality using the lua interface that's built in to grub2. There's a number of problems with what you want, if you want the system to automatically handle it. If you're willing to maintain things manually then you can definitely do what you want.
User avatar
bugsbunny
 
Posts: 5355
Joined: 2008-07-06 17:04

Re: Multiple bootloader menus.

Postby BioTube » 2010-06-04 01:27

GRUB can load new menus; Freespire used that feature.
Image
Ludwig von Mises wrote:The elite should be supreme by virtue of persuasion, not by the assistance of firing squads.
User avatar
BioTube
 
Posts: 7551
Joined: 2007-06-01 04:34

Re: Multiple bootloader menus.

Postby pcalvert » 2010-06-04 04:45

I don't know about GRUB2, but I think GRUB "legacy" can do it. The older versions of the sidux live CD were set up that way.

Phil
“Property is the fruit of labor; property is desirable; it is a positive good
in the world. That some should be rich shows that others may become
rich, and hence is just encouragement to industry and enterprise.”
— Abraham Lincoln
pcalvert
 
Posts: 1881
Joined: 2006-04-21 11:19
Location: Sol Sector

Re: Multiple bootloader menus.

Postby aspnair » 2010-06-04 05:02

Have you tried "configfile" feature of grub? Using that you could load another configuration menu file.
Compressed Air Energy Storage, Entropy and Efficiency
http://saurorja.org/2012/06/18/compress ... fficiency/
User avatar
aspnair
 
Posts: 1247
Joined: 2009-06-18 12:27
Location: Twitter: @anand_sivaram

Re: Multiple bootloader menus.

Postby bugsbunny » 2010-06-04 10:32

I think that the configfile option still won't do exactly what he wants. The net effect of that would be the same as a chainload to a different bootloader.

He would still need to have grub installed in each partition in order to maintain the various config files, and I gather that he wants to avoid installing a bootloader on multiple partitions.

Given the lowlevl nature of a bootlaoder and what it does I really don't think you can avoid installing multiple bootloaders, unless you manually maintain the grub configuration - modifying each time a kernel is installed/removed on any of the other os partitions. He could use a common /boot partition for all the distos, although he'd have to play some games with mount to get it to work correctly. He'd need a structure in the real boot partition something like:

assume that /boot is /dev/sda1
/boot
/boot/grub
/boot/distro2kernels/
/boot/distro3kernels/

on distro2 he would then need to mount /dev/sda1 as /tempboot and then use a bind mount to mount /tempboot/distro2kernels/ as /boot. The same type of thing would be done on any additional distros. That way kernels would be installed to the common /boot partition, but each distro would have kernels in there own subdirectory.

You need to have them in there own subdirectory in order to prevent Debians update-grub (I'm assuming that Debian is controlling the primary /boot) from finding the kernels from the other distros and automatically creating (erroneous) entries for them. (they'd be erroneous because, among other things, the root drive would be incorrect).

You would then need to manually create entries for the other distros for example:
Code: Select all
title      Distro2, kernel 2.6.34-01.i386distro2
root      (hd1,2)
kernel      /distro2kernels/vmlinuz-2.6.34-01.i386distro2 root=LABEL=distro2root ro
initrd      /distro2kernels/initrd.img-2.6.34-01.i386distro2


The above should work (although I haven't tested it in the above form) and would eliminate the need for multiple boot loaders, but at the cost of needing to manually maintain grub's config (be it legacy or grub2, although the method of making customized changes is different between the two) for any distributions other than Debians.
User avatar
bugsbunny
 
Posts: 5355
Joined: 2008-07-06 17:04

Re: Multiple bootloader menus.

Postby frostschutz » 2010-06-04 14:41

I have multiple boot menus in grub1 - I use an USB key to boot, and I have separate menus for my desktop PC, for my netbook, for Live CDs, for Windows dual-boot, for misc stuff like memtest, etc. I also have the main overview menu which, pretty much, lets me select the standard kernel (so on the desktop I don't have to select anything) and the submenus listed below (like the desktop menu for alternate kernels for the desktop).

I use the configfile command for that, for example for the LiveCD menu

Code: Select all
#
# LiveCD menu
#
title LiveCD >
configfile /livecd/menu.lst


and every submenu can go back to the main menu

Code: Select all
#
# Main menu
#
title < Back
configfile /grub/menu.lst


I'm very happy with this solution.

Never tried GRUB2, probably won't for a long long time (for as long as GRUB1 boots my OSes actually).
User avatar
frostschutz
 
Posts: 68
Joined: 2010-05-10 22:56

Re: Multiple bootloader menus.

Postby refracta » 2010-06-04 14:52

refracta wrote:(deja vu)

viewtopic.php?f=19&t=42485
refracta
 
Posts: 1235
Joined: 2008-10-26 01:46

Re: Multiple bootloader menus.

Postby frostschutz » 2010-06-04 15:44

It's an error in the Matrix ... they're coming for you
User avatar
frostschutz
 
Posts: 68
Joined: 2010-05-10 22:56

Re: Multiple bootloader menus.

Postby edbarx » 2010-06-04 16:51

@ frostschutz

Could you please give more details.

Thanks.
Debian == { > 30, 000 packages }; Debian != systemd
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.
User avatar
edbarx
 
Posts: 5399
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E

Re: Multiple bootloader menus.

Postby frostschutz » 2010-06-04 17:44

Not sure what "more" details there could be.

You have a menu.lst; it contains boot entries; you make a boot entry that points to a different menu.lst that contains different boot entries. That's all there is to it.

If your main menu points to several other menus, and each of those menus points back to the main menu, you get a parent<->child menu structure.

You could also have a flat sibling structure where each menu points to each other menu directly.

It's up to you. There's no magic involved. If you can write boot entries for the Linux kernel, you can write boot entries that point to other menus, since those are much simpler, only title and config file, instead of title, root, kernel, initrd, parameters, blah...
User avatar
frostschutz
 
Posts: 68
Joined: 2010-05-10 22:56

Next

Return to Debian Development

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable