summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authormmoss@google.com <mmoss@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-15 20:56:22 +0000
committermmoss@google.com <mmoss@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-15 20:56:22 +0000
commit6a61700060ce63e72b9b6dc70c2672c71d9e5438 (patch)
tree95842a61ac3677126d896aed1433c4d1309c6e90 /build
parentf1e6e0218795cf635c877a60dbd5e8be784b381d (diff)
downloadchromium_src-6a61700060ce63e72b9b6dc70c2672c71d9e5438.zip
chromium_src-6a61700060ce63e72b9b6dc70c2672c71d9e5438.tar.gz
chromium_src-6a61700060ce63e72b9b6dc70c2672c71d9e5438.tar.bz2
Add the chroot creator to the default set of allowed groups (with override flag).
This fixes a buildbot issue where chroots can't be used without sudo (because there is no 'admin' group, and chrome-bot only belongs to the 'chrome-bot' group). Review URL: http://codereview.chromium.org/3755010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62790 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-xbuild/install-chroot.sh21
1 files changed, 15 insertions, 6 deletions
diff --git a/build/install-chroot.sh b/build/install-chroot.sh
index 194c0d6..b5b3ccd 100755
--- a/build/install-chroot.sh
+++ b/build/install-chroot.sh
@@ -11,15 +11,21 @@
# Debian-derived system.
usage() {
- echo "usage: ${0##*/} [-m mirror]"
- echo "-m mirror an alternate repository mirror for package downloads"
- echo "-h this help message"
+ echo "usage: ${0##*/} [-m mirror] [-g group,...]"
+ echo "-g group,... groups that can use the chroot unauthenticated"
+ echo " Default: 'admin' and current user's group ('$(id -gn)')"
+ echo "-m mirror an alternate repository mirror for package downloads"
+ echo "-h this help message"
}
process_opts() {
local OPTNAME OPTIND OPTERR OPTARG
- while getopts ":m:h" OPTNAME; do
+ while getopts ":g:m:h" OPTNAME; do
case "$OPTNAME" in
+ g)
+ [ -n "${OPTARG}" ] &&
+ chroot_groups="${chroot_groups}${chroot_groups:+,}${OPTARG}"
+ ;;
m)
if [ -n "${mirror}" ]; then
echo "You can only specify exactly one mirror location"
@@ -167,6 +173,9 @@ fi
# Add new entry to /etc/schroot/schroot.conf
grep ubuntu.com /usr/share/debootstrap/scripts/"${distname}" >&/dev/null &&
brand="Ubuntu" || brand="Debian"
+if [ -z "${chroot_groups}" ]; then
+ chroot_groups="admin,$(id -gn)"
+fi
sudo sh -c 'cat >>/etc/schroot/schroot.conf' <<EOF
[${target%bit}]
description=${brand} ${distname} ${arch}
@@ -174,8 +183,8 @@ type=directory
directory=/var/lib/chroot/${target}
priority=3
users=root
-groups=admin
-root-groups=admin
+groups=${chroot_groups}
+root-groups=${chroot_groups}
personality=linux$([ "${arch}" != 64bit ] && echo 32)
script-config=script-${target}