udev-builtin-kmod.c revision 9f6445e34a57c270f013c9416c123e56261553dd
/*
* load kernel modules
*
* Copyright (C) 2011-2012 Kay Sievers <kay@vrfy.org>
* Copyright (C) 2011 ProFUSION embedded systems
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <libkmod.h>
#include "udev.h"
{
struct kmod_list *l;
int err;
if (err < 0)
return err;
kmod_list_foreach(l, list) {
if (err == KMOD_PROBE_APPLY_BLACKLIST)
else if (err == 0)
else
}
return err;
}
_printf_(6,0)
{
}
{
int i;
if (!ctx)
return 0;
return EXIT_FAILURE;
}
for (i = 2; argv[i]; i++) {
}
return EXIT_SUCCESS;
}
/* called at udev startup and reload */
{
if (ctx)
return 0;
if (!ctx)
return -ENOMEM;
log_debug("load module index");
return 0;
}
/* called on udev shutdown and reload request */
{
log_debug("unload module index");
}
/* called every couple of seconds during event activity; 'true' if config has changed */
{
log_debug("validate module index");
if (!ctx)
return false;
}
const struct udev_builtin udev_builtin_kmod = {
.name = "kmod",
.cmd = builtin_kmod,
.help = "kernel module loader",
.run_once = false,
};