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

Side by Side Diff: overlay_list

Issue 3080019: Add overlay_list script. (Closed) Base URL: ssh://git@chromiumos-git/crosutils.git
Patch Set: Remove line breaks, warning message and fix 80 column wrapping. Created 10 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/bash
2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 # This script generates the list of board overlays and variants.
8
9 # Load common constants. This should be the first executable line.
10 # The path to common.sh should be relative to your script's location.
11 . "$(dirname "$0")/common.sh"
12
13 get_default_board
14
15 # Flags
16 DEFINE_string board "$DEFAULT_BOARD" "The name of the board to set up."
17 DEFINE_string board_overlay "" "Location of the board overlay."
18 DEFINE_string variant "" "Board variant."
19
20 # Parse command line flags
21 FLAGS "$@" || exit 1
22 eval set -- "${FLAGS_ARGV}"
23
24 # Only now can we die on error. shflags functions leak non-zero error codes,
25 # so will die prematurely if 'set -e' is specified before now.
26 set -e
27
28 if [ -z "$FLAGS_board" ] ; then
29 error "--board required."
30 exit 1
31 fi
32
33 #
34 # Check for chromeos-overlay.
35 #
36 CHROMEOS_OVERLAY="${SRC_ROOT}/private-overlays/chromeos-overlay"
37
38 if [ -d "${CHROMEOS_OVERLAY}" ]; then
39 echo "${CHROMEOS_OVERLAY}"
40 fi
41
42 #
43 # Check if there are any board overlays. There should be at least a top
44 # level board specific overlay.
45 #
46 PRIMARY_BOARD_OVERLAY="${SRC_ROOT}/overlays/overlay-${FLAGS_board}"
47
48 if [ -d "${PRIMARY_BOARD_OVERLAY}" ]; then
49 echo "${PRIMARY_BOARD_OVERLAY}"
50
51 #
52 # Add the public variant overlay
53 #
54 if [ -n "$FLAGS_variant" ] ; then
55 VARIANT_NAME="overlay-variant-${FLAGS_board}-${FLAGS_variant}"
56 VARIANT_OVERLAY="${SRC_ROOT}/overlays/${VARIANT_NAME}"
57
58 if [ ! -d "$VARIANT_OVERLAY" ] ; then
59 error "Can't find variant overlay directory $VARIANT_OVERLAY"
60 exit 1
61 fi
62
63 echo "${VARIANT_OVERLAY}"
64 fi
65
66 #
67 # Add any private overlays and variant overlays for this board.
68 #
69 if [ -d "${SRC_ROOT}/private-overlays" ] ; then
70 OVERLAY_NAME="overlay-${FLAGS_board}-private"
71 PRIVATE_OVERLAY="${SRC_ROOT}/private-overlays/${OVERLAY_NAME}"
72
73 if [ -d "${PRIVATE_OVERLAY}" ] ; then
74 echo "${PRIVATE_OVERLAY}"
75 fi
76
77 #
78 # Add the public and private variant overlays
79 #
80 if [ -n "$FLAGS_variant" ] ; then
81 VARIANT_NAME="overlay-variant-${FLAGS_board}-${FLAGS_variant}-private"
82 PRIVATE_VARIANT_OVERLAY="${SRC_ROOT}/private-overlays/${VARIANT_NAME}"
83
84 if [ -d "${PRIVATE_VARIANT_OVERLAY}" ] ; then
85 echo "${PRIVATE_VARIANT_OVERLAY}"
86 fi
87 fi
88 fi
89 fi
90
91 #
92 # Finally, add in any user requested board overlays.
93 #
94 if [ -d "${FLAGS_board_overlay}" ] ; then
95 echo "${FLAGS_board_overlay}"
96 fi
OLDNEW
« 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