From owner-svn-src-all@freebsd.org Fri Nov 2 21:07:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6917A10DB626; Fri, 2 Nov 2018 21:07:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F3407E5B2; Fri, 2 Nov 2018 21:07:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3F3B102BB; Fri, 2 Nov 2018 21:07:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA2L769q061695; Fri, 2 Nov 2018 21:07:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2L76I2061694; Fri, 2 Nov 2018 21:07:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811022107.wA2L76I2061694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 2 Nov 2018 21:07:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340082 - head/sys/tools X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/tools X-SVN-Commit-Revision: 340082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 21:07:07 -0000 Author: emaste Date: Fri Nov 2 21:07:06 2018 New Revision: 340082 URL: https://svnweb.freebsd.org/changeset/base/340082 Log: embed_mfs.sh: replace some compound statements with conventional ifs Use the more readable form - there's no need to try being clever. Modified: head/sys/tools/embed_mfs.sh Modified: head/sys/tools/embed_mfs.sh ============================================================================== --- head/sys/tools/embed_mfs.sh Fri Nov 2 20:56:19 2018 (r340081) +++ head/sys/tools/embed_mfs.sh Fri Nov 2 21:07:06 2018 (r340082) @@ -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'; 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 && \