From: Anton Mikanovich <amikan@ilbers.de>
To: isar-users@googlegroups.com
Cc: Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH] deb-dl-dir: Avoid hanging mounts on failed download
Date: Thu, 17 Oct 2024 10:57:27 +0300 [thread overview]
Message-ID: <20241017075727.101424-1-amikan@ilbers.de> (raw)
If apt-get fails during debsrc_download execution there will be mount
left behind. Protect it with a trap for cleanup in case of failure.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
meta/classes/deb-dl-dir.bbclass | 3 +++
1 file changed, 3 insertions(+)
diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass
index 55e56c50..7ebd057e 100644
--- a/meta/classes/deb-dl-dir.bbclass
+++ b/meta/classes/deb-dl-dir.bbclass
@@ -48,6 +48,9 @@ debsrc_download() {
debsrc_do_mounts "${rootfs}"
+ trap 'exit 1' INT HUP QUIT TERM ALRM USR1
+ trap 'debsrc_undo_mounts "${rootfs}"' EXIT
+
( flock 9
set -e
printenv | grep -q BB_VERBOSE_LOGS && set -x
--
2.34.1
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20241017075727.101424-1-amikan%40ilbers.de.
reply other threads:[~2024-10-17 7:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20241017075727.101424-1-amikan@ilbers.de \
--to=amikan@ilbers.de \
--cc=isar-users@googlegroups.com \
/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