public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Maxim Yu. Osipov" <mosipov@ilbers.de>
To: Jan Kiszka <jan.kiszka@siemens.com>,
	isar-users <isar-users@googlegroups.com>,
	Cedric Hombourger <Cedric_Hombourger@mentor.com>
Subject: Re: [PATCH] isar-bootstrap: Fix and cleanup bind mounting
Date: Fri, 7 Dec 2018 16:45:43 +0300	[thread overview]
Message-ID: <e95f018f-70f0-9c25-3fd3-6f51b6cc4b57@ilbers.de> (raw)
In-Reply-To: <6f5714bc-d5f5-c08f-c408-b32bab9169fc@siemens.com>

On 11/29/18 7:29 PM, Jan Kiszka wrote:
> First, wrong variables were used (there is no BUILDCHROOT_DIR for
> isar_bootstrap). And then we simply left the mount points active after
> completing the bootstrap. The led to setup_root_file_system copying all
> the mount point content over into the buildchroot or rootfs - including
> base-apt when it was used.

Applied to the 'next',

Thanks,
Maxim.

> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> 
> This is a precondition for "isar-image: umount base-apt when doing
> offline build" to work properly. IOW, that patch reveal these bugs.
> 
> Possibly, this also explains the increasing mount count that was visible
> in CI.
> 
>   meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 21 +++++++++++----------
>   1 file changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> index 8ea3b08..da077d0 100644
> --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> @@ -185,12 +185,8 @@ isar_bootstrap() {
>       sudo -E flock "${ISAR_BOOTSTRAP_LOCK}" -c "\
>           set -e
>           if [ ! -e "${DEPLOY_ISAR_BOOTSTRAP}" ]; then
> -            if [ -e "${ROOTFSDIR}" ]; then
> -               umount -R -l "${ROOTFSDIR}/dev" || true
> -               umount -l "${ROOTFSDIR}/proc" || true
> -               umount -R -l "${ROOTFSDIR}/sys" || true
> -               rm -rf "${ROOTFSDIR}"
> -            fi
> +            rm -rf "${ROOTFSDIR}"
> +
>               if [ ${IS_HOST} ]; then
>                   ${DEBOOTSTRAP} $debootstrap_args \
>                                  ${@get_distro_components_argument(d, True)} \
> @@ -247,17 +243,22 @@ isar_bootstrap() {
>               "${ROOTFSDIR}/chroot-setup.sh" "setup" "${ROOTFSDIR}"
>   
>               # update APT
> -            mount --rbind /dev ${BUILDCHROOT_DIR}/dev
> -            mount --make-rslave ${BUILDCHROOT_DIR}/dev
> +            mount --rbind /dev ${ROOTFSDIR}/dev
> +            mount --make-rslave ${ROOTFSDIR}/dev
>               mount -t proc none ${ROOTFSDIR}/proc
> -            mount --rbind /sys ${BUILDCHROOT_DIR}/sys
> -            mount --make-rslave ${BUILDCHROOT_DIR}/sys
> +            mount --rbind /sys ${ROOTFSDIR}/sys
> +            mount --make-rslave ${ROOTFSDIR}/sys
>   
>               export DEBIAN_FRONTEND=noninteractive
>               chroot "${ROOTFSDIR}" /usr/bin/apt-get update -y
>               chroot "${ROOTFSDIR}" /usr/bin/apt-get dist-upgrade -y \
>                                     -o Debug::pkgProblemResolver=yes
>   
> +            umount -R -l "${ROOTFSDIR}/dev"
> +            umount -l "${ROOTFSDIR}/proc"
> +            umount -R -l "${ROOTFSDIR}/sys"
> +            umount -l "${ROOTFSDIR}/base-apt" || true
> +
>               # Finalize debootstrap by setting the link in deploy
>               ln -Tfsr "${ROOTFSDIR}" "${DEPLOY_ISAR_BOOTSTRAP}"
>           fi"
> 


-- 
Maxim Osipov
ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn
Germany
+49 (151) 6517 6917
mosipov@ilbers.de
http://ilbers.de/
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov

      parent reply	other threads:[~2018-12-07 13:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29 16:29 Jan Kiszka
2018-11-29 18:39 ` Henning Schild
2018-11-30  9:20   ` Maxim Yu. Osipov
2018-11-30  9:36     ` Henning Schild
2018-11-30  9:40       ` Jan Kiszka
2018-11-30  9:38     ` Jan Kiszka
2018-11-30 10:19       ` Jan Kiszka
2018-11-30 10:51         ` Jan Kiszka
2018-12-03 12:59     ` Jan Kiszka
2018-12-03 14:37       ` Hombourger, Cedric
2018-12-04 10:49       ` Maxim Yu. Osipov
2018-12-04 14:24         ` Jan Kiszka
2018-12-04 15:42           ` Jan Kiszka
2018-12-04 15:45             ` Hombourger, Cedric
2018-12-04 16:59               ` Maxim Yu. Osipov
2018-12-04 17:10                 ` Jan Kiszka
2018-12-04 17:31                   ` Jan Kiszka
2018-12-04 15:45             ` Jan Kiszka
2018-12-07 13:45 ` Maxim Yu. Osipov [this message]

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=e95f018f-70f0-9c25-3fd3-6f51b6cc4b57@ilbers.de \
    --to=mosipov@ilbers.de \
    --cc=Cedric_Hombourger@mentor.com \
    --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