4 * Copyright (C) 2011 Kay Sievers <kay.sievers@vrfy.org>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
33 static int builtin_kmod(struct udev_device
*dev
, int argc
, char *argv
[], bool test
)
35 struct udev
*udev
= udev_device_get_udev(dev
);
38 err(udev
, "missing command + argument\n");
42 printf("soon we '%s' the module '%s' (%i) here\n", argv
[1], argv
[2], argc
);
43 printf("test: %s\n", kmod
);
47 static int builtin_kmod_load(struct udev
*udev
)
49 info(udev
, "load module index\n");
50 asprintf(&kmod
, "pid: %u", getpid());
54 static int builtin_kmod_unload(struct udev
*udev
)
56 info(udev
, "unload module index\n");
61 const struct udev_builtin udev_builtin_kmod
= {
64 .load
= builtin_kmod_load
,
65 .unload
= builtin_kmod_unload
,
66 .help
= "kernel module loader",