How best to adapt grub configuration?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How best to adapt grub configuration?

arch general mailing list-2
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)
Reply | Threaded
Open this post in threaded view
|

Re: How best to adapt grub configuration?

arch general mailing list-2
Em abril 16, 2018 8:20 Jeanette C. via arch-general escreveu:

> 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,
>
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

attachment0 (887 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

How best to adapt grub configuration?

respiranto-2
In reply to this post by arch general mailing list-2
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


On 2018-04-16 13:20, Jeanette C. via arch-general wrote:

> 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)
Reply | Threaded
Open this post in threaded view
|

Re: How best to adapt grub configuration?

arch general mailing list-2
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)