bootspec: stat() on an autofs mount point doesn't trigger it, let's hence do it explicitly

This commit is contained in:
Lennart Poettering 2019-02-08 17:18:48 +01:00
parent c8b32d06bd
commit 8312d69409
1 changed files with 7 additions and 1 deletions

View File

@ -874,12 +874,18 @@ static int verify_fsroot_dir(
dev_t *ret_dev) {
struct stat st, st2;
const char *t2;
const char *t2, *trigger;
int r;
assert(path);
assert(ret_dev);
/* So, the ESP and XBOOTLDR partition are commonly located on an autofs mount. stat() on the
* directory won't trigger it, if it is not mounted yet. Let's hence explicitly trigger it here,
* before stat()ing */
trigger = strjoina(path, "/trigger"); /* Filename doesn't matter... */
(void) access(trigger, F_OK);
if (stat(path, &st) < 0)
return log_full_errno((searching && errno == ENOENT) ||
(unprivileged_mode && errno == EACCES) ? LOG_DEBUG : LOG_ERR, errno,