Skip to content

Commit

Permalink
fix: check if xx-lib.sh is needed before executing
Browse files Browse the repository at this point in the history
  • Loading branch information
jozzsi authored and LaszloGombos committed Nov 10, 2024
1 parent c79fc8f commit 8b71a80
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion modules.d/90crypt/cryptroot-ask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules.d/90crypt/probe-keydev.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 1 addition & 2 deletions modules.d/90livenet/livenetroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
3 changes: 2 additions & 1 deletion modules.d/90livenet/parse-livenet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=)
Expand Down
2 changes: 1 addition & 1 deletion modules.d/95cifs/cifsroot.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion modules.d/95cifs/parse-cifsroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=)
Expand Down
2 changes: 1 addition & 1 deletion modules.d/95nfs/nfsroot.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 8b71a80

Please sign in to comment.