blob: b33f9dd04d367360cc427698e5afc3701eeddf5b [file] [log] [blame]
# Copyright 2014 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.
# factory-mini is a subset of the factory software that can
# be used to run utilities like gooftool, hwid, and regcode, which may
# be useful in the CrOS test environment. For instance, this would
# allow "gooftool probe" to be used to probe hardware components in
# Moblab.
#
# We don't want to install the entire chromeos-factory package in the
# test image, since it is quite large, so this package comprises a
# small ".par" file (/usr/local/factory-mini/factory-mini.par)
# containing the necessary subset of factory Python code, and symlinks
# from /usr/local/bin to that file.
EAPI=5
CROS_WORKON_COMMIT="1e9e773ca023116c2b39f1bda8c7f98c6f261b18"
CROS_WORKON_TREE="5a8a5ee5c30926d411d5a7ccd8d4affbed16da37"
CROS_WORKON_PROJECT="chromiumos/platform/factory"
CROS_WORKON_LOCALNAME="factory"
CROS_WORKON_DESTDIR="${S}"
PYTHON_COMPAT=( python2_7 )
inherit cros-workon python-r1
DESCRIPTION="Subset of factory software to be installed in test images"
LICENSE="BSD-Google"
SLOT="0"
KEYWORDS="*"
IUSE=""
DEPEND="${PYTHON_DEPS}
dev-python/jsonrpclib
dev-python/pyyaml
dev-python/protobuf-python
virtual/chromeos-bsp-factory
virtual/chromeos-regions
"
RDEPEND="!chromeos-base/chromeos-factory-mini"
pkg_setup() {
cros-workon_pkg_setup
python_setup
}
src_configure() {
default
cros-workon_src_configure
# Export build settings
export PYTHON="${EPYTHON}"
export PYTHON_SITEDIR="${ESYSROOT}$(python_get_sitedir)"
export SRCROOT="${CROS_WORKON_SRCROOT}"
export FROM_EBUILD=1
}
src_compile() {
emake par MAKE_PAR_ARGS=--mini PAR_NAME=factory-mini.par
}
src_install() {
exeinto /usr/local/factory-mini
doexe build/par/factory-mini.par
# Sanity check: make sure we can run gooftool --help with only
# the -mini.par file.
build/par/factory-mini.par gooftool --help |
grep -q "^usage: gooftool" || die
# Install only symlinks for binaries usable with factory-mini.par.
"${S}/bin/install_symlinks" \
--mode mini --target ../factory-mini/factory-mini.par \
"${D}"/usr/local/bin || die
}