}
static EFI_STATUS image_start(
- EFI_FILE *root_dir,
EFI_HANDLE parent_image,
const Config *config,
const ConfigEntry *entry) {
if (entry->call)
(void) entry->call();
+ _cleanup_(file_closep) EFI_FILE *image_root = LibOpenRoot(entry->device);
+ if (!image_root)
+ return log_error_status_stall(EFI_DEVICE_ERROR, L"Error opening root path.");
+
path = FileDevicePath(entry->device, entry->loader);
if (!path)
return log_error_status_stall(EFI_INVALID_PARAMETER, L"Error getting device path.");
return log_error_status_stall(err, L"Error loading %s: %r", entry->loader, err);
if (entry->devicetree) {
- err = devicetree_install(&dtstate, root_dir, entry->devicetree);
+ err = devicetree_install(&dtstate, image_root, entry->devicetree);
if (EFI_ERROR(err))
return log_error_status_stall(err, L"Error loading %s: %r", entry->devicetree, err);
}
/* Optionally, read a random seed off the ESP and pass it to the OS */
(void) process_random_seed(root_dir, config.random_seed_mode);
- err = image_start(root_dir, image, &config, entry);
+ err = image_start(image, &config, entry);
if (EFI_ERROR(err)) {
graphics_mode(FALSE);
log_error_stall(L"Failed to execute %s (%s): %r", entry->title_show, entry->loader, err);