summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harkin <ryan.harkin@linaro.org>2013-11-19 09:21:20 -0600
committerLeif Lindholm <leif.lindholm@linaro.org>2014-05-22 18:58:06 +0100
commit4a5485922e9013e554b4a84214adaf10846d74c4 (patch)
treeac8a1ca153af9d1599c666617a7e1b149a8345c6
parent2c7b3e6381ada66144ab6e725547e5290174ed77 (diff)
downloadedk2-topics-juno.tar.gz
ArmPlatformPkg/Bds: skip initrd if not foundjunofvp-basefvp
When loading a Linux image, if the initrd is not found, we will display an error, but attempt to load the kernel anyway. Previous behaviour dropped the user back to the menu, thus allowing them to update the config. However, this does not suit booting in automated environments where test images may or may not have an initrd. Example, Ubuntu and Android images require an initrd; OpenEmbedded images do not. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org> Signed-off-by: Steven Kinney <steven.kinney@linaro.org>
-rw-r--r--ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c b/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c
index d0eb075..4805b40 100644
--- a/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c
+++ b/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c
@@ -258,19 +258,20 @@ BdsBootLinuxFdt (
Status = BdsLoadImage (InitrdDevicePath, AllocateAnyPages, &InitrdImageBase, &InitrdImageBaseSize);
}
if (EFI_ERROR(Status)) {
- Print (L"ERROR: Did not find initrd image.\n");
- goto EXIT_FREE_LINUX;
- }
-
- // Check if the initrd is a uInitrd
- if (*(UINT32*)((UINTN)InitrdImageBase) == LINUX_UIMAGE_SIGNATURE) {
- // Skip the 64-byte image header
- InitrdImage = (EFI_PHYSICAL_ADDRESS)((UINTN)InitrdImageBase + 64);
- InitrdImageSize = InitrdImageBaseSize - 64;
- } else {
- InitrdImage = InitrdImageBase;
- InitrdImageSize = InitrdImageBaseSize;
+ Print (L"ERROR: Did not find initrd image, you may need to update your config. Attempting to continue without it.\n");
+ InitrdImageBase = 0;
}
+ else {
+ // Check if the initrd is a uInitrd
+ if (*(UINT32*)((UINTN)InitrdImageBase) == LINUX_UIMAGE_SIGNATURE) {
+ // Skip the 64-byte image header
+ InitrdImage = (EFI_PHYSICAL_ADDRESS)((UINTN)InitrdImageBase + 64);
+ InitrdImageSize = InitrdImageBaseSize - 64;
+ } else {
+ InitrdImage = InitrdImageBase;
+ InitrdImageSize = InitrdImageBaseSize;
+ }
+ }
}
// Load the FDT binary from a device path. The FDT will be reloaded later to a more appropriate location for the Linux kernel.
@@ -299,7 +300,6 @@ EXIT_FREE_INITRD:
gBS->FreePages (InitrdImageBase, EFI_SIZE_TO_PAGES (InitrdImageBaseSize));
}
-EXIT_FREE_LINUX:
gBS->FreePages (LinuxImage, EFI_SIZE_TO_PAGES (LinuxImageSize));
return Status;