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
#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"
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);