wok view busybox/stuff/busybox-1.16.1-modprobe.u @ rev 5738

Add 'git-gui' package, v0.12.0.66.
Tested on Stable (built & installed) and Cooking (installed after upgrade) successfully.
author Ben Arnold <ben@seawolfsanctuary.com>
date Sat Jun 26 13:59:56 2010 +0100 (2010-06-26)
parents 52dc580d9edb
children
line source
1 --- busybox-1.16.1/include/usage.h
2 +++ busybox-1.16.1/include/usage.h
3 @@ -2898,7 +2898,7 @@
4 #define modprobe_trivial_usage \
5 IF_MODPROBE_SMALL("[-qfwrsv] MODULE [symbol=value]...") \
6 IF_NOT_MODPROBE_SMALL("[-" \
7 - IF_FEATURE_2_4_MODULES("k")"nqrsv" \
8 + IF_FEATURE_2_4_MODULES("k")"nlqrsv" \
9 IF_FEATURE_MODPROBE_BLACKLIST("b")"] MODULE [symbol=value]...")
10 #define modprobe_full_usage "\n\n" \
11 "Options:" \
12 @@ -2915,6 +2915,7 @@
13 "\n -k Make module autoclean-able" \
14 ) \
15 "\n -n Dry run" \
16 + "\n -l List" \
17 "\n -q Quiet" \
18 "\n -r Remove module (stacks) or do autoclean" \
19 "\n -s Report via syslog instead of stderr" \
21 --- busybox-1.16.1/modutils/modprobe.c
22 +++ busybox-1.16.1/modutils/modprobe.c
23 @@ -367,11 +367,10 @@
24 opt = getopt32(argv, INSMOD_OPTS MODPROBE_OPTS INSMOD_ARGS, NULL, NULL);
25 argv += optind;
27 - if (opt & (MODPROBE_OPT_DUMP_ONLY | MODPROBE_OPT_LIST_ONLY |
28 - MODPROBE_OPT_SHOW_ONLY))
29 + if (opt & (MODPROBE_OPT_DUMP_ONLY | MODPROBE_OPT_SHOW_ONLY))
30 bb_error_msg_and_die("not supported");
32 - if (!argv[0]) {
33 + if (!argv[0] && !(opt & MODPROBE_OPT_LIST_ONLY)) {
34 if (opt & MODPROBE_OPT_REMOVE) {
35 /* "modprobe -r" (w/o params).
36 * "If name is NULL, all unused modules marked
37 @@ -403,6 +402,27 @@
38 DBG("adding module %s", *argv);
39 add_probe(*argv++);
40 } while (*argv);
41 + } else if (opt & MODPROBE_OPT_LIST_ONLY) {
42 + char *colon, name[MODULE_NAME_LEN], *tokens[2];
43 + parser_t *p = config_open2(CONFIG_DEFAULT_DEPMOD_FILE, xfopen_for_read);
44 +
45 + while (config_read(p, tokens, 2, 1, "# \t", PARSE_NORMAL)) {
46 + int i;
47 +
48 + colon = last_char_is(tokens[0], ':');
49 + if (colon == NULL)
50 + continue;
51 + *colon = 0;
52 + filename2modname(tokens[0], name);
53 + if (!argv[0])
54 + puts(tokens[0]);
55 + else for (i = 0; argv[i]; i++) {
56 + if (fnmatch(argv[i],name,0) == 0) {
57 + puts(tokens[0]);
58 + }
59 + }
60 + }
61 + return EXIT_SUCCESS;
62 } else {
63 /* First argument is module name, rest are parameters */
64 DBG("probing just module %s", *argv);