From: Zbigniew Jędrzejewski-Szmek Date: Sun, 19 May 2019 10:01:32 +0000 (+0200) Subject: bootctl: do not allow -x and -p to be used together X-Git-Tag: v243-rc1~404^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa467bcae16f7090813d6e549487e73a95157f69;p=thirdparty%2Fsystemd.git 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. --- 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;