From f9c2f5f21f213f59a8504beaa3fe3a99f1701aca Mon Sep 17 00:00:00 2001 From: Gabriele Giacone <1o5g4r8o@gmail.com> Date: Mon, 22 Jun 2015 22:36:47 +0000 Subject: Add support for hurd Closes: #753801 --- pbuilder-modules | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) (limited to 'pbuilder-modules') 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 -- cgit v1.2.3