blob: f2b041fe9d0b74588117282eff81d7bd9c185a12 [file] [log] [blame]
Tom Joseph1562bbc2017-02-20 12:01:43 +05301# Common code for recipes that implement Phosphor IPMI Whitelist
2# packages
3
4WHITELIST ?= "${PN}.conf"
Patrick Williams43b61b72017-02-24 13:04:06 -06005INSTALLDIR = "${D}${datadir}/phosphor-ipmi-host/"
Tom Joseph1562bbc2017-02-20 12:01:43 +05306
7python phosphor_ipmi_host_whitelist_postinstall() {
8 def install_whitelist(d):
9 # Create the install directory if needed
10 whitelist_file = d.getVar('WHITELIST', True)
11 install_dir = d.getVar('INSTALLDIR', True)
12 if not os.path.exists(install_dir):
13 os.makedirs(install_dir)
14 install_file = os.path.join(install_dir, whitelist_file)
15
16 # Search for conf file in FILESPATH
17 searchpaths = d.getVar('FILESPATH', True)
18 path = bb.utils.which(searchpaths, whitelist_file)
19 if not os.path.isfile(path):
20 bb.fatal('Did not find conf file "%s"' % whitelist_file)
21
22 # Copy the conf file into install directory
23 bb.utils.copyfile(path, install_file)
24
25 install_whitelist(d)
26}
Patrick Williams43b61b72017-02-24 13:04:06 -060027do_install[postfuncs] += "phosphor_ipmi_host_whitelist_postinstall"