summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2016-04-19 14:33:20 -0700
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2016-06-24 00:48:42 +0200
commit088c6f613c4d0cd6765ea54d788979dbe787aa6a (patch)
tree36ff16fc2808faff284cb09a8141c21cb159ddc4
parent774301853331e060f1a5f9f30ad36c87dd291217 (diff)
update.sh: use test expressions in if statement for colibri-t20
Since we introduced set -e commands which fail will exit silently. This leads to no error message when the grep which tests for specified parameters failed. We could solve it with || true, but it seems more lightweight to just test for the strings inside the if statement. It also checks for the full length (e.g. disallows "25" as RAM size). The later fixed only 256 MB RAM size copy paste issue. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
-rwxr-xr-xrecipes/images/files/library/tegra/update.sh16
1 files changed, 7 insertions, 9 deletions
diff --git a/recipes/images/files/library/tegra/update.sh b/recipes/images/files/library/tegra/update.sh
index 76e7c6c..5b080ca 100755
--- a/recipes/images/files/library/tegra/update.sh
+++ b/recipes/images/files/library/tegra/update.sh
@@ -201,22 +201,20 @@ if [ "$UBOOT_RECOVERY" -eq 1 ] ; then
if [ "${MODTYPE}" = "colibri-t20" ] ; then
#some sanity test, we really need RAM_SIZE and MODVERSION set
echo ""
- echo "256, 512" | grep -q ${RAM_SIZE}
- if [ $? -eq 1 ] ; then
+ SANITY_CHECK=1
+ if [ "256" != ${RAM_SIZE} ] && [ "512" != ${RAM_SIZE} ]; then
printf "\033[1mplease specify your RAM size with the -r parameter\033[0m\n"
+ SANITY_CHECK=0
fi
- echo "v11, v12" | grep -q ${MODVERSION}
- if [ $? -eq 1 ] ; then
+ if [ "v11" != ${MODVERSION} ] && [ "v12" != ${MODVERSION} ]; then
printf "\033[1mplease specify your module version with the -v parameter\033[0m\n"
- Usage
- exit 0
+ SANITY_CHECK=0
fi
- echo "256, 512" | grep -q ${RAM_SIZE}
- if [ $? -eq 1 ] ; then
+ if [ ${SANITY_CHECK} -eq 0 ] ; then
Usage
- exit 0
+ exit 1
fi
fi