summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Prokop <mika@debian.org>2010-06-14 11:11:42 +0200
committerMichael Prokop <mika@debian.org>2010-06-14 11:11:42 +0200
commit2a8c9907b1095015e1d669d3cd895657936f6247 (patch)
tree729973be1eebf296ca270d6e070816bb111ce187
parente65ee485d9d6f257e70231669a13e05cc45acbb3 (diff)
downloadinitramfs-tools-2a8c9907b1095015e1d669d3cd895657936f6247.tar.gz
initramfs-tools-2a8c9907b1095015e1d669d3cd895657936f6247.zip
hook-functions/mkinitramfs/update-initramfs: consequently output error messages to stderr
Signed-off-by: Michael Prokop <mika@debian.org>
-rw-r--r--hook-functions22
-rwxr-xr-xmkinitramfs4
-rwxr-xr-xupdate-initramfs8
3 files changed, 17 insertions, 17 deletions
diff --git a/hook-functions b/hook-functions
index 0a6c9b7..f5da1c4 100644
--- a/hook-functions
+++ b/hook-functions
@@ -220,16 +220,16 @@ dep_add_modules()
# require mounted sysfs
if [ ! -d /sys/devices/ ]; then
- echo "mkinitramfs: MODULES dep requires mounted sysfs on /sys"
+ echo "mkinitramfs: MODULES dep requires mounted sysfs on /sys" >&2
exit 1
fi
# findout root block device + fstype
eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')"
if [ -z "$root" ]; then
- echo "mkinitramfs: failed to determine root device"
- echo "mkinitramfs: workaround is MODULES=most"
- echo "Error please report bug on initramfs-tools and include the output of 'mount'"
+ echo "mkinitramfs: failed to determine root device" >&2
+ echo "mkinitramfs: workaround is MODULES=most" >&2
+ echo "Error please report bug on initramfs-tools and include the output of 'mount'" >&2
exit 1
fi
@@ -252,10 +252,10 @@ dep_add_modules()
if [ "${FSTYPE}" = "unknown" ]; then
FSTYPE=$(blkid -o value -s TYPE "${root}")
if [ -z "${FSTYPE}" ]; then
- echo "mkinitramfs: unknown fstype on root ${root}"
- echo "mkinitramfs: workaround is MODULES=most"
- echo "Error please report bug on initramfs-tools"
- exit 1
+ echo "mkinitramfs: unknown fstype on root ${root}" >&2
+ echo "mkinitramfs: workaround is MODULES=most" >&2
+ echo "Error please report bug on initramfs-tools" >&2
+ exit 1
fi
fi
@@ -349,9 +349,9 @@ dep_add_modules()
# Error out if /sys lack block dev
if [ -z "${block}" ] || [ ! -e /sys/block/${block} ]; then
- echo "mkinitramfs: for root ${root} missing ${block} /sys/block/ entry"
- echo "mkinitramfs: workaround is MODULES=most"
- echo "mkinitramfs: Error please report the bug"
+ echo "mkinitramfs: for root ${root} missing ${block} /sys/block/ entry" >&2
+ echo "mkinitramfs: workaround is MODULES=most" >&2
+ echo "mkinitramfs: Error please report the bug" >&2
exit 1
fi
diff --git a/mkinitramfs b/mkinitramfs
index baf69dd..58e4c11 100755
--- a/mkinitramfs
+++ b/mkinitramfs
@@ -148,7 +148,7 @@ fi
[ "${compress}" = lzop ] && compress="lzop -9"
if [ -d "${outfile}" ]; then
- echo "${outfile} is a directory"
+ echo "${outfile} is a directory" >&2
exit 1
fi
@@ -266,7 +266,7 @@ if [ -n "${ROOT:-}" ]; then
fi
if ! command -v ldd >/dev/null 2>&1 ; then
- echo "WARNING: no ldd around - install libc-bin"
+ echo "WARNING: no ldd around - install libc-bin" >&2
exit 1
fi
diff --git a/update-initramfs b/update-initramfs
index f8408e6..53ebed2 100755
--- a/update-initramfs
+++ b/update-initramfs
@@ -170,7 +170,7 @@ generate_initramfs()
# minversion wasn't met, exit 0
exit 0
fi
- echo "update-initramfs: failed for ${initramfs}"
+ echo "update-initramfs: failed for ${initramfs}" >&2
exit $mkinitramfs_return
fi
}
@@ -180,7 +180,7 @@ run_lilo()
{
# show lilo errors on failure
if ! lilo -t > /dev/null 2>&1 ; then
- echo "ERROR lilo fails for new ${initramfs}:"
+ echo "ERROR lilo fails for new ${initramfs}:" >&2
echo
lilo -t
fi
@@ -460,7 +460,7 @@ while getopts "k:cudyvtb:h?" flag; do
b)
BOOTDIR="${OPTARG}"
if [ ! -d "${BOOTDIR}" ]; then
- echo "Error: ${BOOTDIR} is not a directory."
+ echo "Error: ${BOOTDIR} is not a directory." >&2
exit 1
fi
;;
@@ -473,7 +473,7 @@ done
shift $((${OPTIND} - 1))
if [ $# -ne 0 ]; then
- echo "Invalid argument for option -k."
+ echo "Invalid argument for option -k." >&2
usage
fi