From owner-freebsd-hackers Tue Jun 11 01:31:50 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id BAA13575 for hackers-outgoing; Tue, 11 Jun 1996 01:31:50 -0700 (PDT) Received: from ns.pa-consulting.com (ns.pa-consulting.com [193.118.224.1]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id BAA13560 for ; Tue, 11 Jun 1996 01:31:39 -0700 (PDT) Received: from SMTPGATE.PA-CONSULTING.COM by ns.pa-consulting.com (8.6.4) id JAA05129; Tue, 11 Jun 1996 09:40:23 +0100 Received: by SMTPGATE.PA-CONSULTING.COM with Microsoft Mail id <31BDA174@SMTPGATE.PA-CONSULTING.COM>; Tue, 11 Jun 96 09:40:20 PDT From: Duncan Barclay To: freebsd-hackers Subject: Aotu mounter +NFS LKM Date: Tue, 11 Jun 96 09:15:00 PDT Message-ID: <31BDA174@SMTPGATE.PA-CONSULTING.COM> Encoding: 24 TEXT, 149 TEXT X-Mailer: Microsoft Mail V3.0 X-MS-Attachment: AMD_DIFF. 4316 05-09-1996 22:46 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Dear All Over the weekend I decided to try and get amd to help me mount floppies. After reading the manuals and understanding it I got down to work but it didnt. After a while it dawned on me that amd uses nfs, ergo one needs nfs in the kernel, as I run a standalone machine I dont have nfs compiled into my kernel. Ahh I thought what about the nfs lkm? Does it load using modload...no panic after panic after panic. However all was not lost, run mountd or nfsd or nfsiod and the lkm is installed correctly. So patch up amd to check for nfs and load the module if it is not there. Diffs included Duncan Barclay [[ AMD_DIFF : 2309 in AMD_DIFF. ]] Only in /cdrom/usr/src/usr.sbin/amd/amd: 00_TRANS.TBL diff -c amd/ChangeLog /cdrom/usr/src/usr.sbin/amd/amd/ChangeLog *** amd/ChangeLog Sun Feb 18 13:16:45 1996 --- /cdrom/usr/src/usr.sbin/amd/amd/ChangeLog Wed May 25 15:22:04 1994 *************** *** 1,13 **** - Sun Feb 17 1996 Duncan Barclay - * (amd.c) Added in LKM checking for nfs. - - * (ufs_ops.c) Removed FS_NOTIMEOUT flag for ufs filesystems - so that they can timeout on floppy disks. - This may really break if amd is started with a -r flag. I - haven't tried it... - - * Also updated manpage to refelct LKM bit. - Sun Jun 7 19:01:37 1992 Jan-Simon Pendry (jsp at achilles) * Code cut for BSD 4.4 alpha. --- 1,3 ---- diff -c amd/Makefile /cdrom/usr/src/usr.sbin/amd/amd/Makefile *** amd/Makefile Sun Feb 18 13:12:58 1996 --- /cdrom/usr/src/usr.sbin/amd/amd/Makefile Sun Aug 7 10:04:11 1994 *************** *** 28,32 **** .PATH: ${.CURDIR}/../rpcx ${.CURDIR}/../config .include "Makefile.config" ! .include "../Makefile.inc" .include --- 28,32 ---- .PATH: ${.CURDIR}/../rpcx ${.CURDIR}/../config .include "Makefile.config" ! .include "../../Makefile.inc" .include diff -c amd/amd.8 /cdrom/usr/src/usr.sbin/amd/amd/amd.8 *** amd/amd.8 Sun Feb 18 13:06:21 1996 --- /cdrom/usr/src/usr.sbin/amd/amd/amd.8 Wed May 25 15:22:02 1994 *************** *** 183,204 **** .Fl v option and a fuller description is available in the program source. - .Pp - If - .Nm amd - detects that the running kernel does not include - .Tn NFS - support, it will attempt to load a loadable kernel module containing - .Tn NFS - code, using - .Xr modload 8 - by way of - .Xr vfsload 3 . - If this fails, or no - .Tn NFS - LKM was available, - .Nm amd - exits with an error. .Sh FILES .Bl -tag -width /axx .It Pa /a --- 183,188 ---- diff -c amd/amd.c /cdrom/usr/src/usr.sbin/amd/amd/amd.c *** amd/amd.c Sun Feb 18 12:56:57 1996 --- /cdrom/usr/src/usr.sbin/amd/amd/amd.c Wed May 25 15:22:00 1994 *************** *** 56,62 **** #include #include #include - #include char pid_fsname[16 + MAXHOSTNAMELEN]; /* "kiska.southseas.nz:(pid%d)" */ char *progname; /* "amd" */ --- 56,61 ---- *************** *** 196,220 **** char *domdot; int ppid = 0; int error; - struct vfsconf *vfc; /* ! * Make sure some built-in assumptions are true before we start. ! * Like NFS is in the kernel. (dmlb 18/2/96) */ - vfc = getvfsbyname("nfs"); - if(!vfc && vfsisloadable("nfs")) { - if(vfsload("nfs")) - err(1, "vfsload(nfs)"); - endvfsent(); /* flush cache */ - vfc = getvfsbyname("nfs"); - } - - if(!vfc) { - errx(1, "NFS support is not available in the running kernel"); - } - - #define MAXNFSDCNT 20 assert(sizeof(nfscookie) >= sizeof (unsigned int)); assert(sizeof(int) >= 4); --- 195,204 ---- char *domdot; int ppid = 0; int error; /* ! * Make sure some built-in assumptions are true before we start */ assert(sizeof(nfscookie) >= sizeof (unsigned int)); assert(sizeof(int) >= 4); diff -c amd/ufs_ops.c /cdrom/usr/src/usr.sbin/amd/amd/ufs_ops.c *** amd/ufs_ops.c Sat Feb 17 23:46:16 1996 --- /cdrom/usr/src/usr.sbin/amd/amd/ufs_ops.c Wed May 25 15:22:02 1994 *************** *** 169,185 **** 0, /* ufs_umounted */ find_afs_srvr, #ifdef FLUSH_KERNEL_NAME_CACHE ! FS_MKMNT|FS_UBACKGROUND|FS_AMQINFO #else /* FLUSH_KERNEL_NAME_CACHE */ ! FS_MKMNT|FS_UBACKGROUND|FS_AMQINFO #endif /* FLUSH_KERNEL_NAME_CACHE */ }; - /* dmlb 2/96 - * The above two options lines used to read - * FS_MKMNT|FS_NOTIMEOUT|FS_UBACKGROUND|FS_AMQINFO - * which means that ufs file systems cannot timeout. - * I removed this so that I can mount floppys and unmount them okay - * - */ #endif /* HAS_UFS */ --- 169,178 ---- 0, /* ufs_umounted */ find_afs_srvr, #ifdef FLUSH_KERNEL_NAME_CACHE ! FS_MKMNT|FS_NOTIMEOUT|FS_UBACKGROUND|FS_AMQINFO #else /* FLUSH_KERNEL_NAME_CACHE */ ! FS_MKMNT|FS_NOTIMEOUT|FS_UBACKGROUND|FS_AMQINFO #endif /* FLUSH_KERNEL_NAME_CACHE */ }; #endif /* HAS_UFS */