]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Add --qemu-smbios option
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 12 Mar 2023 18:56:50 +0000 (19:56 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 13 Mar 2023 12:13:18 +0000 (13:13 +0100)
This can be used to set io.systemd.stub.kernel-cmdline-extra to add
extra kernel cmdline arguments at runtime.

mkosi.md
mkosi/__init__.py
mkosi/backend.py

index aa60b9f93e67c67e7c500b2bd8b148d918f6ce65..840932ac238cee1ae6365cad4c7be03c4eef8434 100644 (file)
--- a/mkosi.md
+++ b/mkosi.md
@@ -813,6 +813,11 @@ a boolean argument: either "1", "yes", or "true" to enable, or "0",
 : Space-delimited list of additional arguments to pass when invoking
   qemu.
 
+`QemuSMBIOS=`
+
+: Space-delimited list of additional SMBIOS Type 11 strings to pass
+  when invoking qemu.
+
 `Netdev=`, `--netdev`
 
 : When used with the boot or qemu verbs, this option creates a virtual
index 89dd76dc7250aa42907bda91696f889734c46bbd..afea7767392e45f2e3f67ea2604ec6d468a510d7 100644 (file)
@@ -1301,6 +1301,7 @@ class ArgumentParserMkosi(argparse.ArgumentParser):
         "SignExpectedPCR": "--sign-expected-pcr",
         "RepositoryDirectories": "--repository-directory",
         "Credentials": "--credential",
+        "QemuSMBIOS": "--qemu-smbios",
     }
 
     def __init__(self, *kargs: Any, **kwargs: Any) -> None:
@@ -1910,6 +1911,12 @@ def create_parser() -> ArgumentParserMkosi:
         # arguments.
         help=argparse.SUPPRESS,
     )
+    group.add_argument(
+        "--qemu-smbios",
+        action=RepeatableSpaceDelimitedListAction,
+        default=[],
+        help="Set an SMBIOS Type 11 string when running qemu",
+    )
     group.add_argument(
         "--network-veth",     # Compatibility option
         dest="netdev",
@@ -3672,6 +3679,8 @@ def run_qemu(config: MkosiConfig) -> None:
 
     for k, v in config.credentials.items():
         cmdline += ["-smbios", f"type=11,value=io.systemd.credential:{k}={v}"]
+    for v in config.qemu_smbios:
+        cmdline += ["-smbios", f"type=11,value={v}"]
 
     with contextlib.ExitStack() as stack:
         if fw_supports_sb:
index e44de931d4dea9ab66f3242cb055e0e08f79270b..a129eb3112f365a9116fb8449ea19d634805b484 100644 (file)
@@ -317,6 +317,7 @@ class MkosiConfig:
     qemu_mem: str
     qemu_kvm: bool
     qemu_args: Sequence[str]
+    qemu_smbios: Sequence[str]
 
     passphrase: Optional[Path]