tools_kmod_SOURCES = tools/kmod.c tools/kmod.h tools/kmod-lsmod.c \
tools/kmod-rmmod.c tools/kmod-insmod.c \
- tools/kmod-modinfo.c
+ tools/kmod-modinfo.c tools/kmod-modprobe.c
tools_kmod_CPPFLAGS = $(AM_CPPFLAGS) -DKMOD_BUNDLE_TOOL=1
tools_kmod_LDADD = libkmod/libkmod.la
endif
(void)data;
}
-int main(int argc, char **orig_argv)
+static int do_modprobe(int argc, char **orig_argv)
{
struct kmod_ctx *ctx;
char **args = NULL, **argv;
free(config_paths);
return EXIT_FAILURE;
}
+
+#ifndef KMOD_BUNDLE_TOOL
+int main(int argc, char *argv[])
+{
+ return do_modprobe(argc, argv);
+}
+
+#else
+#include "kmod.h"
+
+const struct kmod_cmd kmod_cmd_compat_modprobe = {
+ .name = "modprobe",
+ .cmd = do_modprobe,
+ .help = "compat modprobe command",
+};
+
+#endif
&kmod_cmd_compat_rmmod,
&kmod_cmd_compat_insmod,
&kmod_cmd_compat_modinfo,
+ &kmod_cmd_compat_modprobe,
};
static int kmod_help(int argc, char *argv[])
extern const struct kmod_cmd kmod_cmd_compat_rmmod;
extern const struct kmod_cmd kmod_cmd_compat_insmod;
extern const struct kmod_cmd kmod_cmd_compat_modinfo;
+extern const struct kmod_cmd kmod_cmd_compat_modprobe;
#endif