From 2a8c9907b1095015e1d669d3cd895657936f6247 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 14 Jun 2010 11:11:42 +0200 Subject: hook-functions/mkinitramfs/update-initramfs: consequently output error messages to stderr Signed-off-by: Michael Prokop --- hook-functions | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'hook-functions') 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 -- cgit v1.2.3