* [PATCH v3 0/1] fix: mount pts into rootfs @ 2022-05-11 9:38 Felix Moessbauer 2022-05-11 9:38 ` [PATCH v3 1/1] " Felix Moessbauer 2022-06-08 9:29 ` [PATCH v3 0/1] " Anton Mikanovich 0 siblings, 2 replies; 6+ messages in thread From: Felix Moessbauer @ 2022-05-11 9:38 UTC (permalink / raw) To: isar-users; +Cc: jan.kiszka, ibr, Felix Moessbauer Changes since v2: - use --bind instead of --rbind Changes since v1: - fix path to ROOTFSDIR Felix Moessbauer (1): fix: mount pts into rootfs 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(-) -- 2.30.2 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v3 1/1] fix: mount pts into rootfs 2022-05-11 9:38 [PATCH v3 0/1] fix: mount pts into rootfs Felix Moessbauer @ 2022-05-11 9:38 ` Felix Moessbauer 2022-05-18 11:12 ` Anton Mikanovich 2022-06-08 9:29 ` [PATCH v3 0/1] " Anton Mikanovich 1 sibling, 1 reply; 6+ messages in thread From: Felix Moessbauer @ 2022-05-11 9:38 UTC (permalink / raw) To: isar-users; +Cc: jan.kiszka, ibr, Felix Moessbauer 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 <felix.moessbauer@siemens.com> --- 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" -- 2.30.2 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 1/1] fix: mount pts into rootfs 2022-05-11 9:38 ` [PATCH v3 1/1] " Felix Moessbauer @ 2022-05-18 11:12 ` Anton Mikanovich 2022-05-18 12:28 ` Bezdeka, Florian 0 siblings, 1 reply; 6+ messages in thread From: Anton Mikanovich @ 2022-05-18 11:12 UTC (permalink / raw) To: Felix Moessbauer, isar-users; +Cc: jan.kiszka, ibr 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 <felix.moessbauer@siemens.com> > --- > 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: $ 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 2) fix also /dev/shm ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 1/1] fix: mount pts into rootfs 2022-05-18 11:12 ` Anton Mikanovich @ 2022-05-18 12:28 ` Bezdeka, Florian 2022-05-18 13:00 ` Anton Mikanovich 0 siblings, 1 reply; 6+ messages in thread From: Bezdeka, Florian @ 2022-05-18 12:28 UTC (permalink / raw) To: amikan, isar-users; +Cc: jan.kiszka, Moessbauer, Felix, ibr 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 <felix.moessbauer@siemens.com> > > --- > > 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. > > $ 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? > 2) fix also /dev/shm > Best regards, Florian ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 1/1] fix: mount pts into rootfs 2022-05-18 12:28 ` Bezdeka, Florian @ 2022-05-18 13:00 ` Anton Mikanovich 0 siblings, 0 replies; 6+ messages in thread From: Anton Mikanovich @ 2022-05-18 13:00 UTC (permalink / raw) To: Bezdeka, Florian, isar-users; +Cc: jan.kiszka, Moessbauer, Felix, ibr 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 <felix.moessbauer@siemens.com> >>> --- >>> 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. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 0/1] fix: mount pts into rootfs 2022-05-11 9:38 [PATCH v3 0/1] fix: mount pts into rootfs Felix Moessbauer 2022-05-11 9:38 ` [PATCH v3 1/1] " Felix Moessbauer @ 2022-06-08 9:29 ` Anton Mikanovich 1 sibling, 0 replies; 6+ messages in thread From: Anton Mikanovich @ 2022-06-08 9:29 UTC (permalink / raw) To: Felix Moessbauer, isar-users Cc: jan.kiszka, Baurzhan Ismagulov, Bezdeka, Florian 11.05.2022 12:38, Felix Moessbauer wrote: > Changes since v2: > > - use --bind instead of --rbind > > Changes since v1: > > - fix path to ROOTFSDIR > > Felix Moessbauer (1): > fix: mount pts into rootfs > > 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(-) > Applied to next, thanks. I will address any further fixes in a separate patch. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-06-08 9:29 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-05-11 9:38 [PATCH v3 0/1] fix: mount pts into rootfs Felix Moessbauer 2022-05-11 9:38 ` [PATCH v3 1/1] " Felix Moessbauer 2022-05-18 11:12 ` Anton Mikanovich 2022-05-18 12:28 ` Bezdeka, Florian 2022-05-18 13:00 ` Anton Mikanovich 2022-06-08 9:29 ` [PATCH v3 0/1] " Anton Mikanovich
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox