wok-stable annotate busybox/stuff/busybox-1.12.0-modprobe.u @ rev 5692

busybox: add modprobe -l support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jun 05 15:38:11 2010 +0200 (2010-06-05)
parents 6e89af8c5f82
children
rev   line source
pascal@1402 1 --- busybox-1.12.0/modutils/modprobe.c
pascal@1402 2 +++ busybox-1.12.0/modutils/modprobe.c
pascal@1402 3 @@ -932,8 +932,9 @@
pascal@1402 4 opt = getopt32(argv, MAIN_OPT_STR, &unused, &unused);
pascal@1402 5 argv += optind;
pascal@1402 6
pascal@1402 7 - if (opt & (DUMP_CONF_EXIT | LIST_ALL))
pascal@1402 8 + if (opt & DUMP_CONF_EXIT)
pascal@1402 9 return EXIT_SUCCESS;
pascal@1402 10 +
pascal@1402 11 if (opt & (RESTRICT_DIR | CONFIG_FILE))
pascal@1402 12 bb_error_msg_and_die("-t and -C not supported");
pascal@1402 13
pascal@1430 14 @@ -942,6 +943,15 @@
pascal@1402 15 if (!depend)
pascal@1402 16 bb_error_msg_and_die("cannot parse "CONFIG_DEFAULT_DEPMOD_FILE);
pascal@1402 17
pascal@1402 18 + if (opt & LIST_ALL) {
pascal@1430 19 + struct dep_t *dt;
pascal@1430 20 + for (dt = depend; dt && dt->m_path; dt = dt->m_next) {
pascal@1430 21 + if (*argv && fnmatch(*argv,dt->m_name,0)) continue;
pascal@1430 22 + puts(dt->m_path);
pascal@1402 23 + }
pascal@1402 24 + return EXIT_SUCCESS;
pascal@1402 25 + }
pascal@1402 26 +
pascal@1402 27 if (remove_opt) {
pascal@1402 28 do {
pascal@1402 29 /* (*argv) can be NULL here */
pascal@1637 30
pascal@1637 31 --- busybox-1.12.0/modutils/modprobe.c
pascal@1637 32 +++ busybox-1.12.0/modutils/modprobe.c
pascal@1637 33 @@ -921,6 +921,20 @@
pascal@1637 34 return rc;
pascal@1637 35 }
pascal@1637 36
pascal@1637 37 +void mod_walk(void (*action)(char *name, char *path, void *env), void *data);
pascal@1637 38 +void mod_walk(void (*action)(char *name, char *path, void *env), void *data)
pascal@1637 39 +{
pascal@1637 40 + struct dep_t *dt;
pascal@1637 41 +
pascal@1637 42 + depend = build_dep();
pascal@1637 43 + if (!depend)
pascal@1637 44 + bb_error_msg_and_die("cannot parse "CONFIG_DEFAULT_DEPMOD_FILE);
pascal@1637 45 +
pascal@1637 46 + for (dt = depend; dt && dt->m_path; dt = dt->m_next) {
pascal@1637 47 + action(dt->m_name, dt->m_path, data);
pascal@1637 48 + }
pascal@1637 49 +}
pascal@1637 50 +
pascal@1637 51 int modprobe_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
pascal@1637 52 int modprobe_main(int argc UNUSED_PARAM, char **argv)
pascal@1637 53 {