This documentation page will guide you thwough the configuration of a build environment to cross-build dsc packages and obtain the binary deb packages for all the architectures supported by our distribution

This is how we set up our build servers and this is how you can reproduce the same environment to test your own dsc source packages before submitting them to us

The OS

Install Parrot OS amd64, it doesn't matter what edition, what does matter here is to have a working parrot core (this should work on debian too)

Tip:

during the installation we suggest to use btrfs as your filesystem to take advantage of its snapshots/subvolumes feature

Useful packages

To install all the needed packages for our setup, launch the following commands

sudo apt update # refresh the packages list
sudo apt dist-upgrade # do a full system upgrade
sudo apt autoremove # remove old useless dependencies no longer required after the upgrade
sudo apt install ubuntu-dev-tools devscripts build-essential schroot sbuild git-buildpackage debhelper debootstrap

Preliminary Setup

You need to configure the envronment to correctly create your environment

echo -e "SCHROOT_CONF_SUFFIX=\"source-root-users=root,sbuild,admin
source-root-groups=root,sbuild,admin
preserve-environment=true
\"" > $HOME/.mk-sbuild.rc

sg sbuild
sbuild-update --keygen

Create Sbuild chroots

Now we need to create a schroot environment for each architecture we want to be able to compile for

let's suppose we want to support amd64, i386 and armhf:

mk-sbuild \
--arch=amd64 \
--name=parrot \
--skip-updates \
--skip-proposed \
--skip-security \
--debootstrap-mirror=http://archive.parrotsec.org/parrot \
--debootstrap-keyring=/usr/share/keyrings/parrot-archive-keyring.gpg \
--debootstrap-include=gnupg2,parrot-archive-keyring,apt-transport-https,nano,postfix,ca-certificates,debian-keyring \
--distro=debian \
parrot


mk-sbuild \
--arch=i386 \
--name=parrot \
--skip-updates \
--skip-proposed \
--skip-security \
--debootstrap-mirror=http://archive.parrotsec.org/parrot \
--debootstrap-keyring=/usr/share/keyrings/parrot-archive-keyring.gpg \
--debootstrap-include=gnupg2,parrot-archive-keyring,apt-transport-https,nano,postfix,ca-certificates,debian-keyring \
--distro=debian \
parrot


mk-sbuild \
--arch=armhf \
--name=parrot \
--skip-updates \
--skip-proposed \
--skip-security \
--debootstrap-mirror=http://archive.parrotsec.org/parrot \
--debootstrap-keyring=/usr/share/keyrings/parrot-archive-keyring.gpg \
--debootstrap-include=gnupg2,parrot-archive-keyring,apt-transport-https,nano,postfix,ca-certificates,debian-keyring \
--distro=debian \
parrot

mk-sbuild \
--arch=arm64 \
--name=parrot \
--skip-updates \
--skip-proposed \
--skip-security \
--debootstrap-mirror=http://archive.parrotsec.org/parrot \
--debootstrap-keyring=/usr/share/keyrings/parrot-archive-keyring.gpg \
--debootstrap-include=gnupg2,parrot-archive-keyring,apt-transport-https,nano,postfix,ca-certificates,debian-keyring \
--distro=debian \
parrot

if you use btrfs as your filesystem you can also add the

--type=btrfs-snapshot

option to create the container as a btrfs snapshot

Post Installation Steps

Now you have your schroot environment set up and almost ready to be used.

we strongly recommend to do the following steps to enter each schroot environment and apply some post-installation steps

sudo schroot -u root -d / --all-source-chroots parrot-mirror-selector default testing
sudo schroot -u root -d / --all-source-chroots apt update
sudo schroot -u root -d / --all-source-chroots apt install devscripts debhelper postfix