#!/bin/bash # Copyright (c) 2012 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. . "$(dirname "$0")/common.sh" || exit 1 # Script must run inside the chroot assert_inside_chroot "$@" # Do not run as root assert_not_root_user # Developer-visible flags. DEFINE_boolean usepkg $FLAGS_TRUE \ "Use binary packages to bootstrap." DEFINE_boolean getbinpkg $FLAGS_TRUE \ "Download binary packages from remote repository." FLAGS_HELP="usage: $(basename $0) [flags] Performs an update of the chroot. This script is called as part of build_packages, so there is typically no need to call this script directly. " show_help_if_requested "$@" # The following options are advanced options, only available to those willing # to read the source code. They are not shown in help output, since they are # not needed for the typical developer workflow. DEFINE_integer jobs "${NUM_JOBS}" \ "How many packages to build in parallel at maximum." DEFINE_boolean skip_toolchain_update $FLAGS_FALSE \ "Don't update the toolchains." DEFINE_string toolchain_boards "" \ "Extra toolchains to setup for the specified boards." # 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 'switch_to_strict_mode' is specified before now. switch_to_strict_mode . "${BUILD_LIBRARY_DIR}/toolchain_util.sh" PORTAGE_STABLE_OVERLAY="/usr/local/portage/stable" CROSSDEV_OVERLAY="/usr/local/portage/crossdev" COREOS_OVERLAY="/usr/local/portage/coreos" COREOS_CONFIG="${COREOS_OVERLAY}/coreos/config" info "Setting up portage..." sudo mkdir -p "/etc/portage/repos.conf/" sudo rm -f "/etc/portage/make.conf" sudo touch "/etc/portage/make.conf.user" sudo_clobber "/etc/portage/make.conf" < /dev/null sudo mkdir -p "/${CROSSDEV_OVERLAY}/metadata" sudo tee "/${CROSSDEV_OVERLAY}/metadata/layout.conf" > /dev/null <