From 900550c4e0c2a48a5d0c01db0adb23e73a6aa195 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 24 Nov 2014 15:17:45 +0100 Subject: [PATCH] dracut-functions.sh: check if dinfo is a function If "dinfo" is an executable, dracut-logger.sh would never be sourced. See: https://bugzilla.redhat.com/show_bug.cgi?id=1167082 (cherry picked from commit 26d14fb3d36d6091f64258a62c49939478405693) --- dracut-functions.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dracut-functions.sh b/dracut-functions.sh index 31586ca..973e231 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -169,7 +169,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 @@ -202,12 +208,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() {