From patchwork Fri Oct 11 10:00:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Mikanovich X-Patchwork-Id: 3864 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Fri, 11 Oct 2024 12:01:12 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-pl1-f192.google.com (mail-pl1-f192.google.com [209.85.214.192]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 49BA1Arw008714 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 11 Oct 2024 12:01:11 +0200 Received: by mail-pl1-f192.google.com with SMTP id d9443c01a7336-20c9673e8cdsf11298485ad.3 for ; Fri, 11 Oct 2024 03:01:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1728640865; cv=pass; d=google.com; s=arc-20240605; b=ZsunWqv/tRde45H/aQIM0AoyZRDmEBE/9J0U07+AIxUKEfjMYc6XkfHqMRaYyoXdqn OIFZxMapyC/2TyxPXdwy9qnLl1+UgBjQw07rxY3kOWuA1YZEQuFTVtkj370ibOrILLY1 32Xt85ewg6MakpMH1tL/LqGe0AT/JHNl29GSInXKSntCl1RK4Fnt9peiQSUat377P++z PIF1SmFi6VZP+J3rPwDF1HuE9U2eo40H+K4zL0AwoQAlXn7HSedhPY2X02IYpTuDnee7 5PPmjHXjSi18epi9UC3rkyyoH21VkLfU73zZbqGjEJlVtBH8sw8ZCwUvIn23uu0seiJs NN5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=cHicdqCX0DkE396uF0hSsJhO2b6DZ01e2ZAaF6XwwA8=; fh=n98ClXTKdMYclGhXE/0Ts2XtHKKRcxLiLkVh3k2enZg=; b=IImEJfd42qHtC5QvfeAFlPXQkfUQczaMMjqjwUaGHBLUI7HdgDyWHmAFav1o46i61r wd0jF8mv+Fze0NOhKCJGrAKG5FpauEwTJYt7QKh3QEk04BfYsBSnHA6+7kRLlO9FGzul lo0XmHF4iB4Uk/2qHtezdyGpTFN+BL9SevSxEfRspDty86tJK0RL/AH0mICeVVxvvHw0 vS4e+RKU+BR1TMhfNpoE4eOMWHZwjtCU2cOHZ3K5v9QKow2uuet2dPBfqFkwdw/QYGUR 4kVlhZ1o7lObb02h7AceFhCx3NbUWdzhQN0TSQIiEclx67MHr7cLg4T9wBiFJvQThxaf 9UcQ==; darn=isar-build.org ARC-Authentication-Results: i=2; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1728640865; x=1729245665; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=cHicdqCX0DkE396uF0hSsJhO2b6DZ01e2ZAaF6XwwA8=; b=EtSH29vI3LfrZ5M0L0rROEo2yojznbSKGmDoElpHfFsBfbK1VFd1l5c3DeD17luzrN yTHVryw8dclhWgNn6c/MJUU16bx0Z8vdpCkwA3G8RZgm+CfKHp5oJH6V5BrY2MC6IZDW JHspbZiQWDFiT8QKSOOok7+MLrjzRy0GZfTvJRVF7fHQ84buC6MOvDW6gdj5qSzNl2Dg DzEahesbs0z0bJ4n3WdSWM9LX/Kr7KhjD8Xpr2oUsCtxyR5qlR9w4ozxaiHYbqoOKbRq hX2FYX7GyTBSzA50kGZmDBme1kHyJm+17FB9vNLJXLAHP72IelyWBC97rrs9xxKNPndr ciDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728640865; x=1729245665; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=cHicdqCX0DkE396uF0hSsJhO2b6DZ01e2ZAaF6XwwA8=; b=dWI4Mihgm2gs+PZD2xZTukwkeUO+99I023/QW9et8yf/MylP9zCOwTaUflRe4mY+07 T36UeXbiIYo8t7iveiAGJn3TCN1djhMABRBwoDbNWvCebaxeu6qc9y1TVVntvRBuLqPj S5A7RSvxSPgdczFbO5SIxLyfDPibiSQmH/xvSO+zFJJdAFpsh7hKqSpws/8y5CMVbaMq A0z4lrUNYRm1KfIxYYwY8/YArGA8UIuDsM6JBILdVf6TuHL3h6Mkb1e3Rgc/7cSdYa/T TEksw5dsOJCj9X/T7zECcQ7szHWTSWc1OvzDp0CfqQIvnX7re68uW+T7Qe3wE/4sv5aQ 61oQ== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCVS/IgYQ0SmW3597zJumSCi300GlWZkf30Ex3Lg6bYuIPDuNoBYbKwpZwZywXtF1HhHUTSV3jk=@isar-build.org X-Gm-Message-State: AOJu0YyOGcaMpDeMtFOABeevA4MDU5XydtUiIBynldjwIEH3REz07z5b dkI7eWjrZagQRDTVLR8J542esG4PwZ9cCPZ04sciaj1FtOfgR4Fn X-Google-Smtp-Source: AGHT+IGosN77At2JTm0+xTJEvVX4BIJiEIoaO1fxp+WxNKs6+NhhkLGxWQKHRNqm1//hLMo9VXhjnw== X-Received: by 2002:a17:902:e845:b0:20b:a6f5:2780 with SMTP id d9443c01a7336-20ca1459d58mr35572975ad.17.1728640865043; Fri, 11 Oct 2024 03:01:05 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:902:d48a:b0:206:8932:d4fa with SMTP id d9443c01a7336-20c8069c09els19483905ad.0.-pod-prod-09-us; Fri, 11 Oct 2024 03:01:04 -0700 (PDT) X-Received: by 2002:a17:903:2310:b0:20c:3d9e:5f2b with SMTP id d9443c01a7336-20ca16fb8a0mr28949935ad.57.1728640863775; Fri, 11 Oct 2024 03:01:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728640863; cv=none; d=google.com; s=arc-20240605; b=RleGvDfbuRUCVOR95X+OBWWwcFnvSlN7choVoJBdnPOVZwZadqEGqPLetARGcC7XSH B2O+n+vGdiiSE6j4KJ2E4m8axGKDrEFa2GPaMGjJ3ob7h4ZQVIbMk5pCpQNCyTNN787s acGJT30bqIPRddOrX0ZJqbJ+f7Nak527TMChl83ID0c8zxR0UCva7CJ67CZAssbyEb13 +FQOmbN97umSaRHWekwbk+qdoV85NL2YmQX/mjul/bBe0w9RCXt6/7VIEXT26h/2hLRd MvnU7PQ8lNIgeNxu7kCnLo125kUy+7c99gQyV0N17llJW+Rvg5z5Fj6u27bLrxPbzS5P 1ckQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=CafFxxDQJ/OMrOeNCg+XJGcdCM19hgXn7pbBHnyvhEw=; fh=ayfAe8qmvuhnFlecYJaCAyE02arlonJgV2H/zKorYgo=; b=INz0oid0aHqMUVH7SB9BUe2RRUQ0ja1bdNkvbN9c5Ls4o4hnP0O4Hzu+Kksp1uBvvw k+SUm/0Oh0hWIj1a7CCFh1pysBFJjjTMLOYYx7prYX1AD1ClI4J6hHYmHk6NQiFPOnXf 2uEHw3dvfWKUzNLMMSTOjLaMVKuiRjkKc+1oRNck7C2WlTu7VN63RuuwWTgOnMERD18O xmgD6Xm7j+qegJQ0szs0+Ad195MAPQ83ecREWeASwp4EDq1gv0Myb9sODVOKbQ18gKSe zfHDjT7YgkWC0aiSIrCe4QQ1XKDWGZDbACcVc51B0VsMDTDCS5GymAo6ifLjCtU/9zZN CeZQ==; dara=google.com 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 Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id d9443c01a7336-20c8bac50b0si1191415ad.3.2024.10.11.03.01.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Oct 2024 03:01:03 -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; Received: from user-B660.promwad.corp ([159.148.83.114]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 49BA0vWL008632 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Oct 2024 12:01:01 +0200 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: Jan Kiszka Subject: [PATCH v3 4/8] image: Avoid breaking the build when mounts are no longer present on umount Date: Fri, 11 Oct 2024 13:00:46 +0300 Message-Id: <20241011100050.322686-5-amikan@ilbers.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241011100050.322686-1-amikan@ilbers.de> References: <20241011100050.322686-1-amikan@ilbers.de> MIME-Version: 1.0 X-Spam-Status: No, score=-4.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS 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-Original-Sender: amikan@ilbers.de X-Original-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 Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: Jan Kiszka This does not seem to trigger yet because we always have those mountpoints present. But if that is no longer the case, we will bail out when mountpoint fails due to the set -e. Fixes: 165519a7b314 ("sudo: Fail on the first error") Signed-off-by: Jan Kiszka --- meta/classes/image.bbclass | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 0c162aa3..9d5b782a 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -418,24 +418,31 @@ do_rootfs_finalize() { -maxdepth 1 -name 'qemu-*-static' -type f -delete fi - mountpoint -q '${ROOTFSDIR}/isar-apt' && \ - umount '${ROOTFSDIR}/isar-apt' && \ + if mountpoint -q '${ROOTFSDIR}/isar-apt'; then + umount '${ROOTFSDIR}/isar-apt' rmdir --ignore-fail-on-non-empty ${ROOTFSDIR}/isar-apt + fi - mountpoint -q '${ROOTFSDIR}/base-apt' && \ - umount '${ROOTFSDIR}/base-apt' && \ + if mountpoint -q '${ROOTFSDIR}/base-apt'; then + umount '${ROOTFSDIR}/base-apt' rmdir --ignore-fail-on-non-empty ${ROOTFSDIR}/base-apt + fi - mountpoint -q '${ROOTFSDIR}/dev/pts' && \ + if mountpoint -q '${ROOTFSDIR}/dev/pts'; then umount '${ROOTFSDIR}/dev/pts' - mountpoint -q '${ROOTFSDIR}/dev/shm' && \ + fi + if mountpoint -q '${ROOTFSDIR}/dev/shm'; then umount '${ROOTFSDIR}/dev/shm' - mountpoint -q '${ROOTFSDIR}/dev' && \ + fi + if mountpoint -q '${ROOTFSDIR}/dev'; then umount '${ROOTFSDIR}/dev' - mountpoint -q '${ROOTFSDIR}/proc' && \ + fi + if mountpoint -q '${ROOTFSDIR}/proc'; then umount '${ROOTFSDIR}/proc' - mountpoint -q '${ROOTFSDIR}/sys' && \ + fi + if mountpoint -q '${ROOTFSDIR}/sys'; then umount '${ROOTFSDIR}/sys' + fi if [ -e "${ROOTFSDIR}/etc/apt/sources-list" ]; then mv "${ROOTFSDIR}/etc/apt/sources-list" \