Skip to content

Commit

Permalink
make-memstick.sh: use 'set -e' to abort if any step fails
Browse files Browse the repository at this point in the history
Also remove the now-redundant error handling that was only for makefs.

This change applies arm64's r308171 to the other make-memstick.sh
versions.

Reviewed by:	gjb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D12195
  • Loading branch information
emaste committed Sep 5, 2017
1 parent d1d5718 commit 771b740
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 2 additions & 4 deletions release/amd64/make-memstick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# $FreeBSD$
#

set -e

PATH=/bin:/usr/bin:/sbin:/usr/sbin
export PATH

Expand All @@ -31,10 +33,6 @@ fi
echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab
echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local
makefs -B little -o label=FreeBSD_Install ${2}.part ${1}
if [ $? -ne 0 ]; then
echo "makefs failed"
exit 1
fi
rm ${1}/etc/fstab
rm ${1}/etc/rc.conf.local

Expand Down
6 changes: 2 additions & 4 deletions release/i386/make-memstick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# $FreeBSD$
#

set -e

PATH=/bin:/usr/bin:/sbin:/usr/sbin
export PATH

Expand All @@ -31,10 +33,6 @@ fi
echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab
echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local
makefs -B little -o label=FreeBSD_Install ${2}.part ${1}
if [ $? -ne 0 ]; then
echo "makefs failed"
exit 1
fi
rm ${1}/etc/fstab
rm ${1}/etc/rc.conf.local

Expand Down
6 changes: 2 additions & 4 deletions release/powerpc/make-memstick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# $FreeBSD$
#

set -e

PATH=/bin:/usr/bin:/sbin:/usr/sbin
export PATH

Expand All @@ -36,10 +38,6 @@ echo '/dev/da0s3 / ufs ro,noatime 1 1' > ${1}/etc/fstab
echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local
rm -f ${tempfile}
makefs -B big ${tempfile} ${1}
if [ $? -ne 0 ]; then
echo "makefs failed"
exit 1
fi
rm ${1}/etc/fstab
rm ${1}/etc/rc.conf.local

Expand Down

0 comments on commit 771b740

Please sign in to comment.