diff options
author | Darren Hart <dvhart@linux.intel.com> | 2014-07-21 23:46:50 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-07-23 21:59:14 +0100 |
commit | cfa23a21d4f97136af56066d5d438c4a612eac11 (patch) | |
tree | 0995f521fe3d362df73700343c51dec409e4e77a /scripts/contrib/mkefidisk.sh | |
parent | ce3857994a0055a0e47b97771ec8ffc5b28e32f4 (diff) | |
download | poky-cfa23a21d4f97136af56066d5d438c4a612eac11.tar.gz |
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.
(From OE-Core rev: a085cdf0e2dcf6543f61a8bdf68f83bcf8006373)
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib/mkefidisk.sh')
-rwxr-xr-x | scripts/contrib/mkefidisk.sh | 6 |
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() { | |||
48 | fi | 48 | fi |
49 | } | 49 | } |
50 | 50 | ||
51 | trap 'die "Signal Received, Aborting..."' HUP INT TERM | ||
52 | |||
51 | # Logging routines | 53 | # Logging routines |
52 | WARNINGS=0 | 54 | WARNINGS=0 |
53 | ERRORS=0 | 55 | ERRORS=0 |
@@ -71,7 +73,7 @@ success() { | |||
71 | echo "${GREEN}$1${CLEAR}" | 73 | echo "${GREEN}$1${CLEAR}" |
72 | } | 74 | } |
73 | die() { | 75 | die() { |
74 | error $1 | 76 | error "$1" |
75 | cleanup | 77 | cleanup |
76 | exit 1 | 78 | exit 1 |
77 | } | 79 | } |
@@ -288,7 +290,7 @@ unmount_device || die "Failed to unmount $DEVICE partitions" | |||
288 | # | 290 | # |
289 | # Format $DEVICE partitions | 291 | # Format $DEVICE partitions |
290 | # | 292 | # |
291 | info "Formating partitions" | 293 | info "Formatting partitions" |
292 | debug "Formatting $BOOTFS as vfat" | 294 | debug "Formatting $BOOTFS as vfat" |
293 | if [ ! "${DEVICE#/dev/loop}" = "${DEVICE}" ]; then | 295 | if [ ! "${DEVICE#/dev/loop}" = "${DEVICE}" ]; then |
294 | mkfs.vfat -I $BOOTFS -n "EFI" >$OUT 2>&1 || die "Failed to format $BOOTFS" | 296 | mkfs.vfat -I $BOOTFS -n "EFI" >$OUT 2>&1 || die "Failed to format $BOOTFS" |