summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilton Miller <miltonm@us.ibm.com>2016-06-15 18:47:38 -0500
committerMilton Miller <miltonm@us.ibm.com>2016-06-30 14:46:42 -0500
commit6343f09de92af8211d4152ca283104cb0a8f204c (patch)
tree1f9604e43fc5b13a7e40cdfd72fc736ed6df5d44
parent0f1edbefd47d9a0234b66e55a820a38cec01baa0 (diff)
downloadtalos-openbmc-6343f09de92af8211d4152ca283104cb0a8f204c.tar.gz
talos-openbmc-6343f09de92af8211d4152ca283104cb0a8f204c.zip
initfs: update: Consistently add ERROR: and print to stderr
Make sure all error messages start with the tag ERROR and its printed to stderr by creating an echoerr function. Previously one case had the file descriptors backwards in the redirection. Signed-off-by: Milton Miller <miltonm@us.ibm.com>
-rwxr-xr-xmeta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
index f0ca989d2..e51dbf879 100755
--- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
+++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
@@ -2,6 +2,10 @@
echo update: "$@"
+echoerr() {
+ echo 1>&2 "ERROR: $@"
+}
+
cd /
if ! test -r /proc/mounts || ! test -f /proc/mounts
then
@@ -21,7 +25,7 @@ fi
if grep mtd /proc/mounts
then
- echo 1>&2 "Error: A mtd device is mounted."
+ echoerr "A mtd device is mounted."
exit 1
fi
@@ -90,7 +94,7 @@ do
toram=y
shift ;;
*)
- echo 2>&1 "Unknown option $1"
+ echoerr "Unknown option $1"
exit 1 ;;
esac
done
@@ -126,7 +130,7 @@ do
m=$(findmtd ${f#$image})
if test -z "$m"
then
- echo 1>&2 "Unable to find mtd partiton for ${f##*/}."
+ echoerr "Unable to find mtd partiton for ${f##*/}."
exit 1
fi
done
OpenPOWER on IntegriCloud