Tue 17 Jun 2008 08:57:54 AM UTC, original submission:
grub_efi_get_memory_map() has two failure modes and one, GRUB_EFI_BUFFER_TOO_SMALL is not handled gracefully.
The the problem occurs if a native EFI firmware requires more than MEMORY_MAP_SIZE; 4096 bytes in this case.
By happenstance, the problem is mis-reported as "too little memory" when in fact, the memory map itself is not processor properly.
It probably takes a seriously large server board such as the Intel NSW1U Network Server to report such a large memory map table.
As an example, the NSW1U, American Megatrends bios version S5000.86B.10.00.0085 requires 7872 bytes.
The following is a workaround for this class of symptom and a differential diagnostic message for the errors possible from grub_efi_get_memory_map().
Index: mm.c
===================================================================
RCS file: /sources/grub/grub2/kern/efi/mm.c,v
retrieving revision 1.4
diff -r1.4 mm.c
33c33
< #define MEMORY_MAP_SIZE 0x1000
---
> #define MEMORY_MAP_SIZE 0x2000
346a347
> int efi_status;
367c368,373
< if (grub_efi_get_memory_map (&map_size, memory_map, 0, &desc_size, 0) < 0)
---
> efi_status = grub_efi_get_memory_map (&map_size, memory_map, 0, &desc_size, 0);
>
> if (efi_status == 0)
> grub_fatal ("buffer too small: need %d bytes", map_size);
>
> if (efi_status == -1)
|