LinuxArguments = &OptionalData->Arguments.LinuxArguments;\r
\r
CmdLineSize = ReadUnaligned16 ((CONST UINT16*)&LinuxArguments->CmdLineSize);\r
- InitrdSize = GetUnalignedDevicePathSize ((EFI_DEVICE_PATH*)((LinuxArguments + 1) + CmdLineSize));\r
\r
- Print(L"File path of the initrd: ");\r
- Status = DeviceSupport->UpdateDevicePathNode (\r
- (EFI_DEVICE_PATH_PROTOCOL *)((UINTN)(LinuxArguments + 1) + CmdLineSize), &InitrdPathList, NULL, NULL);\r
- if (EFI_ERROR(Status) && Status != EFI_NOT_FOUND) {// EFI_NOT_FOUND is returned on empty input string, but we can boot without an initrd\r
- Status = EFI_ABORTED;\r
- goto EXIT;\r
+ InitrdSize = ReadUnaligned16 ((CONST UINT16*)&LinuxArguments->InitrdSize);\r
+ if (InitrdSize > 0) {\r
+ Print(L"File path of the initrd: ");\r
+ Status = DeviceSupport->UpdateDevicePathNode ((EFI_DEVICE_PATH*)((LinuxArguments + 1) + CmdLineSize), &InitrdPathList, NULL, NULL);\r
+ if (EFI_ERROR(Status) && Status != EFI_NOT_FOUND) {// EFI_NOT_FOUND is returned on empty input string, but we can boot without an initrd\r
+ Status = EFI_ABORTED;\r
+ goto EXIT;\r
+ }\r
+ InitrdSize = GetDevicePathSize (InitrdPathList);\r
}\r
\r
Print(L"Arguments to pass to the binary: "); \r
}\r
\r
CmdLineSize = AsciiStrSize (CmdLine);\r
- InitrdSize = GetDevicePathSize (InitrdPathList);\r
\r
BootArguments = (ARM_BDS_LOADER_ARGUMENTS*)AllocatePool(sizeof(ARM_BDS_LOADER_ARGUMENTS) + CmdLineSize + InitrdSize);\r
BootArguments->LinuxArguments.CmdLineSize = CmdLineSize;\r
}\r
\r
Print(L"Description for this new Entry: ");\r
+ StrnCpy (BootDescription, BootOption->Description, BOOT_DEVICE_DESCRIPTION_MAX);\r
Status = EditHIInputStr (BootDescription, BOOT_DEVICE_DESCRIPTION_MAX);\r
if (EFI_ERROR(Status)) {\r
Status = EFI_ABORTED;\r
EFI_DEVICE_PATH_TO_TEXT_PROTOCOL* DevicePathToTextProtocol;\r
ARM_BDS_LOADER_OPTIONAL_DATA* OptionalData;\r
UINTN CmdLineSize;\r
- ARM_BDS_LOADER_TYPE LoaderType;\r
+ ARM_BDS_LOADER_TYPE LoaderType;\r
\r
Status = gBS->LocateProtocol (&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol);\r
if (EFI_ERROR(Status)) {\r