| # Copyright 2016 The Chromium OS Authors. All rights reserved. |
| # Distributed under the terms of the GNU General Public License v2 |
| |
| EAPI=5 |
| |
| CROS_BOARDS=( |
| # Boards moving to a newer image |
| fizz |
| nautilus |
| scarlet |
| soraka |
| ) |
| inherit cros-board |
| |
| DESCRIPTION="Ebuild to support the Chrome OS CR50 device." |
| |
| LICENSE="BSD-Google" |
| SLOT="0" |
| KEYWORDS="*" |
| |
| RDEPEND="chromeos-base/chromeos-cr50-scripts" |
| |
| # There are two major types of images of Cr50, prod (used on most MP devices) |
| # and pre-pvt, used on devices still not fully released. |
| # |
| LIMITED_PROD_IMAGE="cr50.r0.0.10.w0.3.3" |
| PRE_PVT_IMAGE="cr50.r0.0.10.w0.2.2_FFFF_00000000_00000010" |
| PROD_IMAGE="cr50.r0.0.10.w0.3.0" |
| |
| # Let's make sure that all images are included in the manifest. |
| CR50_BASE_NAMES=( |
| "${LIMITED_PROD_IMAGE}" |
| "${PRE_PVT_IMAGE}" |
| "${PROD_IMAGE}" |
| ) |
| MIRROR_PATH="gs://chromeos-localmirror/distfiles/" |
| SRC_URI="$(printf " ${MIRROR_PATH}/%s.tbz2" "${CR50_BASE_NAMES[@]}")" |
| |
| S="${WORKDIR}" |
| |
| src_install() { |
| # Always install both pre-pvt and MP Cr50 images, let the updater at |
| # run time decide which one to use, based on the H1 Board ID flags |
| # value. |
| local prod_image |
| local prepvt_image |
| |
| if [[ -n "$(get_current_board_no_variant)" ]]; then |
| prod_image="${LIMITED_PROD_IMAGE}" |
| prepvt_image="${PRE_PVT_IMAGE}" |
| else |
| prod_image="${PROD_IMAGE}" |
| prepvt_image="${PROD_IMAGE}" |
| fi |
| |
| insinto /opt/google/cr50/firmware |
| |
| elog "Will install ${prepvt_image} and ${prod_image}" |
| |
| newins "${prepvt_image}"/*.bin.prod cr50.bin.prepvt |
| newins "${prod_image}"/*.bin.prod cr50.bin.prod |
| } |