diff --git a/dracut-functions.sh b/dracut-functions.sh index b43b7664..17a71f0e 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -176,7 +176,13 @@ srcmods="/lib/modules/$kernel/" } export srcmods -if ! type dinfo >/dev/null 2>&1; then +# is_func +# Check whether $1 is a function. +is_func() { + [[ "$(type -t "$1")" = "function" ]] +} + +if ! is_func dinfo >/dev/null 2>&1; then . "$dracutbasedir/dracut-logger.sh" dlog_init fi @@ -209,12 +215,6 @@ mksubdirs() { [[ -e ${1%/*} ]] || mkdir -m 0755 -p -- "${1%/*}" } -# is_func -# Check whether $1 is a function. -is_func() { - [[ "$(type -t "$1")" = "function" ]] -} - # Function prints global variables in format name=value line by line. # $@ = list of global variables' name print_vars() {