- // TODO: Commented-out version above is more efficient if the below FindVolumeAndFilename()
- // and ReadFile() calls (and surrounding logic) are moved earlier; however, this causes
- // some computers, including my 32-bit Mac Mini and 64-bit Intel machine, to fail when
- // launching a Linux kernel, with a "Failed to handle fs_proto" error message from the
- // kernel. Find out what's causing this and fix it.
- if (ReturnStatus == EFI_ACCESS_DENIED) {
- // TODO: I originally had the next few lines a
- FindVolumeAndFilename(DevicePaths[DevicePathIndex], &DeviceVolume, &loader);
- if (DeviceVolume != NULL) {
- Status = ReadFile(DeviceVolume->RootDir, loader, &File, &ImageSize);
- ImageData = File.Buffer;
- } else {
- Status = EFI_NOT_FOUND;
- Print(L"Error: device volume not found!\n");
- } // if/else
- ReturnStatus = Status = start_image(SelfImageHandle, loader, ImageData, ImageSize, FullLoadOptions, DeviceVolume);
- if (ReturnStatus == EFI_SUCCESS) {
- UseMok = TRUE;
- } // if
- }
+ ReturnStatus = Status = refit_call6_wrapper(BS->LoadImage, FALSE, SelfImageHandle, DevicePaths[DevicePathIndex],
+ NULL, 0, &ChildImageHandle);