linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* A patch for dhcp and nfsroot.
@ 2001-08-29  0:14 ` hugang
  2001-09-13 18:32   ` John D. Kim
  2001-09-14  0:51   ` hugang
  0 siblings, 2 replies; 5+ messages in thread
From: hugang @ 2001-08-29  0:14 UTC (permalink / raw)
  To: Alan Cox; +Cc: gero, linux-kernel, torvalds

[-- Attachment #1: Type: text/plain, Size: 535 bytes --]

Alan Cox:
	Hello.

	This is my first kernel patch . It change the kernel dhcp auto config to module. So we can dynamic insmod the net card before insmod dhcp .This is useful to disaster recover linux.

-- 
Best Regard!
礼!
----------------------------------------------------
hugang : 胡刚 	GNU/Linux User
email  : gang_hu@soul.com.cn linuxbest@soul.com.cn
Tel    : +861068425741/2/3/4
Web    : http://www.soul.com.cn

	Beijing Soul technology Co.Ltd.
	   北京众志和达科技有限公司
----------------------------------------------------

[-- Attachment #2: nfsroot.patch --]
[-- Type: application/octet-stream, Size: 4377 bytes --]

diff -u -r linux-kernel/fs/Config.in linux-nfsrot/fs/Config.in
--- linux-kernel/fs/Config.in	Tue Jul  3 05:03:04 2001
+++ linux-nfsrot/fs/Config.in	Sat Aug 25 00:59:23 2001
@@ -80,7 +80,7 @@
    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
+   dep_bool '  Root file system on NFS' CONFIG_ROOT_NFS $CONFIG_NFS_FS
 
    dep_tristate 'NFS server support' CONFIG_NFSD $CONFIG_INET
    dep_mbool '  Provide NFSv3 server support' CONFIG_NFSD_V3 $CONFIG_NFSD
diff -u -r linux-kernel/fs/nfs/nfsroot.c linux-nfsrot/fs/nfs/nfsroot.c
--- linux-kernel/fs/nfs/nfsroot.c	Fri Aug 17 00:55:52 2001
+++ linux-nfsrot/fs/nfs/nfsroot.c	Sat Aug 25 00:59:23 2001
@@ -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,8 @@
 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[256] __initdata = { 0, } ;      /* Path to mount as root */
 
 /***************************************************************************
 
@@ -464,3 +467,5 @@
 	set_sockaddr((struct sockaddr_in *) &nfs_data.addr, servaddr, nfs_port);
 	return (void*)&nfs_data;
 }
+EXPORT_SYMBOL(root_server_addr);
+EXPORT_SYMBOL(root_server_path);
diff -u -r linux-kernel/include/net/ipconfig.h linux-nfsrot/include/net/ipconfig.h
--- linux-kernel/include/net/ipconfig.h	Wed May  2 11:59:24 2001
+++ linux-nfsrot/include/net/ipconfig.h	Sat Aug 25 00:59:23 2001
@@ -21,7 +21,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 u8 root_server_path[256];	/* Path to mount as root */
 
 
 
@@ -36,3 +36,4 @@
 #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 */
+
diff -u -r linux-kernel/net/core/dev.c linux-nfsrot/net/core/dev.c
--- linux-kernel/net/core/dev.c	Fri Aug 17 00:56:10 2001
+++ linux-nfsrot/net/core/dev.c	Sat Aug 25 00:59:23 2001
@@ -2818,3 +2818,5 @@
 	return call_usermodehelper(argv [0], argv, envp);
 }
 #endif
+
+EXPORT_SYMBOL(dev_change_flags);
diff -u -r linux-kernel/net/ipv4/Config.in linux-nfsrot/net/ipv4/Config.in
--- linux-kernel/net/ipv4/Config.in	Wed May  2 11:59:24 2001
+++ linux-nfsrot/net/ipv4/Config.in	Sat Aug 25 00:59:23 2001
@@ -18,8 +18,8 @@
    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
diff -u -r linux-kernel/net/ipv4/ipconfig.c linux-nfsrot/net/ipv4/ipconfig.c
--- linux-kernel/net/ipv4/ipconfig.c	Wed May  2 11:59:24 2001
+++ linux-nfsrot/net/ipv4/ipconfig.c	Sat Aug 25 01:11:03 2001
@@ -123,8 +123,8 @@
 
 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 */
+//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: */
 
@@ -1212,7 +1212,7 @@
 	return 0;
 }
 
-module_init(ip_auto_config);
+//module_init(ip_auto_config);
 
 
 /*
@@ -1340,5 +1340,13 @@
 	return ip_auto_config_setup(addrs);
 }
 
+int init_module(void)
+{
+#ifdef MODULE
+  ic_enable = 1;
+#endif
+  ip_auto_config();
+  return 0;
+}
 __setup("ip=", ip_auto_config_setup);
 __setup("nfsaddrs=", nfsaddrs_config_setup);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: A patch for dhcp and nfsroot.
  2001-08-29  0:14 ` A patch for dhcp and nfsroot hugang
