diff -urN linux/fs/Config.in linux-kernel/fs/Config.in --- linux/fs/Config.in Tue Jul 3 05:03:04 2001 +++ linux-kernel/fs/Config.in Fri Sep 28 11:11:40 2001 @@ -80,7 +80,9 @@ dep_tristate 'Coda file system support (advanced network fs)' CONFIG_CODA_FS $CONFIG_INET dep_tristate 'NFS file system support' CONFIG_NFS_FS $CONFIG_INET dep_mbool ' Provide NFSv3 client support' CONFIG_NFS_V3 $CONFIG_NFS_FS - dep_bool ' Root file system on NFS' CONFIG_ROOT_NFS $CONFIG_NFS_FS $CONFIG_IP_PNP +if [ "$CONFIG_IP_PNP" != "n" ]; then + dep_bool ' Root file system on NFS' CONFIG_ROOT_NFS $CONFIG_NFS_FS +fi dep_tristate 'NFS server support' CONFIG_NFSD $CONFIG_INET dep_mbool ' Provide NFSv3 server support' CONFIG_NFSD_V3 $CONFIG_NFSD diff -urN linux/fs/nfs/Makefile linux-kernel/fs/nfs/Makefile --- linux/fs/nfs/Makefile Sat Dec 30 06:07:23 2000 +++ linux-kernel/fs/nfs/Makefile Fri Sep 28 11:11:40 2001 @@ -12,6 +12,8 @@ obj-y := inode.o file.o read.o write.o dir.o symlink.o proc.o \ nfs2xdr.o flushd.o unlink.o +export-objs := nfsroot.o + obj-$(CONFIG_ROOT_NFS) += nfsroot.o mount_clnt.o obj-$(CONFIG_NFS_V3) += nfs3proc.o nfs3xdr.o diff -urN linux/fs/nfs/nfsroot.c linux-kernel/fs/nfs/nfsroot.c --- linux/fs/nfs/nfsroot.c Fri Aug 17 00:55:52 2001 +++ linux-kernel/fs/nfs/nfsroot.c Fri Sep 28 11:11:40 2001 @@ -82,6 +82,7 @@ #include #include #include +#include /* Define this to allow debugging output */ #undef NFSROOT_DEBUG @@ -104,6 +105,18 @@ static int nfs_port __initdata = 0; /* Port to connect to for NFS */ static int mount_port __initdata = 0; /* Mount daemon port number */ +static u32 root_server_addr __initdata = INADDR_NONE ; +static u8 root_server_path[256] __initdata = { 0 , }; + + +int __initdata root_server_set(u32 server_addr, u8 server_path[]){ + int i ; + root_server_addr = server_addr ; + for (i = 0 ; i < 255 ; i++ ) + root_server_path[i] = server_path[i]; +} + +EXPORT_SYMBOL(root_server_set); /*************************************************************************** diff -urN linux/include/net/ipconfig.h linux-kernel/include/net/ipconfig.h --- linux/include/net/ipconfig.h Wed May 2 11:59:24 2001 +++ linux-kernel/include/net/ipconfig.h Fri Sep 28 11:12:29 2001 @@ -6,6 +6,9 @@ * Automatic IP Layer Configuration */ +#ifndef IPCONFIG_H +#define IPCONFIG_H + /* The following are initdata: */ extern int ic_enable; /* Enable or disable the whole shebang */ @@ -20,10 +23,7 @@ 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 */ - - +extern int root_server_set(u32 , u8 *); /* The following are persistent (not initdata): */ @@ -36,3 +36,5 @@ #define IC_BOOTP 0x01 /* BOOTP (or DHCP, see below) */ #define IC_RARP 0x02 /* RARP */ #define IC_USE_DHCP 0x100 /* If on, use DHCP instead of BOOTP */ + +#endif diff -urN linux/net/core/Makefile linux-kernel/net/core/Makefile --- linux/net/core/Makefile Sat Dec 30 06:07:24 2000 +++ linux-kernel/net/core/Makefile Fri Sep 28 11:11:40 2001 @@ -9,7 +9,7 @@ O_TARGET := core.o -export-objs := netfilter.o profile.o +export-objs := netfilter.o profile.o dev.o obj-y := sock.o skbuff.o iovec.o datagram.o scm.o diff -urN linux/net/core/dev.c linux-kernel/net/core/dev.c --- linux/net/core/dev.c Thu Sep 27 18:17:19 2001 +++ linux-kernel/net/core/dev.c Fri Sep 28 11:11:40 2001 @@ -2846,3 +2846,6 @@ return call_usermodehelper(argv [0], argv, envp); } #endif + +EXPORT_SYMBOL(dev_change_flags); + diff -urN linux/net/ipv4/Config.in linux-kernel/net/ipv4/Config.in --- linux/net/ipv4/Config.in Wed May 2 11:59:24 2001 +++ linux-kernel/net/ipv4/Config.in Fri Sep 28 11:11:40 2001 @@ -18,13 +18,15 @@ bool ' IP: verbose route monitoring' CONFIG_IP_ROUTE_VERBOSE bool ' IP: large routing tables' CONFIG_IP_ROUTE_LARGE_TABLES fi -bool ' IP: kernel level autoconfiguration' CONFIG_IP_PNP -if [ "$CONFIG_IP_PNP" = "y" ]; then +tristate ' IP: kernel level autoconfiguration' CONFIG_IP_PNP +if [ "$CONFIG_IP_PNP" != "n" ]; then bool ' IP: DHCP support' CONFIG_IP_PNP_DHCP bool ' IP: BOOTP support' CONFIG_IP_PNP_BOOTP bool ' IP: RARP support' CONFIG_IP_PNP_RARP # not yet ready.. # bool ' IP: ARP support' CONFIG_IP_PNP_ARP + define_bool CONFIG_ROOT_NFS y + define_bool CONFIG_NFS_FS y fi tristate ' IP: tunneling' CONFIG_NET_IPIP tristate ' IP: GRE tunnels over IP' CONFIG_NET_IPGRE diff -urN linux/net/ipv4/ipconfig.c linux-kernel/net/ipv4/ipconfig.c --- linux/net/ipv4/ipconfig.c Wed May 2 11:59:24 2001 +++ linux-kernel/net/ipv4/ipconfig.c Fri Sep 28 11:11:40 2001 @@ -54,6 +54,8 @@ #include #include +#include + /* Define this to allow debugging output */ #undef IPCONFIG_DEBUG @@ -123,9 +125,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 */ @@ -150,6 +149,9 @@ static int ic_dhcp_msgtype __initdata = 0; /* DHCP msg type received */ #endif +static u32 root_server_addr = INADDR_NONE; +static u8 root_server_path[256] = { 0 , }; + /* * Network devices @@ -1212,7 +1214,7 @@ return 0; } -module_init(ip_auto_config); +//module_init(ip_auto_config); /* @@ -1342,3 +1344,21 @@ __setup("ip=", ip_auto_config_setup); __setup("nfsaddrs=", nfsaddrs_config_setup); + + +int init_module(void) +{ +#ifdef MODULE + ic_enable = 1; +#endif + ip_auto_config(); + //nfsaddrs_config_setup("ip=dhcp"); + root_server_set(root_server_addr, root_server_path); + return 0; +} + +int cleanup_module(void) +{ + proc_net_remove("pnp"); + return 0; +}