diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2014-04-19 15:04:39 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2014-04-19 15:04:39 +0200 |
| commit | 5fd3ddfb243f8f3a8ef471ff8c323a76cf815574 (patch) | |
| tree | 80138de44f47129192fc4d65ee89bb57a5975f3b | |
| parent | e152cb818903f219a641c03b7c3ef290ed39a49d (diff) | |
| download | busybox-w32-5fd3ddfb243f8f3a8ef471ff8c323a76cf815574.tar.gz busybox-w32-5fd3ddfb243f8f3a8ef471ff8c323a76cf815574.tar.bz2 busybox-w32-5fd3ddfb243f8f3a8ef471ff8c323a76cf815574.zip | |
modprobe-small: fix help messages for aliased module-related applets
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| -rw-r--r-- | include/applets.src.h | 50 | ||||
| -rw-r--r-- | modutils/insmod.c | 2 | ||||
| -rw-r--r-- | modutils/modprobe-small.c | 18 | ||||
| -rw-r--r-- | modutils/modprobe.c | 2 | ||||
| -rwxr-xr-x | scripts/trylink | 2 |
5 files changed, 35 insertions, 39 deletions
diff --git a/include/applets.src.h b/include/applets.src.h index 7dbd4c7f3..aedcf22dc 100644 --- a/include/applets.src.h +++ b/include/applets.src.h | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | /* | 9 | /* |
| 10 | name - applet name as it is typed on command line | 10 | name - applet name as it is typed on command line |
| 11 | name2 - applet name, converted to C (ether-wake: name2 = ether_wake) | 11 | help - applet name, converted to C (ether-wake: help = ether_wake) |
| 12 | main - corresponding <applet>_main to call (bzcat: main = bunzip2) | 12 | main - corresponding <applet>_main to call (bzcat: main = bunzip2) |
| 13 | l - location to install link to: [/usr]/[s]bin | 13 | l - location to install link to: [/usr]/[s]bin |
| 14 | s - suid type: | 14 | s - suid type: |
| @@ -24,46 +24,46 @@ s - suid type: | |||
| 24 | 24 | ||
| 25 | #if defined(PROTOTYPES) | 25 | #if defined(PROTOTYPES) |
| 26 | # define APPLET(name,l,s) int name##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 26 | # define APPLET(name,l,s) int name##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
| 27 | # define APPLET_ODDNAME(name,main,l,s,name2) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 27 | # define APPLET_ODDNAME(name,main,l,s,help) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
| 28 | # define APPLET_NOEXEC(name,main,l,s,name2) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 28 | # define APPLET_NOEXEC(name,main,l,s,help) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
| 29 | # define APPLET_NOFORK(name,main,l,s,name2) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 29 | # define APPLET_NOFORK(name,main,l,s,help) int main##_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
| 30 | 30 | ||
| 31 | #elif defined(NAME_MAIN_CNAME) | 31 | #elif defined(NAME_MAIN) |
| 32 | # define APPLET(name,l,s) name name##_main name | 32 | # define APPLET(name,l,s) name name##_main |
| 33 | # define APPLET_ODDNAME(name,main,l,s,name2) name main##_main name2 | 33 | # define APPLET_ODDNAME(name,main,l,s,help) name main##_main |
| 34 | # define APPLET_NOEXEC(name,main,l,s,name2) name main##_main name2 | 34 | # define APPLET_NOEXEC(name,main,l,s,help) name main##_main |
| 35 | # define APPLET_NOFORK(name,main,l,s,name2) name main##_main name2 | 35 | # define APPLET_NOFORK(name,main,l,s,help) name main##_main |
| 36 | 36 | ||
| 37 | #elif defined(MAKE_USAGE) && ENABLE_FEATURE_VERBOSE_USAGE | 37 | #elif defined(MAKE_USAGE) && ENABLE_FEATURE_VERBOSE_USAGE |
| 38 | # define APPLET(name,l,s) MAKE_USAGE(#name, name##_trivial_usage name##_full_usage) | 38 | # define APPLET(name,l,s) MAKE_USAGE(#name, name##_trivial_usage name##_full_usage) |
| 39 | # define APPLET_ODDNAME(name,main,l,s,name2) MAKE_USAGE(#name, name2##_trivial_usage name2##_full_usage) | 39 | # define APPLET_ODDNAME(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage help##_full_usage) |
| 40 | # define APPLET_NOEXEC(name,main,l,s,name2) MAKE_USAGE(#name, name2##_trivial_usage name2##_full_usage) | 40 | # define APPLET_NOEXEC(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage help##_full_usage) |
| 41 | # define APPLET_NOFORK(name,main,l,s,name2) MAKE_USAGE(#name, name2##_trivial_usage name2##_full_usage) | 41 | # define APPLET_NOFORK(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage help##_full_usage) |
| 42 | 42 | ||
| 43 | #elif defined(MAKE_USAGE) && !ENABLE_FEATURE_VERBOSE_USAGE | 43 | #elif defined(MAKE_USAGE) && !ENABLE_FEATURE_VERBOSE_USAGE |
| 44 | # define APPLET(name,l,s) MAKE_USAGE(#name, name##_trivial_usage) | 44 | # define APPLET(name,l,s) MAKE_USAGE(#name, name##_trivial_usage) |
| 45 | # define APPLET_ODDNAME(name,main,l,s,name2) MAKE_USAGE(#name, name2##_trivial_usage) | 45 | # define APPLET_ODDNAME(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage) |
| 46 | # define APPLET_NOEXEC(name,main,l,s,name2) MAKE_USAGE(#name, name2##_trivial_usage) | 46 | # define APPLET_NOEXEC(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage) |
| 47 | # define APPLET_NOFORK(name,main,l,s,name2) MAKE_USAGE(#name, name2##_trivial_usage) | 47 | # define APPLET_NOFORK(name,main,l,s,help) MAKE_USAGE(#name, help##_trivial_usage) |
| 48 | 48 | ||
| 49 | #elif defined(MAKE_LINKS) | 49 | #elif defined(MAKE_LINKS) |
| 50 | # define APPLET(name,l,c) LINK l name | 50 | # define APPLET(name,l,c) LINK l name |
| 51 | # define APPLET_ODDNAME(name,main,l,s,name2) LINK l name | 51 | # define APPLET_ODDNAME(name,main,l,s,help) LINK l name |
| 52 | # define APPLET_NOEXEC(name,main,l,s,name2) LINK l name | 52 | # define APPLET_NOEXEC(name,main,l,s,help) LINK l name |
| 53 | # define APPLET_NOFORK(name,main,l,s,name2) LINK l name | 53 | # define APPLET_NOFORK(name,main,l,s,help) LINK l name |
| 54 | 54 | ||
| 55 | #elif defined(MAKE_SUID) | 55 | #elif defined(MAKE_SUID) |
| 56 | # define APPLET(name,l,s) SUID s l name | 56 | # define APPLET(name,l,s) SUID s l name |
| 57 | # define APPLET_ODDNAME(name,main,l,s,name2) SUID s l name | 57 | # define APPLET_ODDNAME(name,main,l,s,help) SUID s l name |
| 58 | # define APPLET_NOEXEC(name,main,l,s,name2) SUID s l name | 58 | # define APPLET_NOEXEC(name,main,l,s,help) SUID s l name |
| 59 | # define APPLET_NOFORK(name,main,l,s,name2) SUID s l name | 59 | # define APPLET_NOFORK(name,main,l,s,help) SUID s l name |
| 60 | 60 | ||
| 61 | #else | 61 | #else |
| 62 | static struct bb_applet applets[] = { /* name, main, location, need_suid */ | 62 | static struct bb_applet applets[] = { /* name, main, location, need_suid */ |
| 63 | # define APPLET(name,l,s) { #name, #name, l, s }, | 63 | # define APPLET(name,l,s) { #name, #name, l, s }, |
| 64 | # define APPLET_ODDNAME(name,main,l,s,name2) { #name, #main, l, s }, | 64 | # define APPLET_ODDNAME(name,main,l,s,help) { #name, #main, l, s }, |
| 65 | # define APPLET_NOEXEC(name,main,l,s,name2) { #name, #main, l, s, 1 }, | 65 | # define APPLET_NOEXEC(name,main,l,s,help) { #name, #main, l, s, 1 }, |
| 66 | # define APPLET_NOFORK(name,main,l,s,name2) { #name, #main, l, s, 1, 1 }, | 66 | # define APPLET_NOFORK(name,main,l,s,help) { #name, #main, l, s, 1, 1 }, |
| 67 | #endif | 67 | #endif |
| 68 | 68 | ||
| 69 | #if ENABLE_INSTALL_NO_USR | 69 | #if ENABLE_INSTALL_NO_USR |
| @@ -391,7 +391,7 @@ IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) | |||
| 391 | IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) | 391 | IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) |
| 392 | IF_ZCIP(APPLET(zcip, BB_DIR_SBIN, BB_SUID_DROP)) | 392 | IF_ZCIP(APPLET(zcip, BB_DIR_SBIN, BB_SUID_DROP)) |
| 393 | 393 | ||
| 394 | #if !defined(PROTOTYPES) && !defined(NAME_MAIN_CNAME) && !defined(MAKE_USAGE) \ | 394 | #if !defined(PROTOTYPES) && !defined(NAME_MAIN) && !defined(MAKE_USAGE) \ |
| 395 | && !defined(MAKE_LINKS) && !defined(MAKE_SUID) | 395 | && !defined(MAKE_LINKS) && !defined(MAKE_SUID) |
| 396 | }; | 396 | }; |
| 397 | #endif | 397 | #endif |
diff --git a/modutils/insmod.c b/modutils/insmod.c index 887d9f2a3..9c3c992a5 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | //usage: IF_NOT_FEATURE_2_4_MODULES("FILE ") | 21 | //usage: IF_NOT_FEATURE_2_4_MODULES("FILE ") |
| 22 | //usage: "[SYMBOL=VALUE]..." | 22 | //usage: "[SYMBOL=VALUE]..." |
| 23 | //usage:#define insmod_full_usage "\n\n" | 23 | //usage:#define insmod_full_usage "\n\n" |
| 24 | //usage: "Load the specified kernel modules into the kernel" | 24 | //usage: "Load kernel module" |
| 25 | //usage: IF_FEATURE_2_4_MODULES( "\n" | 25 | //usage: IF_FEATURE_2_4_MODULES( "\n" |
| 26 | //usage: "\n -f Force module to load into the wrong kernel version" | 26 | //usage: "\n -f Force module to load into the wrong kernel version" |
| 27 | //usage: "\n -k Make module autoclean-able" | 27 | //usage: "\n -k Make module autoclean-able" |
diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c index 5b7836344..023755db3 100644 --- a/modutils/modprobe-small.c +++ b/modutils/modprobe-small.c | |||
| @@ -9,10 +9,10 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | //applet:IF_MODPROBE_SMALL(APPLET(modprobe, BB_DIR_SBIN, BB_SUID_DROP)) | 11 | //applet:IF_MODPROBE_SMALL(APPLET(modprobe, BB_DIR_SBIN, BB_SUID_DROP)) |
| 12 | //applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(depmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, modprobe)) | 12 | //applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(depmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, depmod)) |
| 13 | //applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(insmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, modprobe)) | 13 | //applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(insmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, insmod)) |
| 14 | //applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(lsmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, modprobe)) | 14 | //applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(lsmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, lsmod)) |
| 15 | //applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(rmmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, modprobe)) | 15 | //applet:IF_MODPROBE_SMALL(APPLET_ODDNAME(rmmod, modprobe, BB_DIR_SBIN, BB_SUID_DROP, rmmod)) |
| 16 | 16 | ||
| 17 | #include "libbb.h" | 17 | #include "libbb.h" |
| 18 | /* After libbb.h, since it needs sys/types.h on some systems */ | 18 | /* After libbb.h, since it needs sys/types.h on some systems */ |
| @@ -583,7 +583,7 @@ static void process_module(char *name, const char *cmdline_options) | |||
| 583 | // for the given alias. For example, | 583 | // for the given alias. For example, |
| 584 | // "pci:v00008086d00007010sv00000000sd00000000bc01sc01i80" matches | 584 | // "pci:v00008086d00007010sv00000000sd00000000bc01sc01i80" matches |
| 585 | // ata_piix because it has an alias "pci:v00008086d00007010sv*sd*bc*sc*i*" | 585 | // ata_piix because it has an alias "pci:v00008086d00007010sv*sd*bc*sc*i*" |
| 586 | // and ata_generic, it has an alias "alias=pci:v*d*sv*sd*bc01sc01i*" | 586 | // and ata_generic, it has an alias "pci:v*d*sv*sd*bc01sc01i*" |
| 587 | // Standard modprobe would load them both. | 587 | // Standard modprobe would load them both. |
| 588 | // In this code, find_alias() returns only the first matching module. | 588 | // In this code, find_alias() returns only the first matching module. |
| 589 | 589 | ||
| @@ -703,10 +703,6 @@ The following options are useful for people managing distributions: | |||
| 703 | 703 | ||
| 704 | //usage:#if ENABLE_MODPROBE_SMALL | 704 | //usage:#if ENABLE_MODPROBE_SMALL |
| 705 | 705 | ||
| 706 | //// Note: currently, help system shows modprobe --help text for all aliased cmds | ||
| 707 | //// (see APPLET_ODDNAME macro definition). | ||
| 708 | //// All other help texts defined below are not used. FIXME? | ||
| 709 | |||
| 710 | //usage:#define depmod_trivial_usage NOUSAGE_STR | 706 | //usage:#define depmod_trivial_usage NOUSAGE_STR |
| 711 | //usage:#define depmod_full_usage "" | 707 | //usage:#define depmod_full_usage "" |
| 712 | 708 | ||
| @@ -720,7 +716,7 @@ The following options are useful for people managing distributions: | |||
| 720 | //usage: IF_NOT_FEATURE_2_4_MODULES("FILE ") | 716 | //usage: IF_NOT_FEATURE_2_4_MODULES("FILE ") |
| 721 | //usage: "[SYMBOL=VALUE]..." | 717 | //usage: "[SYMBOL=VALUE]..." |
| 722 | //usage:#define insmod_full_usage "\n\n" | 718 | //usage:#define insmod_full_usage "\n\n" |
| 723 | //usage: "Load the specified kernel modules into the kernel" | 719 | //usage: "Load kernel module" |
| 724 | //usage: IF_FEATURE_2_4_MODULES( "\n" | 720 | //usage: IF_FEATURE_2_4_MODULES( "\n" |
| 725 | //usage: "\n -f Force module to load into the wrong kernel version" | 721 | //usage: "\n -f Force module to load into the wrong kernel version" |
| 726 | //usage: "\n -k Make module autoclean-able" | 722 | //usage: "\n -k Make module autoclean-able" |
| @@ -745,7 +741,7 @@ The following options are useful for people managing distributions: | |||
| 745 | //usage: "$ rmmod tulip\n" | 741 | //usage: "$ rmmod tulip\n" |
| 746 | 742 | ||
| 747 | //usage:#define modprobe_trivial_usage | 743 | //usage:#define modprobe_trivial_usage |
| 748 | //usage: "[-qfwrsv] MODULE [symbol=value]..." | 744 | //usage: "[-qfwrsv] MODULE [SYMBOL=VALUE]..." |
| 749 | //usage:#define modprobe_full_usage "\n\n" | 745 | //usage:#define modprobe_full_usage "\n\n" |
| 750 | //usage: " -r Remove MODULE (stacks) or do autoclean" | 746 | //usage: " -r Remove MODULE (stacks) or do autoclean" |
| 751 | //usage: "\n -q Quiet" | 747 | //usage: "\n -q Quiet" |
diff --git a/modutils/modprobe.c b/modutils/modprobe.c index 7f7446d8e..f08f0850d 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c | |||
| @@ -87,7 +87,7 @@ | |||
| 87 | //usage: | 87 | //usage: |
| 88 | //usage:#define modprobe_trivial_usage | 88 | //usage:#define modprobe_trivial_usage |
| 89 | //usage: "[-alrqvsD" IF_FEATURE_MODPROBE_BLACKLIST("b") "]" | 89 | //usage: "[-alrqvsD" IF_FEATURE_MODPROBE_BLACKLIST("b") "]" |
| 90 | //usage: " MODULE [symbol=value]..." | 90 | //usage: " MODULE [SYMBOL=VALUE]..." |
| 91 | //usage:#define modprobe_full_usage "\n\n" | 91 | //usage:#define modprobe_full_usage "\n\n" |
| 92 | //usage: " -a Load multiple MODULEs" | 92 | //usage: " -a Load multiple MODULEs" |
| 93 | //usage: "\n -l List (MODULE is a pattern)" | 93 | //usage: "\n -l List (MODULE is a pattern)" |
diff --git a/scripts/trylink b/scripts/trylink index e47169917..85095235c 100755 --- a/scripts/trylink +++ b/scripts/trylink | |||
| @@ -268,7 +268,7 @@ fi | |||
| 268 | 268 | ||
| 269 | if test "$CONFIG_FEATURE_INDIVIDUAL" = y; then | 269 | if test "$CONFIG_FEATURE_INDIVIDUAL" = y; then |
| 270 | echo "Linking individual applets against libbusybox (see $sharedlib_dir/*)" | 270 | echo "Linking individual applets against libbusybox (see $sharedlib_dir/*)" |
| 271 | gcc -DNAME_MAIN_CNAME -E -include include/autoconf.h include/applets.h \ | 271 | gcc -DNAME_MAIN -E -include include/autoconf.h include/applets.h \ |
| 272 | | grep -v "^#" \ | 272 | | grep -v "^#" \ |
| 273 | | grep -v "^$" \ | 273 | | grep -v "^$" \ |
| 274 | > applet_lst.tmp | 274 | > applet_lst.tmp |