@ 2001-09-13 18:32   ` John D. Kim
  2001-09-14  0:51   ` hugang
  1 sibling, 0 replies; 5+ messages in thread
From: John D. Kim @ 2001-09-13 18:32 UTC (permalink / raw)
  To: hugang; +Cc: Alan Cox, gero, linux-kernel, torvalds

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=X-UNKNOWN, Size: 734 bytes --]

Anyone tried this yet?  I've tried it on 2.4.9-ac8, but the module
complains of not being able find the kernel it was built for.

On Wed, 29 Aug 2001, hugang wrote:

> Alan Cox:
> 	Hello.
>
> 	This is my first kernel patch . It change the kernel dhcp auto config to module. So we can dynamic insmod the net card before insmod dhcp .This is useful to disaster recover linux.
>
> --
> Best Regard!
> Àñ£¡
> ----------------------------------------------------
> hugang : ºú¸Õ 	GNU/Linux User
> email  : gang_hu@soul.com.cn linuxbest@soul.com.cn
> Tel    : +861068425741/2/3/4
> Web    : http://www.soul.com.cn
>
> 	Beijing Soul technology Co.Ltd.
> 	   ±±¾©ÖÚÖ¾ºÍ´ï¿Æ¼¼ÓÐÏÞ¹«Ë¾
> ----------------------------------------------------
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: A patch for dhcp and nfsroot.
  2001-08-29  0:14 ` A patch for dhcp and nfsroot hugang
  2001-09-13 18:32   ` John D. Kim
@ 2001-09-14  0:51   ` hugang
  2001-09-14 22:06     ` John D. Kim
  2001-09-15  5:23     ` [Patch]:New " hugang
  1 sibling, 2 replies; 5+ messages in thread
From: hugang @ 2001-09-14  0:51 UTC (permalink / raw)
  To: John D. Kim; +Cc: alan, gero, linux-kernel, torvalds

On Thu, 13 Sep 2001 10:47:18 -0700 (PDT)
"John D. Kim" <johnkim@aslab.com> wrote:
>Hi hugang.  This came just in time to fix a problem I'm having.  But when
>I try to load it using insmod, it complains that it cannot find the kernel
>it was built for.  Have you got this working successfully?  Which kernel
>are you running?  I'm running 2.4.9-ac8.
>
>I'm also using this in an initrd setting.  I'm trying to load the kernel
>and the initrd image, have the ipconfig modules get stuff through dhcp and
>then nfsroot.  Can you think of what might be causing this problem?  I'm
>no kernel hacker, but I'll do what I can.
>
>
>
Thanks for test it.

Yes,it work in my labs with kernel 2.4.8 (not ac)! I use it for an linux disaster recovery solution.

It your still can use it , I put my use kernel in http://www.soul.com.cn/2.4.9/2.4.9-disaster.tar.bz2

/boot/vmlinu.gz  	kernel
/boot/initrd.img.gz	initrd.img
/lib/module		kernel modules.

Beacuse my netcard can not remote boot, I use grub .
In grub command:

bootp
root (nd)
kernel vmlinuz.gz root=/dev/nfs
initrd initrd.img.gz

I test it with eepro100 netcard.I thinks it can work with another net card.


-- 
Best Regard!
礼!
----------------------------------------------------
hugang : 胡刚 	GNU/Linux User
email  : gang_hu@soul.com.cn linuxbest@soul.com.cn
Tel    : +861068425741/2/3/4
Web    : http://www.soul.com.cn

	Beijing Soul technology Co.Ltd.
	   北京众志和达科技有限公司
----------------------------------------------------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: A patch for dhcp and nfsroot.
  2001-09-14  0:51   ` hugang
@ 2001-09-14 22:06     ` John D. Kim
  2001-09-15  5:23     ` [Patch]:New " hugang
  1 sibling, 0 replies; 5+ messages in thread
From: John D. Kim @ 2001-09-14 22:06 UTC (permalink / raw)
  To: hugang; +Cc: linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=X-UNKNOWN, Size: 2316 bytes --]

Hmmm...  I've tried the patch with 2.4.8, 2.4.8-ac12, and 2.4.9-ac8.  All
three says "couldn't find the kernel version the module was compiled for"
when insmod tries to load the ipconfig module.  I've also tried different
versions of insmod(2.4.0, 2.4.2, and 2.4.8).  I have not yet tried your
kernel yet since I'm working with pcmcia devices, but I'll give it a try
as well, just to see if ipconfig would load or not.

Anyone else here have a clue?

On Fri, 14 Sep 2001, hugang wrote:

> On Thu, 13 Sep 2001 10:47:18 -0700 (PDT)
> "John D. Kim" <johnkim@aslab.com> wrote:
> >Hi hugang.  This came just in time to fix a problem I'm having.  But when
> >I try to load it using insmod, it complains that it cannot find the kernel
> >it was built for.  Have you got this working successfully?  Which kernel
> >are you running?  I'm running 2.4.9-ac8.
> >
> >I'm also using this in an initrd setting.  I'm trying to load the kernel
> >and the initrd image, have the ipconfig modules get stuff through dhcp and
> >then nfsroot.  Can you think of what might be causing this problem?  I'm
> >no kernel hacker, but I'll do what I can.
> >
> >
> >
> Thanks for test it.
>
> Yes,it work in my labs with kernel 2.4.8 (not ac)! I use it for an linux disaster recovery solution.
>
> It your still can use it , I put my use kernel in http://www.soul.com.cn/2.4.9/2.4.9-disaster.tar.bz2
>
> /boot/vmlinu.gz  	kernel
> /boot/initrd.img.gz	initrd.img
> /lib/module		kernel modules.
>
> Beacuse my netcard can not remote boot, I use grub .
> In grub command:
>
> bootp
> root (nd)
> kernel vmlinuz.gz root=/dev/nfs
> initrd initrd.img.gz
>
> I test it with eepro100 netcard.I thinks it can work with another net card.
>
>
> --
> Best Regard!
> Àñ£¡
> ----------------------------------------------------
> hugang : ºú¸Õ 	GNU/Linux User
> email  : gang_hu@soul.com.cn linuxbest@soul.com.cn
> Tel    : +861068425741/2/3/4
> Web    : http://www.soul.com.cn
>
> 	Beijing Soul technology Co.Ltd.
> 	   ±±¾©ÖÚÖ¾ºÍ´ï¿Æ¼¼ÓÐÏÞ¹«Ë¾
> ----------------------------------------------------
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Patch]:New patch for dhcp and nfsroot.
  2001-09-14  0:51   ` hugang
  2001-09-14 22:06     ` John D. Kim
