Patch for nfsroot and auto dhcp.
Subsystems (4)
PATCH 1/1 Patch for nfsroot and auto dhcp.
Hello all
This patch is for 2.4.10 .
fs/Config.in +3 -1
@@ -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
fs/nfs/Makefile +2 -0
@@ -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
fs/nfs/nfsroot.c +13 -0
@@ -82,6 +82,7 @@#include <linux/major.h> #include <linux/utsname.h> #include <net/ipconfig.h> +#include <linux/module.h> /* 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);/***************************************************************************
include/net/ipconfig.h +6 -4
@@ -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
net/core/Makefile +1 -1
@@ -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
net/core/dev.c +3 -0
@@ -2846,3 +2846,6 @@ return call_usermodehelper(argv [0], argv, envp); }#endif + +EXPORT_SYMBOL (dev_change_flags); +
net/ipv4/Config.in +4 -2
@@ -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
net/ipv4/ipconfig.c +24 -4
@@ -54,6 +54,8 @@#include <asm/uaccess.h> #include <asm/checksum.h> +#include <linux/module.h> +/* 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 ; +}