blob: 2212daf72bfa41cb5cd23a484390486759bab512 [file] [log] [blame]
# Copyright 2012 The ChromiumOS Authors
# Distributed under the terms of the GNU General Public License v2
# $Header:
EAPI=7
CROS_WORKON_COMMIT=("aa20ec25d94c80be1ebfd76f72db8332e93e1c21" "f029229daac8a4571be184641cb135ff9c59b6b0")
CROS_WORKON_TREE=("a0d4971b64022c855898c6d6440cebb3010bfcfc" "f1a077f4ce404e5072f04770112c923dc96c489b" "a1d20628607e89075d2f48a6d979c951c69ae813" "3c4c2d1f78d70547ae755c56c69f969581b0b975" "49403b06791097cda35c94d1712e5fcdaf84fdc4" "7b0b7f321f98085e15be5ad4d258c7d6f0c68abb" "5f046ffe739243be8cc54f6e2d70868cddb22388" "135271dfc18c2aff8ea07def0392f08cdb00c45a" "e03866d9ecdf3529248f3d4bd0b63499a092f2c3" "052584a30fcbe73624a942716f00e76fc4724675" "cc017f63eacaeca48c92a83cc071201b85b1a06f" "cc0a81deb93c1c189b611a6913c7168bb37d5211" "846e05a6f441152253ce9355531fe3dc7f927c5e" "3c7de6316ebdc7d62b958199ee523fd303e314d7" "429c11c73b15b5d06eb36a8a38e377b4742168aa" "f3609a221be25945f2116ac6f8ddbd3e666162b9" "b5aabe06d8a7b9aa4654782409722708f89cb733")
CROS_WORKON_PROJECT=(
"chromiumos/third_party/coreboot"
"chromiumos/platform/vboot_reference"
)
CROS_WORKON_LOCALNAME=(
"coreboot"
"../platform/vboot_reference"
)
CROS_WORKON_DESTDIR=(
"${S}"
"${S}/3rdparty/vboot"
)
CROS_WORKON_EGIT_BRANCH=(
"chromeos-2016.05"
"main"
)
# coreboot:src/arch/x85/include/arch: used by inteltool, x86 only
# coreboot:src/commonlib: used by cbfstool
# coreboot:src/vendorcode/intel: used by cbfstool
# coreboot:util/*: tools built by this ebuild
# vboot: minimum set of files and directories to build vboot_lib for cbfstool
CROS_WORKON_SUBTREE=(
"src/arch/x86/include/arch src/commonlib src/vendorcode/intel util/archive util/cbmem util/cbfstool util/ifdtool util/inteltool util/mma util/nvramtool util/superiotool util/amdfwtool"
"Makefile cgpt host firmware futility"
)
inherit cros-workon toolchain-funcs cros-sanitizers
DESCRIPTION="Utilities for modifying coreboot firmware images"
HOMEPAGE="http://coreboot.org"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="*"
IUSE="cros_host mma +pci static"
LIB_DEPEND="
sys-apps/pciutils[static-libs(+)]
sys-apps/flashrom
"
RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
DEPEND="${RDEPEND}
static? ( ${LIB_DEPEND} )
"
_emake() {
emake \
TOOLLDFLAGS="${LDFLAGS}" \
CC="${CC}" \
STRIP="true" \
"$@"
}
src_configure() {
sanitizers-setup-env
use static && append-ldflags -static
tc-export CC PKG_CONFIG
}
is_x86() {
use x86 || use amd64
}
src_compile() {
_emake -C util/cbfstool obj="${PWD}/util/cbfstool"
if use cros_host; then
_emake -C util/archive HOSTCC="${CC}"
else
_emake -C util/cbmem
fi
if is_x86; then
_emake -C util/ifdtool
if use cros_host; then
_emake -C util/amdfwtool
else
_emake -C util/superiotool \
CONFIG_PCI=$(usex pci)
_emake -C util/inteltool
_emake -C util/nvramtool
fi
fi
}
src_install() {
dobin util/cbfstool/cbfstool
dobin util/cbfstool/elogtool
if use cros_host; then
dobin util/cbfstool/fmaptool
dobin util/cbfstool/cbfs-compression-tool
dobin util/archive/archive
else
dobin util/cbmem/cbmem
fi
if is_x86; then
dobin util/ifdtool/ifdtool
if use cros_host; then
dobin util/amdfwtool/amdfwread
else
dobin util/superiotool/superiotool
dobin util/inteltool/inteltool
dobin util/nvramtool/nvramtool
fi
if use mma; then
dobin util/mma/mma_setup_test.sh
dobin util/mma/mma_get_result.sh
dobin util/mma/mma_automated_test.sh
insinto /etc/init
doins util/mma/mma.conf
fi
fi
}