summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-01-30 08:29:58 -0600
committerGitHub <noreply@github.com>2024-01-30 08:29:58 -0600
commit8bd6c24b50a34225763058c1daa28c8a8fe59098 (patch)
tree211c13a3df56abe246d556eaf04d8208d12b5af4 /src
parent02f7f91e3937f1622ba055847aa96b207d5ba754 (diff)
parent287c3edbac7f308d3240bdec253f0e5103e8eca1 (diff)
downloadvyos-1x-8bd6c24b50a34225763058c1daa28c8a8fe59098.tar.gz
vyos-1x-8bd6c24b50a34225763058c1daa28c8a8fe59098.zip
Merge pull request #2888 from vyos/mergify/bp/sagitta/pr-2886
system-option: T5979: Add configurable kernel boot options (backport #2886)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/system_option.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/conf_mode/system_option.py b/src/conf_mode/system_option.py
index d92121b3d..3b5b67437 100755
--- a/src/conf_mode/system_option.py
+++ b/src/conf_mode/system_option.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2019-2023 VyOS maintainers and contributors
+# Copyright (C) 2019-2024 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -22,6 +22,7 @@ from time import sleep
from vyos.config import Config
from vyos.configverify import verify_source_interface
+from vyos.system import grub_util
from vyos.template import render
from vyos.utils.process import cmd
from vyos.utils.process import is_systemd_service_running
@@ -39,7 +40,6 @@ time_format_to_locale = {
'24-hour': 'en_GB.UTF-8'
}
-
def get_config(config=None):
if config:
conf = config
@@ -87,6 +87,13 @@ def verify(options):
def generate(options):
render(curlrc_config, 'system/curlrc.j2', options)
render(ssh_config, 'system/ssh_config.j2', options)
+
+ cmdline_options = []
+ if 'kernel' in options:
+ if 'disable_mitigations' in options['kernel']:
+ cmdline_options.append('mitigations=off')
+ grub_util.update_kernel_cmdline_options(' '.join(cmdline_options))
+
return None
def apply(options):