diff options
author | Tom Joseph <tomjoseph@in.ibm.com> | 2017-02-01 17:17:27 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-02-01 22:57:35 +0300 |
commit | dcdc8ea6109f1ebcf8378b9ccf73b0672da5032c (patch) | |
tree | fec3b71739b734490c2122b0aafa28ce3851941d /meta-phosphor/classes/obmc-phosphor-ipmiprovider-symlink.bbclass | |
parent | 821d074359f9259bf8f1b6cf34fc81368f79611a (diff) | |
download | openbmc-dcdc8ea6109f1ebcf8378b9ccf73b0672da5032c.tar.xz |
Create symlink for IPMI Provider libraries
The IPMI provider libraries are installed into /usr/lib/ipmid-providers.
If the provider library is applicable for host-ipmid channel then soft
link is created to /usr/lib/host-ipmid. In this way the soft links are
created for the provider library to the corresponding directory.
Change-Id: I586bc830efd2b1d1ff1941181d1aa8d9a400f628
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
Diffstat (limited to 'meta-phosphor/classes/obmc-phosphor-ipmiprovider-symlink.bbclass')
-rw-r--r-- | meta-phosphor/classes/obmc-phosphor-ipmiprovider-symlink.bbclass | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/meta-phosphor/classes/obmc-phosphor-ipmiprovider-symlink.bbclass b/meta-phosphor/classes/obmc-phosphor-ipmiprovider-symlink.bbclass new file mode 100644 index 000000000..f2570fd6f --- /dev/null +++ b/meta-phosphor/classes/obmc-phosphor-ipmiprovider-symlink.bbclass @@ -0,0 +1,37 @@ +# Common code for recipes that create IPMI provider libraries + +LIBDIR = "${D}/${libdir}/ipmid-providers/" +HOSTIPMI_LIBDIR = "${D}/${libdir}/host-ipmid/" +NETIPMI_LIBDIR = "${D}/${libdir}/net-ipmid/" + +python symlink_create_postinstall() { + def install_symlink(d, libname, install_dir): + import glob; + + if not os.path.exists(install_dir): + os.makedirs(install_dir) + + lib_dir = d.getVar('LIBDIR', True) + + # find the library extension libxxx.so.? + install_file = lib_dir + libname + ".?" + + filelist = glob.glob(install_file); + + # get the library name + path, file = os.path.split(filelist[0]) + os.chdir(install_dir) + source = "../ipmid-providers/" + file + + # create the symlink + os.symlink(source, file) + + for libname in listvar_to_list(d, 'HOSTIPMI_PROVIDER_LIBRARY'): + install_dir = d.getVar('HOSTIPMI_LIBDIR', True) + install_symlink(d, libname, install_dir) + + for libname in listvar_to_list(d, 'NETIPMI_PROVIDER_LIBRARY'): + install_dir = d.getVar('NETIPMI_LIBDIR', True) + install_symlink(d, libname, install_dir) +} +do_install[postfuncs] += "symlink_create_postinstall"
\ No newline at end of file |