mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-24 23:21:17 +02:00
BUG=quickfix for bot break TEST=run ./update_chroot Change-Id: I459d50f3e3374c1ff8ff8fc692c8ba7f3582bbd5 Reviewed-on: http://gerrit.chromium.org/gerrit/743 Tested-by: David James <davidjames@chromium.org> Reviewed-by: David James <davidjames@chromium.org>
47 lines
1.4 KiB
Bash
Executable File
47 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
# Performs an update of the chroot.
|
|
|
|
# Load common CrOS utilities. Inside the chroot this file is installed in
|
|
# /usr/lib/crosutils. Outside the chroot we find it relative to the script's
|
|
# location.
|
|
. "$(dirname $0)/common.sh" || ! echo "Unable to load common.sh" || exit 1
|
|
|
|
# Script must run inside the chroot
|
|
assert_inside_chroot "$@"
|
|
|
|
# Flags
|
|
DEFINE_boolean usepkg $FLAGS_TRUE \
|
|
"Use binary packages to bootstrap."
|
|
DEFINE_boolean fast ${DEFAULT_FAST} "Call many emerges in parallel"
|
|
DEFINE_integer retries -1 \
|
|
"On build failure, the number of times to retry."
|
|
|
|
# Parse command line flags
|
|
FLAGS "$@" || exit 1
|
|
eval set -- "${FLAGS_ARGV}"
|
|
|
|
# Only now can we die on error. shflags functions leak non-zero error codes,
|
|
# so will die prematurely if 'set -e' is specified before now.
|
|
set -e
|
|
|
|
info "Updating chroot"
|
|
|
|
EMERGE_FLAGS="-uDNv --with-bdeps=y"
|
|
|
|
# Perform an update of hard-host-depends and world in the chroot.
|
|
EMERGE_CMD="emerge"
|
|
if [ "${FLAGS_fast}" -eq "${FLAGS_TRUE}" ]; then
|
|
EMERGE_CMD="${GCLIENT_ROOT}/chromite/bin/parallel_emerge"
|
|
fi
|
|
if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then
|
|
EMERGE_CMD="${EMERGE_CMD} -g"
|
|
fi
|
|
eretry sudo -E ${EMERGE_CMD} ${EMERGE_FLAGS} \
|
|
chromeos-base/hard-host-depends world
|
|
|