diff options
author | Gabriele Giacone <1o5g4r8o@gmail.com> | 2015-06-22 22:36:47 +0000 |
---|---|---|
committer | Mattia Rizzolo <mattia@mapreri.org> | 2015-06-22 22:36:47 +0000 |
commit | f9c2f5f21f213f59a8504beaa3fe3a99f1701aca (patch) | |
tree | c6c98f3e6f606de8c0a9ca0c242fdf4361355a42 | |
parent | 831310f93c3ee8665868997f7396f2421959e986 (diff) | |
download | pbuilder-f9c2f5f21f213f59a8504beaa3fe3a99f1701aca.tar pbuilder-f9c2f5f21f213f59a8504beaa3fe3a99f1701aca.tar.gz |
Add support for hurd
Closes: #753801
-rwxr-xr-x | pbuilder-createbuildenv | 6 | ||||
-rw-r--r-- | pbuilder-modules | 42 | ||||
-rw-r--r-- | pbuilderrc | 2 |
3 files changed, 39 insertions, 11 deletions
diff --git a/pbuilder-createbuildenv b/pbuilder-createbuildenv index 8362b1c..8979bd5 100755 --- a/pbuilder-createbuildenv +++ b/pbuilder-createbuildenv @@ -68,12 +68,12 @@ fi # FIXME if the end-user passes another --include= to debootstrap in # DEBOOTSTRAPOPTS, it will override the --include=apt one and apt might not be # installed -if ! ( cd "$BUILDPLACE" && \ - "${DEBOOTSTRAP}" ${ARCHITECTURE:+--arch=$ARCHITECTURE} \ +if ! ( "${DEBOOTSTRAP}" \ + ${ARCHITECTURE:+--arch=$ARCHITECTURE} \ --include=apt \ "${DEBOOTSTRAPOPTS[@]}" \ "$DISTRIBUTION" \ - . \ + "$BUILDPLACE" \ "$MIRRORSITE" \ $DEBOOTSTRAPSCRIPT ) ; then log "E: $DEBOOTSTRAP failed" 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 @@ -4,7 +4,7 @@ BASETGZ=/var/cache/pbuilder/base.tgz #EXTRAPACKAGES="" #export DEBIAN_BUILDARCH=athlon -BUILDPLACE=/var/cache/pbuilder/build/ +BUILDPLACE=/var/cache/pbuilder/build MIRRORSITE=http://cdn.debian.net/debian #OTHERMIRROR="deb http://www.home.com/updates/ ./" #export http_proxy=http://your-proxy:8080/ |