diff options
author | Tom Joseph <tomjoseph@in.ibm.com> | 2017-02-20 09:31:43 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-02-21 17:21:01 +0300 |
commit | 1562bbcb50e2bf7b6130dc9f8d34494cd115c8d5 (patch) | |
tree | 3d272e4ec35ffcd0a541d7275ee46465e8bcd386 /meta-phosphor/classes/phosphor-ipmi-host-whitelist.bbclass | |
parent | f7ef071db9da4fec6b43e683c1dae8b33c350479 (diff) | |
download | openbmc-1562bbcb50e2bf7b6130dc9f8d34494cd115c8d5.tar.xz |
IPMI Whitelisted commands for FRU and OEM repositories
The IPMI whitelisted commands for phosphor-ipmi-fru and openpower-ipmi-oem
is added. Only the IPMI whitelisted listed commands are allowed in
restricted mode.
The IPMI whitelisted commands for phosphor-ipmi-fru and openpower-ipmi-oem
are added as native packages and host-ipmid depends on those.
Change-Id: Ic4184773656567eb0dffa30ef29f8bc3ced3aff4
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
Diffstat (limited to 'meta-phosphor/classes/phosphor-ipmi-host-whitelist.bbclass')
-rw-r--r-- | meta-phosphor/classes/phosphor-ipmi-host-whitelist.bbclass | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/meta-phosphor/classes/phosphor-ipmi-host-whitelist.bbclass b/meta-phosphor/classes/phosphor-ipmi-host-whitelist.bbclass new file mode 100644 index 000000000..7db71d5c3 --- /dev/null +++ b/meta-phosphor/classes/phosphor-ipmi-host-whitelist.bbclass @@ -0,0 +1,27 @@ +# Common code for recipes that implement Phosphor IPMI Whitelist +# packages + +WHITELIST ?= "${PN}.conf" +INSTALLDIR = "${sysconfdir}/phosphor-ipmi-host/" + +python phosphor_ipmi_host_whitelist_postinstall() { + def install_whitelist(d): + # Create the install directory if needed + whitelist_file = d.getVar('WHITELIST', True) + install_dir = d.getVar('INSTALLDIR', True) + if not os.path.exists(install_dir): + os.makedirs(install_dir) + install_file = os.path.join(install_dir, whitelist_file) + + # Search for conf file in FILESPATH + searchpaths = d.getVar('FILESPATH', True) + path = bb.utils.which(searchpaths, whitelist_file) + if not os.path.isfile(path): + bb.fatal('Did not find conf file "%s"' % whitelist_file) + + # Copy the conf file into install directory + bb.utils.copyfile(path, install_file) + + install_whitelist(d) +} +do_install[postfuncs] += "phosphor_ipmi_host_whitelist_postinstall"
\ No newline at end of file |