[buildd-tools-devel] Bug#789694: schroot: Please consider patch to fix it on hurd-i386

Samuel Thibault sthibault at debian.org
Thu Jul 9 08:45:04 UTC 2015


Gabriele Giacone, le Tue 23 Jun 2015 15:42:52 +0200, a écrit :
> More info in threads at
>  https://lists.debian.org/debian-hurd/2014/09/msg00058.html
>  https://lists.debian.org/debian-hurd/2015/05/msg00063.html

We also need a summary, because there is a lot of information spread
across the whole thread, it's hard to determine how it fits together.

AIUI, what we have is:

- debootstrap sets up a passive (i.e. permanent) bind mount from /proc
to $CHROOT/proc
- schroot sets up other active bind mounts (e.g. for /dev, /servers,
etc.) as added in gnu/fstab from your patch
- do_umount_all "$CHROOT_MOUNT_LOCATION" does not work on the Hurd
because of bug #763932, that's why the second do_umount_all call.
- that second call (do_umount_all "${CHROOT_FILE_UNPACK_DIR}/${SESSION_ID}")
manages to umount /dev, /servers etc. but not /proc because that one is
passive, and umount doesn't unmount passive mounts. This is why the
addition of the explicit settrans to make it go away.

Please correct anything wrong in this summary.  Notably I don't think
debootstrap uses a passive translator, and thus I don't see why the
second do_umount_all shouldn't be able to umount $CHROOT/proc actually.

That was the kind of summary you should have attached with your patch.
Please really take the habit of writing this kind of summary, otherwise
it'd take a huge lot of time for the maintainer to gather, thus
considerably lowering the probability that he works on the bug at all.

> diff --git a/etc/setup.d/10mount b/etc/setup.d/10mount
> index 27c18d0..884c36a 100755
> --- a/etc/setup.d/10mount
> +++ b/etc/setup.d/10mount
> @@ -224,6 +224,21 @@ if [ "$CHROOT_TYPE" = "directory" ] \
>      elif [ $STAGE = "setup-stop" ]; then
>  
>          do_umount_all "$CHROOT_MOUNT_LOCATION"
> +        #
> +        # If CHROOT_TYPE is "file", _UNPACK_DIR is bindmounted on
> +        # _MOUNT_LOCATION. Hurd does need to also bindmount /dev and
> +        # /servers on respectively _MOUNT_LOCATION/dev and
> +        # _MOUNT_LOCATION/servers, but due to #763932, currently
> +        # bindmounts-on-bindmounts result mounted on first bindmount
> +        # source device i.e. _UNPACK_DIR.
> +        # Workaround also umounts filesystems under _UNPACK_DIR.
> +        #
> +        if [ "$CHROOT_TYPE" = "file" -a "$(uname -s)" = "GNU" ]; then
> +            do_umount_all "${CHROOT_FILE_UNPACK_DIR}/${SESSION_ID}"
> +            info "Unmounting ${CHROOT_FILE_UNPACK_DIR}/${SESSION_ID}/proc"
> +            settrans -apg "${CHROOT_FILE_UNPACK_DIR}/${SESSION_ID}/proc" || exit 1
> +        fi
> +
>          if [ "$CREATE_UNION" = "yes" ]; then
>              do_umount_all "$CHROOT_UNION_UNDERLAY_DIRECTORY"
>          fi



More information about the Buildd-tools-devel mailing list