Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@linux.intel.com>
To: Darren Hart <dvhart@linux.intel.com>,
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 2/2] mkefidisk.sh: Add signal handling
Date: Mon, 21 Jul 2014 16:01:17 -0700	[thread overview]
Message-ID: <CFF2E9A5.9D541%dvhart@linux.intel.com> (raw)
In-Reply-To: <4d5011c9e8ab86c32edd9ac606fa1330576bb97f.1405982758.git.dvhart@linux.intel.com>

Please ignore this one (2/2), it rearranges output in a way that might
lead to someone pulling the USB key before the sync completes. I will
resend 2/2 of separately.

Apologies :/

On 7/21/14, 15:45, "Darren Hart" <dvhart@linux.intel.com> wrote:

>Add basic signal handling to unmount and remove any temporary files.
>
>Signed-off-by: Darren Hart <dvhart@linux.intel.com>
>---
> scripts/contrib/mkefidisk.sh | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
>diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh
>index 44ab8d5..7d48b53 100755
>--- a/scripts/contrib/mkefidisk.sh
>+++ b/scripts/contrib/mkefidisk.sh
>@@ -46,7 +46,9 @@ cleanup() {
> 	if [ -d "$TMPDIR" ]; then
> 		rm -rf $TMPDIR || error "Failed to remove $TMPDIR"
> 	fi
>+	exit $1
> }
>+trap cleanup HUP INT TERM
> 
> # Logging routines
> WARNINGS=0
>@@ -72,8 +74,7 @@ success() {
> }
> die() {
> 	error $1
>-	cleanup
>-	exit 1
>+	cleanup 1
> }
> debug() {
> 	if [ $DEBUG -eq 1 ]; then
>@@ -375,10 +376,6 @@ if [ -d $ROOTFS_MNT/etc/udev/ ] ; then
> 	echo "$TARGET_DEVICE" >> $ROOTFS_MNT/etc/udev/mount.blacklist
> fi
> 
>-
>-# Call cleanup to unmount devices and images and remove the TMPDIR
>-cleanup
>-
> echo ""
> if [ $WARNINGS -ne 0 ] && [ $ERRORS -eq 0 ]; then
> 	echo "${YELLOW}Installation completed with warnings${CLEAR}"
>@@ -391,3 +388,6 @@ else
> 	success "Installation completed successfully"
> fi
> echo ""
>+
>+# Call cleanup to unmount devices and images and remove the TMPDIR
>+cleanup 0
>-- 
>2.0.0
>
>


-- 
Darren Hart					Open Source Technology Center
darren.hart@intel.com				            Intel Corporation





      reply	other threads:[~2014-07-21 23:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-21 22:45 [PATCH 1/2] mkefidisk.sh: Fix redirection to 1 Darren Hart
2014-07-21 22:45 ` [PATCH 2/2] mkefidisk.sh: Add signal handling Darren Hart
2014-07-21 23:01   ` Darren Hart [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CFF2E9A5.9D541%dvhart@linux.intel.com \
    --to=dvhart@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox