1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00

builtin: kmod - depend on libkmod >= 5

This commit is contained in:
Lucas De Marchi 2012-02-06 21:47:00 -02:00 committed by Kay Sievers
parent 6118dab105
commit 96b2eef25b
2 changed files with 6 additions and 12 deletions

View File

@ -25,7 +25,7 @@ AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([POSIX RT library not fo
PKG_CHECK_MODULES(BLKID, blkid >= 2.20) PKG_CHECK_MODULES(BLKID, blkid >= 2.20)
PKG_CHECK_MODULES(KMOD, libkmod >= 3) PKG_CHECK_MODULES(KMOD, libkmod >= 5)
if test "x$cross_compiling" = "xno" ; then if test "x$cross_compiling" = "xno" ; then
AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids]) AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids])

View File

@ -36,7 +36,6 @@ static struct kmod_ctx *ctx;
static int load_module(struct udev *udev, const char *alias) static int load_module(struct udev *udev, const char *alias)
{ {
struct kmod_list *list = NULL; struct kmod_list *list = NULL;
struct kmod_list *listb = NULL;
struct kmod_list *l; struct kmod_list *l;
int err; int err;
@ -44,20 +43,16 @@ static int load_module(struct udev *udev, const char *alias)
if (err < 0) if (err < 0)
return err; return err;
err = kmod_module_get_filtered_blacklist(ctx, list, &listb);
if (err < 0)
return err;
if (list == NULL) if (list == NULL)
info(udev, "no module matches '%s'\n", alias); info(udev, "no module matches '%s'\n", alias);
else if (listb == NULL)
info(udev, "modules matching '%s' are blacklisted\n", alias);
kmod_list_foreach(l, listb) { kmod_list_foreach(l, list) {
struct kmod_module *mod = kmod_module_get_module(l); struct kmod_module *mod = kmod_module_get_module(l);
err = kmod_module_probe_insert_module(mod, 0, NULL, NULL, NULL); err = kmod_module_probe_insert_module(mod, KMOD_PROBE_APPLY_BLACKLIST, NULL, NULL, NULL, NULL);
if (err >=0 ) if (err == KMOD_PROBE_APPLY_BLACKLIST)
info(udev, "module '%s' is blacklisted\n", kmod_module_get_name(mod));
else if (err == 0)
info(udev, "inserted '%s'\n", kmod_module_get_name(mod)); info(udev, "inserted '%s'\n", kmod_module_get_name(mod));
else else
info(udev, "failed to insert '%s'\n", kmod_module_get_name(mod)); info(udev, "failed to insert '%s'\n", kmod_module_get_name(mod));
@ -66,7 +61,6 @@ static int load_module(struct udev *udev, const char *alias)
} }
kmod_module_unref_list(list); kmod_module_unref_list(list);
kmod_module_unref_list(listb);
return err; return err;
} }