return 0;
}
-static int update_efi_boot_binaries(const char *esp_path, const char *source_path) {
+static int update_efi_boot_binaries(
+ const char *esp_path,
+ const char *source_path,
+ const char *ignore_filename) {
+
_cleanup_closedir_ DIR *d = NULL;
_cleanup_free_ char *p = NULL;
int r, ret = 0;
if (!endswith_no_case(de->d_name, ".efi"))
continue;
+ if (strcaseeq_ptr(ignore_filename, de->d_name))
+ continue;
+
fd = xopenat_full(dirfd(d), de->d_name, O_RDONLY|O_CLOEXEC|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW, XO_REGULAR, /* mode= */ 0);
if (fd < 0)
return log_error_errno(fd, "Failed to open \"%s/%s\" for reading: %m", p, de->d_name);
/* Create the EFI default boot loader name (specified for removable devices) */
v = strjoina("/EFI/BOOT/BOOT", e);
- ascii_strupper(strrchr(v, '/') + 1);
+ const char *boot_dot_efi = ascii_strupper(strrchr(v, '/') + 1);
r = chase(v, esp_path, CHASE_PREFIX_ROOT|CHASE_PROHIBIT_SYMLINKS|CHASE_NONEXISTENT|CHASE_TRIGGER_AUTOFS, &default_dest_path, NULL);
if (r < 0)
RET_GATHER(ret, copy_file_with_version_check(source_path, default_dest_path, force));
- /* If we were installed under any other name in /EFI/BOOT, make sure we update those binaries
+ /* If we were installed under any other name in /EFI/BOOT/, make sure we update those binaries
* as well. */
if (!force)
- RET_GATHER(ret, update_efi_boot_binaries(esp_path, source_path));
+ RET_GATHER(ret, update_efi_boot_binaries(esp_path, source_path, boot_dot_efi));
}
return ret;