tags 354344 + patch fixed-upstream pending thanks Adeodato Simó <[EMAIL PROTECTED]> writes:
> the current implementation for session-managed plain chroots uses > mount --bind to mount the chroot under /var/lib/schroot/mount. Roger's > initial idea was to use mount --rbind, so that existing bind-mounts > would be preserved, but he discovered a bug in mount (#354298) that > prevents --rbind from being useful. > > This bug is a reminder to move from --bind to --rbind once #354298 is > fixed. Now schroot uses a helper (schroot-listmounts) to assist with filesystem unmounting, the bug in mount can be worked around by using /proc/mounts. I applied the following patch to SVN to do this. It will apply and work with 0.2.11-1 as well (but not earlier versions). Regards, Roger -- Roger Leigh Printing on GNU/Linux? http://gutenprint.sourceforge.net/ Debian GNU/Linux http://www.debian.org/ GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
Index: schroot/setup/10mount =================================================================== --- schroot/setup/10mount (revision 711) +++ schroot/setup/10mount (working copy) @@ -44,7 +44,7 @@ if [ "$CHROOT_TYPE" = "plain" ] || [ "$CHROOT_TYPE" = "file" ] || [ "$CHROOT_TYPE" = "block-device" ] || [ "$CHROOT_TYPE" = "lvm-snapshot" ]; then if [ "$CHROOT_TYPE" = "plain" ]; then - CHROOT_MOUNT_OPTIONS="--bind" + CHROOT_MOUNT_OPTIONS="--rbind" CHROOT_MOUNT_DEVICE="$CHROOT_LOCATION" fi @@ -75,11 +75,13 @@ do_mount "$CHROOT_MOUNT_OPTIONS" "$CHROOT_MOUNT_DEVICE" "$CHROOT_MOUNT_LOCATION" fi - do_mount "-t proc" "proc" "${CHROOT_PATH}/proc" - do_mount "-o rw,bind" "/dev/pts" "${CHROOT_PATH}/dev/pts" - do_mount "-t tmpfs" "tmpfs" "${CHROOT_PATH}/dev/shm" - do_mount "-o rw,bind" "/home" "${CHROOT_PATH}/home" - do_mount "-o rw,bind" "/tmp" "${CHROOT_PATH}/tmp" + if [ "$CHROOT_TYPE" != "plain" ]; then + do_mount "-t proc" "proc" "${CHROOT_PATH}/proc" + do_mount "-o rw,bind" "/dev/pts" "${CHROOT_PATH}/dev/pts" + do_mount "-t tmpfs" "tmpfs" "${CHROOT_PATH}/dev/shm" + do_mount "-o rw,bind" "/home" "${CHROOT_PATH}/home" + do_mount "-o rw,bind" "/tmp" "${CHROOT_PATH}/tmp" + fi elif [ $1 = "setup-stop" ]; then Index: debian/changelog =================================================================== --- debian/changelog (revision 711) +++ debian/changelog (working copy) @@ -1,6 +1,8 @@ schroot (0.99.0-1) unstable; urgency=low * New upstream release. + * Bind mounts are now used for session-managed plain chroots + (Closes: #354344). -- Index: ChangeLog =================================================================== --- ChangeLog (revision 711) +++ ChangeLog (working copy) @@ -1,5 +1,13 @@ 2006-06-13 Roger Leigh <[EMAIL PROTECTED]> + * debian/changelog: Close #354344. + + * schroot/setup/10mount: Mount plain chroots with --rbind rather + than --bind. This is safe now schroot-listmounts is used to + unmount all filesystems in the chroot. + +2006-06-13 Roger Leigh <[EMAIL PROTECTED]> + * THANKS: New file. Add Ben Hutchings. 2006-06-13 Roger Leigh <[EMAIL PROTECTED]>
pgpbomMUwXjed.pgp
Description: PGP signature