Initrd file not loaded
Hi:
I posted an issue loading the initrd file in a Xeon Platform, the problem was the following:
Quoted 2 lines · Jesús Velazquez
Quoted 1 line
* We are trying to use Grub2 for booting RedHat Enterprise Linux 4 update 2
*
Quoted 1 line
Quoted 1 line
* on Xeon Platforms. But, we found that the initrd file is not
loaded by grub*
Quoted 2 lines
Quoted 2 lines
* and the kernel can't mount /. The linux kernel doesn't recognize the boot*
* disk and It dies.
*
Quoted 4 lines
Please describe how you boot the linux.
Thanks,
Okuji
We found the following misbehavior:
In the function grub_rescue_cmd_initrd (at file loader/i386/pc/linux.c), the following lines of code (lines 335-336)
if (!linux_mem_size && linux_mem_size < addr_max)
addr_max = linux_mem_size;
Setup the addr_max to linux_mem_size when "mem=" option is not specified. I mean the condition is inverted. That means
that if somebody doesn't specify the "mem=" option, linux_mem_size is 0 and addr_max = linux_mem_size. If we remove
the inverted condition (!linux_mem_size), the initrd file is loaded without any problem, and the system boots ok. We think that
the logic of this condition is if someone specifies the "mem=" option we need to adjust the addr_max variable to point to the upper memory boundary, right?
We are working with a 8-Way Xeon Platform with 8GB of memory. The weird thing is that the original code works without any issues on Desktop configurations (< 4GB of memory). We also forced addr_max to GRUB_LINUX_INITRD_MAX_ADDRESS (lines 324-329 at file loader/i386/pc/linux.c).
#if 0
if (grub_le_to_cpu16 (lh->version) >= 0x0203)
addr_max = grub_cpu_to_le32 (lh->initrd_addr_max);
#else
addr_max = GRUB_LINUX_INITRD_MAX_ADDRESS;
#endif
We have 8 GB of memory (4G available for protected mode), so we don't bother about it, we have enough memory.
Regards,
Jesus & Oscar
Quoted 8 lines · Jesús Velazquez
In the function
grub_rescue_cmd_initrd(at fileloader/i386/pc/linux.c), the following lines of code (lines 335-336)if (!linux_mem_size &&
linux_mem_size<addr_max)addr_max = linux_mem_size;Setup the
addr_maxtolinux_mem_sizewhen "mem=" option is not specified. I mean the condition is inverted.
Uggh, you are right. I will fix this.
Quoted 6 lines
#if 0
if (grub_le_to_cpu16(lh->version) >=0x0203)addr_max = grub_cpu_to_le32 (lh->initrd_addr_max); #else addr_max = GRUB_LINUX_INITRD_MAX_ADDRESS;#endif
Hmm, this is strange. The boot protocl 2.03 is supposed to put a right value there. What value is written in your kernel?
Thanks,
Okuji