From 39ee15dbc3d7a03572cb7adc7dafd4860a0a3b47 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 23 Jan 2019 18:20:58 +0100 Subject: [PATCH] build: Provide modules-load.d for loading pkcs8_key_parser module --- Makefile.am | 3 +++ configure.ac | 13 +++++++++++++ src/pkcs8.conf | 5 +++++ 3 files changed, 21 insertions(+) create mode 100644 src/pkcs8.conf diff --git a/Makefile.am b/Makefile.am index 435bc872..837f9bd0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -142,6 +142,9 @@ systemd_unit_DATA = dbus_busdir = @DBUS_BUSDIR@ dbus_bus_DATA = + +systemd_modloaddir = @SYSTEMD_MODLOADDIR@ +systemd_modload_DATA = src/pkcs8.conf endif eap_sources = src/eap.c src/eap.h src/eap-private.h \ diff --git a/configure.ac b/configure.ac index 3198e6a2..19239d44 100644 --- a/configure.ac +++ b/configure.ac @@ -209,6 +209,19 @@ if (test "${enable_systemd_service}" != "no" && test -z "${path_systemd_unitdir} fi AC_SUBST(SYSTEMD_UNITDIR, [${path_systemd_unitdir}]) +AC_ARG_WITH([systemd-modloaddir], AC_HELP_STRING([--with-systemd-modloaddir=DIR], + [path to systemd modules load directory]), + [path_systemd_modloaddir=${withval}]) +if (test "${enable_systemd_service}" != "no" && test -z "${path_systemd_modloaddir}"); then + AC_MSG_CHECKING([systemd modules load directory]) + path_systemd_modloaddir="`$PKG_CONFIG --variable=modulesloaddir systemd`" + if (test -z "${path_systemd_modloaddir}"); then + AC_MSG_ERROR([systemd modules load directory is required]) + fi + AC_MSG_RESULT([${path_systemd_modloaddir}]) +fi +AC_SUBST(SYSTEMD_MODLOADDIR, [${path_systemd_modloaddir}]) + AC_ARG_ENABLE([external_ell], AC_HELP_STRING([--enable-external-ell], [enable external Embedded Linux library]), [enable_external_ell=${enableval}]) diff --git a/src/pkcs8.conf b/src/pkcs8.conf new file mode 100644 index 00000000..eae958e8 --- /dev/null +++ b/src/pkcs8.conf @@ -0,0 +1,5 @@ +# When distributions use CONFIG_PKCS8_PRIVATE_KEY_PARSER=m kernel option, +# using keyctl(2) will fail for loading PKCS#8 private keys since there is +# no automatic module loading for key type parsers. This entry ensures +# that the kernel module pkcs8_key_parser.ko is loaded at boot time. +pkcs8_key_parser