From d53dbb38c43da3fd04fed9a55e7b3b9e2c512b9a Mon Sep 17 00:00:00 2001 From: Saul Wold Date: Tue, 7 Nov 2017 10:32:26 -0800 Subject: meta-intel: Reorganize the layout to remove common Remove the concept of the common directory and move all the recipes-* dirs to the top level as a normal layer would be. layer.conf is updated appropriately Signed-off-by: Saul Wold --- recipes-bsp/rmc/rmc-db.bb | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 recipes-bsp/rmc/rmc-db.bb (limited to 'recipes-bsp/rmc/rmc-db.bb') diff --git a/recipes-bsp/rmc/rmc-db.bb b/recipes-bsp/rmc/rmc-db.bb new file mode 100644 index 00000000..f24ed11c --- /dev/null +++ b/recipes-bsp/rmc/rmc-db.bb @@ -0,0 +1,49 @@ +SUMMARY = "Central RMC Database" +DESCRIPTION = "Generate a centralized RMC database for RMC feature. \ +Fingerprints and data for all boards supported are specified by variable \ +RMC_BOARD_DATA_DIRS which is a list of top directories that contains \ +subdirectories for boards. Developers can add their top directories by appending \ +them to this variable in a rmc-db.bbappend.Refer to rmc-db bbclass for more \ +information." + +LICENSE = "MIT" + +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +S = "${WORKDIR}" + +inherit rmc-db + +RMC_BOARD_DATA_DIRS ?= "${THISDIR}/boards/" +RMC_DB_DIR = "${WORKDIR}/db" + +# Let sstate be aware of change in any added board directories +do_generate_rmc_db[file-checksums] = "${@get_rmc_top_dirs_list(d)}" + +# derived from get_lic_checksum_file_list(d) in base.bbclass in OE +def get_rmc_top_dirs_list(d): + dirlist = [] + dirs = d.getVar("RMC_BOARD_DATA_DIRS", True) or '' + topdirs = dirs.split() + for each in topdirs: + dirlist.append(each + ":" + str(os.path.exists(each))) + return " ".join(dirlist) + +do_generate_rmc_db () { + rmc_generate_db "${RMC_BOARD_DATA_DIRS}" "${RMC_DB_DIR}"/rmc.db +} + +addtask generate_rmc_db after do_compile + +inherit deploy + +do_deploy () { + if [ -f ${RMC_DB_DIR}/rmc.db ]; then + install -m 0400 ${RMC_DB_DIR}/rmc.db ${DEPLOYDIR} + else + rm -f ${DEPLOYDIR}/rmc.db + echo "Warning: no RMC central database found, skip deployment." + fi +} + +addtask deploy after do_generate_rmc_db -- cgit v1.2.3-54-g00ecf