From e4272898871d813a0cecbc30fb7efc7671becc51 Mon Sep 17 00:00:00 2001 From: Nikita Dubrovskii Date: Tue, 30 Jan 2024 09:09:58 +0100 Subject: [PATCH] stages(zipl.inst): support appending kernel options In some cases it could useful to add additional kernel options without modifying BLS config, so any subsequent call to `zipl` would ignore them. We are going to use this to append `ignition.firstboot` to kernel cmdline for CoreOS on s390x. --- stages/org.osbuild.zipl.inst | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/stages/org.osbuild.zipl.inst b/stages/org.osbuild.zipl.inst index a9bea045..caca9f82 100755 --- a/stages/org.osbuild.zipl.inst +++ b/stages/org.osbuild.zipl.inst @@ -28,6 +28,14 @@ SCHEMA_2 = r""" "location": { "type": "number" }, + "kernel_opts_append": { + "description": "Additional kernel options to add to the discovered options", + "type": "array", + "items": { + "description": "A single kernel command line option", + "type": "string" + } + }, "blocksize": { "type": "number", "default": 512 @@ -85,6 +93,7 @@ def find_kernel(root, kernel: str): def main(paths, devices, options): kver = options["kernel"] location = options["location"] + append_kopts = options.get("kernel_opts_append", []) blocksize = options.get("blocksize", 512) root = paths["mounts"] @@ -100,7 +109,7 @@ def main(paths, devices, options): "--target", f"{root}/boot", "--image", kernel, "--ramdisk", initrd, - "--parameters", kopts, + "--parameters", f"{kopts} {' '.join(append_kopts)}" if append_kopts else kopts, "--targetbase", device, "--targettype", "SCSI", "--targetblocksize", str(blocksize),