Skip to content
Snippets Groups Projects
Commit a5d2f1b4 authored by Thomas Bellman's avatar Thomas Bellman
Browse files

Allow users to override the guessed bootloader.

Add a parameter 'provider' to the kernel_option definition, allowing
users to specify which bootloader is in use.
parent 2497c4ee
No related branches found
No related tags found
No related merge requests found
# Copyright © 2017 Thomas Bellman, Linköping, Sweden
# Copyright © 2017-2018 Thomas Bellman, Linköping, Sweden
# Licensed under the GNU LGPL v3+; see the README file for more information.
/*
* Set or remove a kernel commandline option.
*
* Which bootloader is in use will be guessed. The heuristics for that
* are not very good.
* Depending on the details of the bootloader, the option might be set/unset
* for all kernels, or just for all Linux kernels. There is currently no
* way to control this.
*
* Parameters:
* - name Kernel commandline option to set or remove.
......@@ -20,12 +21,21 @@
* like "console=ttyS0".
* Since only ensure => absent is implemented, the value
* parameter is currently ignored.
*
* - provider The bootloader in use. Supported values are 'grub0' and
* 'grub2'. If not specified, the bootloader will be guessed
* based on the operating system.
* The grub2 provider currently only supports removing options.
*/
define bootloader::kernel_option($ensure='present', $value=undef)
define bootloader::kernel_option(
$ensure='present', $value=undef, $provider=undef)
{
if ($provider) {
$bootloader = $provider
} else {
include bootloader::guess
$bootloader = $bootloader::guess::bootloader
}
case $bootloader
{
'grub0': {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment