]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: LoadLinuxLib: Fix check for relocatable kernel
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 16 Jan 2013 06:49:27 +0000 (06:49 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 16 Jan 2013 06:49:27 +0000 (06:49 +0000)
Boot protocol 2.05 just means that the relocatable_kernel field is present
in the header. We should actually check that it's *set*.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14051 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/Library/LoadLinuxLib/Linux.c

index 96c985bc2d7e574c20030d886b811e8647efe4dd..b06285c51a545721f07d79fb900d76a62b90923e 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -60,7 +60,8 @@ LoadLinuxCheckKernelSetup (
 \r
   if ((Bp->hdr.signature != 0xAA55) || // Check boot sector signature\r
       (Bp->hdr.header != SETUP_HDR) ||\r
-      (Bp->hdr.version < 0x205)        // We only support relocatable kernels\r
+      (Bp->hdr.version < 0x205) || // We only support relocatable kernels\r
+      (!Bp->hdr.relocatable_kernel)\r
      ) {\r
     return EFI_UNSUPPORTED;\r
   } else {\r
@@ -606,7 +607,7 @@ LoadLinux (
 \r
   Bp = (struct boot_params *) KernelSetup;\r
 \r
-  if (Bp->hdr.version < 0x205) {\r
+  if (Bp->hdr.version < 0x205 || !Bp->hdr.relocatable_kernel) {\r
     //\r
     // We only support relocatable kernels\r
     //\r