From aa467bcae16f7090813d6e549487e73a95157f69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 19 May 2019 12:01:32 +0200 Subject: [PATCH] bootctl: do not allow -x and -p to be used together -x already prints the path to ESP in some circumstances, and allowing both to be printed seems confusing. --- man/bootctl.xml | 14 +++++++------- src/boot/bootctl.c | 6 ++++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/man/bootctl.xml b/man/bootctl.xml index 3e1f9b588b3..46b9738b148 100644 --- a/man/bootctl.xml +++ b/man/bootctl.xml @@ -60,18 +60,18 @@ - This option modifies the behaviour of status. Prints only the - path to the EFI System Partition (ESP) to standard output and exits. + This option modifies the behaviour of status. Only prints the path + to the EFI System Partition (ESP) to standard output and exits. - This option modifies the behaviour of status. Prints only the - path to the Extended Boot Loader partition if it exists, and the path to the ESP otherwise to - standard output and exit. This command is useful to determine where to place boot loader entries, as - they are preferably placed in the Extended Boot Loader partition if it exists and in the ESP - otherwise. + This option modifies the behaviour of status. Only prints the path + to the Extended Boot Loader partition if it exists, and the path to the ESP otherwise to standard + output and exit. This command is useful to determine where to place boot loader entries, as they are + preferably placed in the Extended Boot Loader partition if it exists and in the ESP otherwise. + diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index c3ebdd7c4ea..55924adf069 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -1067,10 +1067,16 @@ static int parse_argv(int argc, char *argv[]) { break; case 'p': + if (arg_print_dollar_boot_path) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), + "--print-boot-path/-x cannot be combined with --print-esp-path/-p"); arg_print_esp_path = true; break; case 'x': + if (arg_print_esp_path) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), + "--print-boot-path/-x cannot be combined with --print-esp-path/-p"); arg_print_dollar_boot_path = true; break; -- 2.47.3