For setting up sbuild with schroot, I'm now using the ubuntu package sbuild-launchpad-chroot Its quite easy to set up a new sbuild or schroot that way.
Install the package
$ apt-get install sbuild-launchpad-chroot
Build yourself sbuild chroots.
$ rel="cosmic"; arch="amd64"
$ sudo sbuild-launchpad-chroot create \
--architecture="$arch" "--name=$rel-$arch" "--series=$rel"
Build!
$ sbuild --resolve-alternatives --dist=cosmic --arch=amd64 --arch-all my.dsc
I find that sbuild cli can be painful. I've written
sbuild-it
to do the
right thing. You feed it a dsc or a changes file and it figures out where
to build it and does that.
I use the 91smoser-schroot-setup
script here to apply my local customizations
to the schroot. This results in no local maintenance, as the script does it
all on each new chroot.
I add a 'user-$rel-$arch' schroot that has /home mounted. Note that my
/etc/schroot/default/fstab
file has the /home
entry with rbind
instead of
bind
. That is due to bug 769595
related to private home.
$ sbconf=/etc/schroot/chroot.d/$rel-$arch
$ userconf="/etc/schroot/chroot.d/user-$rel-$arch"
$ sudo cp "$sbconf" "$userconf"
$ sudo sed -i \
-e "s,^\[$rel-$arch\],[user-$rel-$arch]," \
-e "s,^profile=sbuild,profile=default," \
-e "s,^description=,description=schroot with /home based on $rel-$arch," \
-e "/^aliases=/d" \
"$userconf"