Discussion:
How best to adapt grub configuration?
(too old to reply)
Jeanette C. via arch-general
2018-04-16 11:20:56 UTC
Permalink
Raw Message
Hey hey,
how would I best adapt Grub's configuration file (gurb.cfg)?

The usecase: I use Grub's play command to play different melodies for
different entries and one when Grub is ready to be used. The reason behind it:
I'm blind and like to know quite early on what is happening.

Where would I best put these changes so they will survive Grub updates and
regeneration of the config file?

Thanks and best wishes,

Jeanette

--------
* Website: http://juliencoder.de - for summer is a state of sound
* SoundCloud: https://soundcloud.com/jeanette_c
* Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
* GitHub: https://github.com/jeanette-c
* Twitter: https://twitter.com/jeanette_c_s

You should never try to change me
I can be nobody else
And I like the way I am <3
(Britney Spears)
Giancarlo Razzolini via arch-general
2018-04-16 12:47:30 UTC
Permalink
Raw Message
Post by Jeanette C. via arch-general
Hey hey,
how would I best adapt Grub's configuration file (gurb.cfg)?
The usecase: I use Grub's play command to play different melodies for
I'm blind and like to know quite early on what is happening.
Where would I best put these changes so they will survive Grub updates and
regeneration of the config file?
Thanks and best wishes,
Hi Jeanette,

You can use the /etc/grub.d directory for this. Depending on how you implement this,
you can use any file that does not come by default.

Regards,
Giancarlo Razzolini
respiranto
2018-04-16 14:20:28 UTC
Permalink
Raw Message
Hi Jeanette,

in my opinion, the easiest option is to just write grub.cfg by hand.
Fortunately, in Arch, grub.cfg will never be overwritten by an update.

For basic functionality, grub.cfg may e.g. look like the following:
---
set default=0
set timeout=5

play <tune>

menuentry 'Arch' {
play <tune_arch>
search --fs-uuid --set=root --hint=(hdX,gptY) <BOOT_UUID>
linux /vmlinuz-linux root=UUID=<ARCH_UUID>
initrd /initramfs-linux.img
}

menuentry 'Debian' {
play <tune_debian>
search --fs-uuid --set=root --hint=(hdU,gptV) <DEBIAN_UUID>
linux /boot/vmlinuz-<ver> root=UUID=<DEBIAN_UUID>
initrd /boot/initrd.img-<ver>
}

menuentry 'OpenBSD' {
play <tune_obsd>
search --fs-uuid --set=root --hint=(hdR,gptS) <SOME_UUID>
insmod chain
chainloader <some_path>/BOOTX64.efi
}
---
assuming /boot is on a separate partition on Arch, but not on Debian.
And, for OpenBSD, that you are using (U)EFI.

In case you use Debian or another Operating System where parameters like
the kernel path change, you will have to update it manually though (or
by using a custom script running after update).

I am not sure where you would like the sounds to hear, so you might have
to change things. Also, I assumed the sound files to be located on the
current partition, i.e. - unless changed - the partition GRUB's
configuration files reside on.

Also, you should make sure, grub.cfg is not overwritten by another
distribution's package manager, like Debian's.

Note that the sounds will be played once the respective OS is about to
be booted. I don't know whether it is possible to hear the sound just
upon just selecting an option using arrow keys.

Also, you might consider writing functions for the separate boot options
that you can just call from the GRUB command line.


Regards,
Einhard
Post by Jeanette C. via arch-general
Hey hey,
how would I best adapt Grub's configuration file (gurb.cfg)?
The usecase: I use Grub's play command to play different melodies for
different entries and one when Grub is ready to be used. The reason
behind it: I'm blind and like to know quite early on what is happening.
Where would I best put these changes so they will survive Grub updates
and regeneration of the config file?
Thanks and best wishes,
Jeanette
--------
 * Website: http://juliencoder.de - for summer is a state of sound
 * SoundCloud: https://soundcloud.com/jeanette_c
 * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
 * GitHub: https://github.com/jeanette-c
 * Twitter: https://twitter.com/jeanette_c_s
You should never try to change me
I can be nobody else
And I like the way I am <3
(Britney Spears)
Jeanette C. via arch-general
2018-04-16 14:28:45 UTC
Permalink
Raw Message
Hello Einhad,
thank you for your detailed response. That is currently the way I'm running
it. I was just wondering if I should - as Giancarlo suggested - one of the
suplementary files and, if so, which ones.

As for the example configuration it was spot on. Alas, I haven't discovered a
way to play the tunes when the cursor is on an entry. It's been a wile since
I've read the documentation. Maybe another look is warranted.

Best wishes,

Jeanette

--------
* Website: http://juliencoder.de - for summer is a state of sound
* SoundCloud: https://soundcloud.com/jeanette_c
* Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
* GitHub: https://github.com/jeanette-c
* Twitter: https://twitter.com/jeanette_c_s

You should never try to change me
I can be nobody else
And I like the way I am <3
(Britney Spears)

Loading...