1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-05-19 12:01:32 +02:00
parent fba4e94506
commit aa467bcae1
2 changed files with 13 additions and 7 deletions

View File

@ -60,18 +60,18 @@
<varlistentry> <varlistentry>
<term><option>-p</option></term> <term><option>-p</option></term>
<term><option>--print-esp-path</option></term> <term><option>--print-esp-path</option></term>
<listitem><para>This option modifies the behaviour of <command>status</command>. Prints only the <listitem><para>This option modifies the behaviour of <command>status</command>. Only prints the path
path to the EFI System Partition (ESP) to standard output and exits.</para></listitem> to the EFI System Partition (ESP) to standard output and exits.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><option>-x</option></term> <term><option>-x</option></term>
<term><option>--print-boot-path</option></term> <term><option>--print-boot-path</option></term>
<listitem><para>This option modifies the behaviour of <command>status</command>. Prints only the <listitem><para>This option modifies the behaviour of <command>status</command>. Only prints the path
path to the Extended Boot Loader partition if it exists, and the path to the ESP otherwise to to the Extended Boot Loader partition if it exists, and the path to the ESP otherwise to standard
standard output and exit. This command is useful to determine where to place boot loader entries, as output and exit. This command is useful to determine where to place boot loader entries, as they are
they are preferably placed in the Extended Boot Loader partition if it exists and in the ESP preferably placed in the Extended Boot Loader partition if it exists and in the ESP otherwise.
otherwise.</para></listitem> </para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>

View File

@ -1067,10 +1067,16 @@ static int parse_argv(int argc, char *argv[]) {
break; break;
case 'p': 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; arg_print_esp_path = true;
break; break;
case 'x': 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; arg_print_dollar_boot_path = true;
break; break;