[PATCH][2.5.22] fix x86 initrd breakage

From: Mikael Pettersson (mikpe@csd.uu.se)
Date: Mon Jun 17 2002 - 19:55:58 EST


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

--- linux-2.5.22/arch/i386/boot/Makefile.~1~ Tue Jun 11 14:18:07 2002
+++ linux-2.5.22/arch/i386/boot/Makefile Tue Jun 18 00:43:12 2002
@@ -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
 
 # ---------------------------------------------------------------------------
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jun 23 2002 - 22:00:15 EST