summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2025-08-01 20:57:01 +0100
committerGitHub <noreply@github.com>2025-08-01 20:57:01 +0100
commitacd77116af06f4eaaeb3c8a1dd4fa394aadc96d2 (patch)
treecf0a3f3d10ffaa3c7227b4396b2edfef9e9c74a6
parentbc3ca477a0d92ae2fa5f6f3e0d756243a5aaea27 (diff)
parent94c9f432b59cbb57845db03583d357a0677412f4 (diff)
downloadvyos-1x-acd77116af06f4eaaeb3c8a1dd4fa394aadc96d2.tar.gz
vyos-1x-acd77116af06f4eaaeb3c8a1dd4fa394aadc96d2.zip
Merge pull request #4639 from c-po/T7668-optimize
T7668: bail out early in get_cli_kernel_options() if nothing is to do
-rwxr-xr-xsrc/op_mode/image_installer.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/op_mode/image_installer.py b/src/op_mode/image_installer.py
index 2a9830f37..e42d5b856 100755
--- a/src/op_mode/image_installer.py
+++ b/src/op_mode/image_installer.py
@@ -493,12 +493,13 @@ def setup_grub(root_dir: str) -> None:
def get_cli_kernel_options(config_file: str) -> list:
config = ConfigTree(read_file(config_file))
config_dict = loads(config.to_json())
+ cmdline_options = []
kernel_options = dict_search('system.option.kernel', config_dict)
if kernel_options is None:
- kernel_options = {}
+ return cmdline_options
+
k_cpu_opts = kernel_options.get('cpu', {})
k_memory_opts = kernel_options.get('memory', {})
- cmdline_options = []
# XXX: This code path and if statements must be kept in sync with the Kernel
# option handling in system_options.py:generate(). This occurance is used