|
From: | KESHAV P.R. |
Subject: | Re: Initramfs not loaded or passed to kernel in grub2 UEFI x86_64 |
Date: | Fri, 18 Jun 2010 19:14:41 +0530 |
The problem seems to be related to the way grub2 allocates the memory for the kernel and initramfs. Both my Archlinux x86_64 kernel and its corresponding initramfs are LZMA compressed (which is now Archlinux default). I guess the problem is as follows :- 1. First load the LZMA compressed x86_64 kernel bzImage into memory. 2. Then load the LZMA compressed initramfs cpio archive into memory. 3. Launch the linux kernel. 4. The kernel decompresses itself and then takes in all the boot parameters passed by grub2 and the memory location of loaded initramfs image (which is still LZMA compressed as in memory). The kernel might have overwritten parts of the initramfs LZMA archive in the memory and once the kernel tries to create the rootfs it find a corrupted initramfs in the memory. If I am right grub2 does not decompress either the kernel or the initramfs. It is the job of the kernel. This kernel panic or error somehow doee not occur with BIOS version of GRUB2. It occurs in the x86_64 UEFI version only as of now (not sure about i386 UEFI GRUB2). As I mentioned before Fedora's grub-legacy grub.efi boots Archlinux without any problem. Archlinux does not include any disk-controller driver or filesystem driver built-in the kernel by default and it is impossible to boot without the initramfs (atleast in GRUB2 UEFI x86_64 for now). Is this in anyway related to assumption of a compression ratio of 50% for kernel/initramfs in the file (grub2-source-dir)/loader/i386/efi/linux.c ? LZMA generally produces even smaller compression ratios (between 20 to 30 %). I think adequate contiguous memory should be allocated for uncompressed kernel alone so that after its own decompression it finds a not-corrupted initramfs in the memory. I am attaching the memory map reported by the UEFI firmware used (both EDK and EDK2 of tianocore.sourceforge.net) if it is of help in any case. Output using "memmap > fs0:\edk2_duet_memmap.txt" and "memmap > fs0:\edk_duet_memmap.txt" in EFI shell. Regards
dmesg_fedora_kernel_grub2_efi_x64.txt
Description: Text document
kernel_35_edk2_grub_legacy_efi.txt
Description: Text document
edk_duet_memmap.txt
Description: Text document
edk2_duet_memmap.txt
Description: Text document
[Prev in Thread] | Current Thread | [Next in Thread] |