mirror of
https://github.com/systemd/systemd.git
synced 2025-01-11 09:18:07 +03:00
bootspec: introduce SYSTEMD_ESP_PATH for overriding where to look for the ESP (#10834)
This commit is contained in:
parent
53640e6fb9
commit
cc7a0bfa15
@ -125,6 +125,12 @@ bootctl and other tools that access the EFI System Partition (ESP):
|
||||
is a FAT file system are turned off, as are checks that the path is located
|
||||
on a GPT partition with the correct type UUID.
|
||||
|
||||
* `$SYSTEMD_ESP_PATH=…` — override the path to the EFI System Partition. This
|
||||
may be used to override ESP path auto detection, and redirect any accesses to
|
||||
the ESP to the specified directory. Not that unlike with bootctl's --path=
|
||||
switch only very superficial validation of the specified path is done when
|
||||
this environment variable is used.
|
||||
|
||||
systemd itself:
|
||||
|
||||
* `$SYSTEMD_ACTIVATION_UNIT` — set for all NSS and PAM module invocations that
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
@ -590,6 +591,18 @@ int find_esp_and_warn(
|
||||
goto found;
|
||||
}
|
||||
|
||||
path = getenv("SYSTEMD_ESP_PATH");
|
||||
if (path) {
|
||||
if (!path_is_valid(path) || !path_is_absolute(path)) {
|
||||
log_error("$SYSTEMD_ESP_PATH does not refer to absolute path, refusing to use it: %s", path);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Note: when the user explicitly configured things with an env var we won't validate the mount
|
||||
* point. After all we want this to be useful for testing. */
|
||||
goto found;
|
||||
}
|
||||
|
||||
FOREACH_STRING(path, "/efi", "/boot", "/boot/efi") {
|
||||
|
||||
r = verify_esp(path, true, unprivileged_mode, ret_part, ret_pstart, ret_psize, ret_uuid);
|
||||
|
Loading…
Reference in New Issue
Block a user