]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Revert "Make user provided command line take preference over roothash="
authorDaanDeMeyer <daan.j.demeyer@gmail.com>
Tue, 1 Jul 2025 07:22:11 +0000 (09:22 +0200)
committerDaanDeMeyer <daan.j.demeyer@gmail.com>
Tue, 1 Jul 2025 20:47:13 +0000 (22:47 +0200)
This reverts commit 5a15c7d31d097a11f83cfae664b0b7bb40100fc3.

mkosi/__init__.py

index 0ec8a85cb24db172058dea5a8e040f80c97a749e..99a424f9798e8c037ba473dc21e9eaaafcf83c11 100644 (file)
@@ -1938,20 +1938,18 @@ def finalize_cmdline(
     else:
         cmdline = []
 
-    cmdline += context.config.kernel_command_line
+    if roothash:
+        cmdline += [roothash]
 
-    for name in ("root", "mount.usr"):
-        type_prefix = name.removeprefix("mount.")
-        if not (root := next((p.uuid for p in partitions if p.type.startswith(type_prefix)), None)):
-            continue
+    cmdline += context.config.kernel_command_line
 
-        cmdline = [f"{name}=PARTUUID={root}" if c == f"{name}=PARTUUID" else c for c in cmdline]
+    if not roothash:
+        for name in ("root", "mount.usr"):
+            type_prefix = name.removeprefix("mount.")
+            if not (root := next((p.uuid for p in partitions if p.type.startswith(type_prefix)), None)):
+                continue
 
-    if roothash and (
-        (roothash.startswith("roothash=") and not any(c.startswith("root=") for c in cmdline))
-        or (roothash.startswith("usrhash=") and not any(c.startswith("mount.usr") for c in cmdline))
-    ):
-        cmdline += [roothash]
+            cmdline = [f"{name}=PARTUUID={root}" if c == f"{name}=PARTUUID" else c for c in cmdline]
 
     return cmdline