From: David Dillow Date: Mon, 1 Jun 2009 23:59:22 +0000 (-0400) Subject: Allow NFS and NBD to be built into the kernel X-Git-Tag: 0.1~135 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b4dc8ad346413fa131fc15a09f6c40464966191f;p=platform%2Fupstream%2Fdracut.git Allow NFS and NBD to be built into the kernel Probe for NFS and NBD capability before trying to load their modules in case they are built into the kernel. Ugly use of flag files, but avoids the need for grep to be on the image. --- diff --git a/modules.d/95nbd/nbdroot b/modules.d/95nbd/nbdroot index 51120c2..1130cca 100755 --- a/modules.d/95nbd/nbdroot +++ b/modules.d/95nbd/nbdroot @@ -71,7 +71,17 @@ getarg ro && nbdrw=ro getarg rw && nbdrw=rw fsopts=${fsopts+$fsopts,}${nbdrw} -modprobe nbd || exit 1 +if [ ! -e /tmp/nbd.present ]; then + cat /proc/devices | while read t1 devt; do + if [ "$devt" = "nbd" ]; then + >/tmp/nfs.present + break + fi + done +fi +if [ ! -e /tmp/nbd.present ]; then + modprobe nbd || exit 1 +fi # XXX better way to wait for the device to be made? i=0 diff --git a/modules.d/95nfs/nfsroot b/modules.d/95nfs/nfsroot index 18e1300..2d08b68 100755 --- a/modules.d/95nfs/nfsroot +++ b/modules.d/95nfs/nfsroot @@ -46,7 +46,16 @@ getarg rw && nfsrw=rw nfsflags=${nfsflags+$nfsflags,}${nfsrw} # Load the modules so the filesystem type is there -modprobe nfs || exit 1 +if [ ! -e /tmp/nfs.present ]; then + cat /proc/filesystems | while read t1 fst; do + case "$fst" in + nfs|nfs4) >/tmp/nfs.present; break ;; + esac + done +fi +if [ ! -e /tmp/nfs.present ]; then + modprobe nfs || exit 1 +fi # XXX don't forget to move /var/lib/nfs/rpc_pipefs to new /