From 6a09c102f2b58a34a18762de64894466152a8a7d Mon Sep 17 00:00:00 2001 From: Jianxun Zhang Date: Wed, 3 Aug 2016 11:04:12 -0700 Subject: rmc: Add Runtime Machine Configuration (RMC) project RMC recipe fetch RMC project and build it more than once in build time: RMC tool is built for host architecture (native). The tool for host is used to generate RMC database in build time. RMC tool is also built for target architecture, so that scripts in user space can call RMC tool on a running target. Developers can also boot a target and run rmc tool to obtain fingerprint for a new board type. RMC libraries are compiled for both of UEFI context and user space. They are always linked in RMC tool and can be linked into an EFI bootloader. The recipes don't install libraries for target's user space until we have a new client needs it. The rmc-db.bbclass provides functions to generate rmc database file for other software components to reuse. We absorb a patch from Tom Zanussi to update source location with the public link. We could put this change in another commit, but leaving the replaced internal link in this commit could cause trouble when people bisect the project but don't have access to the internal location: ---------------------- rmc: Update to use public repo The repo the rmc recipe was pointing to was private - it's now public Signed-off-by: Tom Zanussi common/recipes-bsp/rmc/rmc.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/recipes-bsp/rmc/rmc.inc b/common/recipes-bsp/rmc/rmc.inc index c046e2e..bdf930d 100644 --- a/common/recipes-bsp/rmc/rmc.inc +++ b/common/recipes-bsp/rmc/rmc.inc @@ -15,7 +15,7 @@ LICENSE = "MIT" LIC_FILES_CHKSUM = "file://COPYING;md5=bcdd376d27b26bde6afadd67aa3c8b07" -SRC_URI = "git://git@git.yoctoproject.org/rmc;protocol=ssh" +SRC_URI = "git://git.yoctoproject.org/rmc" ... ---------------------- Signed-off-by: Jianxun Zhang Reviewed-by: Saul Wold Signed-off-by: Tom Zanussi --- common/recipes-bsp/rmc/rmc.bb | 46 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 common/recipes-bsp/rmc/rmc.bb (limited to 'common/recipes-bsp/rmc/rmc.bb') diff --git a/common/recipes-bsp/rmc/rmc.bb b/common/recipes-bsp/rmc/rmc.bb new file mode 100644 index 00000000..d8e538b2 --- /dev/null +++ b/common/recipes-bsp/rmc/rmc.bb @@ -0,0 +1,46 @@ +SUMMARY = "RMC (Runtime Machine Configuration)" + +DESCRIPTION = "RMC project provides a tool and libraries to identify types \ +of hardware boards and access any file-based data specific to the board's \ +type at runtime in a centralized way. Software (clients) can have a generic \ +logic to query board-specific data from RMC without knowing the type of board. \ +This make it possible to have a generic software work running on boards which \ +require any quirks or customizations at a board or product level. \ +" + +LICENSE = "MIT" + +LIC_FILES_CHKSUM = "file://COPYING;md5=838c366f69b72c5df05c96dff79b35f2" + +SRC_URI = "git://git.yoctoproject.org/rmc" + +SRCREV = "9bc0f645729bb41e050395fbfac170fca351b3b8" + +S = "${WORKDIR}/git" + +DEPENDS_class-target = "gnu-efi" + +# from gnu-efi, we should align arch-mapping with it. +def rmc_efi_arch(d): + import re + arch = d.getVar("TARGET_ARCH", True) + if re.match("i[3456789]86", arch): + return "ia32" + return arch + +do_compile_class-target() { + oe_runmake + oe_runmake RMC_EFI_HEADER_PREFIX=${STAGING_INCDIR}/efi RMC_EFI_ARCH="${@rmc_efi_arch(d)}" -f Makefile.efi +} + +do_install() { + oe_runmake RMC_EFI_ARCH="${@rmc_efi_arch(d)}" RMC_INSTALL_PREFIX=${D}/usr install + oe_runmake RMC_EFI_ARCH="${@rmc_efi_arch(d)}" RMC_INSTALL_PREFIX=${D}/usr -f Makefile.efi install +} + +do_install_class-native() { + install -d ${D}${STAGING_BINDIR_NATIVE} + install -m 0755 ${S}/src/rmc ${D}${STAGING_BINDIR_NATIVE} +} + +BBCLASSEXTEND = "native" -- cgit v1.2.3-54-g00ecf