return Status;\r
}\r
\r
+EFI_STATUS\r
+UpdateFdtPath (\r
+ IN LIST_ENTRY *BootOptionsList\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+\r
+ BDS_SUPPORTED_DEVICE *SupportedBootDevice;\r
+ EFI_DEVICE_PATH_PROTOCOL *FdtDevicePathNode;\r
+ EFI_DEVICE_PATH_PROTOCOL *FdtDevicePath;\r
+\r
+ Status = SelectBootDevice (&SupportedBootDevice);\r
+ if (EFI_ERROR(Status)) {\r
+ Status = EFI_ABORTED;\r
+ goto EXIT;\r
+ }\r
+\r
+ // Create the specific device path node\r
+ Print(L"File path of the FDT blob: ");\r
+ Status = SupportedBootDevice->Support->CreateDevicePathNode (SupportedBootDevice, &FdtDevicePathNode, NULL, NULL);\r
+ if (EFI_ERROR(Status)) {\r
+ Status = EFI_ABORTED;\r
+ goto EXIT;\r
+ }\r
+\r
+ if (FdtDevicePathNode != NULL) {\r
+ // Append the Device Path node to the select device path\r
+ FdtDevicePath = AppendDevicePathNode (SupportedBootDevice->DevicePathProtocol, FdtDevicePathNode);\r
+ Status = gRT->SetVariable ((CHAR16*)L"FDT", &gEfiGlobalVariableGuid, (EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS ), 4, &FdtDevicePath);\r
+ ASSERT_EFI_ERROR(Status);\r
+ } else {\r
+ gRT->SetVariable ((CHAR16*)L"FDT", &gEfiGlobalVariableGuid, (EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS ), 0, NULL);\r
+ ASSERT_EFI_ERROR(Status);\r
+ }\r
+\r
+EXIT:\r
+ if (Status == EFI_ABORTED) {\r
+ Print(L"\n");\r
+ }\r
+ FreePool(SupportedBootDevice);\r
+ return Status;\r
+}\r
+\r
struct BOOT_MANAGER_ENTRY {\r
CONST CHAR16* Description;\r
EFI_STATUS (*Callback) (IN LIST_ENTRY *BootOptionsList);\r
{ L"Add Boot Device Entry", BootMenuAddBootOption },\r
{ L"Update Boot Device Entry", BootMenuUpdateBootOption },\r
{ L"Remove Boot Device Entry", BootMenuRemoveBootOption },\r
+ { L"Update FDT path", UpdateFdtPath },\r
};\r
\r
EFI_STATUS\r