linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Make ipconfig.c work as a loadable module.
@ 2003-03-06 21:10 Robin Holt
  2003-03-06 22:34 ` Alan Cox
  0 siblings, 1 reply; 32+ messages in thread
From: Robin Holt @ 2003-03-06 21:10 UTC (permalink / raw)
  To: Linux Kernel Mailing List, netdev


The patch at the end of this email makes ipconfig.c work as a loadable 
module under the 2.5.  The diff was taken against the bitkeeper tree 
changeset 1.1075.

Currently ipconfig.o must get statically linked into the kernel.  I have a 
proprietary driver which the supplier will not provide a GPL version or 
info.  In order to mount root over NFS, I need to get the vendors driver 
loaded via a ramdisk.

A couple more items get moved from ipconfig.h to nfs_fs.h.


Thanks,
Robin Holt


-------------------------  Patch  ---------------------------------------

===== fs/Kconfig 1.18 vs edited =====
--- 1.18/fs/Kconfig	Sun Feb  9 19:29:49 2003
+++ edited/fs/Kconfig	Wed Mar  5 11:07:56 2003
@@ -1270,7 +1270,7 @@
 
 config ROOT_NFS
 	bool "Root file system on NFS"
-	depends on NFS_FS=y && IP_PNP
+	depends on NFS_FS=y && IP_PNP!=n
 	help
 	  If you want your Linux box to mount its whole root file system (the
 	  one containing the directory /) from some other computer over the
===== fs/nfs/nfsroot.c 1.11 vs edited =====
--- 1.11/fs/nfs/nfsroot.c	Thu Nov  7 11:29:59 2002
+++ edited/fs/nfs/nfsroot.c	Wed Mar  5 11:07:56 2003
@@ -69,6 +69,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
@@ -106,6 +107,15 @@
 static struct nfs_mount_data nfs_data __initdata = { 0, };/* NFS mount info */
 static int nfs_port __initdata = 0;		/* Port to connect to for NFS */
 static int mount_port __initdata = 0;		/* Mount daemon port number */
+
+
+u32 root_server_addr __initdata = INADDR_NONE;	/* Address of NFS server */
+u8 root_server_path[NFS_ROOT_PATH_LEN] __initdata = { 0, };	/* Path to mount as root */
+
+#ifdef CONFIG_IP_PNP_MODULE
+EXPORT_SYMBOL(root_server_addr);
+EXPORT_SYMBOL(root_server_path);
+#endif
 
 
 /***************************************************************************
===== include/linux/nfs_fs.h 1.43 vs edited =====
--- 1.43/include/linux/nfs_fs.h	Sat Dec 21 00:29:02 2002
+++ edited/include/linux/nfs_fs.h	Wed Mar  5 11:07:56 2003
@@ -417,7 +417,12 @@
 
 /* NFS root */
 
+#ifdef CONFIG_ROOT_NFS
+#define NFS_ROOT_PATH_LEN     256
+extern u8 root_server_path[NFS_ROOT_PATH_LEN];        /* Path to mount as root */
+
 extern void * nfs_root_data(void);
+#endif
 
 #define nfs_wait_event(clnt, wq, condition)				\
 ({									\
===== include/net/ipconfig.h 1.2 vs edited =====
--- 1.2/include/net/ipconfig.h	Tue Feb  5 01:40:15 2002
+++ edited/include/net/ipconfig.h	Wed Mar  5 11:07:56 2003
@@ -21,7 +21,6 @@
 extern u32 ic_servaddr;		/* Boot server IP address */
 
 extern u32 root_server_addr;	/* Address of NFS server */
-extern u8 root_server_path[];	/* Path to mount as root */
 
 
 
===== net/ipv4/Kconfig 1.4 vs edited =====
--- 1.4/net/ipv4/Kconfig	Wed Nov 13 06:52:02 2002
+++ edited/net/ipv4/Kconfig	Wed Mar  5 11:07:56 2003
@@ -133,8 +133,8 @@
 	  you may want to say Y here to speed up the routing process.
 
 config IP_PNP
-	bool "IP: kernel level autoconfiguration"
-	depends on INET
+	tristate "IP: kernel level autoconfiguration"
+	depends on INET!=n
 	help
 	  This enables automatic configuration of IP addresses of devices and
 	  of the routing table during kernel boot, based on either information
@@ -146,7 +146,7 @@
 
 config IP_PNP_DHCP
 	bool "IP: DHCP support"
-	depends on IP_PNP
+	depends on IP_PNP!=n
 	---help---
 	  If you want your Linux box to mount its whole root file system (the
 	  one containing the directory /) from some other computer over the
@@ -163,7 +163,7 @@
 
 config IP_PNP_BOOTP
 	bool "IP: BOOTP support"
-	depends on IP_PNP
+	depends on IP_PNP!=n
 	---help---
 	  If you want your Linux box to mount its whole root file system (the
 	  one containing the directory /) from some other computer over the
@@ -178,7 +178,7 @@
 
 config IP_PNP_RARP
 	bool "IP: RARP support"
-	depends on IP_PNP
+	depends on IP_PNP!=n
 	help
 	  If you want your Linux box to mount its whole root file system (the
 	  one containing the directory /) from some other computer over the
===== net/ipv4/ipconfig.c 1.22 vs edited =====
--- 1.22/net/ipv4/ipconfig.c	Tue Feb 18 12:38:27 2003
+++ edited/net/ipv4/ipconfig.c	Wed Mar  5 11:07:56 2003
@@ -32,6 +32,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
@@ -52,6 +53,7 @@
 #include <linux/proc_fs.h>
 #include <linux/major.h>
 #include <linux/root_dev.h>
+#include <linux/nfs_fs.h>
 #include <net/arp.h>
 #include <net/ip.h>
 #include <net/ipconfig.h>
@@ -131,9 +133,6 @@
 
 u32 ic_servaddr __initdata = INADDR_NONE;	/* Boot server IP address */
 
-u32 root_server_addr __initdata = INADDR_NONE;	/* Address of NFS server */
-u8 root_server_path[256] __initdata = { 0, };	/* Path to mount as root */
-
 /* Persistent data: */
 
 int ic_proto_used;			/* Protocol used, if any */
@@ -1136,6 +1135,7 @@
 	unsigned long jiff;
 
 #ifdef CONFIG_PROC_FS
+	/* >>> Need to remove this on unload!!! */
 	proc_net_create("pnp", 0, pnp_get_info);
 #endif /* CONFIG_PROC_FS */
 
@@ -1263,8 +1263,6 @@
 	return 0;
 }
 
-module_init(ip_auto_config);
-
 
 /*
  *  Decode any IP configuration options in the "ip=" or "nfsaddrs=" kernel
@@ -1386,6 +1384,29 @@
 	return 1;
 }
 
+
+#ifdef CONFIG_IP_PNP_MODULE
+char *ip = NULL;
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Martin Mares");
+MODULE_DESCRIPTION("IP Autoconfig module: \n" \
+	"Uses BOOTP/DHCP/RARP to determine IP configuration before the root\n"
+       " filesystem is mounted.  See nfsroot.txt in the kernel source.");
+MODULE_PARM(ip, "s");
+MODULE_PARM_DESC(ip, "[[<client-ip>]:[<server-ip>]:[<gw-ip>]:[<netmask>]:[<hostname>]:[<device>]:]<autoconf>");
+
+
+int __init init_module(void)
+{
+	if (ip != NULL) {
+		ip_auto_config_setup(ip);
+	}
+
+	return ip_auto_config();
+}
+#else
+module_init(ip_auto_config);
+
 static int __init nfsaddrs_config_setup(char *addrs)
 {
 	return ip_auto_config_setup(addrs);
@@ -1393,3 +1414,4 @@
 
 __setup("ip=", ip_auto_config_setup);
 __setup("nfsaddrs=", nfsaddrs_config_setup);
+#endif


^ permalink raw reply	[flat|nested] 32+ messages in thread
[parent not found: <Pine.LNX.4.44.0303081132030.12316-100000@kenzo.iwr.uni-heidelberg.de>]

end of thread, other threads:[~2003-03-09  8:47 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-06 21:10 Make ipconfig.c work as a loadable module Robin Holt
2003-03-06 22:34 ` Alan Cox
2003-03-06 22:11   ` Jeff Garzik
2003-03-06 22:25     ` Russell King
2003-03-06 22:32       ` Jeff Garzik
2003-03-07  0:13       ` Alan Cox
2003-03-06 23:19         ` Russell King
2003-03-07  0:29           ` Alan Cox
2003-03-07  0:08             ` Russell King
2003-03-07  1:29               ` Chris Dukes
2003-03-07  9:42                 ` Russell King
2003-03-07 11:46                   ` Bogdan Costescu
2003-03-08  2:03                     ` Eric W. Biederman
2003-03-07 13:38                   ` Chris Dukes
2003-03-07 14:29                     ` Russell King
2003-03-07 16:23                       ` Richard B. Johnson
2003-03-09  1:21                         ` Horst von Brand
2003-03-09  8:57                           ` Willy Tarreau
2003-03-07 21:47                   ` William Lee Irwin III
2003-03-07 22:00                     ` Chris Friesen
2003-03-07  7:15             ` Michael Mueller
2003-03-07 12:54               ` Alan Cox
2003-03-07 21:33                 ` Michael Mueller
2003-03-09  4:46                 ` Arnaldo Carvalho de Melo
2003-03-07  9:10             ` Denis Vlasenko
2003-03-07 14:43               ` Charles Cazabon
2003-03-07 15:06                 ` John Bradford
     [not found] <Pine.LNX.4.44.0303081132030.12316-100000@kenzo.iwr.uni-heidelberg.de>
2003-03-08 16:07 ` Eric W. Biederman
2003-03-08 16:19   ` Russell King
2003-03-08 16:48     ` Eric W. Biederman
2003-03-08 17:05       ` Russell King
2003-03-08 18:01         ` Eric W. Biederman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).