Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jun 96 09:15:00 PDT
From:      Duncan Barclay <Duncan.Barclay@pa-consulting.com>
To:        freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Aotu mounter +NFS LKM
Message-ID:  <31BDA174@SMTPGATE.PA-CONSULTING.COM>

next in thread | raw e-mail | index | archive | help

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 <bsd.prog.mk>
--- 28,32 ----
  
  .PATH: ${.CURDIR}/../rpcx ${.CURDIR}/../config
  .include "Makefile.config"
! .include "../../Makefile.inc"
  .include <bsd.prog.mk>
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 <sys/ioctl.h>
  #include <fcntl.h>
  #include <setjmp.h>
- #include <err.h>
  
  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 */




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?31BDA174>