]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
url-lib: make nfs support optional
authorWill Woods <wwoods@redhat.com>
Wed, 29 Feb 2012 18:09:57 +0000 (13:09 -0500)
committerHarald Hoyer <harald@redhat.com>
Fri, 2 Mar 2012 10:11:56 +0000 (11:11 +0100)
Only include /lib/nfs-lib.sh if it exists, and then only run
add_url_handler if nfs-lib was imported.

modules.d/45url-lib/url-lib.sh

index 1fc80a185dbec550afaa186650aad8a4c884654d..043a700ffc1b4d59ce96a86a738a61c04aa9ab22 100755 (executable)
@@ -74,7 +74,7 @@ set_http_header() {
 
 ### NFS ##############################################################
 
-. /lib/nfs-lib.sh
+[ -e /lib/nfs-lib.sh ] && . /lib/nfs-lib.sh
 
 nfs_already_mounted() {
     local server="$1" path="$2" localdir="" s="" p=""
@@ -112,4 +112,4 @@ nfs_fetch_url() {
     [ -f "$outloc" ] || return 253
     echo "$outloc"
 }
-add_url_handler nfs_fetch_url nfs nfs4
+command -v nfs_to_var >/dev/null && add_url_handler nfs_fetch_url nfs nfs4