summaryrefslogtreecommitdiff
path: root/ArmPkg
diff options
context:
space:
mode:
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Library/BdsLib/BdsLinuxLoader.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ArmPkg/Library/BdsLib/BdsLinuxLoader.c b/ArmPkg/Library/BdsLib/BdsLinuxLoader.c
index d2e0effb35..6cd49a2fca 100644
--- a/ArmPkg/Library/BdsLib/BdsLinuxLoader.c
+++ b/ArmPkg/Library/BdsLib/BdsLinuxLoader.c
@@ -166,6 +166,13 @@ BdsBootLinuxAtag (
Print (L"ERROR: Did not find initrd image.\n");
return Status;
}
+
+ // Check if the initrd is a uInitrd
+ if (*(UINT32*)((UINTN)InitrdImage) == LINUX_UIMAGE_SIGNATURE) {
+ // Skip the 64-byte image header
+ InitrdImage = (EFI_PHYSICAL_ADDRESS)((UINTN)InitrdImage + 64);
+ InitrdImageSize -= 64;
+ }
}
//
@@ -233,6 +240,13 @@ BdsBootLinuxFdt (
Print (L"ERROR: Did not find initrd image.\n");
return Status;
}
+
+ // Check if the initrd is a uInitrd
+ if (*(UINT32*)((UINTN)InitrdImage) == LINUX_UIMAGE_SIGNATURE) {
+ // Skip the 64-byte image header
+ InitrdImage = (EFI_PHYSICAL_ADDRESS)((UINTN)InitrdImage + 64);
+ InitrdImageSize -= 64;
+ }
}
// Load the FDT binary from a device path