1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 00:51:24 +03:00

kmod-setup: conditionalize kmod autoloading properly

Load kdbus.ko only if we are built with kdbus, and load ip_tables.ko
only if we are built with iptables support.
This commit is contained in:
Lennart Poettering 2015-05-18 17:27:37 +02:00
parent 958b66ea16
commit a363680faa

View File

@ -65,11 +65,15 @@ int kmod_setup(void) {
/* this should never be a module */ /* this should never be a module */
{ "unix", "/proc/net/unix", true, NULL }, { "unix", "/proc/net/unix", true, NULL },
#ifdef ENABLE_KDBUS
/* IPC is needed before we bring up any other services */ /* IPC is needed before we bring up any other services */
{ "kdbus", "/sys/fs/kdbus", false, is_kdbus_wanted }, { "kdbus", "/sys/fs/kdbus", false, is_kdbus_wanted },
#endif
#ifdef HAVE_LIBIPTC
/* netfilter is needed by networkd, nspawn among others, and cannot be autoloaded */ /* netfilter is needed by networkd, nspawn among others, and cannot be autoloaded */
{ "ip_tables", "/proc/net/ip_tables_names", false, NULL }, { "ip_tables", "/proc/net/ip_tables_names", false, NULL },
#endif
}; };
struct kmod_ctx *ctx = NULL; struct kmod_ctx *ctx = NULL;
unsigned int i; unsigned int i;