]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
nfs-server: Fix kernel version check in initscript.
authorStefan Schantl <stefan.schantl@ipfire.org>
Fri, 3 Apr 2015 16:59:12 +0000 (18:59 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Fri, 3 Apr 2015 16:59:12 +0000 (18:59 +0200)
nfsd requires a mounted nfsd filesystem which has been introduced in
the kernel 2.6 tree. To determine the current running kernel, a check
was included in the initscript which works fine until we switched to a kernel
version 3.x.

This commit fixes this check, so the nfs-server will startup again.

Fixes #10760.

lfs/nfs
src/initscripts/init.d/nfs-server

diff --git a/lfs/nfs b/lfs/nfs
index d18487baa8c3685f02db75f2a10894b0d8099428..417f155fd287167b65237badcd0a3fd13629acbc 100644 (file)
--- a/lfs/nfs
+++ b/lfs/nfs
@@ -32,7 +32,7 @@ DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 PROG       = nfs
-PAK_VER    = 5
+PAK_VER    = 6
 
 DEPS       = "portmap"
 
index 397722c1c2967570a6a761077b860e483c391020..41055ad5b909a01d7584b6a003c4de56d75015ea 100644 (file)
@@ -27,8 +27,8 @@ case "$1" in
                        loadproc /usr/sbin/rpc.rquotad
                fi
 
-               # NFSD support only in 2.6 kernel
-               /bin/uname -r | /bin/grep "2.6" 2>&1 > /dev/null
+               # NFSD support requires kernel 2.6 or newer.
+               /bin/uname -r | /bin/grep -E "^2.6|^3" 2>&1 > /dev/null
                if [ $? = 0 ]; then
                        boot_mesg "Mounting nfsd virtual filesystem..."
                        /bin/mount -t nfsd none /proc/fs/nfsd 2>&1 > /dev/null
@@ -62,8 +62,8 @@ case "$1" in
                /usr/sbin/exportfs -au 2>&1 > /dev/null
                evaluate_retval
 
-               # NFSD support only in 2.6 kernel
-                /bin/uname -r | /bin/grep "2.6" 2>&1 > /dev/null
+               # NFSD support requires kernel 2.6 or newer.
+                /bin/uname -r | /bin/grep -E "^2.6|^3" 2>&1 > /dev/null
                 if [ $? = 0 ]; then
                        boot_mesg "Unmounting NFS Virtual Filesystem..."
                        /bin/umount /proc/fs/nfsd 2>&1 > /dev/null