summaryrefslogtreecommitdiffstats
path: root/bin/chroot-run.sh
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2014-05-23 13:19:15 +0200
committerHelmut Grohne <helmut@subdivi.de>2014-05-23 13:19:15 +0200
commitfd94a8edc5c5a4d884f41f13e528dc2136950f47 (patch)
tree3b55ebbede774c739f97f7ee4b25a3df6502cdb4 /bin/chroot-run.sh
parent8f2451764d0d08bc0cd6c2429f6b112ce388ddfe (diff)
downloadjenkins.debian.net-fd94a8edc5c5a4d884f41f13e528dc2136950f47.tar.xz
use minimal chroots for rebootstrap
This should reduce io-load on jenkins by not installing unneeded stuff.
Diffstat (limited to 'bin/chroot-run.sh')
-rwxr-xr-xbin/chroot-run.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/bin/chroot-run.sh b/bin/chroot-run.sh
index 05df628b..577fc62c 100755
--- a/bin/chroot-run.sh
+++ b/bin/chroot-run.sh
@@ -11,7 +11,7 @@ common_init "$@"
# $2 $3 ... = command to run inside a clean chroot running the distro in $1
if [ $# -lt 2 ]; then
- echo "usage: $0 DISTRO [backports] CMD [ARG1 ARG2 ...]"
+ echo "usage: $0 DISTRO [backports|minimal] CMD [ARG1 ARG2 ...]"
exit 1
fi
@@ -24,6 +24,11 @@ if [ "$1" == "backports" ] ; then
shift
fi
+if [ "$1" == "minimal" ] ; then
+ MINIMAL=yes
+ shift
+fi
+
if [ ! -d "$CHROOT_BASE" ]; then
echo "Directory $CHROOT_BASE does not exist, aborting."
exit 1
@@ -79,6 +84,9 @@ run() {
cat > $CHROOT_TARGET/tmp/chroot-testrun <<-EOF
$SCRIPT_HEADER
cd /tmp/testrun
+EOF
+ if [ "$MINIMAL" != "yes" ]; then
+ cat >> $CHROOT_TARGET/tmp/chroot-testrun <<-EOF
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/23jenkins
apt-get install build-essential devscripts git
if [ -f debian/control ] ; then
@@ -86,8 +94,9 @@ if [ -f debian/control ] ; then
# install build-depends
mk-build-deps -ir
fi
-$@
EOF
+ fi
+ echo "$*" >> $CHROOT_TARGET/tmp/chroot-testrun
chmod +x $CHROOT_TARGET/tmp/chroot-testrun
sudo chroot $CHROOT_TARGET /tmp/chroot-testrun