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>
fi
}
+trap 'die "Signal Received, Aborting..."' HUP INT TERM
+
# Logging routines
WARNINGS=0
ERRORS=0
echo "${GREEN}$1${CLEAR}"
}
die() {
- error $1
+ error "$1"
cleanup
exit 1
}
#
# 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"