From b82b34e06d0f8b91a1a30a847e0b1dd80ed0a046 Mon Sep 17 00:00:00 2001 From: Pascal Bellard Date: Mon, 7 Jun 2010 01:16:45 +0200 Subject: modprobe: add support for -l and -s. Remove some unsupported options Fixed some goofs in help text function old new delta modprobe_main 494 653 +159 packed_usage 27129 27145 +16 insmod_main 98 95 -3 Signed-off-by: Pascal Bellard Signed-off-by: Denys Vlasenko --- modutils/modutils.h | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) (limited to 'modutils/modutils.h') diff --git a/modutils/modutils.h b/modutils/modutils.h index 131a5087b..d46870ca6 100644 --- a/modutils/modutils.h +++ b/modutils/modutils.h @@ -23,32 +23,27 @@ int string_to_llist(char *string, llist_t **llist, const char *delim) FAST_FUNC; char *filename2modname(const char *filename, char *modname) FAST_FUNC; char *parse_cmdline_module_options(char **argv) FAST_FUNC; +/* insmod for 2.4 and modprobe's options (insmod 2.6 has no options at all): */ #define INSMOD_OPTS \ - "vq" \ - IF_FEATURE_2_4_MODULES("sLo:fkx") \ - IF_FEATURE_INSMOD_LOAD_MAP("m") - -#define INSMOD_ARGS IF_FEATURE_2_4_MODULES(, NULL) + "vqs" \ + IF_FEATURE_2_4_MODULES("Lfkx" IF_FEATURE_INSMOD_LOAD_MAP("m")) +#define INSMOD_ARGS /* (was meant to support -o NAME) , NULL */ enum { - INSMOD_OPT_VERBOSE = 0x0001, - INSMOD_OPT_SILENT = 0x0002, - INSMOD_OPT_SYSLOG = 0x0004 * ENABLE_FEATURE_2_4_MODULES, - INSMOD_OPT_LOCK = 0x0008 * ENABLE_FEATURE_2_4_MODULES, - INSMOD_OPT_OUTPUTNAME = 0x0010 * ENABLE_FEATURE_2_4_MODULES, - INSMOD_OPT_FORCE = 0x0020 * ENABLE_FEATURE_2_4_MODULES, - INSMOD_OPT_KERNELD = 0x0040 * ENABLE_FEATURE_2_4_MODULES, - INSMOD_OPT_NO_EXPORT = 0x0080 * ENABLE_FEATURE_2_4_MODULES, - INSMOD_OPT_PRINT_MAP = 0x0100 * ENABLE_FEATURE_INSMOD_LOAD_MAP, -#if ENABLE_FEATURE_2_4_MODULES -# if ENABLE_FEATURE_INSMOD_LOAD_MAP - INSMOD_OPT_UNUSED = 0x0200, -# else - INSMOD_OPT_UNUSED = 0x0100, -# endif -#else - INSMOD_OPT_UNUSED = 0x0004, -#endif + INSMOD_OPT_VERBOSE = (1 << 0), + INSMOD_OPT_SILENT = (1 << 1), + INSMOD_OPT_SYSLOG = (1 << 2), + //INSMOD_OPT_OUTPUTNAME = (1 << x) - not supported yet + INSMOD_OPT_LOCK = (1 << 3) * ENABLE_FEATURE_2_4_MODULES, + INSMOD_OPT_FORCE = (1 << 4) * ENABLE_FEATURE_2_4_MODULES, + INSMOD_OPT_KERNELD = (1 << 5) * ENABLE_FEATURE_2_4_MODULES, + INSMOD_OPT_NO_EXPORT = (1 << 6) * ENABLE_FEATURE_2_4_MODULES, + INSMOD_OPT_PRINT_MAP = (1 << 7) * ENABLE_FEATURE_INSMOD_LOAD_MAP, + INSMOD_OPT_UNUSED = + (INSMOD_OPT_PRINT_MAP ? INSMOD_OPT_PRINT_MAP + : INSMOD_OPT_NO_EXPORT ? INSMOD_OPT_NO_EXPORT + : INSMOD_OPT_SYSLOG + ) << 1 }; #if ENABLE_FEATURE_INSMOD_TRY_MMAP -- cgit v1.2.3