[2.5.22] fix x86 initrd breakage
PATCH 1/1 [2.5.22] fix x86 initrd breakage
Linus & Kai,
Summary: 2.5.17 broke initrd on x86. Fix below.
arch/i386/boot/Makefile sets RAMDISK := -DRAMDISK=512, so bootsect.S puts 512 in the ram_size word.
At boot, arch/i386/kernel/setup.c reads ram_size (RAMDISK_FLAGS) and extracts the low 11 bits (== 512) into rd_image_start. init/do_mounts.c tries to find a gzip or FS image in /dev/ram starting at block rd_image_start (512). It fails because the image normally starts at block 0, and prints:
"RAMDISK: Couldn't find valid RAM disk image starting at 512."
Why: Kai's patch in 2.5.17 to move x86-specific options from Makefile to arch/i386/boot/Makefile unfortunately lost the fact that the orginal "#export RAMDISK = -DRAMDISK=512" statement was commented out. (I suspect a typo.) RAMDISK is obsolete since 1.3.something, and uncommenting it has "interesting" effects since the ram_size field has a very different meaning now.
The patch below reverts the statement to its pre-2.5.17 state. Perhaps it should be removed altogether?
Cc: to Andi Kleen since it seems x86_64 also is affected by this bug.
/Mikael
arch/i386/boot/Makefile renamed from arch/i386/boot/Makefile.~1~ +1 -1
@@ -23,7 +23,7 @@ # If you want the RAM disk device, define this to be the size in blocks. -RAMDISK := -DRAMDISK=512 +#RAMDISK := -DRAMDISK=512 # ---------------------------------------------------------------------------
Quoted 5 lines
The patch below reverts the statement to its pre-2.5.17 state. Perhaps it should be removed altogether?
Cc: to Andi Kleen since it seems
x86_64also is affected by this bug.
Thanks. I removed that statement for x86-64 from my tree.
-Andi
Quoted 9 lines
arch/i386/boot/Makefile renamed from arch/i386/boot/Makefile.~1~ +1
-1@@ -23,7 +23,7 @@ # If you want the RAM disk device, define this to be the size in blocks. -RAMDISK := -DRAMDISK=512 +#RAMDISK := -DRAMDISK=512