ibm-s390-linux / s390-tools

Tools for use with the s390 Linux kernel and device drivers
MIT License
63 stars 59 forks source link

handling of the EKMF Web plugin and library #93

Closed sharkcz closed 3 years ago

sharkcz commented 3 years ago

s390-tools 2.15.0 have added EKMF Web plugin and support library to the set of produced libs and tools. But they don't follow the best practices on how they can be properly distributed.

You can take a look at the qclib, they also use plain Makefile to manage all details of the building/linking process.

sharkcz commented 3 years ago

also libekmfweb and the zkey-ekmfweb plugin should go under /usr/lib64 rather than /lib64

ifranzki commented 3 years ago

Thanks for suggesting this. I have prepared a patch to introduce what you asked for. Please take a look and let me know if this is what you are looking for: https://github.com/ifranzki/s390-tools/commit/b27e3ec68086672213a695e21ff764dac761502e

I moved zkey-ekmfweb.so to /usr/lib64/zkey/. To ensure that zkey can load this plugin I needed to specify the absolute path to the library in zkey/kms-plugins.conf. Is there a better way for this?

sharkcz commented 3 years ago

Thanks, Ingo. I have commented in the patch itself.

ifranzki commented 3 years ago

Thanks for the comments. I have reworked the commit according to your comments and force pushed, please see here: https://github.com/ifranzki/s390-tools/commit/d09ed47ea548b831d3556142d15164ef7bf2d9be.

So for zkey-ekmfweb.so I only create the .so without a version in the file names, but I set the soname ELF attribute to zkey-ekmfweb.so.1, is this correct?

sharkcz commented 3 years ago

Thanks for the comments. I have reworked the commit according to your comments and force pushed, please see here: ifranzki@d09ed47.

thanks, will take a look

So for zkey-ekmfweb.so I only create the .so without a version in the file names, but I set the soname ELF attribute to zkey-ekmfweb.so.1, is this correct?

yes, I would do it this way. It will contain the ABI info, but still allow simple dlopen()ing via zkey-ekmfweb.so.

sharkcz commented 3 years ago

I have commented in the new patch, I believe it should be the last batch :-) I have applied the changes locally and the result looks good.

ifranzki commented 3 years ago

Thanks, I have adjusted the commit accordingly: https://github.com/ifranzki/s390-tools/commit/4a1979de79d9de48a44538f856f1d50f398541a8

We will integrate this patch internally and make it available on the master branch soon.

sharkcz commented 3 years ago

Awesome, I will add the last version to the Fedora s390utils package.

ifranzki commented 3 years ago

Would moving zkey-ekmfweb.so to /usr/libexec/zkey/ be fine with you, too?

sharkcz commented 3 years ago

https://docs.fedoraproject.org/en-US/packaging-guidelines/#_libexecdir is what our guidelines say about libexec, thus I would prefer to keep zkey-ekmfweb.so in /usr/lib64/zkey.

xnox commented 3 years ago

https://docs.fedoraproject.org/en-US/packaging-guidelines/#_libexecdir is what our guidelines say about libexec, thus I would prefer to keep zkey-ekmfweb.so in /usr/lib64/zkey.

yes.... it says that libexecdir may be used..... which would be the same location for both Ubuntu and Fedora. Ubuntu cannot use /usr/lib64/zkey at all for the s390x port.

also it is cute that the fedora guidelines mention upstream configuration system.... it would be nice if s390-tools had meson (or make / autoconf, or well anything) to detect and configure these things. As by default rpm macros and debhelper do pass all of these paths with the right expected locations, to buildsystems that have configure step.