ia64/xen-unstable

changeset 3751:4b38851f1bd1

bitkeeper revision 1.1159.223.83 (42097c41y12EFATQuIKPTDS1smnkWQ)

Subject: [Xen-devel] [PATCH] Fix initrd support for Linux 2.4/2.6

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
Signed-off-by: ian@xensource.com
author iap10@tetris.cl.cam.ac.uk
date Wed Feb 09 02:58:09 2005 +0000 (2005-02-09)
parents 73484d0fa776
children 0e59227addd8 9376fcbfd5a0
files linux-2.4.29-xen-sparse/arch/xen/kernel/setup.c linux-2.6.10-xen-sparse/arch/xen/i386/kernel/setup.c
line diff
     1.1 --- a/linux-2.4.29-xen-sparse/arch/xen/kernel/setup.c	Tue Feb 08 22:39:08 2005 +0000
     1.2 +++ b/linux-2.4.29-xen-sparse/arch/xen/kernel/setup.c	Wed Feb 09 02:58:09 2005 +0000
     1.3 @@ -240,7 +240,9 @@ void __init setup_arch(char **cmdline_p)
     1.4      boot_cpu_data.pgd_quick = cpu0_pgd_quicklist;
     1.5      boot_cpu_data.pte_quick = cpu0_pte_quicklist;
     1.6  
     1.7 -    ROOT_DEV = MKDEV(RAMDISK_MAJOR,0);
     1.8 +    /* This must be initialized to UNNAMED_MAJOR for ipconfig to work
     1.9 +       properly.  Setting ROOT_DEV to default to /dev/ram0 breaks initrd. */
    1.10 +    ROOT_DEV = MKDEV(UNNAMED_MAJOR,0);
    1.11      memset(&drive_info, 0, sizeof(drive_info));
    1.12      memset(&screen_info, 0, sizeof(screen_info));
    1.13      
     2.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/setup.c	Tue Feb 08 22:39:08 2005 +0000
     2.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/setup.c	Wed Feb 09 02:58:09 2005 +0000
     2.3 @@ -1359,7 +1359,10 @@ void __init setup_arch(char **cmdline_p)
     2.4  		efi_enabled = 1;
     2.5  #endif
     2.6  
     2.7 - 	ROOT_DEV = MKDEV(RAMDISK_MAJOR,0); /*old_decode_dev(ORIG_ROOT_DEV);*/
     2.8 +	/* This must be initialized to UNNAMED_MAJOR for ipconfig to work
     2.9 +	   properly.  Setting ROOT_DEV to default to /dev/ram0 breaks initrd.
    2.10 +	*/
    2.11 +	ROOT_DEV = MKDEV(UNNAMED_MAJOR,0);
    2.12   	drive_info = DRIVE_INFO;
    2.13   	screen_info = SCREEN_INFO;
    2.14  	edid_info = EDID_INFO;