]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Always update /etc/kernel/cmdline
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 7 May 2022 18:56:59 +0000 (20:56 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 7 May 2022 18:58:26 +0000 (20:58 +0200)
Allows updating the kernel cmdline without needing a full rebuild.

mkosi/__init__.py

index c3abea7293dd72b117963d737b69f464010d0e1f..c24052095a9452e183f34fdaebffaa80d9d41358 100644 (file)
@@ -1714,6 +1714,9 @@ def prepare_tree(args: MkosiArgs, root: Path, do_run_build_script: bool, cached:
     if cached:
         # Reuse machine-id from cached image.
         args.machine_id = uuid.UUID(root.joinpath("etc/machine-id").read_text().strip()).hex
+        # Always update kernel command line.
+        if not do_run_build_script and args.bootable:
+            root.joinpath("etc/kernel/cmdline").write_text(" ".join(args.kernel_command_line) + "\n")
         return
 
     with complete_step("Setting up basic OS tree…"):