aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-modules
diff options
context:
space:
mode:
authorJunichi Uekawa <dancer@netfort.gr.jp>2011-06-24 19:43:25 +0900
committerJunichi Uekawa <dancer@netfort.gr.jp>2011-06-24 19:43:25 +0900
commit19e1e507e3404cb7eb1e27199a83ffb84a628630 (patch)
tree8c2abc15cfadb71cc4f06e05110319698f4e25e9 /pbuilder-modules
parentb82c625202cbb0a46f47bb4eb7c25eac8eb8bb54 (diff)
downloadpbuilder-19e1e507e3404cb7eb1e27199a83ffb84a628630.tar
pbuilder-19e1e507e3404cb7eb1e27199a83ffb84a628630.tar.gz
From: Luca Falavigna <dktrkranz@debian.org>
tags 542837 + patch pending thanks Dear Junichi, I've prepared an NMU for pbuilder (versioned as 0.199+nmu3) and uploaded it to DELAYED/10. Please feel free to tell me if I should delay it longer. I tested this patchset on both kfreebsd-i386 and kfreebsd-amd64, and I can confirm they work as expected. Regards,
Diffstat (limited to 'pbuilder-modules')
-rw-r--r--pbuilder-modules19
1 files changed, 14 insertions, 5 deletions
diff --git a/pbuilder-modules b/pbuilder-modules
index aa3fc2a..3e55153 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -201,6 +201,7 @@ EOF
function umountproc () {
# push arguments on a stack to reverse direction.
local reversed
+ DEB_BUILD_ARCH_OS=$(dpkg-architecture -qDEB_BUILD_ARCH_OS)
reversed=
for mnt in $BINDMOUNTS; do
reversed="$mnt $reversed"
@@ -211,18 +212,21 @@ function umountproc () {
if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
umount_one "selinux"
fi
- if [ "$USEDEVPTS" = "yes" ]; then
+ if [ "$DEB_BUILD_ARCH_OS" = "linux" ] && [ "$USEDEVPTS" = "yes" ]; then
umount_one "dev/pts"
fi
if [ "$USEDEVFS" = "yes" ]; then
umount_one "dev"
fi
if [ "$USEPROC" = "yes" ]; then
- if [ -e $BUILDPLACE/proc/sys/fs/binfmt_misc/status ]; then
+ if [ "$DEB_BUILD_ARCH_OS" = "linux" ] && [ -e $BUILDPLACE/proc/sys/fs/binfmt_misc/status ]; then
umount_one "proc/sys/fs/binfmt_misc"
fi
umount_one "proc"
fi
+ if [ "$DEB_BUILD_ARCH_OS" = "kfreebsd" ]; then
+ umount_one "sys"
+ fi
}
@@ -230,10 +234,13 @@ function umountproc () {
# Also create a policy-rc.d script if it doesn't already exist.
function mountproc () {
local -a mounted
+ DEB_BUILD_ARCH_OS=$(dpkg-architecture -qDEB_BUILD_ARCH_OS)
if [ "$USEPROC" = "yes" ]; then
log "I: mounting /proc filesystem"
mkdir -p $BUILDPLACE/proc
- mount -t proc /proc "$BUILDPLACE/proc"
+ PROCFS="proc"
+ [ "$DEB_BUILD_ARCH_OS" = "kfreebsd" ] && PROCFS="linprocfs"
+ mount -t $PROCFS /proc "$BUILDPLACE/proc"
ln -s ../proc/mounts $BUILDPLACE/etc/mtab 2> /dev/null || true
mounted[${#mounted[@]}]="$BUILDPLACE/proc"
fi
@@ -243,7 +250,7 @@ function mountproc () {
mount -t devfs /dev "$BUILDPLACE/dev"
mounted[${#mounted[@]}]="$BUILDPLACE/dev"
fi
- if [ "$USEDEVPTS" = "yes" ]; then
+ if [ "$DEB_BUILD_ARCH_OS" = "linux" ] && [ "$USEDEVPTS" = "yes" ]; then
log "I: mounting /dev/pts filesystem"
mkdir -p $BUILDPLACE/dev/pts || true
TTYGRP=5
@@ -258,10 +265,12 @@ function mountproc () {
mount -t selinuxfs /selinux "$BUILDPLACE/selinux"
mounted[${#mounted[@]}]="$BUILDPLACE/selinux"
fi
+ MOUNTPARAMS="-obind"
+ [ "$DEB_BUILD_ARCH_OS" = "kfreebsd" ] && MOUNTPARAMS="-t nullfs"
for mnt in $BINDMOUNTS; do
log "I: Mounting $mnt"
if mkdir -p "$BUILDPLACE/$mnt" &&
- mount -obind "$mnt" "$BUILDPLACE/$mnt"; then
+ mount $MOUNTPARAMS "$mnt" "$BUILDPLACE/$mnt"; then
# successful.
mounted[${#mounted[@]}]="$mnt"
else