diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:42 +0000 |
commit | 78e9bb837c258ac0ec7712b3d612cc2f407e731e (patch) | |
tree | f515d16b6efd858a9aeb5b0ef5d6f90bf288283d /src/modules-load | |
parent | Adding debian version 255.5-1. (diff) | |
download | systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.tar.xz systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.zip |
Merging upstream version 256.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/modules-load')
-rw-r--r-- | src/modules-load/meson.build | 2 | ||||
-rw-r--r-- | src/modules-load/modules-load.c | 21 |
2 files changed, 5 insertions, 18 deletions
diff --git a/src/modules-load/meson.build b/src/modules-load/meson.build index 2f1decc..d6375a6 100644 --- a/src/modules-load/meson.build +++ b/src/modules-load/meson.build @@ -5,7 +5,7 @@ executables += [ 'name' : 'systemd-modules-load', 'conditions' : ['HAVE_KMOD'], 'sources' : files('modules-load.c'), - 'dependencies' : libkmod, + 'dependencies' : libkmod_cflags, }, ] diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c index efca237..c1f8183 100644 --- a/src/modules-load/modules-load.c +++ b/src/modules-load/modules-load.c @@ -23,14 +23,6 @@ static const char conf_file_dirs[] = CONF_PATHS_NULSTR("modules-load.d"); STATIC_DESTRUCTOR_REGISTER(arg_proc_cmdline_modules, strv_freep); -static void systemd_kmod_log(void *data, int priority, const char *file, int line, - const char *fn, const char *format, va_list args) { - - DISABLE_WARNING_FORMAT_NONLITERAL; - log_internalv(priority, 0, file, line, fn, format, args); - REENABLE_WARNING; -} - static int add_modules(const char *p) { _cleanup_strv_free_ char **k = NULL; @@ -156,7 +148,7 @@ static int parse_argv(int argc, char *argv[]) { } static int run(int argc, char *argv[]) { - _cleanup_(kmod_unrefp) struct kmod_ctx *ctx = NULL; + _cleanup_(sym_kmod_unrefp) struct kmod_ctx *ctx = NULL; int r, k; r = parse_argv(argc, argv); @@ -171,14 +163,9 @@ static int run(int argc, char *argv[]) { if (r < 0) log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m"); - ctx = kmod_new(NULL, NULL); - if (!ctx) { - log_error("Failed to allocate memory for kmod."); - return -ENOMEM; - } - - kmod_load_resources(ctx); - kmod_set_log_fn(ctx, systemd_kmod_log, NULL); + r = module_setup_context(&ctx); + if (r < 0) + return log_error_errno(r, "Failed to initialize libkmod context: %m"); r = 0; |