20.07.2018 01:02, Istvan Gabor пишет:
Hello:
It will be a little bit long to explain what I want to do.
I have several linux OS-es on a hard disk. Each OS has its own boot loader installed on the OS's root partitition. The MBR has also a boot loader. This boot loader chainloads the other boot loaders on the root partitions. This makes easy to completely separate different boot menus for different OS-es.
For the management of the above scenario at least one of the OS-es must have 2 different boot loader install configurations, one for the mbr boot loader (chainloader) and one for the OS's own boot loader on the root partition.
This can be easily done by using legacy GRUB boot loader by making two separate directories for the chainloader and the other configuration. Each directory contains all the files necessary to install and make work GRUB boot loader.
Legacy GRUB has command option --prefix which enables to use different GRUB config files for different GRUB installations.
grub2-install --boot-directory=/master /dev/sda
Here's an example:
To install MBR grub chainloader:
In grub shell I use: setup --force-lba --prefix=/boot/grub.chainload (hd0) (hd0,0) # in this case config files in /boot/grub.chainload dir are used.
And to install the OS's own boot loader on the root partition: setup --force-lba (hd0,0) (hd0,0) # here the default /boot/grub is used.
Now my question: how can I do the same with GRUB2? I would like to have a main GRUB2 menu/loader on the MBR which chainloads GRUB2 loaders on the different root partitions.
Since GRUB2 configuration files are spotted at different places (/etc/default/grub, /boot/grub2/grub.cfg, /etc/grub.d/* scripts),
The only configuration file is grub.cfg. Everything else is used by grub-mkconfig to generate it, but use of grub-mkconfig is in no way mandatory. You are not going to install new OS every day I guess so master grub.cfg will be pretty static and can be created once and then manually adjusted when OS are added/removed.
I don't know how I could make different configuration files for the different install locations, not to mentions how I could install the different GRUB2 loaders to different locations (to mbr and to the root partition).
In principle you could embed grub.cfg into master grub image (assuming you have enough space in post-MBR gap).
I would appreciate any help in this matter.
Thanks in advance,
Istvan
ps: Please don't ask me why I do want to do this and please do not suggest that I use one GRUB2 menu to load all of the different OS-es. I want to do it because I could do it with legacy GRUB and I expect that it is doable with the advanced GRUB2 too, and anyway I got used to do it that way. Thanks.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org