From d3f73c2fed53074ffdfb231afa85b2d67c90c6ee Mon Sep 17 00:00:00 2001 From: "Christopher James Halse Rogers (RAOF)" Date: Thu, 26 Jul 2007 16:13:48 +1000 Subject: [PATCH 1/2] sbuild now fails when chroot_mode is defined, remove it from template config --- mk-sbuild-lv | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mk-sbuild-lv b/mk-sbuild-lv index fcbf17b..a21617a 100755 --- a/mk-sbuild-lv +++ b/mk-sbuild-lv @@ -52,11 +52,6 @@ if [ ! -w /var/lib/sbuild ]; then # (mandatory, no default!). \$maintainer_name='$USER <$USER@localhost>'; -# Chroot behaviour; possible values are "split" (apt and dpkg are run -# from the host system) and "schroot" (all package operations are done in -# the chroot with schroot, but the chroot must allow networking) -\$chroot_mode = "schroot"; - # Directory for chroot symlinks and sbuild logs. Defaults to the # current directory if unspecified. #\$build_dir='$HOME/ubuntu/build'; From 0346700ec3ad30b9f1ff5ecaba1a1ac1c500a010 Mon Sep 17 00:00:00 2001 From: "Christopher James Halse Rogers (RAOF)" Date: Thu, 26 Jul 2007 16:15:41 +1000 Subject: [PATCH 2/2] Make building debian chroots with mk-sbuild-lv more friendly - Add --source-template option (useful for having different Ubuntu/Debian templates - Add --debootstrap-mirror option (more discoverable than setting DEBOOTSTRAP_MIRROR) --- mk-sbuild-lv | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/mk-sbuild-lv b/mk-sbuild-lv index a21617a..a71a9cb 100755 --- a/mk-sbuild-lv +++ b/mk-sbuild-lv @@ -83,9 +83,11 @@ function usage() { echo "Usage: $0 [OPTIONS] VG Release" >&2 echo "Options:" - echo " --arch=ARCH What architecture to select" - echo " --name=NAME Base name for the schroot (arch is appended)" - echo " --debug Turn on script debugging" + echo " --arch=ARCH What architecture to select" + echo " --name=NAME Base name for the schroot (arch is appended)" + echo " --debug Turn on script debugging" + echo " --source-template=FILE Use FILE as the sources.list template" + echo " --debootstrap-mirror=URL Use URL as the debootstrap source" exit 1 } @@ -93,7 +95,7 @@ function usage() if [ -z "$1" ]; then usage fi -OPTS=`getopt -o '' --long "help,debug,arch:,name::" -- "$@"` +OPTS=`getopt -o '' --long "help,debug,arch:,name:,source-template:,debootstrap-mirror:" -- "$@"` eval set -- "$OPTS" name="" @@ -113,6 +115,18 @@ while :; do name="$2" shift 2 ;; + --source-template) + TEMPLATE_SOURCES="$2" + shift 2 + if [ ! -r $TEMPLATE_SOURCES ]; then + echo "W: Template file $TEMPLATE_SOURCES is not readable" + echo "W: Continuing with default sources!" + fi + ;; + --debootstrap-mirror) + DEBOOTSTRAP_MIRROR="$2" + shift 2 + ;; --) shift break @@ -164,7 +178,9 @@ sudo mount "$CHROOT_PATH" "$MNT" sudo debootstrap $arch_opt $variant_opt "$RELEASE" "$MNT" "${DEBOOTSTRAP_MIRROR:-http://archive.ubuntu.com/ubuntu}" # Update the package sources TEMP_SOURCES=`mktemp -t sources-XXXXXX` -TEMPLATE_SOURCES=~/.mk-sbuild-lv.sources +if [ -z "$TEMPLATE_SOURCES" ]; then + TEMPLATE_SOURCES=~/.mk-sbuild-lv.sources +fi if [ -r "$TEMPLATE_SOURCES" ]; then cat "$TEMPLATE_SOURCES" > "$TEMP_SOURCES" else @@ -224,7 +240,7 @@ set -e # Reload package lists apt-get update || true # Pull down signature requirements -apt-get -y --force-yes install gnupg ubuntu-keyring +#apt-get -y --force-yes install gnupg ubuntu-keyring # Reload package lists apt-get update || true # Disable debconf questions so that automated builds won't prompt