summaryrefslogtreecommitdiff
path: root/vmdb/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'vmdb/plugins')
-rw-r--r--vmdb/plugins/grub.mdwn3
-rw-r--r--vmdb/plugins/grub_plugin.py7
2 files changed, 10 insertions, 0 deletions
diff --git a/vmdb/plugins/grub.mdwn b/vmdb/plugins/grub.mdwn
index c2abe54..645caf0 100644
--- a/vmdb/plugins/grub.mdwn
+++ b/vmdb/plugins/grub.mdwn
@@ -27,6 +27,9 @@ Step keys:
* `quiet` — OPTIONAL; should the kernel be configured to boot
quietly? Default is no.
+* `timeout` — OPTIONAL; set the grub menu timeout, in seconds.
+ Defaults to 0 seconds.
+
Example (in the .vmdb file):
- grub: bios
diff --git a/vmdb/plugins/grub_plugin.py b/vmdb/plugins/grub_plugin.py
index e9501e4..29af435 100644
--- a/vmdb/plugins/grub_plugin.py
+++ b/vmdb/plugins/grub_plugin.py
@@ -95,6 +95,7 @@ class GrubStepRunner(vmdb.StepRunnerInterface):
"tag": "",
"image-dev": "",
"quiet": False,
+ "timeout": 0,
}
def run(self, values, settings, state):
@@ -174,6 +175,7 @@ class GrubStepRunner(vmdb.StepRunnerInterface):
self.set_grub_cmdline_config(chroot, kernel_params)
self.add_grub_crypto_disk(chroot)
+ self.set_grub_timeout(chroot, values["timeout"])
if console == "serial":
self.add_grub_serial_console(chroot)
@@ -277,3 +279,8 @@ class GrubStepRunner(vmdb.StepRunnerInterface):
filename = self.chroot_path(chroot, "/etc/default/grub")
with open(filename, "a") as f:
f.write("GRUB_ENABLE_CRYPTODISK=y\n")
+
+ def set_grub_timeout(self, chroot, timeout):
+ filename = self.chroot_path(chroot, "/etc/default/grub")
+ with open(filename, "a") as f:
+ f.write("GRUB_TIMEOUT={}\n".format(timeout))