All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix initrd support for Linux 2.4/2.6
@ 2005-02-04 21:32 Anthony Liguori
  0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2005-02-04 21:32 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Pratt, Christian Limpach

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]

The following patch sets the default root device to be the null device. 
This is the behavior Linux is launched with no root device specified in
the command line and without a device provided by the boot loader.

Previously, the default root device was set to be /dev/ram0.  This broke
initrd support.  This change was made in 2.6 to because of a bug
reported on September 14th with dynamic ipconfig.  I've recreated his
problem and looked through the code and the source of the problem was
that his kernel command line was incorrect. He was missing the BOOTP
field in the config line requiring that there be an actual root device.

This worked with 2.4 but only because 2.4 was also broken.  His patch
just introduced that bug into 2.6.

I've tested this against the 2.6 and 2.4 trees in a recent copy of
xen-unstable.  I've tested initrd support and ipconfig support
(including dynamic ip support).  They both now work as expected.

If anyone needs an initrd for testing let me know.

Regards,
-- 
Anthony Liguori
Linux Technology Center (LTC) - IBM Austin
E-mail: aliguori@us.ibm.com
Phone: (512) 838-1208

Signed-off-by: Anthony Liguori

[-- Attachment #2: initrd.diff --]
[-- Type: text/x-patch, Size: 1274 bytes --]

--- xen-unstable-orig/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/setup.c	2005-01-25 22:29:18.000000000 -0600
+++ xen-unstable/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/setup.c	2005-02-04 13:44:49.000000000 -0600
@@ -1360,7 +1360,10 @@
 		efi_enabled = 1;
 #endif
 
- 	ROOT_DEV = MKDEV(RAMDISK_MAJOR,0); /*old_decode_dev(ORIG_ROOT_DEV);*/
+	/* This must be initialized to UNNAMED_MAJOR for ipconfig to work
+	   properly.  Setting ROOT_DEV to default to /dev/ram0 breaks initrd.
+	*/
+	ROOT_DEV = MKDEV(UNNAMED_MAJOR,0);
  	drive_info = DRIVE_INFO;
  	screen_info = SCREEN_INFO;
 	edid_info = EDID_INFO;
--- xen-unstable-orig/linux-2.4.29-xen-sparse/arch/xen/kernel/setup.c	2005-01-25 22:29:10.000000000 -0600
+++ xen-unstable/linux-2.4.29-xen-sparse/arch/xen/kernel/setup.c	2005-02-04 13:44:58.000000000 -0600
@@ -240,7 +240,9 @@
     boot_cpu_data.pgd_quick = cpu0_pgd_quicklist;
     boot_cpu_data.pte_quick = cpu0_pte_quicklist;
 
-    ROOT_DEV = MKDEV(RAMDISK_MAJOR,0);
+    /* This must be initialized to UNNAMED_MAJOR for ipconfig to work
+       properly.  Setting ROOT_DEV to default to /dev/ram0 breaks initrd. */
+    ROOT_DEV = MKDEV(UNNAMED_MAJOR,0);
     memset(&drive_info, 0, sizeof(drive_info));
     memset(&screen_info, 0, sizeof(screen_info));
     

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-02-04 21:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-04 21:32 [PATCH] Fix initrd support for Linux 2.4/2.6 Anthony Liguori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.