Update of /cvsroot/leaf/devel/davidmbrooke/src/bering-uclibc/apps/nfsutils In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv1379/nfsutils
Added Files: nfs-utils-1.1.1.tar.gz nfsutils.default nfsutils.exports nfsutils.init README support_nfs_svc_socket_c.patch utils_mountd_cache_c.patch Log Message: NFS Server Package for Werner van Staden --- NEW FILE: support_nfs_svc_socket_c.patch --- *** nfs-utils-1.1.1/support/nfs/svc_socket.c.orig 2007-10-19 04:07:28.000000000 +0100 --- nfs-utils-1.1.1/support/nfs/svc_socket.c 2007-10-28 13:02:10.000000000 +0000 *************** *** 67,74 **** memset (&addr, 0, sizeof (addr)); addr.sin_family = AF_INET; ! ret = getrpcbynumber_r (number, &rpcbuf, rpcdata, sizeof rpcdata, ! &rpcp); if (ret == 0 && rpcp != NULL) { /* First try name. */ --- 67,76 ---- memset (&addr, 0, sizeof (addr)); addr.sin_family = AF_INET; ! // ret = getrpcbynumber_r (number, &rpcbuf, rpcdata, sizeof rpcdata, ! // &rpcp); ! rpcp = getrpcbynumber (number); ! ret = 0; if (ret == 0 && rpcp != NULL) { /* First try name. */ --- NEW FILE: nfs-utils-1.1.1.tar.gz --- (This appears to be a binary file; contents omitted.) --- NEW FILE: nfsutils.exports --- # Sample /etc/exports for nfs-utils # # The following line would make local directory /export/media available # for mounting by host 192.168.1.1, as read-write, and also for any host # on the local network, as read-only. Both use option "no_subtree_check". # # /export/media -no_subtree_check 192.168.1.1(rw) 192.168.1.0/24(ro) --- NEW FILE: README --- README file for Bering-uClibc contrib package "nfsutils" 1. Introduction This directory contains the Bering-uClibc package source for "nfsutils". It provides the user-space NFS server daemons which work alongside the NFS server code built into the Linux kernel. It typically relies on portmap.lrp. See buildtool.cfg for more information. These notes are written against Bering-uClibc version 3.1, hence uClibc version 0.9.28 and Linux kernel version 2.4.34. WARNING: This package DOES NOT work with standard Bering-uClibc. A custom uClibc library is required. In addition, a custom kernel with custom modules is required. See below. 2. Building the package 2.1 Customize the build environment This package requires "full" RPC support from uClibc. As of Bering-uClibc 3.1, the standard uClibc library does not include this. A custom uClibc library is required. This is the same custom library as required by the "portmap" package. Refer to ../portmap/README for details of the custom uClibc build and installation procedure. In addition to the custom uClibc, some special kernel modules are required. As of Bering-uClibc 3.1 these are not built by default. The following assumes that a working buildtool environment is already installed. See http://leaf.sourceforge.net/doc/buc-buildtool.html for more information on the Bering-uClibc buildtool. The kernel modules are selected via changes to the kernel .config file: $ cd source/linux/linux $ patch .config <<EOF *** .config.orig 2007-12-27 13:00:35.000000000 +0000 --- .config 2007-12-27 13:07:48.000000000 +0000 *************** *** 1521,1531 **** # CONFIG_NFS_V3 is not set # CONFIG_NFS_DIRECTIO is not set # CONFIG_ROOT_NFS is not set ! # CONFIG_NFSD is not set ! # CONFIG_NFSD_V3 is not set ! # CONFIG_NFSD_TCP is not set CONFIG_SUNRPC=m CONFIG_LOCKD=m CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set # CONFIG_SMB_UNIX is not set --- 1521,1532 ---- # CONFIG_NFS_V3 is not set # CONFIG_NFS_DIRECTIO is not set # CONFIG_ROOT_NFS is not set ! CONFIG_NFSD=m ! CONFIG_NFSD_V3=y ! CONFIG_NFSD_TCP=y CONFIG_SUNRPC=m CONFIG_LOCKD=m + CONFIG_LOCKD_V4=y CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set # CONFIG_SMB_UNIX is not set EOF $ cd ../../.. NOTE: Some other kernel modules come from add-on packages, not from the kernel source code. Need commands like the following to include these in the kernel (but this is NOT a complete list): $ ./buildtool.pl build lmsensors $ ./buildtool.pl build iscsi Assuming that the kernel has already been built, need to tell buildtool that it should be re-built with "-f" (force): $ ./buildtool.pl -f build kernel The new modules need to be included in a new modules.tgz file: $ cd staging/lib/modules $ tar -cf - 2.4.34 | gzip -9 > modules.tgz 2.2 Build the nfsutils source Add the following lines to conf/sources.conf: <Server cvs-sourceforge-devel-davidmbrooke> Type = viewcvs Name = leaf.cvs.sourceforge.net Serverpath = /leaf/devel/davidmbrooke/src/bering-uclibc/apps </Server> <Package nfsutils> Server = cvs-sourceforge-devel-davidmbrooke Directory = nfsutils Description = Linux NFS Server Utilities <Requires> Name = buildenv Name = tcp_wrappers </Requires> </Package> Download and build the nfsutils files with the following command: $ ./buildtool.pl build nfsutils 2.3. Build the LRP with buildpacket $ fakeroot -- ./buildpacket.pl --packager="YOURNAME" --package=nfsutils 3. Installation 3.1 Installation of custom uClibc Refer to ../portmap/README. 3.2 Installation of custom kernel and modules Copy build/kernel/bzimage-2.4.34-upx to filename "linux" on the Bering-uClibc boot disk. Copy staging/lib/modules/modules.tgz to filename "modules.tgz" on the Bering-uClibc boot disk. 3.3 Installation of nfsutils.lrp Copy package/nfsutils.lrp to the Bering-uClibc boot disk. Be sure to specify the following in /etc/modules: # # NFS server modules sunrpc lockd nfsd 4. Usage notes There are two configuration files: etc/default/nfsutils, which allows the command-line options for the portmap daemon to be modified, and /etc/exports which is used to define the list of exported directories. Typical usage is to specify the mount of a local filesystem in /etc/fstab, with an entry like: /dev/hdb1 /export/media ext3 defaults 1 1 Of course, this requires that the "ext3" module is loaded, which in turn needs "jbd". Need to ensure that directory /export/media is created when Bering-uClibc boots. Entries in /var/lib/lrpkg/local.local must be files, not directories so my preference is to create a ".mountpoint" file and specify this in /var/lib/lrpkg/local.local (requires local.lrp): $ mkdir -p /export/media $ touch /export/media/.mountpoint $ echo "export/media/.mountpoint" >> /var/lib/lrpkg/local.local With the directory mounted locally, specify the export according to the comments in /etc/exports. Error messages like "Can't resolve symbol 'svcudp_create'" mean that the custom uClibc library with "UCLIBC_HAS_RPC=y" has not been installed. If Shorewall is running then ports will need to be opened to allow the NFS server to operate. I don't run Shorewall on my fileserver. david M brooke, 24 March 2008 mailto: davidmbrooke at users dot sourceforge dot net --- NEW FILE: utils_mountd_cache_c.patch --- *** nfs-utils-1.1.1/utils/mountd/cache.c.orig 2007-10-19 04:07:28.000000000 +0100 --- nfs-utils-1.1.1/utils/mountd/cache.c 2007-10-28 13:03:12.000000000 +0000 *************** *** 138,154 **** pw = getpwuid(uid); if (!pw) rv = -1; ! else { ! rv = getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups); ! if (rv == -1 && ngroups >= 100) { ! groups = malloc(sizeof(gid_t)*ngroups); ! if (!groups) ! rv = -1; ! else ! rv = getgrouplist(pw->pw_name, pw->pw_gid, ! groups, &ngroups); ! } ! } qword_printint(f, uid); qword_printint(f, time(0)+30*60); if (rv >= 0) { --- 138,154 ---- pw = getpwuid(uid); if (!pw) rv = -1; ! // else { ! // rv = getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups); ! // if (rv == -1 && ngroups >= 100) { ! // groups = malloc(sizeof(gid_t)*ngroups); ! // if (!groups) ! // rv = -1; ! // else ! // rv = getgrouplist(pw->pw_name, pw->pw_gid, ! // groups, &ngroups); ! // } ! // } qword_printint(f, uid); qword_printint(f, time(0)+30*60); if (rv >= 0) { --- NEW FILE: nfsutils.init --- #!/bin/sh # # /etc/init.d/nfs-utils: start and stop NFS server daemons # RCDLINKS="0,K10 2,S90" PATH=/sbin:/bin:/usr/sbin:/usr/bin # Crude check for "portmap" dependency [ -x /sbin/portmap ] || exit 2 # Check for existence of daemon executables [ -x /usr/sbin/rpc.nfsd ] || exit 2 [ -x /usr/sbin/rpc.mountd ] || exit 2 [ -x /usr/sbin/exportfs ] || exit 2 # Include nfs-utils settings if available if [ -f /etc/default/nfs-utils ] ; then . /etc/default/nfs-utils fi # Define fall-back default settings [ -z "$NFSDOPTS" ] && NFSDOPTS="" [ -z "$NFSDCOUNT" ] && NFSDCOUNT="8" [ -z "$MOUNTDOPTS" ] && MOUNTDOPTS="" RETVAL=0 # See how we were called case "$1" in start) # Create working files touch /var/lib/nfs/etab /var/lib/nfs/rmtab /var/lib/nfs/xtab /var/lib/nfs/state # Start daemons /usr/sbin/exportfs -r echo -n "Starting NFS daemon: " start-stop-daemon --start --exec /usr/sbin/rpc.nfsd --quiet -- $NFSDOPTS $NFSDCOUNT RETVAL=$? if [ $RETVAL == "0" ]; then echo "succeeded." else echo "failed." fi echo -n "Starting NFS mountd: " start-stop-daemon --start --exec /usr/sbin/rpc.mountd --quiet -- $MOUNTDOPTS RETVAL=$? if [ $RETVAL == "0" ]; then echo "succeeded." else echo "failed." fi ;; stop) # Stop daemons echo -n "Shutting down NFS mountd: " start-stop-daemon --stop --exec /usr/sbin/rpc.mountd --quiet RETVAL=$? if [ $RETVAL == "0" ]; then echo "succeeded." else echo "failed." fi echo -n "Shutting down NFS daemon: " # The "--start" below really is correct. We start the # user-space daemon and ask it to stop the kernel daemon(s) start-stop-daemon --start --exec /usr/sbin/rpc.nfsd --quiet -- stop RETVAL=$? if [ $RETVAL == "0" ]; then echo "succeeded." else echo "failed." fi ;; restart) $0 stop sleep 1 $0 start ;; *) echo $"Usage: $0 {start|stop|restart}" exit 1 esac exit 0 --- NEW FILE: nfsutils.default --- # Defaults for nfs-utils initscript (/etc/init.d/nfs-utils) # This is a POSIX shell fragment # # Command-line options for rpc.nfsd # Select from: # -H or --host hostname # -p or --port port # -N or --no-nfs-version vers # -T or --no-tcp # -U or --no-udp NFSDOPTS="" # Number of threads for nfsd NFSDCOUNT="4" # # Command-line options for rpc.mountd # Select from: # -d or --debug kind (all, auth, call, general, parse) # -F or --foreground # -f or --exports-file filename (default is /etc/exports) # -o or --descriptors num # -N or --no-nfs-version vers # -n or --no-tcp # -p or --port port # -P or --state-directory-path directory (default is /var/lib/nfs) # -r or --reverse-lookup # -t or --num-threads num # -V or --nfs-version num MOUNTDOPTS="" ------------------------------------------------------------------------------ Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL, new data types, scalar functions, improved concurrency, built-in packages, OCI, SQL*Plus, data movement tools, best practices and more. http://p.sf.net/sfu/oracle-sfdev2dev _______________________________________________ leaf-cvs-commits mailing list leaf-cvs-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/leaf-cvs-commits