mirror of
https://github.com/systemd/systemd
synced 2024-09-06 16:56:43 +00:00
kernel-install: add --esp-path= and --boot-path= options
Then, kernel-install takes one more step for compatibility with bootctl.
This commit is contained in:
parent
1fd2af1ab8
commit
4cff5e92a9
|
@ -269,20 +269,8 @@
|
||||||
<para>The following options are understood:</para>
|
<para>The following options are understood:</para>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<xi:include href="standard-options.xml" xpointer="esp-path"/>
|
||||||
<term><option>--esp-path=</option></term>
|
<xi:include href="standard-options.xml" xpointer="boot-path"/>
|
||||||
<listitem><para>Path to the EFI System Partition (ESP). If not specified, <filename>/efi/</filename>,
|
|
||||||
<filename>/boot/</filename>, and <filename>/boot/efi/</filename> are checked in turn. It is
|
|
||||||
recommended to mount the ESP to <filename>/efi/</filename>, if possible.</para></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><option>--boot-path=</option></term>
|
|
||||||
<listitem><para>Path to the Extended Boot Loader partition, as defined in the <ulink
|
|
||||||
url="https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader Specification</ulink>. If not
|
|
||||||
specified, <filename>/boot/</filename> is checked. It is recommended to mount the Extended Boot
|
|
||||||
Loader partition to <filename>/boot/</filename>, if possible.</para></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>--root=<replaceable>root</replaceable></option></term>
|
<term><option>--root=<replaceable>root</replaceable></option></term>
|
||||||
|
|
|
@ -186,6 +186,9 @@
|
||||||
<para>The following options are understood:</para>
|
<para>The following options are understood:</para>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
|
<xi:include href="standard-options.xml" xpointer="esp-path"/>
|
||||||
|
<xi:include href="standard-options.xml" xpointer="boot-path"/>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>-v</option></term>
|
<term><option>-v</option></term>
|
||||||
<term><option>--verbose</option></term>
|
<term><option>--verbose</option></term>
|
||||||
|
|
|
@ -97,4 +97,25 @@
|
||||||
in the image are used.</para></listitem>
|
in the image are used.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry id='esp-path'>
|
||||||
|
<term><option>--esp-path=</option></term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Path to the EFI System Partition (ESP). If not specified, <filename>/efi/</filename>,
|
||||||
|
<filename>/boot/</filename>, and <filename>/boot/efi/</filename> are checked in turn. It is
|
||||||
|
recommended to mount the ESP to <filename>/efi/</filename>, if possible.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry id='boot-path'>
|
||||||
|
<term><option>--boot-path=</option></term>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Path to the Extended Boot Loader partition, as defined in the
|
||||||
|
<ulink url="https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader Specification</ulink>.
|
||||||
|
If not specified, <filename>/boot/</filename> is checked. It is recommended to mount the Extended Boot
|
||||||
|
Loader partition to <filename>/boot/</filename>, if possible.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include "kernel-image.h"
|
#include "kernel-image.h"
|
||||||
#include "main-func.h"
|
#include "main-func.h"
|
||||||
#include "mkdir.h"
|
#include "mkdir.h"
|
||||||
|
#include "parse-argument.h"
|
||||||
#include "path-util.h"
|
#include "path-util.h"
|
||||||
#include "pretty-print.h"
|
#include "pretty-print.h"
|
||||||
#include "rm-rf.h"
|
#include "rm-rf.h"
|
||||||
|
@ -28,6 +29,11 @@
|
||||||
#include "verbs.h"
|
#include "verbs.h"
|
||||||
|
|
||||||
static bool arg_verbose = false;
|
static bool arg_verbose = false;
|
||||||
|
static char *arg_esp_path = NULL;
|
||||||
|
static char *arg_xbootldr_path = NULL;
|
||||||
|
|
||||||
|
STATIC_DESTRUCTOR_REGISTER(arg_esp_path, freep);
|
||||||
|
STATIC_DESTRUCTOR_REGISTER(arg_xbootldr_path, freep);
|
||||||
|
|
||||||
typedef enum Action {
|
typedef enum Action {
|
||||||
ACTION_ADD,
|
ACTION_ADD,
|
||||||
|
@ -473,7 +479,7 @@ static int context_acquire_xbootldr(Context *c) {
|
||||||
|
|
||||||
r = find_xbootldr_and_warn_at(
|
r = find_xbootldr_and_warn_at(
|
||||||
/* rfd = */ c->rfd,
|
/* rfd = */ c->rfd,
|
||||||
/* path = */ NULL,
|
/* path = */ arg_xbootldr_path,
|
||||||
/* unprivileged_mode= */ -1,
|
/* unprivileged_mode= */ -1,
|
||||||
/* ret_path = */ &c->boot_root,
|
/* ret_path = */ &c->boot_root,
|
||||||
/* ret_uuid = */ NULL,
|
/* ret_uuid = */ NULL,
|
||||||
|
@ -499,7 +505,7 @@ static int context_acquire_esp(Context *c) {
|
||||||
|
|
||||||
r = find_esp_and_warn_at(
|
r = find_esp_and_warn_at(
|
||||||
/* rfd = */ c->rfd,
|
/* rfd = */ c->rfd,
|
||||||
/* path = */ NULL,
|
/* path = */ arg_esp_path,
|
||||||
/* unprivileged_mode= */ -1,
|
/* unprivileged_mode= */ -1,
|
||||||
/* ret_path = */ &c->boot_root,
|
/* ret_path = */ &c->boot_root,
|
||||||
/* ret_part = */ NULL,
|
/* ret_part = */ NULL,
|
||||||
|
@ -1106,6 +1112,8 @@ static int help(void) {
|
||||||
" -h --help Show this help\n"
|
" -h --help Show this help\n"
|
||||||
" --version Show package version\n"
|
" --version Show package version\n"
|
||||||
" -v --verbose Increase verbosity\n"
|
" -v --verbose Increase verbosity\n"
|
||||||
|
" --esp-path=PATH Path to the EFI System Partition (ESP)\n"
|
||||||
|
" --boot-path=PATH Path to the $BOOT partition\n"
|
||||||
"\nSee the %4$s for details.\n",
|
"\nSee the %4$s for details.\n",
|
||||||
program_invocation_short_name,
|
program_invocation_short_name,
|
||||||
ansi_highlight(),
|
ansi_highlight(),
|
||||||
|
@ -1118,14 +1126,18 @@ static int help(void) {
|
||||||
static int parse_argv(int argc, char *argv[]) {
|
static int parse_argv(int argc, char *argv[]) {
|
||||||
enum {
|
enum {
|
||||||
ARG_VERSION = 0x100,
|
ARG_VERSION = 0x100,
|
||||||
|
ARG_ESP_PATH,
|
||||||
|
ARG_BOOT_PATH,
|
||||||
};
|
};
|
||||||
static const struct option options[] = {
|
static const struct option options[] = {
|
||||||
{ "help", no_argument, NULL, 'h' },
|
{ "help", no_argument, NULL, 'h' },
|
||||||
{ "version", no_argument, NULL, ARG_VERSION },
|
{ "version", no_argument, NULL, ARG_VERSION },
|
||||||
{ "verbose", no_argument, NULL, 'v' },
|
{ "verbose", no_argument, NULL, 'v' },
|
||||||
|
{ "esp-path", required_argument, NULL, ARG_ESP_PATH },
|
||||||
|
{ "boot-path", required_argument, NULL, ARG_BOOT_PATH },
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
int t;
|
int t, r;
|
||||||
|
|
||||||
assert(argc >= 0);
|
assert(argc >= 0);
|
||||||
assert(argv);
|
assert(argv);
|
||||||
|
@ -1143,6 +1155,18 @@ static int parse_argv(int argc, char *argv[]) {
|
||||||
arg_verbose = true;
|
arg_verbose = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ARG_ESP_PATH:
|
||||||
|
r = parse_path_argument(optarg, /* suppress_root = */ false, &arg_esp_path);
|
||||||
|
if (r < 0)
|
||||||
|
return log_oom();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ARG_BOOT_PATH:
|
||||||
|
r = parse_path_argument(optarg, /* suppress_root = */ false, &arg_xbootldr_path);
|
||||||
|
if (r < 0)
|
||||||
|
return log_oom();
|
||||||
|
break;
|
||||||
|
|
||||||
case '?':
|
case '?':
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue