dracut-functions: logging functions adjusted to dracut-logger

master
Amadeusz Żołnowski 2011-03-25 15:56:47 +01:00 committed by Harald Hoyer
parent 0b70674329
commit e27770e10c
1 changed files with 15 additions and 13 deletions

View File

@ -253,7 +253,7 @@ inst_simple() {
if [[ -e "${src%/*}/.${src##*/}.hmac" ]]; then
inst "${src%/*}/.${src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
fi
dinfo "Installing $src"
ddebug "Installing $src"
cp -pfL "$src" "${initdir}$target"
}

@ -305,7 +305,7 @@ inst_library() {
# Create additional symlinks. See rev_symlinks description.
for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do
[[ ! -e $initdir$symlink ]] && {
dinfo "Creating extra symlink: $symlink"
ddebug "Creating extra symlink: $symlink"
inst_symlink $symlink
}
done
@ -340,9 +340,9 @@ inst_binary() {
LC_ALL=C ldd $bin 2>/dev/null | while read line; do
[[ $line = 'not a dynamic executable' ]] && return 1
if [[ $line =~ not\ found ]]; then
derror "Missing a shared library required by $bin."
derror "Run \"ldd $bin\" to find out what it is."
derror "dracut cannot create an initrd."
dfatal "Missing a shared library required by $bin."
dfatal "Run \"ldd $bin\" to find out what it is."
dfatal "dracut cannot create an initrd."
exit 1
fi
so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)'
@ -435,7 +435,7 @@ inst() {
[[ $initdir = $2 ]] && set $1;;
3) [[ -z $initdir ]] && export initdir=$2
set $1 $3;;
*) derror "inst only takes 1 or 2 or 3 arguments"
*) dfatal "inst only takes 1 or 2 or 3 arguments"
exit 1;;
esac
for x in inst_symlink inst_script inst_binary inst_simple; do
@ -455,11 +455,11 @@ inst() {
# All hooks should be POSIX/SuS compliant, they will be sourced by init.
inst_hook() {
if ! [[ -f $3 ]]; then
derror "Cannot install a hook ($3) that does not exist."
derror "Aborting initrd creation."
dfatal "Cannot install a hook ($3) that does not exist."
dfatal "Aborting initrd creation."
exit 1
elif ! strstr "$hookdirs" "$1"; then
derror "No such hook type $1. Aborting initrd creation."
dfatal "No such hook type $1. Aborting initrd creation."
exit 1
fi
inst_simple "$3" "/lib/dracut/hooks/${1}/${2}${3##*/}"
@ -473,9 +473,10 @@ dracut_install() {
while (($# > 0)); do
if ! inst "$1" ; then
if [[ $optional = yes ]]; then
dwarning "Skipping program $1 as it cannot be found and is flagged to be optional"
dwarn "Skipping program $1 as it cannot be found and is" \
"flagged to be optional"
else
derror "Failed to install $1"
dfatal "Failed to install $1"
exit 1
fi
fi
@ -661,7 +662,7 @@ check_module_dir() {
for mod in $modcheck; do
strstr "$mods_to_load" "$mod" && continue
strstr "$omit_dracutmodules" "$mod" && continue
dwarning "Dracut module \"$mod\" cannot be found."
derror "Dracut module \"$mod\" cannot be found."
done
}

@ -684,7 +685,8 @@ install_kmod_with_fw() {
fi
done
if [[ $found != yes ]]; then
dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\""
dwarn "Possible missing firmware \"${fw}\" for kernel module" \
"\"${mod}.ko\""
fi
done
return 0