- Status = BdsBootLinuxFdt (\r
- (EFI_DEVICE_PATH_PROTOCOL *) &KernelDevicePath,\r
- (EFI_DEVICE_PATH_PROTOCOL *) RamdiskDevicePath,\r
- KernelArgs\r
- );\r
+ //\r
+ // Boot Linux using the Legacy Linux Loader\r
+ //\r
+\r
+ Status = LocateEfiApplicationInFvByGuid (&mLinuxLoaderAppGuid, &LinuxLoaderDevicePath);\r
+ if (EFI_ERROR (Status)) {\r
+ Print (L"Couldn't Boot Linux: %d\n", Status);\r
+ return EFI_DEVICE_ERROR;\r
+ }\r
+\r
+ KernelDevicePathTxt = ConvertDevicePathToText ((EFI_DEVICE_PATH_PROTOCOL *) &KernelDevicePath, FALSE, FALSE);\r
+ if (KernelDevicePathTxt == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
+\r
+ RamdiskDevicePathTxt = ConvertDevicePathToText ((EFI_DEVICE_PATH_PROTOCOL *) RamdiskDevicePath, FALSE, FALSE);\r
+ if (RamdiskDevicePathTxt == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
+\r
+ // Initialize Legacy Linux loader command line\r
+ LoadOptions = CatSPrint (NULL, LINUX_LOADER_COMMAND_LINE, KernelDevicePathTxt, RamdiskDevicePathTxt, KernelArgs);\r
+ if (LoadOptions == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
+\r
+ Status = BdsStartEfiApplication (gImageHandle, LinuxLoaderDevicePath, StrSize (LoadOptions), LoadOptions);\r