Sat 12 Nov 2011 12:14:15 AM UTC, original submission:
The purpose of this patch is to allow storing multiple
system grub installations on one device and let the automatic
configuration updating tools works.
My use case is the following:
I use usb keys to boot several full luks encrypted systems,
one key per system for now and I want to store all the grub
installations on one device only.
I first try to install into several partitions but on #grub
channel Jordan_U tell me about using the configfile, here is a
working example of my new setup:
- ${usb_key}/grub: master grub with hand written configuration
to load system specific configurations with "configfile"
directives. This configuration is managed on one particular
system which does the grub-setup calls on upgrade. I added
a script '/etc/grub.d/15_my_systems'
#+begin_src conf
# [...]
menuentry 'Svartalfheim' {
insmod gzio
insmod part_msdos
insmod btrfs
set root='(/dev/sdb,msdos1)'
search --no-floppy --fs-uuid --set=root 3102b6ea-ee28-44d4-82ba-21ec98631f1e
echo 'Loading svartalfheim configuration... '
configfile /svartalfheim/grub/grub.cfg
}
menuentry 'Nidhogg' {
insmod gzio
insmod part_msdos
insmod btrfs
set root='(/dev/sdb,msdos1)'
search --no-floppy --fs-uuid --set=root 3102b6ea-ee28-44d4-82ba-21ec98631f1e
echo 'Loading nidhogg configuration... '
configfile /nidhogg/grub/grub.cfg
}
# [...]
#+end_src
- ${usb_key}/$(hostname -s)/grub: grub installation for each
host generated by update-grub on each system. I use
'GRUB_SETUP=/bin/true' in '/etc/default/grub' to let only
one host doing the MBR upgrades.
Here is the changelog:
- util/grub-mkconfig.in: Load "${sysconfdir}/default/grub"
after providing default value of "${GRUB_PREFIX}".
- util/grub-install.in (GRUB_PREFIX): New name of
"${grubdir}", this permit user configuration with
"${sysconfdir}/default/grub".
(grub_setup): Permit to overwrite this variable with
${GRUB_SETUP} from user default variable file.
Regards.
|