aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-modules
diff options
context:
space:
mode:
authorGabriele Giacone <1o5g4r8o@gmail.com>2015-06-22 22:36:47 +0000
committerMattia Rizzolo <mattia@mapreri.org>2015-06-22 22:36:47 +0000
commitf9c2f5f21f213f59a8504beaa3fe3a99f1701aca (patch)
treec6c98f3e6f606de8c0a9ca0c242fdf4361355a42 /pbuilder-modules
parent831310f93c3ee8665868997f7396f2421959e986 (diff)
downloadpbuilder-f9c2f5f21f213f59a8504beaa3fe3a99f1701aca.tar
pbuilder-f9c2f5f21f213f59a8504beaa3fe3a99f1701aca.tar.gz
Add support for hurd
Closes: #753801
Diffstat (limited to 'pbuilder-modules')
-rw-r--r--pbuilder-modules42
1 files changed, 35 insertions, 7 deletions
diff --git a/pbuilder-modules b/pbuilder-modules
index 293e3d9..2674773 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -153,6 +153,7 @@ function seems_truly_unmounted() {
}
function umount_one () {
+ DEB_BUILD_ARCH_OS=$(dpkg-architecture -qDEB_BUILD_ARCH_OS)
if [ "${IGNORE_UMOUNT}" = "yes" ]; then
# support ignore umount option.
log "I: ignoring umount of $1 filesystem"
@@ -221,7 +222,7 @@ function umountproc () {
if [ "$USEDEVFS" = "yes" ]; then
umount_one "dev"
fi
- if [ "$USERUNSHM" = "yes" ]; then
+ if [ "$USERUNSHM" = "yes" ] && [ "$DEB_BUILD_ARCH_OS" != "hurd" ]; then
umount_one "run/shm"
fi
if [ "$USEPROC" = "yes" ]; then
@@ -233,6 +234,17 @@ function umountproc () {
if [ "$DEB_BUILD_ARCH_OS" = "kfreebsd" ]; then
umount_one "sys"
fi
+ if [ "$DEB_BUILD_ARCH_OS" = "hurd" ]; then
+ umount_one "servers"
+ umount_one "dev"
+
+ # Workaround to remove chroot on Hurd: once /dev firmlink is
+ # removed, chroot removal either gets stuck or fails by removing
+ # some devices.
+ for dev in $BUILDPLACE/dev/{netdde,tty*,pty*,fd,vcs}; do
+ settrans -fg $dev
+ done
+ fi
}
@@ -243,12 +255,20 @@ function mountproc () {
DEB_BUILD_ARCH_OS=$(dpkg-architecture -qDEB_BUILD_ARCH_OS)
if [ "$USEPROC" = "yes" ]; then
log "I: mounting /proc filesystem"
- mkdir -p $BUILDPLACE/proc
- PROCFS="proc"
- if [ "$DEB_BUILD_ARCH_OS" = "kfreebsd" ]; then
- PROCFS="linprocfs"
- fi
- mount -t $PROCFS /proc "$BUILDPLACE/proc"
+ mkdir -p "$BUILDPLACE"/proc
+ case "$DEB_BUILD_ARCH_OS" in
+ kfreebsd)
+ PROCFS="linprocfs"
+ ;;
+ hurd)
+ settrans -fg "$BUILDPLACE/proc"
+ PROCFS="firmlink"
+ ;;
+ *)
+ PROCFS="proc"
+ ;;
+ esac
+ mount -t "$PROCFS" /proc "$BUILDPLACE/proc" || [ "$DEB_BUILD_ARCH_OS" = hurd ]
ln -s ../proc/mounts $BUILDPLACE/etc/mtab 2> /dev/null || true
mounted[${#mounted[@]}]="$BUILDPLACE/proc"
fi
@@ -279,6 +299,14 @@ function mountproc () {
mount -t selinuxfs /selinux "$BUILDPLACE/selinux"
mounted[${#mounted[@]}]="$BUILDPLACE/selinux"
fi
+ if [ "$DEB_BUILD_ARCH_OS" = "hurd" ]; then
+ # /dev and /servers might have already been mounted at
+ # debootstrap chroot creation
+ mount -t firmlink /dev "$BUILDPLACE/dev" || true
+ mounted[${#mounted[@]}]="$BUILDPLACE/dev"
+ mount -t firmlink /servers "$BUILDPLACE/servers" || true
+ mounted[${#mounted[@]}]="$BUILDPLACE/servers"
+ fi
MOUNTPARAMS="-obind"
[ "$DEB_BUILD_ARCH_OS" = "kfreebsd" ] && MOUNTPARAMS="-t nullfs"
for mnt in $BINDMOUNTS; do