Skip to content

Instantly share code, notes, and snippets.

@bewest
Created January 24, 2016 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bewest/d6cd4ac6531acdbb9941 to your computer and use it in GitHub Desktop.
Save bewest/d6cd4ac6531acdbb9941 to your computer and use it in GitHub Desktop.
my rpi pbuilder config
#!/bin/sh
set -e
if [ "$OS" == "debian" ]; then
MIRRORSITE="http://ftp.no.debian.org/debian/"
COMPONENTS="main contrib non-free"
DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}"
"--keyring=/usr/share/keyrings/debian-archive-keyring.gpg")
: ${DIST:="wheezy"}
: ${ARCH:="amd64"}
if [ "$DIST" == "wheezy" ]; then
#EXTRAPACKAGES="$EXTRAPACKAGES debian-backports-keyring"
OTHERMIRROR="$OTHERMIRROR | deb $MIRRORSITE wheezy-backports $COMPONENTS"
fi
elif [ "$OS" == "raspbian" ]; then
MIRRORSITE="http://ftp.acc.umu.se/mirror/raspbian/raspbian/"
COMPONENTS="main contrib non-free"
DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}"
"--keyring=/usr/share/keyrings/raspbian-archive-keyring.gpg")
: ${DIST:="jessie"}
: ${ARCH:="armhf"}
elif [ "$OS" == "ubuntu" ]; then
MIRRORSITE="http://no.archive.ubuntu.com/ubuntu/"
COMPONENTS="main restricted universe multiverse"
DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}"
"--keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg")
else
echo "Unknown OS: $OS"
exit 1
fi
if [ "$DIST" == "" ]; then
echo "DIST is not set"
exit 1
fi
if [ "$ARCH" == "" ]; then
echo "ARCH is not set"
exit 1
fi
NAME="$OS-$DIST-$ARCH"
if [ "$ARCH" == "armel" ] && [ "$(dpkg --print-architecture)" != "armel" ]; then
DEBOOTSTRAP="qemu-debootstrap"
fi
if [ "$ARCH" == "armhf" ] && [ "$(dpkg --print-architecture)" != "armhf" ]; then
DEBOOTSTRAP="qemu-debootstrap"
fi
DEB_BUILD_OPTIONS="parallel=$(nproc) $DEB_BUILD_OPTIONS"
export DEB_BUILD_OPTIONS
DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" "--arch=$ARCH")
BASETGZ="/var/cache/pbuilder/$NAME-base.tgz"
DISTRIBUTION="$DIST"
BUILDRESULT="/var/cache/pbuilder/$NAME/result/"
APTCACHE="/var/cache/pbuilder/$NAME/aptcache/"
BUILDPLACE="/var/cache/pbuilder/build"
HOOKDIR="/var/cache/pbuilder/hook.d/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment