blob: cea6eb9ca5803598d93fefa1df42d0b316f06826 [file] [log] [blame]
Mike Frysinger274d83f2012-02-09 14:13:40 -05001# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Taylor Hutt729e9d42011-08-29 10:05:16 -07002# Distributed under the terms of the GNU General Public License v2
3
4#
5# Original Author: The Chromium OS Authors <chromium-os-dev@chromium.org>
6# Purpose: Library for handling building of ChromiumOS packages
7#
8#
9# This class sets the BOARD environment variable. It is intended to
10# be used by ebuild packages that need to have the board information
11# for various reasons -- for example, to differentiate various
12# hardware attributes at build time; see 'adhd' for an example of
13# this.
14#
15# When set, the BOARD environment variable should conform to the
16# syntax used by the CROS utilities.
17#
18# If an unknown board is encountered, this class deliberately fails
19# the build; this provides an easy method of identifying a change to
20# the build which might affect inheriting packages.
21#
22# For example, the ADHD (Google A/V daemon) package relies on the
23# BOARD variable to determine which hardware should be monitored at
24# runtime. If the BOARD variable is not set, the daemon will not
25# monitor any specific hardware; thus, when a new board is added, the
26# ADHD project must be updated.
27#
Matt Tennant8b6b2382011-09-12 17:47:16 -070028[[ ${EAPI} != "4" ]] && die "Only EAPI=4 is supported"
29
Matt Tennanta6aa5452011-09-09 18:40:46 -070030BOARD_USE_PREFIX="board_use_"
Daniel Eratb1b6c3e2013-09-26 16:32:17 -070031
32# Obsolete boards' names are commented-out but retained in this list so
33# they won't be accidentally recycled in the future.
Matt Tennanta6aa5452011-09-09 18:40:46 -070034ALL_BOARDS=(
Mike Frysinger274d83f2012-02-09 14:13:40 -050035 amd64-corei7
Gaurav Shah6ec6d8d2014-04-17 17:10:19 -070036 #amd64-drm
37 amd64-generic
38 amd64-generic_embedded
Michael Spangde2270d2014-09-08 13:08:45 -040039 amd64-generic_freon
Prathmesh Prabhu8f8fc732014-10-08 18:02:03 -070040 amd64-generic_mobbuild
Mike Frysinger274d83f2012-02-09 14:13:40 -050041 amd64-host
Kevin Chengbe34e202014-02-24 13:10:47 +080042 anglar
Daniel Eratfb4d75f2014-07-23 14:20:47 -070043 #app-shell-panther
Jay (Yong Jae) Kimcba101d2012-12-07 17:14:02 -080044 aries
Mike Frysinger274d83f2012-02-09 14:13:40 -050045 arm-generic
Michael Spangde2270d2014-09-08 13:08:45 -040046 arm-generic_freon
Olof Johansson44cbd8e2014-02-10 14:09:20 -080047 arm64-generic
Bernie Thompson606a3532014-08-13 14:23:16 -070048 auron
Kevin Cheng62d31602014-09-09 14:55:19 +080049 auron_paine
Kane Chenfff2a692014-10-13 16:03:27 +080050 auron_pearlvalley
Kevin Cheng62d31602014-09-09 14:55:19 +080051 auron_yuna
Josh Triplett6513a0f2013-08-19 13:31:42 -070052 bayleybay
Liam McLoughlin19107c42012-07-02 16:39:33 -070053 beaglebone
Albert Chaulk94bc7f52013-12-17 19:21:40 -080054 beaglebone_servo
Mohammed Habibulla86fd34f2013-08-21 11:25:08 -070055 beltino
Chris Wolfefc7be402013-05-30 12:42:52 -040056 blackwall
Steve Funga459cc22014-07-25 17:24:47 -070057 bobcat
Duncan Laurie5acfe202013-06-24 09:43:19 -070058 bolt
Shawn Nematbakhsh81bab192012-06-18 11:05:31 -070059 butterfly
Joe Konnoaabb02f2014-03-04 13:54:41 -080060 bwtm2
Huang, Huki83352a12014-08-04 15:11:28 +080061 candy
Yung Leem21831402013-08-23 16:27:47 -070062 cardhu
Daniel Erat1f5cdc22013-09-27 09:05:14 -070063 #chronos
Gene Chen5b3825a2013-12-10 19:29:38 +080064 clapper
Vadim Bendebury1763d042014-10-01 18:41:36 -070065 cosmos
Bernie Thompsondb407e12014-07-24 18:10:43 -070066 cranky
Katie Roberts-Hoffman452bf602012-02-23 13:19:44 -080067 daisy
Michael Spang2b735582014-08-25 19:48:11 -040068 daisy_freon
Gaurav Shah6ec6d8d2014-04-17 17:10:19 -070069 #daisy-drm
70 daisy_embedded
Bernie Thompson7bcd9e22012-11-15 13:21:30 -080071 daisy_snow
Katie Roberts-Hoffman31138342013-12-20 16:35:27 -080072 daisy_skate
73 daisy_spring
Scott James Remnant95d10fb2013-10-31 17:07:21 -070074 daisy_winter
Andrew Chew351e22a2013-02-12 11:08:48 -080075 dalmore
Gaurav Shahb48d4bf2013-11-27 18:30:52 -080076 duck
Daniel Eratb1b6c3e2013-09-26 16:32:17 -070077 #emeraldlake2
Bernie Thompson55af4792014-03-11 15:18:56 -070078 enguarde
Bernie Thompsonc258e032014-03-19 17:21:53 -070079 expresso
Jay (Yong Jae) Kim596bed12013-04-25 14:55:24 -070080 falco
Brian J Lovin43d61c42014-09-26 13:59:01 -070081 falco_freon
Chad Versaced10c8ce2014-04-17 15:48:44 -070082 falco_gles
Jay (Yong Jae) Kim521bd0e2014-02-06 13:15:00 -080083 falco_li
Josh Triplettacf58252012-07-26 10:51:53 -070084 fb1
Duncan Laurief71e41b2013-03-01 13:49:10 -080085 fox
86 fox_baskingridge
87 fox_wtm1
88 fox_wtm2
Chris Sosacb50f042014-02-04 17:49:27 -080089 gizmo
Kevin Cheng24ed2892013-12-12 13:52:11 +080090 glimmer
Bernie Thompson77963002014-03-19 17:18:48 -070091 gnawty
James Ausmus10348792014-04-25 10:47:58 -070092 hsb
Mike Frysinger274d83f2012-02-09 14:13:40 -050093 ironhide
Nam T. Nguyen8e077942014-09-02 14:13:43 -070094 kayle
Daniel Erat1f5cdc22013-09-27 09:05:14 -070095 #kiev
Bernie Thompsond0a3d252014-02-24 19:47:00 -080096 kip
Jay Kim84088ef2012-04-09 16:50:17 -070097 klang
Frank Hodd2a0162014-06-13 17:31:44 +080098 laser
Bertrand SIMONNETa06cfbb2014-03-19 17:02:10 -070099 lemmings
Nam T. Nguyene0735442014-04-15 10:23:18 -0700100 lemmings_external
Yung Leem21831402013-08-23 16:27:47 -0700101 leon
Mike Frysinger274d83f2012-02-09 14:13:40 -0500102 link
Michael Spang2ba67782014-04-11 18:56:12 -0400103 link_freon
Mike Frysinger274d83f2012-02-09 14:13:40 -0500104 lumpy
Daniel Eratfb4d75f2014-07-23 14:20:47 -0700105 mappy
Daniel Erat76e7c892014-11-03 18:48:04 -0700106 mappy-envoy
Daniel Erat924b7852014-07-31 10:06:19 -0700107 mappy_flashstation
Gaurav Shah3a16bc92014-04-28 17:15:25 -0700108 marble
Shan-Fu Chiou49ba7072014-05-05 11:10:05 +0800109 mccloud
Ronald Claveaub2c33c32014-05-13 09:44:15 +0200110 minnowboard
Mike Frysinger0bc02aa2013-10-19 03:34:54 -0400111 mipseb-o32-generic
112 mipseb-n32-generic
113 mipseb-n64-generic
114 mipsel-o32-generic
115 mipsel-n32-generic
116 mipsel-n64-generic
bowgotsai2d3d0752013-10-24 23:08:57 +0800117 monroe
Nathan Chung1e9af862014-06-11 02:33:45 -0400118 moose
Andrew Chewc15680b2013-07-30 14:22:22 -0700119 nyan
Katie Roberts-Hoffmane76e2c12013-12-20 21:25:54 -0800120 nyan_big
Andrew Chewf1fd3092014-02-06 18:34:38 -0800121 nyan_blaze
Stéphane Marchesin72ccafa2014-06-11 20:27:14 -0700122 nyan_freon
Penny Chiuede8b852014-08-08 18:40:20 +0800123 nyan_kitty
Gaurav Shah99f711f942013-11-27 18:27:51 -0800124 optimus
Anush Elangovane98b4522012-04-25 17:34:36 -0700125 panda
bowgotsaia064c6e2013-10-16 17:24:34 +0800126 panther
Steve Fung3f9af002014-05-05 13:26:50 -0700127 panther_embedded
Pawel Osciak254c8212014-10-28 15:29:25 +0900128 panther_freon
Ricky Liang8327e592014-08-20 11:10:54 +0800129 panther_goofy
Prathmesh Prabhu790b2f42014-10-08 18:04:27 -0700130 panther_moblab
Jay Kimb2152e82012-05-22 20:37:09 -0700131 parrot
Mohammed Habibullad5c704c2013-11-26 16:10:26 -0800132 parrot_ivb
Mohammed Habibullac85eb662013-07-09 14:44:56 -0700133 parrot32
134 parrot64
Kaiyen Chang01c2dfb2014-09-26 15:47:12 +0800135 parry
Katie Roberts-Hoffman1b3abf62013-03-15 16:45:10 -0700136 peach
Katie Roberts-Hoffman57d2b832013-07-30 14:21:03 -0700137 peach_kirby
Katie Roberts-Hoffmanc8be3b12013-12-10 09:24:56 -0800138 peach_pi
Doug Anderson506ffec2013-03-20 13:10:07 -0700139 peach_pit
Dave Parker35df9ae2013-04-23 11:09:01 -0700140 peppy
Haixia Shi282c9192014-10-28 16:11:44 -0700141 peppy_freon
Mike Frysinger0bc02aa2013-10-19 03:34:54 -0400142 ppcbe-32-generic
143 ppcbe-64-generic
144 ppcle-32-generic
145 ppcle-64-generic
Allen Martin68bdb4e2012-11-08 15:44:41 -0800146 puppy
Bernie Thompson9c5c0692014-02-24 19:45:32 -0800147 quawks
Bernie Thompson520fa1f2013-10-04 16:51:53 -0700148 rambi
Liam McLoughlin81d0a492012-05-17 17:38:47 +0100149 raspberrypi
Daniel Erat1f5cdc22013-09-27 09:05:14 -0700150 #ricochet
Gaurav Shah25115942013-11-27 18:29:11 -0800151 rizer
Olof Johansson44cbd8e2014-02-10 14:09:20 -0800152 rush
Aaron Durbin09636f72014-07-14 17:57:35 -0500153 rush_ryu
Mohammed Habibulla4591aaf2013-08-28 13:29:13 -0700154 samus
Jay (Yong Jae) Kim330a3822013-04-22 15:26:25 -0700155 slippy
Chris Masone58b2a1e2013-03-19 14:55:21 -0700156 sonic
Bernie Thompson02db6672013-10-17 15:23:38 -0700157 squawks
Gaurav Shahd1226b02014-03-18 14:34:23 -0700158 storm
Shawn Nematbakhsh81bab192012-06-18 11:05:31 -0700159 stout
Mike Frysingerb6d67942014-04-28 17:40:41 -0400160 #stout32
Brian J Lovin8e4d65a2014-07-01 16:08:23 -0700161 strago
Mike Frysinger274d83f2012-02-09 14:13:40 -0500162 stumpy
Jay (Yong Jae) Kima4f64782013-12-09 16:18:28 -0800163 stumpy_moblab
Mike Frysinger65a3704e2013-04-12 18:19:11 -0400164 stumpy_pico
Bernie Thompson3cab0ec2014-03-11 15:21:04 -0700165 swanky
Steve Fung79db4482014-02-19 17:26:28 -0800166 tails
Daniel Eratb1b6c3e2013-09-26 16:32:17 -0700167 #tegra2
168 #tegra2_aebl
169 #tegra2_arthur
170 #tegra2_asymptote
171 #tegra2_dev-board
172 #tegra2_dev-board-opengl
173 #tegra2_kaen
174 #tegra2_seaboard
175 #tegra2_wario
Mike Frysinger274d83f2012-02-09 14:13:40 -0500176 tegra3-generic
Mohammed Habibullaf9ea7ff2014-04-28 11:30:51 -0700177 tricky
Gaurav Shahae1baa12014-07-18 18:36:16 -0700178 urara
Katie Roberts-Hoffmance9d7d92014-05-16 12:59:09 -0700179 veyron
Katie Roberts-Hoffman31ce4f52014-10-23 15:46:39 -0700180 veyron_jerry
181 veyron_mighty
182 veyron_minnie
Katie Roberts-Hoffman8d008322014-08-18 15:29:55 -0700183 veyron_pinky
Katie Roberts-Hoffman31ce4f52014-10-23 15:46:39 -0700184 veyron_remy
185 veyron_speedy
Daniel Eratb1b6c3e2013-09-26 16:32:17 -0700186 #waluigi
Gaurav Shah5d390372014-10-23 10:35:47 -0700187 whirlwind
Dave Parkerc9611812014-01-22 02:00:29 +0800188 winky
Mohammed Habibullae8283fd2013-07-16 15:45:47 -0700189 wolf
James Ausmus10348792014-04-25 10:47:58 -0700190 wsb
Mike Frysinger2cd338d2012-12-01 15:05:58 -0500191 x32-generic
Mike Frysinger274d83f2012-02-09 14:13:40 -0500192 x86-agz
193 x86-alex
194 x86-alex_he
Micah Catlin10dcede2012-03-19 19:00:36 -0700195 x86-alex_hubble
Sonny Raoe8abf8d2012-04-20 23:00:51 +0000196 x86-alex32
David James39504472012-04-20 18:41:00 -0700197 x86-alex32_he
Mike Frysinger274d83f2012-02-09 14:13:40 -0500198 x86-dogfood
Gaurav Shah6ec6d8d2014-04-17 17:10:19 -0700199 #x86-drm
Daniel Eratb1b6c3e2013-09-26 16:32:17 -0700200 #x86-fruitloop
Mike Frysinger274d83f2012-02-09 14:13:40 -0500201 x86-generic
Gaurav Shah6ec6d8d2014-04-17 17:10:19 -0700202 x86-generic_embedded
Mike Frysinger274d83f2012-02-09 14:13:40 -0500203 x86-mario
204 x86-mario64
Daniel Eratb1b6c3e2013-09-26 16:32:17 -0700205 #x86-pineview
206 #x86-wayland
Mike Frysinger274d83f2012-02-09 14:13:40 -0500207 x86-zgb
208 x86-zgb_he
Sonny Raoe8abf8d2012-04-20 23:00:51 +0000209 x86-zgb32
David James39504472012-04-20 18:41:00 -0700210 x86-zgb32_he
Gediminas Ramanauskasdec45472013-12-19 11:26:40 -0800211 zako
Matt Tennanta6aa5452011-09-09 18:40:46 -0700212)
213
Matt Tennant8b6b2382011-09-12 17:47:16 -0700214# Add BOARD_USE_PREFIX to each board in ALL_BOARDS to create IUSE.
Mike Frysinger169f0402012-02-13 14:35:15 -0500215# Also add cros_host so that we can inherit this eclass in ebuilds
216# that get emerged both in the cros-sdk and for target boards.
217# See REQUIRED_USE below.
218IUSE="${ALL_BOARDS[@]/#/${BOARD_USE_PREFIX}} cros_host"
Taylor Hutt729e9d42011-08-29 10:05:16 -0700219
Matt Tennant8b6b2382011-09-12 17:47:16 -0700220# Require one, and only one, of the board_use flags to be set if this eclass
221# is used. This effectively makes any ebuild that inherits this eclass require
222# a known valid board to be set.
223REQUIRED_USE="^^ ( ${IUSE} )"
224
225# Echo the current board, with variant.
226get_current_board_with_variant()
Taylor Hutt729e9d42011-08-29 10:05:16 -0700227{
Mike Frysinger274d83f2012-02-09 14:13:40 -0500228 local b
Taylor Hutt729e9d42011-08-29 10:05:16 -0700229
Mike Frysinger274d83f2012-02-09 14:13:40 -0500230 for b in "${ALL_BOARDS[@]}"; do
231 if use ${BOARD_USE_PREFIX}${b}; then
232 echo ${b}
233 return
234 fi
235 done
Matt Tennanta6aa5452011-09-09 18:40:46 -0700236
Mike Frysinger274d83f2012-02-09 14:13:40 -0500237 die "Unable to determine current board (with variant)."
Matt Tennant8b6b2382011-09-12 17:47:16 -0700238}
239
240# Echo the current board, without variant.
241get_current_board_no_variant()
242{
Mike Frysinger274d83f2012-02-09 14:13:40 -0500243 get_current_board_with_variant | cut -d '_' -f 1
Taylor Hutt729e9d42011-08-29 10:05:16 -0700244}