diff options
Diffstat (limited to 'etc/schroot')
-rw-r--r-- | etc/schroot/experimental.sources.list | 2 | ||||
-rw-r--r-- | etc/schroot/schroot.conf | 47 | ||||
-rwxr-xr-x | etc/schroot/setup.d/60append-apt-sources | 34 | ||||
-rwxr-xr-x | etc/schroot/setup.d/80append-apt-sources | 13 |
4 files changed, 96 insertions, 0 deletions
diff --git a/etc/schroot/experimental.sources.list b/etc/schroot/experimental.sources.list new file mode 100644 index 0000000..29aa5d0 --- /dev/null +++ b/etc/schroot/experimental.sources.list @@ -0,0 +1,2 @@ +deb http://localhost:9999/debian experimental main +deb-src http://localhost:9999/debian experimental main diff --git a/etc/schroot/schroot.conf b/etc/schroot/schroot.conf new file mode 100644 index 0000000..04d80a4 --- /dev/null +++ b/etc/schroot/schroot.conf @@ -0,0 +1,47 @@ +# schroot chroot definitions. +# See schroot.conf(5) for complete documentation of the file format. + +[sid-snap] +type=lvm-snapshot +description=Debian sid LVM snapshot +groups=sbuild,root +root-users=rak +root-groups=root,sbuild +source-root-users=rak +device=/dev/tosh/sid_amd64_chroot +lvm-snapshot-options=--size 5G +aliases=unstable,unstable-amd64,default + +[experimental-snap] +type=lvm-snapshot +description=Debian experimental LVM snapshot +groups=sbuild,root +root-users=rak +root-groups=root,sbuild +source-root-users=rak +device=/dev/tosh/sid_amd64_chroot +lvm-snapshot-options=--size 5G +aliases=experimental,experimental-amd64 + +[stretch-snap] +type=lvm-snapshot +description=Debian stretch LVM snapshot +groups=sbuild,root +root-users=rak +root-groups=root,sbuild +source-root-users=rak +device=/dev/tosh/stretch_amd64_chroot +lvm-snapshot-options=--size 5G +aliases=stretch,stretch-amd64 + +[anki] +type=lvm-snapshot +profile=desktop +preserve-environment=true +description=Anki chroot +groups=sbuild,root +root-users=rak +root-groups=root,sbuild +source-root-users=rak +device=/dev/tosh/anki +lvm-snapshot-options=--size 3G diff --git a/etc/schroot/setup.d/60append-apt-sources b/etc/schroot/setup.d/60append-apt-sources new file mode 100755 index 0000000..c98b8ce --- /dev/null +++ b/etc/schroot/setup.d/60append-apt-sources @@ -0,0 +1,34 @@ +#!/bin/sh +# https://www.pseudorandom.co.uk/2007/sbuild/ +# /etc/schroot/setup.d/60append-apt-sources + +AUTH_VERBOSITY="verbose" + +if [ $1 = "setup-start" ] || [ $1 = "setup-recover" ]; then + + NAME=$(echo "${CHROOT_NAME}" | sed -e 's/-[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]-[a-z0-9][a-z0-9][a-z0-9][a-z0-9]-[a-z0-9][a-z0-9][a-z0-9][a-z0-9]-[a-z0-9][a-z0-9][a-z0-9][a-z0-9]-[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]//g') + + EXTRA_APT_SOURCES="/etc/schroot/sources.list.d/${NAME}.sources.list" + APT_PREFS="/etc/schroot/sources.list.d/${NAME}.preferences" + + if [ "$AUTH_VERBOSITY" = "verbose" ]; then + echo "Checking for auxiliary apt sources in $EXTRA_APT_SOURCES" >&2 + fi + if [ -e "$EXTRA_APT_SOURCES" ]; then + if [ "$AUTH_VERBOSITY" = "verbose" ]; then + echo "... extra apt sources found" >&2 + fi + cat "$EXTRA_APT_SOURCES" >> "${CHROOT_PATH}/etc/apt/sources.list" + fi + + if [ "$AUTH_VERBOSITY" = "verbose" ]; then + echo "Checking for apt preferences in $APT_PREFS" >&2 + fi + if [ -e "$APT_PREFS" ]; then + if [ "$AUTH_VERBOSITY" = "verbose" ]; then + echo "... apt preferences found" >&2 + fi + install -m644 "$APT_PREFS" "${CHROOT_PATH}/etc/apt/preferences" + fi + +fi diff --git a/etc/schroot/setup.d/80append-apt-sources b/etc/schroot/setup.d/80append-apt-sources new file mode 100755 index 0000000..953a5b1 --- /dev/null +++ b/etc/schroot/setup.d/80append-apt-sources @@ -0,0 +1,13 @@ +#!/bin/sh +# /etc/schroot/setup.d/80apt-get-update + +EXTRA_APT_SOURCES="/etc/schroot/sources.list.d/${CHROOT_NAME}.sources.list" +APT_PREFS="/etc/schroot/sources.list.d/${CHROOT_NAME}.preferences" + +if [ -f "EXTRA_APT_SOURCES" -a $1 = "setup-start" ]; then + if : || [ "$AUTH_VERBOSITY" = "verbose" ]; then + chroot "${CHROOT_PATH}" apt-get update >&2 || true + else + chroot "${CHROOT_PATH}" apt-get update >/dev/null || true + fi +fi |