public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] meta: do not share dev mounts
@ 2022-06-10  8:44 Anton Mikanovich
  2022-06-17 17:07 ` Anton Mikanovich
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Mikanovich @ 2022-06-10  8:44 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

As /dev was mounted into bootstrap/rootfs/buildchroot in shared mode
it made the first ended task unmount /dev/shm or /dev/pts for all other
tasks executed at the moment.
To prevent mounts corruption make /dev to be mounted as private.
This will protect mountpoints from all the propagations during the task
execution.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/classes/buildchroot.bbclass                    | 2 +-
 meta/classes/rootfs.bbclass                         | 2 +-
 meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes/buildchroot.bbclass b/meta/classes/buildchroot.bbclass
index af391df..1148966 100644
--- a/meta/classes/buildchroot.bbclass
+++ b/meta/classes/buildchroot.bbclass
@@ -42,7 +42,7 @@ buildchroot_do_mounts() {
                 mount --bind '${CCACHE_DIR}' '${BUILDCHROOT_DIR}/ccache'
         fi
         mountpoint -q '${BUILDCHROOT_DIR}/dev' ||
-            ( mount --bind /dev '${BUILDCHROOT_DIR}/dev' &&
+            ( mount -o bind,private /dev '${BUILDCHROOT_DIR}/dev' &&
               mount -t tmpfs none '${BUILDCHROOT_DIR}/dev/shm' &&
               mount --bind /dev/pts '${BUILDCHROOT_DIR}/dev/pts' )
         mountpoint -q '${BUILDCHROOT_DIR}/proc' ||
diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index 2f4ea00..bf8b6db 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -34,7 +34,7 @@ rootfs_do_mounts() {
     sudo -s <<'EOSUDO'
         set -e
         mountpoint -q '${ROOTFSDIR}/dev' || \
-            ( mount --bind /dev '${ROOTFSDIR}/dev' &&
+            ( mount -o bind,private /dev '${ROOTFSDIR}/dev' &&
               mount -t tmpfs none '${ROOTFSDIR}/dev/shm' &&
               mount --bind /dev/pts '${ROOTFSDIR}/dev/pts' )
         mountpoint -q '${ROOTFSDIR}/proc' || \
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index 7b4def1..a453b36 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -369,7 +369,7 @@ do_bootstrap() {
         "${ROOTFSDIR}/chroot-setup.sh" "setup" "${ROOTFSDIR}"
 
         # update APT
-        mount --bind /dev ${ROOTFSDIR}/dev
+        mount -o bind,private /dev ${ROOTFSDIR}/dev
         mount --bind /dev/pts ${ROOTFSDIR}/dev/pts
         mount -t tmpfs none "${ROOTFSDIR}/dev/shm"
         mount -t proc none ${ROOTFSDIR}/proc
-- 
2.30.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-17 17:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-10  8:44 [PATCH] meta: do not share dev mounts Anton Mikanovich
2022-06-17 17:07 ` Anton Mikanovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox