From: chombourger@gmail.com
To: isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH v3 2/2] buildchroot: add sysfs mount since expected by some packages
Date: Fri, 16 Nov 2018 08:29:44 -0800 (PST) [thread overview]
Message-ID: <b102a5de-b09f-418f-a29a-4724fc3f4323@googlegroups.com> (raw)
In-Reply-To: <20181114084455.2f46bf86@md1za8fc.ad001.siemens.net>
[-- Attachment #1.1: Type: text/plain, Size: 3721 bytes --]
Hi Henning,
1. the hook we have for when the build ends does handle nested mounts just
fine. I will however post a new patch with 'umount -R' calls in places
where we explicitly umount /dev, /proc and /sys
2. I don't think we have an issue here, the use-case is similar to e.g.
lxc, they do have /sys mounted and packages may be installed at will within
the container
Cedric
On Tuesday, November 13, 2018 at 11:44:57 PM UTC-8, Henning Schild wrote:
>
> Two more things to double-check.
>
> 1. Do the umount hooks we have in place clean up all the recursiveness?
> 2. Once we rbind mount sys the chroot will probably be allowed to mess
> with cgroups, tracing etc. Does a debootstrap change anything there,
> i.e. by installing systemd, libvirt, or perf?
>
> Henning
>
> Am Mon, 12 Nov 2018 20:59:33 -0800
> schrieb Cedric Hombourger <Cedric_H...@mentor.com <javascript:>>:
>
> > Some packages look for /sys when they configure, build or test
> > themselves (for instance golang-google-grpc).
> >
> > Signed-off-by: Cedric Hombourger <Cedric_H...@mentor.com <javascript:>>
> > ---
> > meta/classes/buildchroot.bbclass | 2 ++
> > meta/classes/image.bbclass | 1 +
> > meta/classes/isar-bootstrap-helper.bbclass | 3 +++
> > meta/classes/isar-image.bbclass | 1 +
> > 4 files changed, 7 insertions(+)
> >
> > diff --git a/meta/classes/buildchroot.bbclass
> > b/meta/classes/buildchroot.bbclass index 26d5e80..d2f138f 100644
> > --- a/meta/classes/buildchroot.bbclass
> > +++ b/meta/classes/buildchroot.bbclass
> > @@ -31,5 +31,7 @@ buildchroot_do_mounts() {
> > mount --make-rslave ${BUILDCHROOT_DIR}/dev
> > mount --rbind /proc ${BUILDCHROOT_DIR}/proc
> > mount --make-rslave ${BUILDCHROOT_DIR}/proc
> > + mount --rbind /sys ${BUILDCHROOT_DIR}/sys
> > + mount --make-rslave ${BUILDCHROOT_DIR}/sys
> > fi'
> > }
> > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> > index d033cf5..5806a59 100644
> > --- a/meta/classes/image.bbclass
> > +++ b/meta/classes/image.bbclass
> > @@ -110,6 +110,7 @@ do_populate_sdk() {
> >
> > sudo umount ${SDKCHROOT_DIR}/rootfs/dev || true
> > sudo umount ${SDKCHROOT_DIR}/rootfs/proc || true
> > + sudo umount ${SDKCHROOT_DIR}/rootfs/sys || true
> >
> > # Create SDK archive
> > sudo tar -C ${SDKCHROOT_DIR}
> > --transform="s|^rootfs|sdk-${DISTRO}-${DISTRO_ARCH}|" \ diff --git
> > a/meta/classes/isar-bootstrap-helper.bbclass
> > b/meta/classes/isar-bootstrap-helper.bbclass index 62c0839..7b2ddf3
> > 100644 --- a/meta/classes/isar-bootstrap-helper.bbclass +++
> > b/meta/classes/isar-bootstrap-helper.bbclass @@ -107,6 +107,9 @@
> > setup_root_file_system() { sudo mount --make-rslave ${ROOTFSDIR}/dev
> > sudo mount --rbind /proc ${ROOTFSDIR}/proc
> > sudo mount --make-rslave ${ROOTFSDIR}/proc
> > + sudo install -m 755 -d ${ROOTFSDIR}/sys
> > + sudo mount --rbind /sys ${ROOTFSDIR}/sys
> > + sudo mount --make-rslave ${ROOTFSDIR}/sys
> >
> > # Install packages:
> > E="${@ bb.utils.export_proxies(d)}"
> > diff --git a/meta/classes/isar-image.bbclass
> > b/meta/classes/isar-image.bbclass index e0508be..356c97a 100644
> > --- a/meta/classes/isar-image.bbclass
> > +++ b/meta/classes/isar-image.bbclass
> > @@ -61,6 +61,7 @@ isar_image_cleanup() {
> > sudo rmdir ${IMAGE_ROOTFS}/isar-apt
> > sudo umount -l ${IMAGE_ROOTFS}/dev
> > sudo umount -l ${IMAGE_ROOTFS}/proc
> > + sudo umount -l ${IMAGE_ROOTFS}/sys
> > sudo rm -f
> > "${IMAGE_ROOTFS}/etc/apt/apt.conf.d/55isar-fallback.conf" }
> >
>
>
[-- Attachment #1.2: Type: text/html, Size: 4919 bytes --]
next prev parent reply other threads:[~2018-11-16 16:29 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-09 20:11 [PATCH] " Cedric Hombourger
2018-11-10 7:15 ` [PATCH v2] " Cedric Hombourger
2018-11-12 9:31 ` Henning Schild
2018-11-13 4:59 ` [PATCH v3 1/2] buildchroot+bootstrap: use rbinds for /dev and /proc Cedric Hombourger
2018-11-13 4:59 ` [PATCH v3 2/2] buildchroot: add sysfs mount since expected by some packages Cedric Hombourger
2018-11-13 10:43 ` chombourger
2018-11-13 10:59 ` Jan Kiszka
2018-11-13 12:07 ` Henning Schild
2018-11-13 12:37 ` Hombourger, Cedric
2018-11-13 12:59 ` Jan Kiszka
2018-11-14 7:44 ` Henning Schild
2018-11-16 16:29 ` chombourger [this message]
2018-11-16 16:31 ` [PATCH v4 1/2] buildchroot+bootstrap: rbind mount for /dev Cedric Hombourger
2018-11-16 16:31 ` [PATCH v3 1/2] buildchroot+bootstrap: use rbinds for /dev and /proc Cedric Hombourger
2018-11-16 16:31 ` [PATCH v4 2/2] buildchroot: add sysfs mount since expected by some packages Cedric Hombourger
2018-11-17 14:56 ` [PATCH v5 0/2] rbind mounts for /dev and /sys Cedric Hombourger
2018-11-17 14:56 ` [PATCH v5 1/2] buildchroot+bootstrap: rbind mount for /dev Cedric Hombourger
2018-11-19 9:25 ` Henning Schild
2018-11-20 12:36 ` chombourger
2018-11-17 14:56 ` [PATCH v5 2/2] buildchroot: add sysfs mount since expected by some packages Cedric Hombourger
2018-11-19 9:24 ` Henning Schild
2018-11-20 12:40 ` [PATCH v6 0/2] rbind mounts for /dev and /sys Cedric Hombourger
2018-11-20 12:40 ` [PATCH v6 1/2] buildchroot+bootstrap: rbind mount for /dev Cedric Hombourger
2018-11-20 12:40 ` [PATCH v6 2/2] buildchroot: add sysfs mount since expected by some packages Cedric Hombourger
2018-11-22 16:08 ` chombourger
2018-11-23 14:13 ` [PATCH v6 0/2] rbind mounts for /dev and /sys Maxim Yu. Osipov
2018-11-27 14:45 ` Maxim Yu. Osipov
2018-11-27 14:48 ` Hombourger, Cedric
2018-11-29 8:22 ` Maxim Yu. Osipov
2018-11-29 8:28 ` Hombourger, Cedric
2018-11-29 8:48 ` Maxim Yu. Osipov
2018-11-29 10:00 ` Baurzhan Ismagulov
2018-11-29 9:54 ` Henning Schild
2018-11-19 9:27 ` [PATCH v5 " Henning Schild
2018-11-19 9:30 ` Hombourger, Cedric
2018-11-13 12:06 ` [PATCH v3 1/2] buildchroot+bootstrap: use rbinds for /dev and /proc Henning Schild
2018-11-12 9:46 ` [PATCH v2] buildchroot: add sysfs mount since expected by some packages Maxim Yu. Osipov
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=b102a5de-b09f-418f-a29a-4724fc3f4323@googlegroups.com \
--to=chombourger@gmail.com \
--cc=isar-users@googlegroups.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