@ 2001-09-15  5:23     ` hugang
  1 sibling, 0 replies; 5+ messages in thread
From: hugang @ 2001-09-15  5:23 UTC (permalink / raw)
  To: John D. Kim; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]

On Fri, 14 Sep 2001 15:06:55 -0700 (PDT)
"John D. Kim" <johnkim@aslab.com> wrote:
>Hmmm...  I've tried the patch with 2.4.8, 2.4.8-ac12, and 2.4.9-ac8.  All
>three says "couldn't find the kernel version the module was compiled for"
>when insmod tries to load the ipconfig module.  I've also tried different
>versions of insmod(2.4.0, 2.4.2, and 2.4.8).  I have not yet tried your
>kernel yet since I'm working with pcmcia devices, but I'll give it a try
>as well, just to see if ipconfig would load or not.
>
>Anyone else here have a clue?
>

Sorry .I check the ipconfig.c .I loss some things. Try the 2.4.9nfsroot.patch
1:Your must compile the nfs and nfsroot in kernel.

-- 
Best Regard!
礼!
----------------------------------------------------
hugang : 胡刚 	GNU/Linux User
email  : gang_hu@soul.com.cn linuxbest@soul.com.cn
Tel    : +861068425741/2/3/4
Web    : http://www.soul.com.cn

	Beijing Soul technology Co.Ltd.
	   北京众志和达科技有限公司
----------------------------------------------------

[-- Attachment #2: 2.4.9.nfsroot.patch --]
[-- Type: application/octet-stream, Size: 4464 bytes --]

diff -u -r linux/fs/Config.in linux-nfsroot/fs/Config.in
--- linux/fs/Config.in	Tue Jul  3 05:03:04 2001
+++ linux-nfsroot/fs/Config.in	Sat Sep 15 13:06:29 2001
@@ -80,7 +80,7 @@
    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
+   dep_bool '  Root file system on NFS' CONFIG_ROOT_NFS $CONFIG_NFS_FS
 
    dep_tristate 'NFS server support' CONFIG_NFSD $CONFIG_INET
    dep_mbool '  Provide NFSv3 server support' CONFIG_NFSD_V3 $CONFIG_NFSD
diff -u -r linux/fs/nfs/nfsroot.c linux-nfsroot/fs/nfs/nfsroot.c
--- linux/fs/nfs/nfsroot.c	Fri Aug 17 00:55:52 2001
+++ linux-nfsroot/fs/nfs/nfsroot.c	Sat Sep 15 13:06:29 2001
@@ -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,8 @@
 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[256] __initdata = { 0, } ;      /* Path to mount as root */
 
 /***************************************************************************
 
@@ -464,3 +467,5 @@
 	set_sockaddr((struct sockaddr_in *) &nfs_data.addr, servaddr, nfs_port);
 	return (void*)&nfs_data;
 }
+EXPORT_SYMBOL(root_server_addr);
+EXPORT_SYMBOL(root_server_path);
diff -u -r linux/include/net/ipconfig.h linux-nfsroot/include/net/ipconfig.h
--- linux/include/net/ipconfig.h	Wed May  2 11:59:24 2001
+++ linux-nfsroot/include/net/ipconfig.h	Sat Sep 15 13:06:29 2001
@@ -21,7 +21,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 u8 root_server_path[256];	/* Path to mount as root */
 
 
 
@@ -36,3 +36,4 @@
 #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 */
+
diff -u -r linux/net/core/dev.c linux-nfsroot/net/core/dev.c
--- linux/net/core/dev.c	Fri Aug 17 00:56:10 2001
+++ linux-nfsroot/net/core/dev.c	Sat Sep 15 13:06:29 2001
@@ -2818,3 +2818,5 @@
 	return call_usermodehelper(argv [0], argv, envp);
 }
 #endif
+
+EXPORT_SYMBOL(dev_change_flags);
diff -u -r linux/net/ipv4/Config.in linux-nfsroot/net/ipv4/Config.in
--- linux/net/ipv4/Config.in	Wed May  2 11:59:24 2001
+++ linux-nfsroot/net/ipv4/Config.in	Sat Sep 15 13:06:29 2001
@@ -18,8 +18,8 @@
    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
diff -u -r linux/net/ipv4/ipconfig.c linux-nfsroot/net/ipv4/ipconfig.c
--- linux/net/ipv4/ipconfig.c	Wed May  2 11:59:24 2001
+++ linux-nfsroot/net/ipv4/ipconfig.c	Sat Sep 15 13:07:51 2001
@@ -29,6 +29,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/module.h>
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
@@ -123,8 +124,8 @@
 
 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 */
+//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: */
 
@@ -1212,7 +1213,7 @@
 	return 0;
 }
 
-module_init(ip_auto_config);
+//module_init(ip_auto_config);
 
 
 /*
@@ -1340,5 +1341,13 @@
 	return ip_auto_config_setup(addrs);
 }
 
+int init_module(void)
+{
+#ifdef MODULE
+  ic_enable = 1;
+#endif
+  ip_auto_config();
+  return 0;
+}
 __setup("ip=", ip_auto_config_setup);
 __setup("nfsaddrs=", nfsaddrs_config_setup);

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-09-15  5:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.31.0109131044220.18725-100000@postbox.aslab.com>
2001-08-29  0:14 ` A patch for dhcp and nfsroot hugang
2001-09-13 18:32   ` John D. Kim
2001-09-14  0:51   ` hugang
2001-09-14 22:06     ` John D. Kim
2001-09-15  5:23     ` [Patch]:New " hugang

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).