From: Zbigniew Jędrzejewski-Szmek Date: Mon, 20 Sep 2021 17:14:27 +0000 (+0200) Subject: Use temporary variable to simplify function invocation X-Git-Tag: v11~27^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F833%2Fhead;p=thirdparty%2Fmkosi.git Use temporary variable to simplify function invocation Also let's use normal PEP8-style indentation. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 5102fed1d..a173a5f6e 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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")