dracut-functions: logging functions adjusted to dracut-logger
parent
0b70674329
commit
e27770e10c
|
@ -253,7 +253,7 @@ inst_simple() {
|
||||||
if [[ -e "${src%/*}/.${src##*/}.hmac" ]]; then
|
if [[ -e "${src%/*}/.${src##*/}.hmac" ]]; then
|
||||||
inst "${src%/*}/.${src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
|
inst "${src%/*}/.${src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
|
||||||
fi
|
fi
|
||||||
dinfo "Installing $src"
|
ddebug "Installing $src"
|
||||||
cp -pfL "$src" "${initdir}$target"
|
cp -pfL "$src" "${initdir}$target"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,7 +305,7 @@ inst_library() {
|
||||||
# Create additional symlinks. See rev_symlinks description.
|
# Create additional symlinks. See rev_symlinks description.
|
||||||
for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do
|
for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do
|
||||||
[[ ! -e $initdir$symlink ]] && {
|
[[ ! -e $initdir$symlink ]] && {
|
||||||
dinfo "Creating extra symlink: $symlink"
|
ddebug "Creating extra symlink: $symlink"
|
||||||
inst_symlink $symlink
|
inst_symlink $symlink
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
|
@ -340,9 +340,9 @@ inst_binary() {
|
||||||
LC_ALL=C ldd $bin 2>/dev/null | while read line; do
|
LC_ALL=C ldd $bin 2>/dev/null | while read line; do
|
||||||
[[ $line = 'not a dynamic executable' ]] && return 1
|
[[ $line = 'not a dynamic executable' ]] && return 1
|
||||||
if [[ $line =~ not\ found ]]; then
|
if [[ $line =~ not\ found ]]; then
|
||||||
derror "Missing a shared library required by $bin."
|
dfatal "Missing a shared library required by $bin."
|
||||||
derror "Run \"ldd $bin\" to find out what it is."
|
dfatal "Run \"ldd $bin\" to find out what it is."
|
||||||
derror "dracut cannot create an initrd."
|
dfatal "dracut cannot create an initrd."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)'
|
so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)'
|
||||||
|
@ -435,7 +435,7 @@ inst() {
|
||||||
[[ $initdir = $2 ]] && set $1;;
|
[[ $initdir = $2 ]] && set $1;;
|
||||||
3) [[ -z $initdir ]] && export initdir=$2
|
3) [[ -z $initdir ]] && export initdir=$2
|
||||||
set $1 $3;;
|
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;;
|
exit 1;;
|
||||||
esac
|
esac
|
||||||
for x in inst_symlink inst_script inst_binary inst_simple; do
|
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.
|
# All hooks should be POSIX/SuS compliant, they will be sourced by init.
|
||||||
inst_hook() {
|
inst_hook() {
|
||||||
if ! [[ -f $3 ]]; then
|
if ! [[ -f $3 ]]; then
|
||||||
derror "Cannot install a hook ($3) that does not exist."
|
dfatal "Cannot install a hook ($3) that does not exist."
|
||||||
derror "Aborting initrd creation."
|
dfatal "Aborting initrd creation."
|
||||||
exit 1
|
exit 1
|
||||||
elif ! strstr "$hookdirs" "$1"; then
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
inst_simple "$3" "/lib/dracut/hooks/${1}/${2}${3##*/}"
|
inst_simple "$3" "/lib/dracut/hooks/${1}/${2}${3##*/}"
|
||||||
|
@ -473,9 +473,10 @@ dracut_install() {
|
||||||
while (($# > 0)); do
|
while (($# > 0)); do
|
||||||
if ! inst "$1" ; then
|
if ! inst "$1" ; then
|
||||||
if [[ $optional = yes ]]; 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
|
else
|
||||||
derror "Failed to install $1"
|
dfatal "Failed to install $1"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -661,7 +662,7 @@ check_module_dir() {
|
||||||
for mod in $modcheck; do
|
for mod in $modcheck; do
|
||||||
strstr "$mods_to_load" "$mod" && continue
|
strstr "$mods_to_load" "$mod" && continue
|
||||||
strstr "$omit_dracutmodules" "$mod" && continue
|
strstr "$omit_dracutmodules" "$mod" && continue
|
||||||
dwarning "Dracut module \"$mod\" cannot be found."
|
derror "Dracut module \"$mod\" cannot be found."
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -684,7 +685,8 @@ install_kmod_with_fw() {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [[ $found != yes ]]; then
|
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
|
fi
|
||||||
done
|
done
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Reference in New Issue