From: Baurzhan Ismagulov <ibr@radix50.net>
To: isar-users <isar-users@googlegroups.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Subject: Re: [PATCH v3] Avoid sharing of /dev/shm from the build context
Date: Mon, 21 Mar 2022 13:01:08 +0100 [thread overview]
Message-ID: <YjhpBBXUDHRgcKHi@ilbers.de> (raw)
In-Reply-To: <402b0166-9aca-6f49-63b4-d24ac89f8505@siemens.com>
On Mon, Mar 21, 2022 at 12:50:53PM +0100, Jan Kiszka wrote:
> diff --git a/meta/classes/buildchroot.bbclass b/meta/classes/buildchroot.bbclass
> index dd8f4206..3d2211b9 100644
> --- a/meta/classes/buildchroot.bbclass
> +++ b/meta/classes/buildchroot.bbclass
> @@ -42,8 +42,8 @@ buildchroot_do_mounts() {
> mount --bind '${CCACHE_DIR}' '${BUILDCHROOT_DIR}/ccache'
> fi
> mountpoint -q '${BUILDCHROOT_DIR}/dev' ||
> - mount --rbind /dev '${BUILDCHROOT_DIR}/dev'
> - mount --make-rslave '${BUILDCHROOT_DIR}/dev'
> + ( mount --bind /dev '${BUILDCHROOT_DIR}/dev' &&
> + mount -t tmpfs none '${BUILDCHROOT_DIR}/dev/shm' )
> 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 927af13f..d760ba5c 100644
> --- a/meta/classes/rootfs.bbclass
> +++ b/meta/classes/rootfs.bbclass
> @@ -34,8 +34,8 @@ rootfs_do_mounts() {
> sudo -s <<'EOSUDO'
> set -e
> mountpoint -q '${ROOTFSDIR}/dev' || \
> - mount --rbind /dev '${ROOTFSDIR}/dev'
> - mount --make-rslave '${ROOTFSDIR}/dev'
> + ( mount --bind /dev '${ROOTFSDIR}/dev' &&
> + mount -t tmpfs none '${ROOTFSDIR}/dev/shm' )
> 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 1b16f874..c7fc2b4f 100644
> --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> @@ -360,8 +360,8 @@ do_bootstrap() {
> "${ROOTFSDIR}/chroot-setup.sh" "setup" "${ROOTFSDIR}"
>
> # update APT
> - mount --rbind /dev ${ROOTFSDIR}/dev
> - mount --make-rslave ${ROOTFSDIR}/dev
> + mount --bind /dev ${ROOTFSDIR}/dev
> + mount -t tmpfs none "${ROOTFSDIR}/dev/shm"
> mount -t proc none ${ROOTFSDIR}/proc
> mount --rbind /sys ${ROOTFSDIR}/sys
> mount --make-rslave ${ROOTFSDIR}/sys
> @@ -381,6 +381,7 @@ do_bootstrap() {
> chroot "${ROOTFSDIR}" /usr/bin/apt-get dist-upgrade -y \
> -o Debug::pkgProblemResolver=yes
>
> + umount -l "${ROOTFSDIR}/dev/shm"
> umount -l "${ROOTFSDIR}/dev"
> umount -l "${ROOTFSDIR}/proc"
> umount -l "${ROOTFSDIR}/sys"
Thanks, LGTM.
I hope we can address lazy umounts in the next mount rework version.
With kind regards,
Baurzhan.
next prev parent reply other threads:[~2022-03-21 12:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-21 11:50 Jan Kiszka
2022-03-21 12:01 ` Baurzhan Ismagulov [this message]
2022-03-28 17:49 ` Anton Mikanovich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YjhpBBXUDHRgcKHi@ilbers.de \
--to=ibr@radix50.net \
--cc=isar-users@googlegroups.com \
--cc=jan.kiszka@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox