From: Anton Mikanovich <amikan@ilbers.de>
To: isar-users@googlegroups.com
Cc: Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH v6 3/6] dpkg-base: Clean up unmounting in do_dpkg_build()
Date: Mon, 23 Aug 2021 13:23:39 +0300 [thread overview]
Message-ID: <20210823102342.3674387-4-amikan@ilbers.de> (raw)
In-Reply-To: <20210823102342.3674387-1-amikan@ilbers.de>
Reverting d21d49578e5a "dpkg: Make mount buildroot reliable" brings back
two problems:
* The filesystems mounted under buildchroot (dev, proc, sys, etc.) are
left mounted.
* If dpkg_runbuild() fails, WORKDIR and the filesystems under
buildchroot are left mounted.
Request unmounting the filesystems under buildchroot after every package
build. The actual unmounting will be done after the last job due to the
reference counting.
Also request unmounting in any case, even if building fails.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
meta/classes/dpkg-base.bbclass | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 46b9700..7364a7f 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -169,6 +169,8 @@ dpkg_undo_mounts() {
i=`expr $i + 1`
done
sudo rmdir ${BUILDROOT}
+
+ buildchroot_undo_mounts
}
# Placeholder for actual dpkg_runbuild() implementation
@@ -180,9 +182,11 @@ python do_dpkg_build() {
lock = bb.utils.lockfile(d.getVar("REPO_ISAR_DIR") + "/isar.lock",
shared=True)
bb.build.exec_func("dpkg_do_mounts", d)
- bb.build.exec_func("dpkg_runbuild", d)
- bb.build.exec_func("dpkg_undo_mounts", d)
- bb.utils.unlockfile(lock)
+ try:
+ bb.build.exec_func("dpkg_runbuild", d)
+ finally:
+ bb.build.exec_func("dpkg_undo_mounts", d)
+ bb.utils.unlockfile(lock)
}
addtask dpkg_build before do_build
--
2.25.1
next prev parent reply other threads:[~2021-08-23 10:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-23 10:23 [PATCH v6 0/6] Restore downstream mounts compatibility Anton Mikanovich
2021-08-23 10:23 ` [PATCH v6 1/6] Revert "dpkg: Make mount buildroot reliable" Anton Mikanovich
2021-08-23 10:23 ` [PATCH v6 2/6] dpkg: Limit unmount loop Anton Mikanovich
2021-08-23 10:23 ` Anton Mikanovich [this message]
2021-08-23 10:23 ` [PATCH v6 4/6] events: Do not warn on left mounts by default Anton Mikanovich
2021-08-23 10:23 ` [PATCH v6 5/6] Revert "rootfs: Unmount rootfs mounts if not needed" Anton Mikanovich
2021-08-23 10:23 ` [PATCH v6 6/6] Revert "buildchroot: Unmount buildchroot " Anton Mikanovich
2021-08-27 17:16 ` [PATCH v6 0/6] Restore downstream mounts compatibility Anton Mikanovich
2021-08-30 8:25 ` Jan Kiszka
2021-08-30 18:46 ` Anton Mikanovich
2021-09-08 15:48 ` Henning Schild
2021-09-09 8:13 ` Anton Mikanovich
2021-09-09 9:17 ` Henning Schild
2021-09-13 15:03 ` Anton Mikanovich
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=20210823102342.3674387-4-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