FS#65340 - [grub] Source files in /etc/default/grub.d

Attached to Project: Arch Linux
Opened by notaspamaccount123 (notaspamaccount123) - Friday, 31 January 2020, 19:56 GMT
Last edited by Christian Hesse (eworm) - Monday, 12 June 2023, 06:10 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Christian Hesse (eworm)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

Arch has a default GRUB configuration in /etc/default/grub but sometimes minor changes need to be made (e.g. adding a boot parameter) so it would be great if /etc/default/grub sourced /etc/default/grub.d/*.

This allows packages to create drop-in config files to add whatever they need without needing to overwrite the main config file.

Other distributions such as Debian have this by default.

Additional info:
* package version(s):
any GRUB version
* config and/or log files:
/etc/default/grub
This task depends upon

Closed by  Christian Hesse (eworm)
Monday, 12 June 2023, 06:10 GMT
Reason for closing:  Implemented
Additional comments about closing:  grub 2:2.06.r557.gac560966d-1
Comment by Doug Newgard (Scimmia) - Wednesday, 05 February 2020, 13:38 GMT
Just what do you see it being used for that isn't already covered by .pacnew files?
Comment by notaspamaccount123 (notaspamaccount123) - Wednesday, 05 February 2020, 22:01 GMT
So the package doesn't overwrite any custom user configuration and just adds what it needs.
Comment by Doug Newgard (Scimmia) - Thursday, 06 February 2020, 01:02 GMT
The package never overwrites custom user configs. That's the whole point of .pacnew files.
Comment by Ryan Petris (ryanpetris) - Wednesday, 24 May 2023, 20:18 GMT
Lets forget about .pacnew files for a minute and think about the advantages of having a separate grub.d configuration directory:

1. Changes can be split into smaller distinct files, such as modprobe.d, sysctl.d, tmpfiles.d, udev/rules.d. This is a common pattern even if you're not modifying upstream packages to add it.
2. Having a drop-in configuration directory would allow you to place configuration changes there _from other packages_. For instance, maybe the plymouth package could automatically add "splash" to the CMDLINE argument(s) rather than relying on the user to add it.

Personally #2 is a big thing for me, as I take all the common configuration changes I make and package them where possible. I'm unable to do this for things like grub and mkinitcpio due them not having their own *.d directories. Yes, a .pacnew file is generated when something changes, but then every time they get updated I have to go through and either incorporate any new changes in my file or just make my modifications to the new file and overwrite the old one. I wouldn't have to do that if I could just plop single changes in a .d directory.

I understand that Arch isn't like Debian, but it's the little things like this that can make things so much better with just a tiny bit of effort.
Comment by Christian Hesse (eworm) - Monday, 12 June 2023, 06:10 GMT
Just pushed grub 2:2.06.r557.gac560966d-1, that should do what you want.

Loading...