aboutsummaryrefslogtreecommitdiff
path: root/sys/tools/embed_mfs.sh
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2018-11-02 21:07:06 +0000
committerEd Maste <emaste@FreeBSD.org>2018-11-02 21:07:06 +0000
commit97a7bf30707a9b0075034d5bae89acc6cfad92a6 (patch)
tree431a521e60f7225691e8586973feb542029ae2d9 /sys/tools/embed_mfs.sh
parent4e8c73eb20d192be2bcf9f264a53183af3f95fdb (diff)
downloadsrc-97a7bf30707a9b0075034d5bae89acc6cfad92a6.tar.gz
src-97a7bf30707a9b0075034d5bae89acc6cfad92a6.zip
embed_mfs.sh: replace some compound statements with conventional ifs
Use the more readable form - there's no need to try being clever.
Notes
Notes: svn path=/head/; revision=340082
Diffstat (limited to 'sys/tools/embed_mfs.sh')
-rw-r--r--sys/tools/embed_mfs.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/tools/embed_mfs.sh b/sys/tools/embed_mfs.sh
index 012466230884..072f7818906e 100644
--- a/sys/tools/embed_mfs.sh
+++ b/sys/tools/embed_mfs.sh
@@ -45,7 +45,10 @@ fi
mfs_size=`stat -f '%z' $2 2> /dev/null`
# If we can't determine MFS image size - bail.
-[ -z ${mfs_size} ] && echo "Can't determine MFS image size" && exit 1
+if [ -z ${mfs_size} ]; then
+ echo "Can't determine MFS image size"
+ exit 1
+fi
err_no_mfs="Can't locate mfs section within "
@@ -53,7 +56,10 @@ if file -b $1 | grep -q '^ELF ..-bit .SB executable'; then
sec_info=`elfdump -c $1 2> /dev/null | grep -A 5 -E "sh_name: oldmfs$"`
# If we can't find the mfs section within the given kernel - bail.
- [ -z "${sec_info}" ] && echo "${err_no_mfs} $1" && exit 1
+ if [ -z "${sec_info}" ]; then
+ echo "${err_no_mfs} $1"
+ exit 1
+ fi
sec_size=`echo "${sec_info}" | awk '/sh_size/ {print $2}' 2>/dev/null`
sec_start=`echo "${sec_info}" | \
@@ -78,7 +84,10 @@ else
fi
# If the mfs section size is smaller than the mfs image - bail.
-[ ${sec_size} -lt ${mfs_size} ] && echo "MFS image too large" && exit 1
+if [ ${sec_size} -lt ${mfs_size} ]; then
+ echo "MFS image too large"
+ exit 1
+fi
# Dump the mfs image into the mfs section
dd if=$2 ibs=8192 of=$1 obs=${sec_start} oseek=1 conv=notrunc 2> /dev/null && \