Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Multiple bootloader menus.

User discussion about Debian Development, Debian Project News and Announcements. Not for support questions.
Message
Author
User avatar
edbarx
Posts: 5401
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E
Been thanked: 2 times

Multiple bootloader menus.

#1 Post by edbarx »

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.

refracta
Posts: 1234
Joined: 2008-10-26 01:46

Re: Multiple bootloader menus.

#2 Post by refracta »

(deja vu)

Doesn't grub already work that way?

Doesn't debian already provide symlinks in / to the kernel and initrd?

User avatar
edbarx
Posts: 5401
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E
Been thanked: 2 times

Re: Multiple bootloader menus.

#3 Post by edbarx »

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.

refracta
Posts: 1234
Joined: 2008-10-26 01:46

Re: Multiple bootloader menus.

#4 Post by refracta »

uh....okay then.....you should probably file a bug report and include your patch to provide this functionality.

User avatar
edbarx
Posts: 5401
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E
Been thanked: 2 times

Re: Multiple bootloader menus.

#5 Post by edbarx »

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
bugsbunny
Posts: 5354
Joined: 2008-07-06 17:04
Been thanked: 1 time

Re: Multiple bootloader menus.

#6 Post by bugsbunny »

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
BioTube
Posts: 7520
Joined: 2007-06-01 04:34

Re: Multiple bootloader menus.

#7 Post by BioTube »

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.

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: Multiple bootloader menus.

#8 Post by pcalvert »

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
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

User avatar
aspnair
Posts: 1247
Joined: 2009-06-18 12:27
Location: Twitter: @anand_sivaram

Re: Multiple bootloader menus.

#9 Post by aspnair »

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
bugsbunny
Posts: 5354
Joined: 2008-07-06 17:04
Been thanked: 1 time

Re: Multiple bootloader menus.

#10 Post by bugsbunny »

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
frostschutz
Posts: 68
Joined: 2010-05-10 22:56

Re: Multiple bootloader menus.

#11 Post by frostschutz »

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).

refracta
Posts: 1234
Joined: 2008-10-26 01:46

Re: Multiple bootloader menus.

#12 Post by refracta »


User avatar
frostschutz
Posts: 68
Joined: 2010-05-10 22:56

Re: Multiple bootloader menus.

#13 Post by frostschutz »

It's an error in the Matrix ... they're coming for you

User avatar
edbarx
Posts: 5401
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E
Been thanked: 2 times

Re: Multiple bootloader menus.

#14 Post by edbarx »

@ 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
frostschutz
Posts: 68
Joined: 2010-05-10 22:56

Re: Multiple bootloader menus.

#15 Post by frostschutz »

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
edbarx
Posts: 5401
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E
Been thanked: 2 times

Re: Multiple bootloader menus.

#16 Post by edbarx »

I think, using several small partitions for my bootloaders is the best solution to date. As it is, updating a kernel for any installation, does not require me fiddling with menu.lst. By the way, I am still using grub-legacy. To be honest, I am tempted to remove the need of scripts from grub2 and make it behave exactly like grub-legacy where menu.lst is involved.
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
frostschutz
Posts: 68
Joined: 2010-05-10 22:56

Re: Multiple bootloader menus.

#17 Post by frostschutz »

Getting multiple menus to work AND automatic menu.lst generation for every distro would be a bit of a problem, I agree with you there... for compiling and installing kernels, I do that manually for any distro, so I don't suffer from that problem.

I installed Ubuntu on my parents machine this weekend. Everything went fine UNTIL I had to figure out how to make Windows the first boot entry in Grub, and the Ubuntu stuff below that. Yeah, Ubuntu uses Grub2 nowadays and I couldn't make heads or tails of the grub2 config, so eventually I just had to Google to figure out I have to rename a file in /etc/grub.d/ and run update-grub *shudder*

I hate these automations, on my own machines I do everything related to kernels and grub myself, that way at least I know what's going on... and even more important, it works the same way everywhere, better than each distro inventing their own system...

User avatar
nadir
Posts: 5961
Joined: 2009-10-05 22:06
Location: away

Re: Multiple bootloader menus.

#18 Post by nadir »

Everything went fine UNTIL I had to figure out how to make Windows the first boot entry in Grub,
First entry:

root# cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

GRUB_DEFAULT=0
GRUB_TIMEOUT=20
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

Wrong? Its not the first entry, but is it important?
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: Multiple bootloader menus.

#19 Post by pcalvert »

edbarx wrote:I think, using several small partitions for my bootloaders is the best solution to date.
Why several small partitions? Why not install the boot loader for each OS on its root partition and have just a single small partition for your "master GRUB" that is set up to chain-load the other boot loaders?

Phil
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

User avatar
Tadeas
Posts: 1013
Joined: 2008-09-22 09:11
Location: Prague
Contact:

Re: Multiple bootloader menus.

#20 Post by Tadeas »

Can't you just chainload into another Grub and then chainload back? It worked like this on my system some time ago, there was one "main" Grub in the MBR that booted Debian and Windows directly and chainloaded another Grub for opensuse (and possibly chainloaded back in one menu entry)
Because let’s face it, the unfortunate aspect of software development is that it involves humans. Mewling, disorganized, miserably analog humans. Sometimes they smell bad.

Post Reply