From patchwork Tue Oct 1 15:13:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3840 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Tue, 01 Oct 2024 17:14:12 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-pg1-f192.google.com (mail-pg1-f192.google.com [209.85.215.192]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 491FEAXY014062 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 1 Oct 2024 17:14:11 +0200 Received: by mail-pg1-f192.google.com with SMTP id 41be03b00d2f7-7d4f9974c64sf3797258a12.1 for ; Tue, 01 Oct 2024 08:14:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1727795644; cv=pass; d=google.com; s=arc-20240605; b=ESsMplAG1L/v2IMKkAnjzBPayJopEmG/qFs1tsLAFtB858uoxmSt117PHIvZ5561Hv et91WW9/7Hr4U9aie3V8UnNQabmqyh+siG62RH+LQJQttILuC3VIzX0lPt1a0RsisxNv h4WM2PJDCnxQ1dNqRjI1AN49TLgDkGhq01HnNNYnJiEy+Fo8F2AOnysWpv+6VHMRvK32 4zN3ukrnKa5ogUWFlHcd+Iq55xnn5mz9YDK8+hUrQrieFlwR3lKGHKMGBxvXK95enyOM Ze5XmuNrA4UZAdgAHnlpRbPGmlY2Fzjr30KovTTtSkUBlg73UAhIr1rHsAWCWCQT51xl rVqA== 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:reply-to:feedback-id:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aRKkaUsVXvNBsotZzZ9xZzaCcPhnoG3zbXMppIjWQzA=; fh=qLg9WieqOIALPs8vtePuAWMX/aIpbvuT5UZr+pbmoq4=; b=a9GqdJmXCgGUd/qX0rFZlBilMfMiTlPq7BS76j3kWXvc9zO5sCai5OQYMKpr51HfAm lj08Nj8EcWkzgKeiv5EXs2OttnHjxQpyKmeQVZ4RJBVhMnulpQmfSYJG5Yt+on+V9NFW BO+ujQjCG1Kr+CgTpRT7RqAp3r+BDBOfFu3w0F2qUZsJnlGNj/TXS9qd8yY1xSC3M5TJ WuY+vpOrpT+e3aF8u+D9UuRVvhs19cTIkX7SGaOshlIPYOgMop9pDB2mvpuU3KFX0K3W 4+dcujF5YCupcqdXz0/FGN6LQKxOzlSU3xJdZoJAN8L9StWvtSPkWMe86jb6VBxHDgDS Z5tQ==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=AtXqWcP1; spf=pass (google.com: domain of fm-294854-2024100115140049dae0ce783bd6a314-_pugcn@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-2024100115140049dae0ce783bd6a314-_pUgCn@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1727795644; x=1728400444; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=aRKkaUsVXvNBsotZzZ9xZzaCcPhnoG3zbXMppIjWQzA=; b=hy/e9HiXT5u4+5d5zVdZQ1T1NMXBC9++ln3ZXOZS2weyGRlEpujhhm9NkqoS7wQCZo 933wRKUCwnx6GJQvRUZyjB3rjlqVsBUcGTxsYKJIBGr3sBNanKg/rFBxWL/SCeuLNWYH kt9aA7IuyI76aNaLsHMdALLp9QkGLPgQWKaFnB6riSt9M+745SAmvHTjFbJvyYF7/Hpw 5bZEVC9pg6HeQ+TL+oeuTbuWp78ThzHCqC1/58uQBbOy3waoPBx56WW8sSBB+u3upedL VyUfPoqYjb+TU7xUdPRJE1jDjEyoVS3M5KYFoaVQa3RHSdLDvKS7kBcTxbaq5OylIwxt AF4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727795644; x=1728400444; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=aRKkaUsVXvNBsotZzZ9xZzaCcPhnoG3zbXMppIjWQzA=; b=DUQHJSUvqciFZeu+QFMYT74H8jlMBUHJyH1KwUIuJ05skK2ZMNd7neKLEWgUo1kqCa S5r7FlHPAq6bX0wGXG4adicNokQJOlwQTeEMJixQSEe/JoCKRilXBsAtkag0NwnZ/wxE VYYM2Xz+tkuHENGqHqVdC2f0P6Q2jz5RVqwXqtJqMxiAShih7f/ahd5vNIK3ZBEUOHsB ClWLoWqYSSoZIRvArqi3Lghtq/8OvTbJcgkesuWo5x+TMKwQ+FwP95oFesecUUWlk4Gl W9jw7JU123NViWPQgER4aNZi0zJjcrr4lC7N1WYj0MwLnI3xCoKiruumZUAn9ioV8GsN 0/MQ== X-Forwarded-Encrypted: i=2; AJvYcCVNs/b3vXLtcKZInXkj+TeLDnVcDS2Vqo5PmlISYkoHmT+wVMoo606LZvn89y9z2NECjn8B51c=@isar-build.org X-Gm-Message-State: AOJu0YxxZXm4e4kguoApx2OZ8IRvE/BN8FeGpgh+yAOPhOBVKmWxJg+C b7WS8JAJJRdf+dX9Vfgz2jN+H+UIV8TOfCthgljJtAFLbGxB1oU5 X-Google-Smtp-Source: AGHT+IF/Pe/MpnNkFIF5fjoVmjfHJW4Adv7zXj1zxeDsI5jLD5t1BF33DHefXJd495djJidlL3zXDg== X-Received: by 2002:a17:90a:62c3:b0:2c9:6cd2:1732 with SMTP id 98e67ed59e1d1-2e182cad975mr86587a91.0.1727795644217; Tue, 01 Oct 2024 08:14:04 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:90b:ecc:b0:2da:7722:3e2 with SMTP id 98e67ed59e1d1-2e090d40c27ls2739212a91.1.-pod-prod-07-us; Tue, 01 Oct 2024 08:14:03 -0700 (PDT) X-Received: by 2002:a17:90a:88d:b0:2da:9490:900c with SMTP id 98e67ed59e1d1-2e1846aff5bmr36866a91.21.1727795642622; Tue, 01 Oct 2024 08:14:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727795642; cv=none; d=google.com; s=arc-20240605; b=To9mC8I9UpsFuwZgB6BSGp+jKMWUY84nEOYJNb+FgNVS7D4m6lJ1Ow0sEEj4cDM5pV QchYhfkKy2DljlmtHekv4vNQBmEcqZCS3s5mDqiSdEkxTSqQsxLnbb0HfdfqVSlgkQNq Ny9onbeEyK6L9f2wYxieG7S9NpaQsbW9wWLXAhl9a174S8j4Y3mNks3eny9ThqL/ZvH/ tX/cuucqKUDSoyhcBpOUD9o14LUpDSx/rdqmurgpGtx6/vtW6MHRpQzkdzu9hziTWxOk HyrdLYbLtndaaiV+0d0rbG/k/wRgQCa6s7hLR6/zDzdgNcIUXnfNDIs/XdibShUrq7g5 cAUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=L+aiyg+Vkq2cXPD5BGZvb9NyrKygouJJWb+h7oqhrEo=; fh=gjNsleUMU++pCCGGHOTELE3rzItC14u9gn4+F3xKmnc=; b=kzE8jdKRoMqsteB9rWoi1I1XJ0zpxfCgyxfSKMFcEFZSdp5fYiMWpwjSTCDBMNBbKS qTmObyW4TV0YwlVLnBQIBs0s3v9lefTcyPjl6VSjw45Af0+DKxcvb7Bh46FFUm/LDkb1 Nm2O+gbEzmFs3dCgfut/dG6lO1P2KcTJk4+Nsezf3olZJ1+qpCti6nx5S09uvQoiEbXT riq7wHz+ei5yWrWSFCrRAFU+cYoBmTk7faGo2y3G4qETcvIgDsTqtUGZtXhC2rXrSgIF ac+KX1DWE2UDunLfMx90VoZgZqYq0jcUHGqo5bbtKDMqpTzQZWLncwe5GYGmJ7fcbOH7 ZKOA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=AtXqWcP1; spf=pass (google.com: domain of fm-294854-2024100115140049dae0ce783bd6a314-_pugcn@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-2024100115140049dae0ce783bd6a314-_pUgCn@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-226.siemens.flowmailer.net (mta-64-226.siemens.flowmailer.net. [185.136.64.226]) by gmr-mx.google.com with ESMTPS id 98e67ed59e1d1-2e18258f2b7si11952a91.0.2024.10.01.08.14.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Oct 2024 08:14:02 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-294854-2024100115140049dae0ce783bd6a314-_pugcn@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) client-ip=185.136.64.226; Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 2024100115140049dae0ce783bd6a314 for ; Tue, 01 Oct 2024 17:14:00 +0200 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Florian Bezdeka Subject: [PATCH v2 1/3] image: Avoid breaking the build when mounts are no longer present on umount Date: Tue, 1 Oct 2024 17:13:57 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer X-Original-Sender: jan.kiszka@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=AtXqWcP1; spf=pass (google.com: domain of fm-294854-2024100115140049dae0ce783bd6a314-_pugcn@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-2024100115140049dae0ce783bd6a314-_pUgCn@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Jan Kiszka Reply-To: Jan Kiszka 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-Spam-Status: No, score=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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-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 c29d9e26..ef25df49 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -406,24 +406,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" \