From mboxrd@z Thu Jan 1 00:00:00 1970 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:14 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-qv1-f63.google.com (mail-qv1-f63.google.com [209.85.219.63]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 49BA1D51008775 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 11 Oct 2024 12:01:14 +0200 Received: by mail-qv1-f63.google.com with SMTP id 6a1803df08f44-6cbeca2b235sf21454156d6.3 for ; Fri, 11 Oct 2024 03:01:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1728640867; cv=pass; d=google.com; s=arc-20240605; b=aXoRUlOGaGlWKaLoBjmXpJkMEFaVePB7iqkxMq4EmAaZFHNZx1/neiY/BfupDcMvcz J65lLS7NcNHOADrl1oFQsh+NlG8mopSDr/QuRwF/TZrziq5bvBY/A8vSyWE9ewyNNxEF 7sIM6/YYIbOvllajtcIVTwFXTWm50p+B+wmDCvqRY9lhm6LDZJbUPN7ZFsZuoYSXNr5W cDn1JTH7x5a5DjaPUcWeQnN2LsmPgkioHnjLOx1OOitG15UbLtEFU1fN6kVyaUbg+HdX 7GIHFiLc2UpBcRytNx4/2EtQB9cYN55IlKx4WWQmuZ8xt+ThezhRq70y5neqTX8MKF5i VoAA== 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=NzOesAfV6DU2kRsMJ0UXq3v7iw/78hP9tIRT0ssPL5Q=; fh=WoNBJYpAopNv+JrnmFl+EopT1PDaf8bNTQpvw7x6a70=; b=C0GdeN/gSATi5ZRb4Au6532ua+OCJI3UfaKVmjOkkJW/A6vAy2BDuOQdZIXG+KTQl4 b7AaQ82N8dtK+rehe+5lNVoz2xbzbVUyOMUEj+w7pENE1PlYzGrzJLTI+489HDHi/xny mr2u6dI/zV16Pp8i2MsTh2d3TRNwyVnimA62oVztPj6KVBKJeP1xCUd4O0qHnXBE6ZOW UK6/9KTNnF/ndXZy5sJas4YPRCMQVmRao9X4Wn3GSHhzvN/zCH2HMTNQfPcjGbayQgHC N1Px2R/CjEueuBQ7bsdoW3Etg/m5xJbN0pgl93tJSqKQzX6IR67s52rZvlCZxIBPAsLg MZJg==; darn=ilbers.de 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=1728640867; x=1729245667; darn=ilbers.de; 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=NzOesAfV6DU2kRsMJ0UXq3v7iw/78hP9tIRT0ssPL5Q=; b=MpqCubszQS+ULPkGLMmK+vd/dAzMUHOpMCcFQPU8T44hicZ9HMXbWe/Qr47hmftSsc dgs0+m4JpM5M/UuoykLvAfydCOoM4g1mfNI7Rc51kXW+hseDLXbNc+81CcpNY3nVhgXW wPjxcFj+bM7waCZ2j5QzG8ajbjbRAMAKE3kn4MswJ3zuID/c8xy53XpjPh/YTrzW/X0K RKJKIs6C+h2yRXr2byFBdkNrHSjMDYQLrYq5P8YNHgVk7MeJgov1TABgb/TBg+ePMoqX 8covXe8+Odw4L3KZJAzNty5N+52msINPh8fnQD7MajZVZzX6JthUeKVOfi4RJJ6EzcHJ GfTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728640867; x=1729245667; 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=NzOesAfV6DU2kRsMJ0UXq3v7iw/78hP9tIRT0ssPL5Q=; b=oyf4x0MUV5huBT8BXomrDUn/qfH/6TMy1MsXh0cPMwqWd3CUk7GVZ+wcwYCcE1uuJI iy1FcqVVTL3zGLLuTILWWyn46wlGs+W3hfpkFb5e3oKaIRMfnlGxgvcFZ4QuFN6o4JF2 RmXfOqeyI4bsWpXOtBYnTvYvAe3V2bXc+Vk1hi9/gnlkExAA6mbDUfGFyGKLXQ26YVat c9K9wJ8U/YzSiURn6SM46y9UEpwQRM0+scCPhTOgSOUvFJGMrN7yPHDBXen3MqbW0cz/ X7ty9qiXyRJiPBNJZOwpdzaoMvJUn4OIQd9/krDdD3CMrq4Z9ztqifg9WSCiTRfD5Qln /dsA== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCUJ0pKW9OTvtjebVww0SxjtaC/TCt5RDRc5B31+PQz7ItsgwAEvyt78Jfa8mIIRTOb53+BK@ilbers.de X-Gm-Message-State: AOJu0YzSjKI3DeoAYHJatGFMnMNGaAmx4Ml82qBq2GO7We65GGrx6Zbh wwlZickYQHhcYPBJ9zBqpFC+tTFB9uc2RbyLxKeDqkBqoOUwL2oh X-Google-Smtp-Source: AGHT+IGlE+uuFJPFxt3KtmEfgaqXtRNBt4CAlRhd5aTg5X+daUflENDDsZloPDuWWba2Bdd+joh2vw== X-Received: by 2002:a05:6214:33c4:b0:6cb:ce4c:1cc2 with SMTP id 6a1803df08f44-6cbeff66007mr33723636d6.29.1728640866990; Fri, 11 Oct 2024 03:01:06 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6214:260e:b0:6b0:862d:9779 with SMTP id 6a1803df08f44-6cbe548f84als29765546d6.0.-pod-prod-04-us; Fri, 11 Oct 2024 03:01:06 -0700 (PDT) X-Received: by 2002:a05:620a:4488:b0:7a9:8876:4217 with SMTP id af79cd13be357-7b11a3843b8mr344078385a.25.1728640866337; Fri, 11 Oct 2024 03:01:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728640866; cv=none; d=google.com; s=arc-20240605; b=NibRGO+C8FB76KYbnAN2OseDVbWxb9PB1LwQWYzRyUaQJ9o4nqHS080RVeJLPLJKHf jhgpC4pqVAuPsnIwer33xsQ1Gi9BsyoJEKJKai1BkRFixuIYxXJaV7/sp5ngdxvINTd0 xlzarsLAaGsK5v83tLAHLCld9kjnH1bE9GWGru9aEIU4pZLDr0luPC3mK53VhbM4vo9j CR3q8+JPfRucUudVwlAMI7Wpy4T3jTprovPZQW4fX3HDwrNoyJekZ36CFJjvJ9zDAbVH C+PPUKUJ53DRV/IVBVz33bCelNU4O+ngi+WjL8xiouZ1AKGxIVMKCcOkcH+PWOcHIu8c SzWg== 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=LFqdscIyuyH7v9IH973uboDrXiUGQASG8pNGrdgiYcs=; fh=+XrxACcU08BQoTNb4LOPSrVTQ061QS53EcHPaZcNlwA=; b=RKrJX06YHWI4LUg5hMcdC4IxlEMOgmpoUmX95sU5cki5XDji0g3DMmLB4MqynBWdv7 INqhbwXWH+OiPoavRjp/2VNED0/ENyfcoKvPF/LUdqT8YowmtBaOm00pSYE3YT2AY1oU tzFrSWuMf48T6oTvwJOARIwxtvz3w6/SNbCp72MT1Z6RbqJji/SP5fdawewiqML/Fbql ktvddF9C7eIYfGlkrZPs/NV3qxkxrxQEb3f6I8VOBZWfBfdYeuCKyqm+KYUG2dQItuCI wG+m3nhADyP7p7P4RkUYBQJUSN5+MAuqpOv8x8Wx04Ik74DNQThrqD1mQ4Fs+5HPoJsO WoDg==; 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 d75a77b69052e-4604807bc45si1287261cf.5.2024.10.11.03.01.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Oct 2024 03:01:06 -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 49BA0vWO008632 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Oct 2024 12:01:04 +0200 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: Florian Bezdeka , Anton Mikanovich Subject: [PATCH v3 7/8] rootfs: Add missing umounts in rootfs_postprocess() and rootfs_install() Date: Fri, 11 Oct 2024 13:00:49 +0300 Message-Id: <20241011100050.322686-8-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 Content-Type: text/plain; charset="UTF-8" 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-TUID: k+SfTwhi2yDX From: Florian Bezdeka Calls to rootfs_do_mounts should always be paired with calls to rootfs_do_umounts. With this change, it is done in do_rootfs_install and do_rootfs_postprocess. In case there was an exception thrown within the try blocks they will be re-raised after the finally block has been processed. This way we try to avoid leaking mounts but unmounting might still fail. In any case we tried our best to clean up. To reproduce: . ./isar-init-build-env newbuild mount >01.txt cat >conf/local.conf <02.txt diff -Naurp 01.txt 02.txt +tmpfs on newbuild/tmp/work/debian-bookworm-amd64/sbuild-chroot-target/1.0-r0/rootfs/dev type tmpfs (rw,nosuid,size=4096k,nr_inodes=65536,mode=755,inode64) Signed-off-by: Florian Bezdeka Signed-off-by: Anton Mikanovich --- meta/classes/rootfs.bbclass | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass index ef40cbdf..c7011508 100644 --- a/meta/classes/rootfs.bbclass +++ b/meta/classes/rootfs.bbclass @@ -248,18 +248,21 @@ python do_rootfs_install() { progress_reporter = bb.progress.MultiStageProgressReporter(d, stage_weights) d.rootfs_progress = progress_reporter - for cmd in cmds: - progress_reporter.next_stage() + try: + for cmd in cmds: + progress_reporter.next_stage() - if (d.getVarFlag(cmd, 'isar-apt-lock') or "") == "acquire-before": - lock = bb.utils.lockfile(d.getVar("REPO_ISAR_DIR") + "/isar.lock", - shared=True) + if (d.getVarFlag(cmd, 'isar-apt-lock') or "") == "acquire-before": + lock = bb.utils.lockfile(d.getVar("REPO_ISAR_DIR") + "/isar.lock", + shared=True) - bb.build.exec_func(cmd, d) + bb.build.exec_func(cmd, d) - if (d.getVarFlag(cmd, 'isar-apt-lock') or "") == "release-after": - bb.utils.unlockfile(lock) - progress_reporter.finish() + if (d.getVarFlag(cmd, 'isar-apt-lock') or "") == "release-after": + bb.utils.unlockfile(lock) + progress_reporter.finish() + finally: + bb.build.exec_func('rootfs_do_umounts', d) } addtask rootfs_install before do_rootfs_postprocess after do_unpack @@ -379,9 +382,13 @@ python do_rootfs_postprocess() { if cmds is None or not cmds.strip(): return cmds = cmds.split() - for i, cmd in enumerate(cmds): - bb.build.exec_func(cmd, d) - progress_reporter.update(int(i / len(cmds) * 100)) + + try: + for i, cmd in enumerate(cmds): + bb.build.exec_func(cmd, d) + progress_reporter.update(int(i / len(cmds) * 100)) + finally: + bb.build.exec_func('rootfs_do_umounts', d) } addtask rootfs_postprocess before do_rootfs after do_unpack -- 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/20241011100050.322686-8-amikan%40ilbers.de.