From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6997052726746021888 X-Received: by 2002:a2e:97cf:: with SMTP id m15mr1553865ljj.243.1629128314666; Mon, 16 Aug 2021 08:38:34 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:3f02:: with SMTP id y2ls1563150lfa.3.gmail; Mon, 16 Aug 2021 08:38:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJym9KaW3s/ew/Gyrdu2ub2lbEfpK2/raQXISX9QRlk7QjC00tbo9lrzcg+2m2+xfV6wua/p X-Received: by 2002:a05:6512:1042:: with SMTP id c2mr12322230lfb.283.1629128312174; Mon, 16 Aug 2021 08:38:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629128312; cv=none; d=google.com; s=arc-20160816; b=cqo2dvR+C5IMPQ5u4nPhwpGXQf6ysl9sf5nTxBjyJnBZ4eDiwkeDa6v5pvNEbYDjT8 rQxq2n4dSixyItu8KvgnGZtz2vToSo1LedDWkgCQTaFeDWgK3djbdScdcPo0lj9r5FVz Ot3VHZNpc+rPeCSR4vYmqhqlDfs+JFOuO0fTb5BhxAbKMvNqwUJAGx6oRQzvAPA2zijL 6+ksuLtLKfexYUNydyjbIsSX62g1RD+t4Bns5wUfcMDeeSTgolUE3xH64m7Qzs+vMkox ES/jmU4cjAjR+BBHpm7uUBJNK/TZhzEp5RRGRvkV+6VsNslF1/MBOmW9mGM5P/4tYxqr q1kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=Yg99zwRpXmxsZEr+UeXkSr8VScti6u5h9clNJaVeMpY=; b=Z1lebkqbN1RHc2tuYzNcqoMKjWnrcWVzkwG3XJOIxw74lfcYgwwMNlV2h1SRUwCN3N 4cHRcZSAKojiM+6+qyVwbYKUbIjJQ2dxTbe/wI1XQC6lCGP1zZVP2A3FL2JKz4eC/Kzl 9U2Vt9i0vr6cNm1tZlxqv8/TWGB1M2UxKk9lOjy//RUjDiHwm+wohndujPGgrGcmfQKj Qq2cuAsG6Nj91JyLFk7n2qWSra/HvGt+1nDBRpgclSNMi5wrPK9biuomc8b9HQgd+1pm XQGb6TJ3/yEErFNK4bWmN5qGs0W0ANiC+Ml5ShkDQHy1sFZbnRHpl+s3fCNVyU6dnyjv 9eGw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id a9si440656lfj.12.2021.08.16.08.38.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Aug 2021 08:38:32 -0700 (PDT) Received-SPF: pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Received: from localhost.localdomain (mm-146-26-214-37.mgts.dynamic.pppoe.byfly.by [37.214.26.146] (may be forged)) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPSA id 17GFc3h2004556 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Aug 2021 17:38:27 +0200 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: Anton Mikanovich Subject: [PATCH v4 4/5] dpkg-base: Clean up unmounting in do_dpkg_build() Date: Mon, 16 Aug 2021 18:37:55 +0300 Message-Id: <20210816153756.3549038-5-amikan@ilbers.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210816153756.3549038-1-amikan@ilbers.de> References: <20210816153756.3549038-1-amikan@ilbers.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: KDvDM125a/Gt 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 --- 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 105a1e6..fe814e0 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