commit 39ee15dbc3d7a03572cb7adc7dafd4860a0a3b47
parent 313f1e0367f0c567cf2856e6383a697cc1125c64
Author: Marcel Holtmann <marcel@holtmann.org>
Date: Wed, 23 Jan 2019 18:20:58 +0100
build: Provide modules-load.d for loading pkcs8_key_parser module
Diffstat:
3 files changed, 21 insertions(+), 0 deletions(-)
diff --git 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
@@ -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
@@ -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