If we are installed, log to /var/log/dracut.log.
If we are not installed, log to /tmp/dracut.log
[[ $drivers_l ]] && drivers=$drivers_l
[[ $allowlocal && -f "$(dirname $0)/dracut-functions" ]] && dsrc="$(dirname $0)" || dsrc=/usr/lib/dracut
+
if [[ -f $dsrc/dracut-functions ]]; then
. $dsrc/dracut-functions
else
# Generic substring function. If $2 is in $1, return 0.
strstr() { [[ ! ${1#*$2*} = $1 ]]; }
+if ! [[ $dracutlogfile ]]; then
+ [[ $dsrc = /usr/lib/dracut ]] && \
+ dracutlogfile=/var/log/dracut/log || \
+ dracutlogfile=/tmp/dracut.log
+ >"$dracutlogfile"
+fi
+
dwarning() {
echo "W: $@" >&2
+ echo "W: $@" >>"$dracutlogfile"
}
dinfo() {
[[ $beverbose ]] && echo "I: $@" >&2
+ echo "I: $@" >>"$dracutlogfile"
}
derror() {
echo "E: $@" >&2
+ echo "E: $@" >>"$dracutlogfile"
}
# $1 = file to copy to ramdisk