]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix: check if xx-lib.sh is needed before executing
authorJo Zzsi <jozzsicsataban@gmail.com>
Sun, 10 Nov 2024 13:31:03 +0000 (08:31 -0500)
committerLaszlo <laszlo.gombos@gmail.com>
Sun, 10 Nov 2024 14:06:16 +0000 (09:06 -0500)
modules.d/90crypt/cryptroot-ask.sh
modules.d/90crypt/probe-keydev.sh
modules.d/90livenet/livenetroot.sh
modules.d/90livenet/parse-livenet.sh
modules.d/95cifs/cifsroot.sh
modules.d/95cifs/parse-cifsroot.sh
modules.d/95nfs/nfsroot.sh

index 38afd1eca6d1687f12d3168d3f732e3e6382a7fd..f8608fdf732052f64c40dc17743b204ed8e66ac8 100755 (executable)
@@ -78,7 +78,7 @@ asked_file=/tmp/cryptroot-asked-$luksname
 # load dm_crypt if it is not already loaded
 [ -d /sys/module/dm_crypt ] || modprobe dm_crypt
 
-. /lib/dracut-crypt-lib.sh
+command -v ask_for_password > /dev/null || . /lib/dracut-crypt-lib.sh
 
 #
 # Open LUKS device
index bb86b8fa6b8415a4cef82f8108448f1498a77469..bceb56a3bd6d4b46f4003a5b906aa1e6ac093942 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-. /lib/dracut-crypt-lib.sh
+command -v test_dev > /dev/null || . /lib/dracut-crypt-lib.sh
 
 real_keydev="$1"
 keypath="$2"
index eccaaed7293f1a5e3785906d3db64e6f2a68a137..d8ea4bc3aa72220fd9dacc1bc0d2d09cd85b4ad4 100755 (executable)
@@ -2,8 +2,7 @@
 # livenetroot - fetch a live image from the network and run it
 
 type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-
-. /lib/url-lib.sh
+type fetch_url > /dev/null 2>&1 || . /lib/url-lib.sh
 
 PATH=/usr/sbin:/usr/bin:/sbin:/bin
 RETRIES=${RETRIES:-100}
index a1d14a8fce9f4a1f51d8994dd35220279aa313db..68eb7c76f41828fd5505a3bf34e810122a153616 100755 (executable)
@@ -3,7 +3,8 @@
 # root=live:[url-to-backing-file]
 
 [ -z "$root" ] && root=$(getarg root=)
-. /lib/url-lib.sh
+get_url_handler
+command -v get_url_handler > /dev/null || . /lib/url-lib.sh
 
 # live updates
 updates=$(getarg live.updates=)
index 83539d40da9c975b26f1fdc83b23c21d072b6beb..f54213f5b03e4e5d0cd4202834332d75c0b5a942 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-. /lib/cifs-lib.sh
+type cifs_to_var > /dev/null 2>&1 || . /lib/cifs-lib.sh
 
 [ "$#" = 3 ] || exit 1
 
index b88bef48958c096d5cfa33e3f744f18ea540af01..19ccf90696f5c59c8e3ea82423d8279ef4660207 100755 (executable)
@@ -10,7 +10,7 @@
 #
 
 type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-. /lib/cifs-lib.sh
+type cifs_to_var > /dev/null 2>&1 || . /lib/cifs-lib.sh
 
 # This script is sourced, so root should be set. But let's be paranoid
 [ -z "$root" ] && root=$(getarg root=)
index 794e0d83a09a8f5d62961a4f7e3eca8d110a69e4..a47ec8fb1e284b4a71bb1063cfffab4d7ea5abd6 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-. /lib/nfs-lib.sh
+type nfs_to_var > /dev/null 2>&1 || . /lib/nfs-lib.sh
 
 [ "$#" = 3 ] || exit 1