From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7093814202197868544 X-Received: by 2002:a17:906:301a:b0:6f3:fdd3:4d1c with SMTP id 26-20020a170906301a00b006f3fdd34d1cmr24158841ejz.235.1652878832936; Wed, 18 May 2022 06:00:32 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:907:7ea2:b0:6f4:dcbc:baa9 with SMTP id qb34-20020a1709077ea200b006f4dcbcbaa9ls2646203ejc.2.gmail; Wed, 18 May 2022 06:00:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiZSOgrdYV0HwegMcDQPQRnpC4xmHnfxVVQHzRluPHYnpsEXY4iFUnRTwDX4NKdWMU13Ey X-Received: by 2002:a17:907:6e8b:b0:6f4:7147:a6ac with SMTP id sh11-20020a1709076e8b00b006f47147a6acmr25199798ejc.187.1652878831873; Wed, 18 May 2022 06:00:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652878831; cv=none; d=google.com; s=arc-20160816; b=JOiMdj3YN35MNACNKe/Fy7fViRrMEwIcI4nuDN1vfuVzNte1rMnu9qp/ZaDDJKJ1zJ BbQdcp2la3fqno3JFNS0IV8Gm/dMWTkIMjecO4Zd/zjVtSLsF1dpUBLuBcmHcKeiG7dt SeIb1bh/kfgdHC0ydf8aE3Kk+R1q3yJ/lhOs1TNjzbNjT/Go2WuLeMamfmHyc0Dh+tn9 m0MoUemX4/FL5bMHUbvIzjassg7q5H2j6wMcrO8i++El7UybdCe0tv0aOrXHT06ZvCVb GWLqOuqnA2mwiSa1EeeaHJPYPk/u0mJ8JuTZb57orNE3NoITanhLX2JdnwclBuPzO104 qFWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id; bh=1QkiBq0MevyJgkgMrSnHyDb/cbXLnn0A2vfMtzR3M/c=; b=Ozc1QHahd46NDz+INPfKtjsNOrTOpmVhXif2wHGOsNfYE+HZGd6dwSI8eMDahrAORo qt6b2mHsA28XaJpn1elwQtCPTdJ75N99eLY3bIzR2nJd9m6ud85OaGkZSyEb6qDR+HaA 1M8UBCQHaW57/odMgxoWteMvdxz7GXICBFByHD2zmQxRHKxCOALIWcjpOIElB8MlHSqC 15DDTdSqH4V1oBEkPPXqJYIS8nrolrCjRdKZJ1Jd+i6JSMAaaYppZd4xmFH9V81JzWE6 l9D7oEzmQjHUoPLX/gblBgFHQJKmR9du4kk3AsOFdJApRuGB3CVvMoR5yRsd/tFeftg+ 6wHg== 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 x89-20020a50bae2000000b0041cf5333d81si151432ede.4.2022.05.18.06.00.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 May 2022 06:00:31 -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 [127.0.0.1] (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPSA id 24ID0S6R001871 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 May 2022 15:00:29 +0200 Message-ID: <678fd4ec-5a81-f7e0-465e-39591fa93d77@ilbers.de> Date: Wed, 18 May 2022 16:00:28 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v3 1/1] fix: mount pts into rootfs Content-Language: en-US To: "Bezdeka, Florian" , "isar-users@googlegroups.com" Cc: "jan.kiszka@siemens.com" , "Moessbauer, Felix" , "ibr@radix50.net" References: <20220511093824.1118893-1-felix.moessbauer@siemens.com> <20220511093824.1118893-2-felix.moessbauer@siemens.com> <916167fc-72dd-a083-fa42-1a307c7afb54@ilbers.de> From: Anton Mikanovich In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: 6R3YqMXtzBAL 18.05.2022 15:28, Bezdeka, Florian wrote: > On Wed, 2022-05-18 at 14:12 +0300, Anton Mikanovich wrote: >> 11.05.2022 12:38, Felix Moessbauer wrote: >>> This fixes a regression introduced in 4e1dacc. >>> Pseudo ttys might be required during package building >>> as well as package installation >>> (e.g. to make expect work). >>> >>> The patch mounts /dev/pts from the host. >>> >>> Signed-off-by: Felix Moessbauer >>> --- >>> meta/classes/buildchroot.bbclass | 3 ++- >>> meta/classes/rootfs.bbclass | 3 ++- >>> meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 2 ++ >>> 3 files changed, 6 insertions(+), 2 deletions(-) >>> >>> diff --git a/meta/classes/buildchroot.bbclass b/meta/classes/buildchroot.bbclass >>> index 3d2211b9..af391dff 100644 >>> --- a/meta/classes/buildchroot.bbclass >>> +++ b/meta/classes/buildchroot.bbclass >>> @@ -43,7 +43,8 @@ buildchroot_do_mounts() { >>> fi >>> mountpoint -q '${BUILDCHROOT_DIR}/dev' || >>> ( mount --bind /dev '${BUILDCHROOT_DIR}/dev' && >>> - mount -t tmpfs none '${BUILDCHROOT_DIR}/dev/shm' ) >>> + mount -t tmpfs none '${BUILDCHROOT_DIR}/dev/shm' && >>> + mount --bind /dev/pts '${BUILDCHROOT_DIR}/dev/pts' ) >>> mountpoint -q '${BUILDCHROOT_DIR}/proc' || >>> mount -t proc none '${BUILDCHROOT_DIR}/proc' >>> mountpoint -q '${BUILDCHROOT_DIR}/sys' || >>> diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass >>> index 7e9fb0f3..2f4ea008 100644 >>> --- a/meta/classes/rootfs.bbclass >>> +++ b/meta/classes/rootfs.bbclass >>> @@ -35,7 +35,8 @@ rootfs_do_mounts() { >>> set -e >>> mountpoint -q '${ROOTFSDIR}/dev' || \ >>> ( mount --bind /dev '${ROOTFSDIR}/dev' && >>> - mount -t tmpfs none '${ROOTFSDIR}/dev/shm' ) >>> + mount -t tmpfs none '${ROOTFSDIR}/dev/shm' && >>> + mount --bind /dev/pts '${ROOTFSDIR}/dev/pts' ) >>> mountpoint -q '${ROOTFSDIR}/proc' || \ >>> mount -t proc none '${ROOTFSDIR}/proc' >>> mountpoint -q '${ROOTFSDIR}/sys' || \ >>> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc >>> index 6cc62a5e..7b4def14 100644 >>> --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc >>> +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc >>> @@ -370,6 +370,7 @@ do_bootstrap() { >>> >>> # update APT >>> mount --bind /dev ${ROOTFSDIR}/dev >>> + mount --bind /dev/pts ${ROOTFSDIR}/dev/pts >>> mount -t tmpfs none "${ROOTFSDIR}/dev/shm" >>> mount -t proc none ${ROOTFSDIR}/proc >>> mount --rbind /sys ${ROOTFSDIR}/sys >>> @@ -391,6 +392,7 @@ do_bootstrap() { >>> -o Debug::pkgProblemResolver=yes >>> >>> umount -l "${ROOTFSDIR}/dev/shm" >>> + umount -l "${ROOTFSDIR}/dev/pts" >>> umount -l "${ROOTFSDIR}/dev" >>> umount -l "${ROOTFSDIR}/proc" >>> umount -l "${ROOTFSDIR}/sys" >> Hello, >> >> It looks like we also have other issue caused by 4e1dacc with /dev/shm >> mounting. >> Here is an easy example for reproduce: > Please note that this is not 4e1dacc. The patch we're looking at here > seems fine and seems unrelated. > > The author of 4e1dacc is Jan, not Felix. Of course this is not caused by 'mount pts into rootfs' patch, but definitely related to it. Please look at my comments below. Jan is here in CC, so he will also see it. >> $ bitbake mc:qemuamd64-bullseye:isar-bootstrap-target >> mc:qemuarm64-bullseye:isar-bootstrap-target >> mc:qemuarm-bullseye:isar-bootstrap-target >> >> sometimes fails with: >> >>> umount: >> /home/amikan/isar/build/tmp/work/debian-bullseye-arm64/isar-bootstrap-target/1.0-r0/rootfs/dev/shm: >> not mounted. >> ERROR: Task >> (mc:qemuarm64-bullseye:/home/amikan/isar/meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb:do_bootstrap) >> failed with exit code '1' >> >> So there are 2 options: >> 1) revert 4e1dacc > I have a valid use case here which requires 4e1dacc. I would like to > learn the root cause. I have no idea (so far) why /dev/shm is not > mounted in your case. Any ideas? There is no '--make-rslave' on /dev during its mount to bootstrapped rootfs. It means all the mounts on top of it (like /dev/pts or /dev/shm) can be unmounted by the first finished do_bootstrap. In the case I've mentioned /dev/shm of one task got unmounted by the other one who finished earlier, to it fails to perform unmount by its own.