On Fri, Mar 01, 2024 at 03:43:50PM +0000, Simon Rowe wrote:
> Kernel parameters actually cover a range of purposes, including
> userspace like systemd. They also need setting for a variety of
> reasons:
> 
>   * as distro defaults
>   * to provide configuration for a package
>   * for an admin to set desired behaviour
> 
> Having these all combined in a single line (like GRUB_CMDLINE_LINUX)
> is unwieldy, it is hard to make changes without impacting another
> usecase.
> 
> Add optional support for dropin files in the directories:
> 
>   * /usr/lib/kernel.d/
>   * /etc/kernel.d/
> 
> where the contents of each file with the '.conf' suffix is evaluated
> (excluding comments) and appended to any other kernel parameters
> defined via GRUB_CMDLINE_LINUX etc. Files in /etc/kernel.d/ completely
> replace those of the same name in /usr/lib/kernel.d/. This allows a
> distro or installer to set parameters but then for an admin to
> override them.

I'm -1 on this particular design choice given that it conflicts with
existing consensus in the wider Linux world around storing the kernel
command line in

/etc/kernel/cmdline, /usr/lib/kernel/cmdline, /proc/cmdline

(the first of these files is to be used)

And it is misaligned with already having a /etc/kernel directory
in the first place, a .d should be extending a file. Hence the
expectation here is that such drop-ins would go into a cmdline.d
directory.

Of course, you first are going to have to implement reading
/etc/kernel/cmdline and coordinate with other users like
systemd's kernel-install (or canonical/nullboot also uses it)
to add support for cmdline.d to our kernel installation scripts.

Generally speaking with drop-ins here I would expect this to
work by merging the dropins from /etc and /usr and then doing:

- /etc/kernel/cmdline if available
- /usr/lib/kernel/cmdline if available
- merged drop-ins
- /proc/cmdline

i.e. /usr/lib/kernel/cmdline.d would be completely replaced
by creating an /etc/kernel/cmdline.

-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to