From 89027227a484061647e511c9d1f0405bab4426eb Mon Sep 17 00:00:00 2001 From: John Bowler Date: Sun, 10 Jul 2005 16:26:42 +0000 Subject: Working, tested, nfs-utils. This now pulls in all the dependencies on ipkg install and has a working startup script. --- packages/nfs-utils/files/nfsserver | 30 ++++++++++++++++++++++++++++-- packages/nfs-utils/nfs-utils_1.0.6.bb | 33 +++++++++++++++------------------ 2 files changed, 43 insertions(+), 20 deletions(-) (limited to 'packages') diff --git a/packages/nfs-utils/files/nfsserver b/packages/nfs-utils/files/nfsserver index 3536f0db12..36391ee85a 100644 --- a/packages/nfs-utils/files/nfsserver +++ b/packages/nfs-utils/files/nfsserver @@ -22,9 +22,34 @@ test -x "$NFS_NFSD" || exit 0 # ridiculous 99 test "$NFS_SERVERS" -gt 0 && "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8 # +# The default state directory is /var/lib/nfs +test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs +# #---------------------------------------------------------------------- # Startup and shutdown functions. # Actual startup/shutdown is at the end of this file. +#directories +create_directories(){ + echo -n 'creating NFS state directory: ' + mkdir -p "$NFS_STATEDIR" + ( cd "$NFS_STATEDIR" + umask 077 + mkdir -p sm sm.bak + test -w sm/state || { + rm -f sm/state + :>sm/state + } + umask 022 + for file in xtab etab smtab rmtab + do + test -w "$file" || { + rm -f "$file" + :>"$file" + } + done + ) + echo done +} #mountd start_mountd(){ echo -n 'starting mountd: ' @@ -39,7 +64,7 @@ stop_mountd(){ # #nfsd start_nfsd(){ - echo -n 'starting $1 nfsd kernel threads: ' + echo -n "starting $1 nfsd kernel threads: " start-stop-daemon --start --exec "$NFS_NFSD" -- "$@" echo done } @@ -90,7 +115,8 @@ stop_nfsd(){ # restart: stops and starts mountd #FIXME: need to create the /var/lib/nfs/... directories case "$1" in -start) start_nfsd "$NFS_SERVERS" +start) create_directories + start_nfsd "$NFS_SERVERS" start_mountd test -r /etc/exports && exportfs -a;; stop) exportfs -ua diff --git a/packages/nfs-utils/nfs-utils_1.0.6.bb b/packages/nfs-utils/nfs-utils_1.0.6.bb index 068fb315ad..f72b7226f4 100644 --- a/packages/nfs-utils/nfs-utils_1.0.6.bb +++ b/packages/nfs-utils/nfs-utils_1.0.6.bb @@ -3,20 +3,31 @@ PRIORITY = "optional" SECTION = "console/networking" MAINTAINER = "dyoung " LICENSE = "GPL" -PR = "r1" +PR = "r2" SRC_URI = "${SOURCEFORGE_MIRROR}/nfs/nfs-utils-${PV}.tar.gz \ file://acinclude-lossage.patch;patch=1 \ file://rpcgen-lossage.patch;patch=1 \ file://stat-include.patch;patch=1 \ + file://nfsserver \ file://forgotten-defines" S = ${WORKDIR}/nfs-utils-${PV}/ +# Only kernel-module-nfsd is required here - the nfsd module will +# pull in the remainder of the dependencies. +RDEPENDS = "portmap kernel-module-nfsd" + +INITSCRIPT_NAME = "nfsserver" +# The server has no dependencies at the user run levels, so just put +# it in at the default levels. It must be terminated before the network +# in the shutdown levels, but that works fine. +INITSCRIPT_PARAMS = "defaults" + inherit autotools EXTRA_OECONF = "--with-statduser=nobody \ --enable-nfsv3 \ - --with-statedir=${localstatedir}/lib/nfs" + --with-statedir=/var/lib/nfs" do_compile() { # UGLY HACK ALERT @@ -25,21 +36,8 @@ do_compile() { } do_install() { - mkdir -p ${D}${localstatedir}/lib/nfs - touch ${D}${localstatedir}/lib/nfs/xtab; chmod 644 ${D}${localstatedir}/lib/nfs/xtab - touch ${D}${localstatedir}/lib/nfs/etab; chmod 644 ${D}${localstatedir}/lib/nfs/etab - touch ${D}${localstatedir}/lib/nfs/smtab; chmod 644 ${D}${localstatedir}/lib/nfs/smtab - touch ${D}${localstatedir}/lib/nfs/rmtab; chmod 644 ${D}${localstatedir}/lib/nfs/rmtab - - mkdir -p ${D}${localstatedir}/lib/nfs/sm - mkdir -p ${D}${localstatedir}/lib/nfs/sm.bak - - touch ${D}${localstatedir}/lib/nfs/state - - chmod go-rwx ${D}${localstatedir}/lib/nfs/sm - chmod go-rwx ${D}${localstatedir}/lib/nfs/sm.bak - chmod go-rwx ${D}${localstatedir}/lib/nfs/state - # they should be owned by statduser, how to do that.. + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver install -d ${D}${sbindir} install -m 0755 ${S}/utils/exportfs/exportfs ${D}${sbindir}/exportfs @@ -69,4 +67,3 @@ do_install() { install -m 0644 ${S}/utils/showmount/showmount.man ${D}${mandir}/man8/showmount.8 install -m 0644 ${S}/utils/statd/statd.man ${D}${mandir}/man8/statd.8 } - -- cgit v1.2.3