1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#!/bin/sh
#
# Copyright 2009 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
#
# Author: Daniel Silverstone <daniel.silverstone@canonical.com>
# Buildd Slave tool to mount a chroot
# Expects build id as arg 1, makes build-id to contain the build
# Needs SUDO to be set to a sudo instance for passwordless access
SUDO=/usr/bin/sudo
BUILDID="$1"
GREP=/bin/grep
CUT=/usr/bin/cut
XARGS=/usr/bin/xargs
set -e
exec 2>&1
echo "Unmounting chroot for build $BUILDID..."
#$SUDO umount "$HOME/build-$BUILDID/chroot-autobuild/proc"
#$SUDO umount "$HOME/build-$BUILDID/chroot-autobuild/dev/pts"
#$SUDO umount "$HOME/build-$BUILDID/chroot-autobuild/home/buildd/.ccache"
#$SUDO umount "$HOME/build-$BUILDID/chroot-autobuild/var/cache/apt/archives"
$GREP "$HOME/build-$BUILDID/chroot-autobuild" /proc/mounts | \
$CUT -d\ -f2 | $XARGS -r -n 1 $SUDO umount
|