2001-11-20 22:16:16

by H. J. Lu

[permalink] [raw]
Subject: PATCH: Don't check NFS root when root= is given

When the kernel is configured with NFS root, we should be able to pass
root=/dev/sda1 to kernel. mount_root in fs/super.c checks:

#ifdef CONFIG_ROOT_NFS
if (MAJOR(ROOT_DEV) != UNNAMED_MAJOR)
goto skip_nfs;
....

I think net/ipv4/ipconfig.c should do same.


H.J.
--- linux/net/ipv4/ipconfig.c~ Tue Nov 20 14:11:09 2001
+++ linux/net/ipv4/ipconfig.c Tue Nov 20 11:10:01 2001
@@ -1144,7 +1144,9 @@ static int __init ip_auto_config(void)
*/
if (ic_myaddr == INADDR_NONE ||
#ifdef CONFIG_ROOT_NFS
- (root_server_addr == INADDR_NONE && ic_servaddr == INADDR_NONE) ||
+ (MAJOR(ROOT_DEV) == UNNAMED_MAJOR
+ && root_server_addr == INADDR_NONE
+ && ic_servaddr == INADDR_NONE) ||
#endif
ic_first_dev->next) {
#ifdef IPCONFIG_DYNAMIC