aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pbuilder-modules10
1 files changed, 6 insertions, 4 deletions
diff --git a/pbuilder-modules b/pbuilder-modules
index cd61f89..a983e62 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -214,7 +214,7 @@ function umountproc () {
umount_one "$mnt"
done
if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
- umount_one "selinux"
+ umount_one "$(grep -m 1 ^selinuxfs /proc/mounts | cut -d ' ' -f 2)"
fi
if [ "$DEB_BUILD_ARCH_OS" = "linux" ] && [ "$USEDEVPTS" = "yes" ]; then
umount_one "dev/pts"
@@ -295,9 +295,11 @@ function mountproc () {
fi
if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
log "I: mounting selinux filesystem"
- mkdir -p "$BUILDPLACE/selinux"
- mount -t selinuxfs /selinux "$BUILDPLACE/selinux"
- mounted[${#mounted[@]}]="$BUILDPLACE/selinux"
+ local SELINUX="$(grep -m 1 ^selinuxfs /proc/mounts | cut -d ' ' -f 2)"
+ mkdir -p "$BUILDPLACE/$SELINUX"
+ mount --bind "$SELINUX" "$BUILDPLACE/$SELINUX"
+ mount -o remount,ro,bind "$BUILDPLACE/$SELINUX"
+ mounted[${#mounted[@]}]="$BUILDPLACE/$SELINUX"
fi
if [ "$DEB_BUILD_ARCH_OS" = "hurd" ]; then
# /dev and /servers might have already been mounted at