diff options
| author | Mike Frysinger <vapier@gentoo.org> | 2009-05-05 20:13:45 -0400 |
|---|---|---|
| committer | Mike Frysinger <vapier@gentoo.org> | 2009-05-05 20:13:45 -0400 |
| commit | 00ffaeab80fa12959df7b237326dac73f6ee7680 (patch) | |
| tree | cbdfbd78f33155e0dc3c4554a5a626c08d961f13 /modutils | |
| parent | 3322351724be7e094dfe82a496fd0bbc1626ffff (diff) | |
| download | busybox-w32-00ffaeab80fa12959df7b237326dac73f6ee7680.tar.gz busybox-w32-00ffaeab80fa12959df7b237326dac73f6ee7680.tar.bz2 busybox-w32-00ffaeab80fa12959df7b237326dac73f6ee7680.zip | |
modprobe: add more useful debug points
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'modutils')
| -rw-r--r-- | modutils/modprobe.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c index 3474964f8..52f5e1008 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | #include <sys/utsname.h> | 13 | #include <sys/utsname.h> |
| 14 | #include <fnmatch.h> | 14 | #include <fnmatch.h> |
| 15 | 15 | ||
| 16 | //#define DBG(...) bb_error_msg(__VA_ARGS__) | 16 | //#define DBG(fmt, ...) bb_error_msg("%s: " fmt, __func__, ## __VA_ARGS__) |
| 17 | #define DBG(...) ((void)0) | 17 | #define DBG(...) ((void)0) |
| 18 | 18 | ||
| 19 | #define MODULE_FLAG_LOADED 0x0001 | 19 | #define MODULE_FLAG_LOADED 0x0001 |
| @@ -114,6 +114,7 @@ static void add_probe(const char *name) | |||
| 114 | return; | 114 | return; |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | DBG("queuing %s", name); | ||
| 117 | m->probed_name = name; | 118 | m->probed_name = name; |
| 118 | m->flags |= MODULE_FLAG_NEED_DEPS; | 119 | m->flags |= MODULE_FLAG_NEED_DEPS; |
| 119 | llist_add_to_end(&G.probes, m); | 120 | llist_add_to_end(&G.probes, m); |
| @@ -206,6 +207,7 @@ static int do_modprobe(struct module_entry *m) | |||
| 206 | struct module_entry *m2; | 207 | struct module_entry *m2; |
| 207 | char *fn, *options; | 208 | char *fn, *options; |
| 208 | int rc = -1; | 209 | int rc = -1; |
| 210 | llist_t *l; | ||
| 209 | 211 | ||
| 210 | if (!(m->flags & MODULE_FLAG_FOUND_IN_MODDEP)) { | 212 | if (!(m->flags & MODULE_FLAG_FOUND_IN_MODDEP)) { |
| 211 | DBG("skipping %s, not found in modules.dep", m->modname); | 213 | DBG("skipping %s, not found in modules.dep", m->modname); |
| @@ -216,6 +218,9 @@ static int do_modprobe(struct module_entry *m) | |||
| 216 | if (!(option_mask32 & MODPROBE_OPT_REMOVE)) | 218 | if (!(option_mask32 & MODPROBE_OPT_REMOVE)) |
| 217 | m->deps = llist_rev(m->deps); | 219 | m->deps = llist_rev(m->deps); |
| 218 | 220 | ||
| 221 | for (l = m->deps; l != NULL; l = l->link) | ||
| 222 | DBG("dep: %s", l->data); | ||
| 223 | |||
| 219 | rc = 0; | 224 | rc = 0; |
| 220 | while (m->deps && rc == 0) { | 225 | while (m->deps && rc == 0) { |
| 221 | fn = llist_pop(&m->deps); | 226 | fn = llist_pop(&m->deps); |
| @@ -292,7 +297,8 @@ static void load_modules_dep(void) | |||
| 292 | llist_add_to(&m->deps, xstrdup(tokens[0])); | 297 | llist_add_to(&m->deps, xstrdup(tokens[0])); |
| 293 | if (tokens[1]) | 298 | if (tokens[1]) |
| 294 | string_to_llist(tokens[1], &m->deps, " "); | 299 | string_to_llist(tokens[1], &m->deps, " "); |
| 295 | } | 300 | } else |
| 301 | DBG("skipping dep line"); | ||
| 296 | } | 302 | } |
| 297 | config_close(p); | 303 | config_close(p); |
| 298 | } | 304 | } |
| @@ -342,10 +348,12 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv) | |||
| 342 | if (opt & MODPROBE_OPT_INSERT_ALL) { | 348 | if (opt & MODPROBE_OPT_INSERT_ALL) { |
| 343 | /* Each argument is a module name */ | 349 | /* Each argument is a module name */ |
| 344 | do { | 350 | do { |
| 351 | DBG("adding module %s", *argv); | ||
| 345 | add_probe(*argv++); | 352 | add_probe(*argv++); |
| 346 | } while (*argv); | 353 | } while (*argv); |
| 347 | } else { | 354 | } else { |
| 348 | /* First argument is module name, rest are parameters */ | 355 | /* First argument is module name, rest are parameters */ |
| 356 | DBG("probing just module %s", *argv); | ||
| 349 | add_probe(argv[0]); | 357 | add_probe(argv[0]); |
| 350 | G.cmdline_mopts = parse_cmdline_module_options(argv); | 358 | G.cmdline_mopts = parse_cmdline_module_options(argv); |
| 351 | } | 359 | } |
