]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(base): source hooks without exec
authorHarald Hoyer <harald@redhat.com>
Wed, 31 Mar 2021 14:16:52 +0000 (16:16 +0200)
committerHarald Hoyer <harald@hoyer.xyz>
Wed, 31 Mar 2021 19:31:00 +0000 (21:31 +0200)
Patch 2fabaaa62dcfd31e593ca 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.

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

index 668196dfc113e63c14b3e88f3988d1ecab295085..c35658faf7e57de3fa7a64048d9e6eeeb353862a 100755 (executable)
@@ -408,15 +408,9 @@ source_all() {
     [ "$_dir" ] && [ -d "/$_dir" ] || return
     for f in "/$_dir"/*.sh; do
         if [ -e "$f" ]; then
-            # dash can't source with parameters
-            if [ -z "$BASH" ] && [ $# -gt 0 ]; then
-                [ -x "$f" ] || chmod 0755 "$f"
-                "$f" "$@"
-            else
-                # shellcheck disable=SC1090
-                # shellcheck disable=SC2240
-                . "$f" "$@"
-            fi
+            # shellcheck disable=SC1090
+            # shellcheck disable=SC2240
+            . "$f" "$@"
         fi
     done
 }