diff options
Diffstat (limited to 'modules.d/99base/dracut-lib.sh')
-rwxr-xr-x | modules.d/99base/dracut-lib.sh | 77 |
1 files changed, 39 insertions, 38 deletions
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh index 3084744f..0d5cab9a 100755 --- a/modules.d/99base/dracut-lib.sh +++ b/modules.d/99base/dracut-lib.sh @@ -28,6 +28,45 @@ str_ends() { [ "${1%*$2}" != "$1" ] } +if [ -z "$DRACUT_SYSTEMD" ]; then + + warn() { + check_quiet + echo "<28>dracut Warning: $*" > /dev/kmsg + echo "dracut Warning: $*" >&2 + } + + info() { + check_quiet + echo "<30>dracut: $*" > /dev/kmsg + [ "$DRACUT_QUIET" != "yes" ] && \ + echo "dracut: $*" + } + +else + + warn() { + echo "Warning: $*" >&2 + } + + info() { + echo "$*" + } + +fi + +vwarn() { + while read line; do + warn $line; + done +} + +vinfo() { + while read line; do + info $line; + done +} + # replaces all occurrences of 'search' in 'str' with 'replacement' # # str_replace str search replacement @@ -407,44 +446,6 @@ check_quiet() { fi } -if [ -z "$DRACUT_SYSTEMD" ]; then - - warn() { - check_quiet - echo "<28>dracut Warning: $*" > /dev/kmsg - echo "dracut Warning: $*" >&2 - } - - info() { - check_quiet - echo "<30>dracut: $*" > /dev/kmsg - [ "$DRACUT_QUIET" != "yes" ] && \ - echo "dracut: $*" - } - -else - - warn() { - echo "Warning: $*" >&2 - } - - info() { - echo "$*" - } - -fi - -vwarn() { - while read line; do - warn $line; - done -} - -vinfo() { - while read line; do - info $line; - done -} check_occurances() { # Count the number of times the character $ch occurs in $str |