summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Small <tim@seoss.co.uk>2022-11-24 11:01:42 +0000
committerLars Wirzenius <liw@liw.fi>2023-04-07 08:16:05 +0000
commitb3cd6329569dcbe0d45e544a8771969abf58569a (patch)
treed65bd79da4ff2c31522fe2431f732842d0f8b7cf
parentbc737ad9966201b68f5e8d98521b4abb4add870d (diff)
downloadvmdb2-b3cd6329569dcbe0d45e544a8771969abf58569a.tar.gz
Allow customisation of hard-coded grub Linux kernel params.
The kernel parameters `biosdevname=0 net.ifnames=0 consoleblank=0 rw` were previously hard-coded and non-modifiable in the grub step. Allow user customisation of these parameters, whilst setting the default to the current parameter set for backwards compatibility.
-rw-r--r--vmdb/plugins/grub.mdwn4
-rw-r--r--vmdb/plugins/grub_plugin.py9
2 files changed, 7 insertions, 6 deletions
diff --git a/vmdb/plugins/grub.mdwn b/vmdb/plugins/grub.mdwn
index 75314f8..c8580d1 100644
--- a/vmdb/plugins/grub.mdwn
+++ b/vmdb/plugins/grub.mdwn
@@ -34,6 +34,10 @@ Step keys:
* `timeout` &mdash; OPTIONAL; set the grub menu timeout, in seconds.
Defaults to 0 seconds.
+* `kernel-params` &mdash; OPTIONAL; list of parameters which grub will
+ pass to the Linux kernel. Default is:
+ `["biosdevname=0", "net.ifnames=0", "consoleblank=0", "rw"]`
+
Example (in the .vmdb file):
- grub: bios
diff --git a/vmdb/plugins/grub_plugin.py b/vmdb/plugins/grub_plugin.py
index 31b2016..45f1e5c 100644
--- a/vmdb/plugins/grub_plugin.py
+++ b/vmdb/plugins/grub_plugin.py
@@ -93,6 +93,7 @@ class GrubStepRunner(vmdb.StepRunnerInterface):
"tag": "",
"image-dev": "",
"quiet": False,
+ "kernel-params": ["biosdevname=0", "net.ifnames=0", "consoleblank=0", "rw"],
"timeout": 0,
}
@@ -183,12 +184,8 @@ class GrubStepRunner(vmdb.StepRunnerInterface):
image_dev = prep_dev
self.install_package(chroot, grub_package)
- kernel_params = [
- "biosdevname=0",
- "net.ifnames=0",
- "consoleblank=0",
- "rw",
- ]
+ kernel_params = values["kernel-params"]
+
if console == "serial":
if 'ppc64' in state.arch:
kernel_params.extend(