Translation(s): English - espaƱol


A "porterbox" is a machine provided (generally) by the DSA team to help people port packages to various architectures (or ports as we call them) supported by the Debian project.

Search for "porterbox" on the Developer Machines page.

Porterboxes are generally configured to allow regular users to create new chroots using schroot. The DSA team has a short tutorial about how to use schroot on porterbox machines. By default, all DDs should have access to porterboxes, but you can request guest account accesses if necessary.

Short version is:

schroot -c sid

This will build a new chroot using the sid template and chroot into it. The environment will be destroyed when you exit.

It is recommended to use screen to switch between chroot and normal environment.

Blog post on how to debug on porterbox:

Some useful alias / snippet to append to your .bashrc:

# porterbox aliases start from 'p'
alias psetup='_alias_() { \
  count=$(schroot -l|grep chroot:sid_|wc -l); \
  arch_list=$(schroot -l|grep chroot:sid_|sed -e s/^chroot:sid_// -e s/-dchroot$//); \
  if [ $count -eq 1 ]; then \
    arch=$arch_list; \
  else \
    if [ -n "$1" ]; then \
      arch="$1"; \
    else \
      echo All schroot architectures supported on this host:; \
      echo $arch_list; \
      echo -n "Architecture to create: " && read arch; \
    fi; \
  fi; \
  set -x; \
  sessionID=${USER}-${arch}; \
  schroot-list-sessions; \
  schroot -b -c sid_${arch}-dchroot -n $sessionID; \
  dd-schroot-cmd -c $sessionID apt-get update; \
  dd-schroot-cmd -c $sessionID apt-get dist-upgrade -y; \
  dd-schroot-cmd -c $sessionID apt-get install -y git-buildpackage pristine-tar bash-completion ccache vim; \
  set +x; \
  echo Chroot ready to use: sid_${arch}-dchroot; \
  unset -f _alias_; \
};_alias_'
alias parch='_alias_(){ \
  count=$(schroot-list-sessions|cut -d: -f1|wc -l); \
  arch_list=$(schroot-list-sessions|cut -d: -f1|sed s/${USER}-//); \
  if [ $count -eq 0 ]; then \
    echo There is no schroot available, please use "psetup <arch>" to create one.; \
    unset -f _alias_; \
    return; \
  elif [ $count -eq 1 ]; then \
    arch=$arch_list; \
  else \
    if [ -n "$1" ]; then \
      arch="$1"; \
    else \
      echo All schroot architectures created on this host:; \
      echo $arch_list; \
      echo -n "Architecture to use: " && read arch; \
    fi; \
  fi; \
  set -x; \
  sessionID=${USER}-${arch}; \
  set +x; \
  echo Chroot: sid_${arch}-dchroot; \
  unset -f _alias_; \
};_alias_'
alias pdeps='_alias_(){ set -x;dd-schroot-cmd -c $sessionID apt-get build-dep -y "$1";set +x;unset -f _alias_;};_alias_'
alias pinstall='_alias_(){ set -x;dd-schroot-cmd -c $sessionID apt-get install -y "$@";set +x;unset -f _alias_;};_alias_'
alias pauu='_alias_(){ set -x;dd-schroot-cmd -c $sessionID apt-get update; dd-schroot-cmd -c $sessionID apt-get upgrade -y; set +x;unset -f _alias_;};_alias_'
alias pchroot='echo "Arch: $arch; Chroot: sid_${arch}-dchroot"; schroot -r -c $sessionID'
alias pend='set -x; schroot-list-sessions; schroot -e -c $sessionID; schroot-list-sessions; set +x'
alias plist='set -x; schroot-list-sessions; schroot --list --all-sessions; set +x'

With the snippet above, now you can create a new schroot and start to debug a new package <foo>:

$ psetup arm64
$ pdeps <foo> # install build-dep for package <foo>
$ gbp clone --pristine-tar https://salsa.debian.org/debian/foo.git
$ pinstall <bar> # [optional] if you still need to install package <bar>
$ pchroot
(dchroot)$ cd foo
(dchroot)$ gbp buildpackage -us -uc --git-ignore-branch --git-pristine-tar
(dchroot)$ logout
$ pend

In case you already have created the schroot, and login again:

$ parch arm64
$ pauu # [optional] apt-get update & upgrade
$ pchroot
(dchroot)$ cd foo
...
$ pend