From 1339095dbaffa5e19ea1b46a9a0a291f345d5cf6 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 9 Jun 2015 13:49:32 +0200 Subject: [PATCH] dracut-functions.sh: only honor the first [0-9]+ dir If multiple directories with different numbers exist, only honor the first one. --- dracut-functions.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dracut-functions.sh b/dracut-functions.sh index 36fe2cf8..8f971c0b 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -1130,7 +1130,7 @@ inst_opt_decompress() { # or the "check" script, if module-setup.sh is not found # "check $hostonly" is called module_check() { - local _moddir=$(echo ${dracutbasedir}/modules.d/??${1}) + local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }) local _ret local _forced=0 local _hostonly=$hostonly @@ -1161,7 +1161,7 @@ module_check() { # or the "check" script, if module-setup.sh is not found # "mount_needs=1 check 0" is called module_check_mount() { - local _moddir=$(echo ${dracutbasedir}/modules.d/??${1}) + local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }) local _ret mount_needs=1 [[ -d $_moddir ]] || return 1 @@ -1186,7 +1186,7 @@ module_check_mount() { # execute the depends() function of module-setup.sh of # or the "depends" script, if module-setup.sh is not found module_depends() { - local _moddir=$(echo ${dracutbasedir}/modules.d/??${1}) + local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }) local _ret [[ -d $_moddir ]] || return 1 if [[ ! -f $_moddir/module-setup.sh ]]; then @@ -1209,7 +1209,7 @@ module_depends() { # execute the cmdline() function of module-setup.sh of # or the "cmdline" script, if module-setup.sh is not found module_cmdline() { - local _moddir=$(echo ${dracutbasedir}/modules.d/??${1}) + local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }) local _ret [[ -d $_moddir ]] || return 1 if [[ ! -f $_moddir/module-setup.sh ]]; then @@ -1230,7 +1230,7 @@ module_cmdline() { # execute the install() function of module-setup.sh of # or the "install" script, if module-setup.sh is not found module_install() { - local _moddir=$(echo ${dracutbasedir}/modules.d/??${1}) + local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }) local _ret [[ -d $_moddir ]] || return 1 if [[ ! -f $_moddir/module-setup.sh ]]; then @@ -1251,7 +1251,7 @@ module_install() { # execute the installkernel() function of module-setup.sh of # or the "installkernel" script, if module-setup.sh is not found module_installkernel() { - local _moddir=$(echo ${dracutbasedir}/modules.d/??${1}) + local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }) local _ret [[ -d $_moddir ]] || return 1 if [[ ! -f $_moddir/module-setup.sh ]]; then @@ -1273,7 +1273,7 @@ module_installkernel() { # device and filesystem types in "${host_fs_types[@]}" check_mount() { local _mod=$1 - local _moddir=$(echo ${dracutbasedir}/modules.d/??${1}) + local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }) local _ret local _moddep @@ -1338,7 +1338,7 @@ check_mount() { # that the modules were checked for the dependency tracking process check_module() { local _mod=$1 - local _moddir=$(echo ${dracutbasedir}/modules.d/??${1}) + local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }) local _ret local _moddep # If we are already scheduled to be loaded, no need to check again.