summaryrefslogtreecommitdiff
path: root/ArmPkg
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2012-02-24 16:11:51 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2012-02-24 16:11:51 +0000
commitc0a1f7776b8429d167cf1740ea3dbc4964dca338 (patch)
treef08cb42855a196a46119e4afeab959aa0608ad77 /ArmPkg
parent1093e3074fba9ddbb6e6a9738c1b53a0f7389bb7 (diff)
downloadedk2-platforms-c0a1f7776b8429d167cf1740ea3dbc4964dca338.tar.xz
ArmPkg/BdsLib: Added support for using uInitrd
Detect if there is a u-boot header on the initrd (by checking the signature) and skip it. Signed-off-by: ryan.harkin@linaro.org Reviewed-by: oliviermartin git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13031 6f19259b-4bc3-4df7-8a09-765794883524
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