]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Skip setting kernel root cmdline parameter for UsrOnly with ImageID and without verity
authorMichael A Cassaniti <michael@cassaniti.id.au>
Wed, 27 Jul 2022 04:22:15 +0000 (14:22 +1000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 5 Aug 2022 07:22:56 +0000 (09:22 +0200)
When an image is built as a /usr only image and does not use verity, the kernel
command line should (and already does) contain the parameter `mount.usr`. It
should not contain a root parameter since `systemd-repart` and
`systemd-gpt-auto-generator` will take care of generating and mounting the root
partition.

Without this change the root partition label used on the kernel command line
will be invalid.

mkosi/__init__.py

index 9cce217a529da1fa0e59205f87226aa4796d4a93..4d8be448f35df413506750a4d2abba37344586ab 100644 (file)
@@ -4078,7 +4078,8 @@ def install_unified_kernel(
                 option = "usrhash" if args.usr_only else "roothash"
                 boot_options = f"{boot_options} {option}={root_hash}"
             elif partlabel:
-                boot_options = f"{boot_options} root=PARTLABEL={partlabel}"
+                option = "mount.usr" if args.usr_only else "root"
+                boot_options = f"{boot_options} {option}=PARTLABEL={partlabel}"
 
             osrelease = root / "usr/lib/os-release"
             cmdline = workspace(root) / "cmdline"