From 6a61700060ce63e72b9b6dc70c2672c71d9e5438 Mon Sep 17 00:00:00 2001 From: "mmoss@google.com" Date: Fri, 15 Oct 2010 20:56:22 +0000 Subject: 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 --- build/install-chroot.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'build') 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' <