[buildd-tools-devel] Bug#605950: schroot: Some mountable chroots do not respect mount-options in config file

Nelson Elhage nelhage at MIT.EDU
Sat Dec 4 22:49:26 UTC 2010


Package: schroot
Version: 1.4.14-1
Severity: normal
Tags: patch


10mount, when computing mount options for some chroot types
(e.g. loopback) overrides the mount options set in config, instead of
using both sets.

-- System Information:
Debian Release: 5.0.6
  APT prefers stable
  APT policy: (700, 'stable'), (400, 'testing'), (300, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages schroot depends on:
ii  libboost-filesystem1.42.0 1.42.0-4       filesystem operations (portable pa
ii  libboost-program-options1 1.42.0-4       program options library for C++
ii  libboost-regex1.42.0      1.42.0-4       regular expression library for C++
ii  libboost-system1.42.0     1.42.0-4       Operating system (e.g. diagnostics
ii  libc6                     2.7-18lenny6   GNU C Library: Shared libraries
ii  libgcc1                   1:4.3.2-1.1    GCC support library
ii  liblockdev1               1.0.3-1.2+b1   Run-time shared library for lockin
ii  libpam0g                  1.0.1-5+lenny1 Pluggable Authentication Modules l
ii  libstdc++6                4.4.5-4        The GNU Standard C++ Library v3
ii  libuuid1                  2.17.2-3.3     Universally Unique ID library
ii  schroot-common            1.4.14-1       common files for schroot

schroot recommends no packages.

Versions of packages schroot suggests:
ii  aufs-modules- 2.6.26+0+20080719-6+lenny3 Stackable unification filesystem f
pn  btrfs-tools   <none>                     (no description available)
ii  debootstrap   1.0.10lenny1               Bootstrap a basic Debian system
ii  lvm2          2.02.39-8                  The Linux Logical Volume Manager
ii  unzip         5.52-12                    De-archiver for .zip files

-- no debconf information
-------------- next part --------------
>From 9340a5e9bee5bba6d4d5aee4b36a5c9cb3dfd30d Mon Sep 17 00:00:00 2001
From: Nelson Elhage <nelhage at ksplice.com>
Date: Sat, 4 Dec 2010 17:32:10 -0500
Subject: [PATCH] Make all mountable chroots respect mount options from configuration.

For some chroots we were setting mount options inside the script, which entirel
overrode the ones the user passed in. Combine them, instead.
---
 etc/setup.d/10mount |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/etc/setup.d/10mount b/etc/setup.d/10mount
index 351f430..b6c5ebc 100755
--- a/etc/setup.d/10mount
+++ b/etc/setup.d/10mount
@@ -131,20 +131,20 @@ if [ "$CHROOT_TYPE" = "directory" ] \
 	esac
 
 	if [ "$CHROOT_TYPE" = "directory" ]; then
-	    CHROOT_MOUNT_OPTIONS="$BINDOPT"
+	    CHROOT_MOUNT_OPTIONS="$BINDOPT $CHROOT_MOUNT_OPTIONS"
 	    CHROOT_MOUNT_DEVICE="$CHROOT_DIRECTORY"
 	    if [ ! -d "$CHROOT_DIRECTORY" ]; then
 		fatal "Directory '$CHROOT_DIRECTORY' does not exist"
 	    fi
 	elif [ "$CHROOT_TYPE" = "file" ]; then
-	    CHROOT_MOUNT_OPTIONS="$BINDOPT"
+	    CHROOT_MOUNT_OPTIONS="$BINDOPT $CHROOT_MOUNT_OPTIONS"
 	    CHROOT_MOUNT_DEVICE="${CHROOT_FILE_UNPACK_DIR}/${SESSION_ID}"
 	elif [ "$CHROOT_TYPE" = "block-device" ]; then
 	    if [ ! "$DEVTYPE" "$CHROOT_DEVICE" ]; then
 		fatal "Device '$CHROOT_DEVICE' does not exist"
 	    fi
 	elif [ "$CHROOT_TYPE" = "btrfs-snapshot" ]; then
-	    CHROOT_MOUNT_OPTIONS="$BINDOPT"
+	    CHROOT_MOUNT_OPTIONS="$BINDOPT $CHROOT_MOUNT_OPTIONS"
 	    CHROOT_MOUNT_DEVICE="$CHROOT_BTRFS_SNAPSHOT_NAME"
 	elif [ "$CHROOT_TYPE" = "loopback" ]; then
 	    if [ ! -f "$CHROOT_FILE" ]; then
@@ -155,16 +155,14 @@ if [ "$CHROOT_TYPE" = "directory" ] \
 		freebsd* | k*bsd*-gnu):
 		    LOOP_DEVICE="/dev/$(/sbin/mdconfig -a -t vnode -f "$CHROOT_FILE")"
 		    CHROOT_MOUNT_DEVICE="$LOOP_DEVICE"
-		    CHROOT_MOUNT_OPTIONS=""
 		    ;;
 		*):
 		    LOOP_DEVICE="$(/sbin/losetup -j "$CHROOT_FILE" | sed -e 's/:.*$//')"
 		    if [ -z "$LOOP_DEVICE" ]; then
 			CHROOT_MOUNT_DEVICE="$CHROOT_FILE"
-			CHROOT_MOUNT_OPTIONS="-o loop"
+			CHROOT_MOUNT_OPTIONS="-o loop $CHROOT_MOUNT_OPTIONS"
 		    else
 			CHROOT_MOUNT_DEVICE="$LOOP_DEVICE"
-			CHROOT_MOUNT_OPTIONS=""
 		    fi
 		    ;;
 	    esac
-- 
1.7.1.31.g6297e



More information about the Buildd-tools-devel mailing list