summaryrefslogtreecommitdiff
path: root/scripts/contrib
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2014-07-21 23:46:50 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-23 21:44:21 +0100
commita085cdf0e2dcf6543f61a8bdf68f83bcf8006373 (patch)
treebf8023261a545a43bd52474d07238911ecee0c52 /scripts/contrib
parent1864ca9751c28cca248cfba77a3d23fc58ff43bb (diff)
downloadopenembedded-core-a085cdf0e2dcf6543f61a8bdf68f83bcf8006373.tar.gz
openembedded-core-a085cdf0e2dcf6543f61a8bdf68f83bcf8006373.tar.bz2
openembedded-core-a085cdf0e2dcf6543f61a8bdf68f83bcf8006373.zip
mkefidisk.sh: Add signal handling
Add basic signal handling to unmount and remove any temporary files. Correct a quoting issue with the die() function caught testing signal handling. Fix a minor typo in "formatting" output. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib')
-rwxr-xr-xscripts/contrib/mkefidisk.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh
index 28cfb6dd54..b96b7d4f7d 100755
--- a/scripts/contrib/mkefidisk.sh
+++ b/scripts/contrib/mkefidisk.sh
@@ -48,6 +48,8 @@ cleanup() {
fi
}
+trap 'die "Signal Received, Aborting..."' HUP INT TERM
+
# Logging routines
WARNINGS=0
ERRORS=0
@@ -71,7 +73,7 @@ success() {
echo "${GREEN}$1${CLEAR}"
}
die() {
- error $1
+ error "$1"
cleanup
exit 1
}
@@ -288,7 +290,7 @@ unmount_device || die "Failed to unmount $DEVICE partitions"
#
# Format $DEVICE partitions
#
-info "Formating partitions"
+info "Formatting partitions"
debug "Formatting $BOOTFS as vfat"
if [ ! "${DEVICE#/dev/loop}" = "${DEVICE}" ]; then
mkfs.vfat -I $BOOTFS -n "EFI" >$OUT 2>&1 || die "Failed to format $BOOTFS"