Skip to contentSkip to conversation

gnu-efi-2.0 initrd fix

Linux-ia64 Stephane Eranian 1 participant 1 message Apr 18, 2001

lore
Share & tools
lore
#0 lore raw

Hi All,

I discovered that there was a bug with the code dealing with initrd in the new elilo released as part of gnu-efi-2.0. The ramdisk would get freed by the kernel right at initialization time before ever being used because the EFI memory type used was wrong. The attached patch fixes the problem.

Please try it out and let me know how it goes.

Thanks.

Signature · 1 line
-Stephane
elilo/alloc.c +1 -1
diff -urN gnu-efi-2.0-old/elilo/alloc.c gnu-efi-2.0/elilo/alloc.c
@@ -228,7 +228,7 @@
 alloc_initrd(EFI_PHYSICAL_ADDRESS start_addr, UINTN pgcnt)
 {
 
-	if (alloc_pages(pgcnt, EfiLoaderCode, AllocateAddress, start_addr) == 0) return -1;
+	if (alloc_pages(pgcnt, EfiRuntimeServicesCode, AllocateAddress, start_addr) == 0) return -1;
 
 	initrd_addr  = start_addr;
 	initrd_pgcnt = pgcnt;