diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-05-25 10:11:09 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-05-25 10:11:09 +0300 |
commit | b42511b6cf58a20305ccc2faf361126983126c47 (patch) | |
tree | 314e04a3cd62ed1db88bcde4a98694b69a75d3f8 /vmdb/plugins/grub_plugin.py | |
parent | ade2b23672b5651f978d3f13348d3894bba6cc9a (diff) | |
download | vmdb2-b42511b6cf58a20305ccc2faf361126983126c47.tar.gz |
feat(grub): add timeout setting
Diffstat (limited to 'vmdb/plugins/grub_plugin.py')
-rw-r--r-- | vmdb/plugins/grub_plugin.py | 7 |
1 files changed, 7 insertions, 0 deletions
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)) |