Skip to content

Commit 8059bcb

Browse files
committed
fix(base): source hooks without exec
Patch 2fabaaa changed the behaviour for `dash` under the assumption, that dash does not take parameters for `.` aka `source`. Although this is true, the original positional parameters of the `source_all` function are still in place, so everything is fine with the old way of sourcing.
1 parent 36af051 commit 8059bcb

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

modules.d/99base/dracut-lib.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -408,15 +408,9 @@ source_all() {
408408
[ "$_dir" ] && [ -d "/$_dir" ] || return
409409
for f in "/$_dir"/*.sh; do
410410
if [ -e "$f" ]; then
411-
# dash can't source with parameters
412-
if [ -z "$BASH" ] && [ $# -gt 0 ]; then
413-
[ -x "$f" ] || chmod 0755 "$f"
414-
"$f" "$@"
415-
else
416-
# shellcheck disable=SC1090
417-
# shellcheck disable=SC2240
418-
. "$f" "$@"
419-
fi
411+
# shellcheck disable=SC1090
412+
# shellcheck disable=SC2240
413+
. "$f" "$@"
420414
fi
421415
done
422416
}

0 commit comments

Comments
 (0)