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.
This commit is contained in:
Nikita Dubrovskii 2024-01-30 09:09:58 +01:00 committed by Dusty Mabe
parent c673eab2b5
commit e427289887

View file

@ -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),