From e0126e5b2ed464d6d11168fabe160460d4f54ed7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 20 Sep 2021 19:14:27 +0200 Subject: [PATCH] Use temporary variable to simplify function invocation Also let's use normal PEP8-style indentation. --- mkosi/__init__.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) 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") -- 2.47.2