summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-08-16 11:00:45 +0200
committerHarald Hoyer <harald@redhat.com>2013-08-16 11:00:45 +0200
commitdf478eee753770bde7d5393be62bc17e6bde5f77 (patch)
treeba7a1530c682b18078a58180d030dbf607b735e1
parent8f53670cc5fc37678d06116b0b0dd979421d5495 (diff)
downloaddracut-df478eee753770bde7d5393be62bc17e6bde5f77.tar.gz
dracut-df478eee753770bde7d5393be62bc17e6bde5f77.tar.bz2
dracut-df478eee753770bde7d5393be62bc17e6bde5f77.zip
base/dracut-lib.sh: move warn() definition before usage
-rwxr-xr-xmodules.d/99base/dracut-lib.sh77
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