Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions mkosi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1946,18 +1946,20 @@ def finalize_cmdline(
else:
cmdline = []

if roothash:
cmdline += [roothash]

cmdline += context.config.kernel_command_line

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
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 = [f"{name}=PARTUUID={root}" if c == f"{name}=PARTUUID" else c for c in cmdline]
cmdline = [f"{name}=PARTUUID={root}" if c == f"{name}=PARTUUID" else c for c in cmdline]

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]

return cmdline

Expand Down
Loading