From patchwork Tue Oct 12 04:04:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schmidt, Adriaan" X-Patchwork-Id: 927 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3) with LMTPA; Tue, 12 Oct 2021 15:04:28 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-lf1-f61.google.com (mail-lf1-f61.google.com [209.85.167.61]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPS id 19CD4QYN003867 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 12 Oct 2021 15:04:26 +0200 Received: by mail-lf1-f61.google.com with SMTP id z29-20020a195e5d000000b003fd437f0e07sf12170382lfi.20 for ; Tue, 12 Oct 2021 06:04:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1634043860; cv=pass; d=google.com; s=arc-20160816; b=M1olZj/qK0OTGUdTF5ij/ZOx+C/BTyORPFIwBIV9vmJan5EaURkbPoBX6JWE9djjzK CrFMoAHPr93pCITONi6GrtOsd2INuHFwe+utraPl/YHiz9Rbd8H/Lh/rGOkxnII6ri6X S2IqHmqg/JK7phf3Gq68FZj3L9ICko4m7lMf5TWMS5xNaOXI5ignjeVvwb8gfKvCS9tr h9U6g50/PCb8lmaa2BzgpOh5mQft8UMzBlOY19rTGAmGJvpSsyJoHvK95wpbqhFHoXuA 3jBSpGlkJbKjNYZXZ0auam/AtWABdHzA0ebRWEFnv84G2fKi2xU2iYOADwlsdWMn0zb0 5+tA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=IB5239dxSagMRtBM+pSW1/F2Y823aNwjvwbfNM8ZJL8=; b=tRiw3oCom+/RKoLXqXYC27Iiud4px5/+bh4Y0G7/Cj8UUe3+zywjkMASd232lJ/4AV t/BC35M+dOKW+Px9TMm6JJIGtf7ziDs+NKwTJS/HrjitqtYA77SRiCJ4wiAYvKNFvVtw huGd/0kLVJP9Gfqc7HFQuKqVYnCwDMJMutL8KYokLBgNfcbjOfPZsJWCngxaHzS0UHHA tT7ED1oxrGWExiKV+bcZAUuIgC8jkdOAI1Cl7ybiHtFzeQzG6fgzPECJDWfgTXUWuPAI KEmDUeFFm2ov8mw1q9w9GMBDp8HhKzE5+K8vY+kIVIMKh3/Fko5Qn+aJfXd39EBpN4ca fmzQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of adriaan.schmidt@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=adriaan.schmidt@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=IB5239dxSagMRtBM+pSW1/F2Y823aNwjvwbfNM8ZJL8=; b=kZuXBac9Vmnl55kr2NqBosti94iIW/mFhR5o/X9DG8dEVlIGGFf6YI97ZhUCVEsObv cQOojury96XN1RbXpJDbYxHRYv+ez2rPiD1RUJlxt9ZXzG2f5NHjg1Lf8afwoVuVn3CK sehOhcV5SNz9HZaJDd3Mzn4Bl4+nlnnEZDqx8N4DoEOXDmiMnkzdCoYkTzORH3Rjl9NN t6N2MjOr5yuIFp3ZaO18ZurecbswqAsz1LZpfs9lu4qECnpGWjKNXdvc41LtcI4TV+jo pDN7GoyH1bJA4FIBO/Ii9XttsHdFKfhhdfzxVFGxetU5sRr0MiABgzymiJHkJn80HMfw UTrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=IB5239dxSagMRtBM+pSW1/F2Y823aNwjvwbfNM8ZJL8=; b=YtNDXBD4FSjyCY2XN9TL4/q8XdzOzIBXNvA4DvC6msiTJKFc8mpfOpYiU2Kx3jF7Hk JcvS8B9zDp8H1gAIGaXCIBImT/dHTcXMPQbpCUUP1wiSvRheXJ/18sl7e22UTSfgZl+q a5fxdU700aZEtWvEIs6CaKZuteqnHeImTNkrszyKhytkrt2cjEXF+mCe0OTLujrAYrMo PF3UAauda+r1g81erPtlVf1nzYrL0pW/ggnAKny7Kss6F2BJ6xFmixYsxDFLszcUhaVy q5CnYjucstIzNUsz6QlnyJvQKSDJr4GX61UJUPOn/A+Lt1geAGbkWCtqVvKOaEucYVez yM3w== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM533CeiOspS4E2SHFlby1KCWy98ZbhzgMjEICYU8+GM8MS+OMaxmX 5dVVmhgxEXFJOcotfYFiHkk= X-Google-Smtp-Source: ABdhPJxtdbjbO6BRGSgLHJ1NiVf3BqTsIuv5Uzrh998ynqLvFSfsek6vo/K/po7A61pTRu5Vw8NKuw== X-Received: by 2002:a05:6512:2344:: with SMTP id p4mr32220070lfu.324.1634043859617; Tue, 12 Oct 2021 06:04:19 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:3f14:: with SMTP id y20ls381139lfa.1.gmail; Tue, 12 Oct 2021 06:04:18 -0700 (PDT) X-Received: by 2002:a05:6512:108e:: with SMTP id j14mr33105473lfg.274.1634043858622; Tue, 12 Oct 2021 06:04:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634043858; cv=none; d=google.com; s=arc-20160816; b=GzXa5WDHLA3aiE0HaoVFAPgRCWpEEhnbKjMTNP6kJiKbq2bZi1XGuG0s3Qhw3heLDx J4xr2/9D4MfNUphz7BTGAlPz86wnkEAnsWTMiYbAtJ4GKY75Qpuj3ScqJ5Ihv5a2ZLSG rPxHIcVKjKE0sY/f1xASkyNUQlTsGZTYVU4lDfGbQc4cKmOYEiJQgx4hZIr7ZrXJfsZi 8cVNSTiz7PWKJUBgaTeJ+/VaYSsDIN8DZSbL8/X97R+OaO/2YcCz2S4touKu/noVLxKy cD7R8KYUNlB79NpaTlY48k/PCMVMEl87HjYGbZAX/sZs6+WdvEh5rm5mJ3sPSXUuuwPe BaFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=WHSCLnDRKcT2r8u0P35gFihF10Pgjhna5Tr9eyauFjM=; b=q4dKCnoHy3yik9ayzFQH2RjLjc/nsfqhMvwDnhF6NvJ/4ww2R7Qzo+QmIi/lWw1MeW SotNxAELLqhR8knnltiB16V1pJetMmzPIMxkHdNLjuYqjzivtB1eh28ZzeKTO8gkj6ZA OaZ5+c0fXNhXcAztf4SzgUSe4UeZPUV7xlD8aXsoetJ5dENIgIyuGcZxng0lhvAPIsYt Hgp5c+o8bmZsj2E9ou0FrWDJttYffGHuEdsy0sbkxIY3Q3Xabt4hw7HrJiKNvHIUE+R2 bIA3nR4TYIVoXz2EN7Q7WNKzeuTEhAdcx+5lRnKY1d0optig1teiqzMQtHPSBkwXtKtL 9uyw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of adriaan.schmidt@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=adriaan.schmidt@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id z12si707960lfd.13.2021.10.12.06.04.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Oct 2021 06:04:18 -0700 (PDT) Received-SPF: pass (google.com: domain of adriaan.schmidt@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id 19CD4Hcx002033 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 12 Oct 2021 15:04:17 +0200 Received: from random.ppmd.siemens.net (random.ppmd.siemens.net [139.25.68.25]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 19CD4HmI009739; Tue, 12 Oct 2021 15:04:17 +0200 From: Adriaan Schmidt To: isar-users@googlegroups.com Cc: Adriaan Schmidt Subject: [RFC PATCH 0/5] Refactor mount logic Date: Tue, 12 Oct 2021 15:04:08 +0200 Message-Id: <20211012130413.1719424-1-adriaan.schmidt@siemens.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Original-Sender: adriaan.schmidt@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of adriaan.schmidt@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=adriaan.schmidt@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com 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: INBOX After some reports on problems with mounting and unmounting, here is a proposal to refactor the whole mount logic. The main idea is to have all actual mounting happen in mounts.bbclass, which also takes care of things like reference counting. Any task that needs mounts uses a `do_my_task[mounts] = "..."` varflag annotation. One thing that may need some thoughts: the original rootfs_do_mounts also writes /etc/resolv.conf. This proposal introduces another varflag (`do_my_task[buildchroot] = "1"`) for tasks that need that. Alternatively, we could simply provide a function that needs to be called explicitly. Current status: the code works, but there may be some issues with cleanup/unmounting. The existing ("legacy") cleanup code in isar-events still finds active mounts, which should actually be covered by cleanup code in mounts.bbclass. Adriaan Schmidt (5): oe imports in central location meta: refactor containerization meta: add oe.utils meta: add mounts class meta: refactor to use the new mounting mechanism meta/classes/base.bbclass | 28 + meta/classes/buildchroot.bbclass | 52 +- meta/classes/cpiogz-img.bbclass | 3 +- meta/classes/dpkg-base.bbclass | 49 +- meta/classes/dpkg-gbp.bbclass | 2 - meta/classes/dpkg.bbclass | 4 +- meta/classes/ext4-img.bbclass | 3 +- meta/classes/fit-img.bbclass | 4 +- .../classes/image-container-extension.bbclass | 3 +- meta/classes/image-sdk-extension.bbclass | 6 +- meta/classes/image-tools-extension.bbclass | 4 +- meta/classes/image.bbclass | 30 +- meta/classes/initramfs.bbclass | 2 +- meta/classes/isar-events.bbclass | 4 +- meta/classes/mounts.bbclass | 271 +++++++++ meta/classes/patch.bbclass | 5 - meta/classes/rootfs.bbclass | 50 +- meta/classes/ubi-img.bbclass | 3 +- meta/classes/ubifs-img.bbclass | 3 +- meta/classes/vm-img.bbclass | 7 +- meta/classes/wic-img.bbclass | 31 +- meta/conf/bitbake.conf | 2 +- meta/lib/oe/utils.py | 569 ++++++++++++++++++ .../isar-bootstrap/isar-bootstrap.inc | 43 +- .../buildchroot/buildchroot.inc | 8 +- 25 files changed, 976 insertions(+), 210 deletions(-) create mode 100644 meta/classes/mounts.bbclass create mode 100644 meta/lib/oe/utils.py