blob: a13b0b157a9e20a77945cfe6e5a48e97fd3a88a4 [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"
5INSTALLDIR = "${sysconfdir}/phosphor-ipmi-host/"
6
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}
Tom Josephae46d562017-02-24 01:06:54 -060027do_populate_sysroot[postfuncs] += "phosphor_ipmi_host_whitelist_postinstall"