]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Use temporary variable to simplify function invocation 833/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 20 Sep 2021 17:14:27 +0000 (19:14 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 12 Oct 2021 11:37:06 +0000 (13:37 +0200)
Also let's use normal PEP8-style indentation.

mkosi/__init__.py

index 5102fed1dc780e6462e7b7f9be5331a64ae007ac..a173a5f6ef2ca3f1d67ab85950b12fcd66ecba2a 100644 (file)
@@ -6218,18 +6218,14 @@ def load_args(args: argparse.Namespace) -> CommandLineArguments:
         args.kernel_command_line.append("console=ttyS0")
 
     if args.bootable and args.usr_only and not args.verity:
-        # GPT auto-discovery on empty kernel command lines only looks
-        # for root partitions (in order to avoid ambiguities), if we
-        # shall operate without one (and only have a /usr partition)
-        # we thus need to explicitly say which partition to mount.
-        args.kernel_command_line.append(
-            "mount.usr=/dev/disk/by-partlabel/"
-            + xescape(
-                root_partition_description(
-                    args=None, image_id=args.image_id, image_version=args.image_version, usr_only=args.usr_only
-                )
-            )
-        )
+        # GPT auto-discovery on empty kernel command lines only looks for root partitions
+        # (in order to avoid ambiguities), if we shall operate without one (and only have
+        # a /usr partition) we thus need to explicitly say which partition to mount.
+        name = root_partition_description(args=None,
+                                          image_id=args.image_id,
+                                          image_version=args.image_version,
+                                          usr_only=args.usr_only)
+        args.kernel_command_line.append(f"mount.usr=/dev/disk/by-partlabel/{xescape(name)}")
 
     if not args.read_only:
         args.kernel_command_line.append("rw")