Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: bin/cros_overlay_list

Issue 6392034: Move cros_overlay_list to src/platform/dev. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/cros_overlay_list
diff --git a/bin/cros_overlay_list b/bin/cros_overlay_list
deleted file mode 100755
index 7031068261db71568b91fabc5147c27476a6f2c0..0000000000000000000000000000000000000000
--- a/bin/cros_overlay_list
+++ /dev/null
@@ -1,158 +0,0 @@
-#!/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.
-
-# This script generates the list of board overlays and variants.
-
-# Load common CrOS utilities. Inside the chroot this file is installed in
-# /usr/lib/crosutils. Outside the chroot we find it relative to the scripts
-# location.
-common_paths="/usr/lib/crosutils $(dirname "$0")/.."
-
-for path in ${common_paths} ; do
- if [ -f "${path}/common.sh" ] ; then
- COMMON_SH="${path}/common.sh"
- break
- fi
-done
-
-if [ -z "${COMMON_SH}" ] ; then
- error "common.sh not found in search path (${common_paths})"
- exit 1
-fi
-
-. "${COMMON_SH}"
-
-get_default_board
-
-# Flags
-DEFINE_string board "$DEFAULT_BOARD" "The name of the board to set up."
-DEFINE_string board_overlay "" "Location of the board overlay."
-DEFINE_boolean primary_only ${FLAGS_FALSE} \
- "Only return the path to the board's primary overlay. (Default: false)"
-DEFINE_string variant "" "Board variant."
-
-# 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
-
-if [ -z "$FLAGS_board" ] ; then
- error "--board required."
- exit 1
-fi
-
-if [[ $FLAGS_board =~ [_\ ] ]] ; then
- error "--board name must not contain an underscore (_) or a space ( )."
- exit 1
-fi
-
-if [[ $FLAGS_variant =~ [_\ ] ]] ; then
- error "--variant name must not contain an underscore (_) or a space ( )."
- exit 1
-fi
-
-#
-# Check that the provided variant overlay name is valid.
-#
-if [ -n "$FLAGS_variant" ] ; then
- VARIANT_NAME="overlay-variant-${FLAGS_board}-${FLAGS_variant}"
- VARIANT_OVERLAY="${SRC_ROOT}/overlays/${VARIANT_NAME}"
- PRIVATE_VARIANT_NAME="overlay-variant-${FLAGS_board}-${FLAGS_variant}-private"
- PRIVATE_VARIANT_OVERLAY="${SRC_ROOT}/private-overlays/${PRIVATE_VARIANT_NAME}"
- if [ ! -d "${VARIANT_OVERLAY}" ] && \
- [ ! -d "${PRIVATE_VARIANT_OVERLAY}" ] ; then
- error "There is no variant overlay called '${FLAGS_variant}'"
- exit 1
- fi
-fi
-
-function is_primary_overlay() {
- local directory=$1
- [ -f "${directory}/make.conf" ] || return 1
- [ -f "${directory}/toolchain.conf" ] || return 1
- return 0
-}
-
-BOARD_OVERLAY="${SRC_ROOT}/overlays/overlay-${FLAGS_board}"
-PRIVATE_OVERLAY_NAME="overlay-${FLAGS_board}-private"
-PRIVATE_BOARD_OVERLAY="${SRC_ROOT}/private-overlays/${PRIVATE_OVERLAY_NAME}"
-
-#
-# Identify the primary board overlay or die.
-#
-if is_primary_overlay ${BOARD_OVERLAY}; then
- PRIMARY_OVERLAY="${BOARD_OVERLAY}"
-elif is_primary_overlay "${PRIVATE_BOARD_OVERLAY}"; then
- PRIMARY_OVERLAY="${PRIVATE_BOARD_OVERLAY}"
-fi
-if [ ! -n "${PRIMARY_OVERLAY}" ]; then
- error "There is no primary board overlay for ${FLAGS_board}"
- exit 1
-fi
-
-#
-# If only the primary overlay is needed, provide it and exit.
-#
-if [ "${FLAGS_primary_only}" -eq "${FLAGS_TRUE}" ]; then
- echo "${PRIMARY_OVERLAY}"
- exit 0
-fi
-
-#
-# Check for chromeos-overlay.
-#
-CHROMEOS_OVERLAY="${SRC_ROOT}/private-overlays/chromeos-overlay"
-
-if [ -d "${CHROMEOS_OVERLAY}" ]; then
- echo "${CHROMEOS_OVERLAY}"
-fi
-
-#
-# Check if there are any public board overlays.
-#
-if [ -d "${BOARD_OVERLAY}" ]; then
- echo "${BOARD_OVERLAY}"
-
- #
- # Add the public variant overlay if it exists.
- #
- if [ -n "$FLAGS_variant" ] ; then
- if [ -d "$VARIANT_OVERLAY" ] ; then
- echo "${VARIANT_OVERLAY}"
- fi
- fi
-fi
-
-#
-# Add any private overlays and private variant overlays for this board.
-#
-if [ -d "${SRC_ROOT}/private-overlays" ] ; then
- OVERLAY_NAME="overlay-${FLAGS_board}-private"
- PRIVATE_OVERLAY="${SRC_ROOT}/private-overlays/${OVERLAY_NAME}"
-
- if [ -d "${PRIVATE_OVERLAY}" ] ; then
- echo "${PRIVATE_OVERLAY}"
- fi
-
- #
- # Add the private variant overlay if it exists.
- #
- if [ -n "$FLAGS_variant" ] ; then
- if [ -d "${PRIVATE_VARIANT_OVERLAY}" ] ; then
- echo "${PRIVATE_VARIANT_OVERLAY}"
- fi
- fi
-fi
-
-#
-# Finally, add in any user requested board overlays.
-#
-if [ -d "${FLAGS_board_overlay}" ] ; then
- echo "${FLAGS_board_overlay}"
-fi
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698