diff -Nur linux.orig/Documentation/Configure.help linux/Documentation/Configure.help --- linux.orig/Documentation/Configure.help Mon Oct 22 14:57:05 2001 +++ linux/Documentation/Configure.help Mon Oct 22 15:08:52 2001 @@ -737,6 +737,35 @@ called nbd.o. If unsure, say N. + +Network disk device support +CONFIG_BLK_DEV_NWD + If you say Y here, your kernel will be able to act as network disk + client and provide you with network disk block devices. This is + similar to NBD in that the driver forwards block device requests + over network to server, which performs the operations on files on + its local filesystem and returns results back to the client. The + driver will enlarge your kernel by about 8 KiB. + + Unlike NBD though, NWD it uses RPC to transfer block device requests + to the server. The network disk devices can be also used for root + filesystems, making it easy to setup diskless environment -- all you + need is kernel image with network drivers. The RPC transport protocol + can be either TCP/IP or UDP/IP, the latter being the default one and + probably the one more suitable for reliable, local area networks. The + driver utilizes built-in kernel SunRPC infrastructure, thus saying Y + here will force SunRPC into your kernel, which will enlarge it by + about 65 KiB. + + Consult for more information concerning + the kernel client driver and user space server. + + If you want to compile this driver as a module (i.e. code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read . The module will be + called nwd.o. + + If unsure, say N. ATA/IDE/MFM/RLL support CONFIG_IDE diff -Nur linux.orig/Makefile linux/Makefile --- linux.orig/Makefile Mon Oct 22 14:57:05 2001 +++ linux/Makefile Mon Oct 22 15:08:52 2001 @@ -185,6 +185,7 @@ DRIVERS-$(CONFIG_SGI_IP22) += drivers/sgi/sgi.a DRIVERS-$(CONFIG_VT) += drivers/video/video.o DRIVERS-$(CONFIG_PARIDE) += drivers/block/paride/paride.a +DRIVERS-$(CONFIG_BLK_DEV_NWD) += drivers/block/nwd/nwd.o DRIVERS-$(CONFIG_HAMRADIO) += drivers/net/hamradio/hamradio.o DRIVERS-$(CONFIG_TC) += drivers/tc/tc.a DRIVERS-$(CONFIG_USB) += drivers/usb/usbdrv.o diff -Nur linux.orig/drivers/block/Config.in linux/drivers/block/Config.in --- linux.orig/drivers/block/Config.in Mon Oct 22 14:54:31 2001 +++ linux/drivers/block/Config.in Mon Oct 22 15:08:52 2001 @@ -48,6 +48,7 @@ dep_mbool ' Encryption support (see Crypto section) (EXPERIMENTAL)' CONFIG_BLK_DEV_LOOP_GEN $CONFIG_BLK_DEV_LOOP dep_tristate 'Network block device support' CONFIG_BLK_DEV_NBD $CONFIG_NET +dep_tristate 'Network disk device support' CONFIG_BLK_DEV_NWD $CONFIG_NET tristate 'RAM disk support' CONFIG_BLK_DEV_RAM if [ "$CONFIG_BLK_DEV_RAM" = "y" -o "$CONFIG_BLK_DEV_RAM" = "m" ]; then diff -Nur linux.orig/drivers/block/Makefile linux/drivers/block/Makefile --- linux.orig/drivers/block/Makefile Fri Dec 29 23:07:21 2000 +++ linux/drivers/block/Makefile Mon Oct 22 15:08:52 2001 @@ -33,5 +33,6 @@ obj-$(CONFIG_BLK_DEV_NBD) += nbd.o subdir-$(CONFIG_PARIDE) += paride +subdir-$(CONFIG_BLK_DEV_NWD) += nwd include $(TOPDIR)/Rules.make diff -Nur linux.orig/include/linux/blk.h linux/include/linux/blk.h --- linux.orig/include/linux/blk.h Fri Jul 20 21:53:47 2001 +++ linux/include/linux/blk.h Mon Oct 22 15:08:52 2001 @@ -296,6 +296,12 @@ #define DEVICE_REQUEST do_nbd_request #define DEVICE_NR(device) (MINOR(device)) +#elif (MAJOR_NR == NWD_MAJOR) + +#define DEVICE_NAME "nwd" +#define DEVICE_REQUEST nwd_request +#define DEVICE_NR(device) (MINOR(device)) + #elif (MAJOR_NR == MDISK_MAJOR) #define DEVICE_NAME "mdisk" diff -Nur linux.orig/include/linux/major.h linux/include/linux/major.h --- linux.orig/include/linux/major.h Mon Oct 22 14:54:51 2001 +++ linux/include/linux/major.h Mon Oct 22 15:08:52 2001 @@ -88,6 +88,8 @@ #define LVM_BLK_MAJOR 58 /* Logical Volume Manager */ +#define NWD_MAJOR 62 /* Network disk driver */ + #define SCSI_DISK1_MAJOR 65 #define SCSI_DISK2_MAJOR 66 #define SCSI_DISK3_MAJOR 67 diff -Nur linux.orig/init/main.c linux/init/main.c --- linux.orig/init/main.c Mon Oct 22 14:54:48 2001 +++ linux/init/main.c Mon Oct 22 15:10:44 2001 @@ -114,6 +114,7 @@ #endif extern void ecard_init(void); +extern int nwd_boot_init(void); #if defined(CONFIG_SYSVIPC) extern void ipc_init(void); @@ -229,6 +230,10 @@ { "apblock", APBLOCK_MAJOR << 8}, { "ddv", DDV_MAJOR << 8}, { "jsfd", JSFD_MAJOR << 8}, +#ifdef CONFIG_BLK_DEV_NWD + { "nwd", 0x3E00 }, +#endif + #if defined(CONFIG_ARCH_S390) { "dasda", (DASD_MAJOR << MINORBITS) }, { "dasdb", (DASD_MAJOR << MINORBITS) + (1 << 2) }, @@ -774,6 +779,12 @@ start_context_thread(); do_initcalls(); +#ifdef CONFIG_BLK_DEV_NWD + /* Must be done after NET/RPC initialization */ + if (nwd_boot_init()) + panic ("Unable to setup network disk root device."); +#endif + #ifdef CONFIG_IRDA irda_proto_init(); irda_device_init(); /* Must be done after protocol initialization */