summaryrefslogtreecommitdiffstats
path: root/common/recipes-bsp
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-bsp')
-rw-r--r--common/recipes-bsp/rmc/rmc-db.bb48
1 files changed, 48 insertions, 0 deletions
diff --git a/common/recipes-bsp/rmc/rmc-db.bb b/common/recipes-bsp/rmc/rmc-db.bb
new file mode 100644
index 00000000..14553af0
--- /dev/null
+++ b/common/recipes-bsp/rmc/rmc-db.bb
@@ -0,0 +1,48 @@
1SUMMARY = "Central RMC Database"
2DESCRIPTION = "Generate a centralized RMC database for RMC feature. \
3Fingerprints and data for all boards supported are specified by variable \
4RMC_BOARD_DATA_DIRS which is a list of top directories that contains \
5subdirectories for boards. Developers can add their top directories by appending \
6them to this variable in a rmc-db.bbappend.Refer to rmc-db bbclass for more \
7information."
8
9LICENSE = "MIT"
10
11LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
12
13S = "${WORKDIR}"
14
15inherit rmc-db
16
17RMC_BOARD_DATA_DIRS_append := " ${THISDIR}/boards/"
18RMC_DB_DIR = "${WORKDIR}/db"
19
20# Let sstate be aware of change in any added board directories
21do_generate_rmc_db[file-checksums] = "${@get_rmc_top_dirs_list(d)}"
22
23# derived from get_lic_checksum_file_list(d) in base.bbclass in OE
24def get_rmc_top_dirs_list(d):
25 dirlist = []
26 dirs = d.getVar("RMC_BOARD_DATA_DIRS", True) or ''
27 topdirs = dirs.split()
28 for each in topdirs:
29 dirlist.append(each + ":" + str(os.path.exists(each)))
30 return " ".join(dirlist)
31
32do_generate_rmc_db () {
33 rmc_generate_db "${RMC_BOARD_DATA_DIRS}" "${RMC_DB_DIR}"/rmc.db
34}
35
36addtask generate_rmc_db after do_compile
37
38inherit deploy
39
40do_deploy () {
41 if [ -f ${RMC_DB_DIR}/rmc.db ]; then
42 install -m 0400 ${RMC_DB_DIR}/rmc.db ${DEPLOYDIR}
43 else
44 echo "Warning: no RMC central database found, skip deployment."
45 fi
46}
47
48addtask deploy after do_generate_rmc_db