diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-22 18:29:01 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-22 18:29:01 +0000 |
commit | 36309cf3f495dcfd4aba541425b34dd2455cccf2 (patch) | |
tree | 5ab06fac3af13f714ac6f69dfacf88246499ce10 | |
parent | cc5feabeba2b1cbc3a1751af08f645b868967519 (diff) | |
download | busybox-w32-36309cf3f495dcfd4aba541425b34dd2455cccf2.tar.gz busybox-w32-36309cf3f495dcfd4aba541425b34dd2455cccf2.tar.bz2 busybox-w32-36309cf3f495dcfd4aba541425b34dd2455cccf2.zip |
insmod: clarify module_name / file_name distinction
-rw-r--r-- | include/usage.h | 6 | ||||
-rw-r--r-- | modutils/insmod.c | 10 | ||||
-rw-r--r-- | modutils/modutils-24.c | 16 | ||||
-rw-r--r-- | modutils/modutils.h | 2 |
4 files changed, 23 insertions, 11 deletions
diff --git a/include/usage.h b/include/usage.h index 5223e9e18..49c94000b 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -1864,8 +1864,12 @@ | |||
1864 | "\ninotifyd waits for PROG to exit." \ | 1864 | "\ninotifyd waits for PROG to exit." \ |
1865 | "\nWhen x event happens for all FILEs, inotifyd exits" \ | 1865 | "\nWhen x event happens for all FILEs, inotifyd exits" \ |
1866 | 1866 | ||
1867 | /* 2.6 style insmod has no options and required filename | ||
1868 | * (not module name - .ko can't be omitted) */ | ||
1867 | #define insmod_trivial_usage \ | 1869 | #define insmod_trivial_usage \ |
1868 | USE_FEATURE_2_4_MODULES("[OPTION]... ") "MODULE [symbol=value]..." | 1870 | USE_FEATURE_2_4_MODULES("[OPTION]... MODULE ") \ |
1871 | SKIP_FEATURE_2_4_MODULES("FILE ") \ | ||
1872 | "[symbol=value]..." | ||
1869 | #define insmod_full_usage "\n\n" \ | 1873 | #define insmod_full_usage "\n\n" \ |
1870 | "Load the specified kernel modules into the kernel" \ | 1874 | "Load the specified kernel modules into the kernel" \ |
1871 | USE_FEATURE_2_4_MODULES( "\n" \ | 1875 | USE_FEATURE_2_4_MODULES( "\n" \ |
diff --git a/modutils/insmod.c b/modutils/insmod.c index 61ee5009b..4d211f50c 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -16,9 +16,17 @@ int insmod_main(int argc UNUSED_PARAM, char **argv) | |||
16 | char *filename; | 16 | char *filename; |
17 | int rc; | 17 | int rc; |
18 | 18 | ||
19 | /* Compat note: | ||
20 | * 2.6 style insmod has no options and required filename | ||
21 | * (not module name - .ko can't be omitted). | ||
22 | * 2.4 style insmod can take module name without .ko | ||
23 | * and performs module search in default directories | ||
24 | * or in $MODPATH. | ||
25 | */ | ||
26 | |||
19 | USE_FEATURE_2_4_MODULES( | 27 | USE_FEATURE_2_4_MODULES( |
20 | getopt32(argv, INSMOD_OPTS INSMOD_ARGS); | 28 | getopt32(argv, INSMOD_OPTS INSMOD_ARGS); |
21 | argv += optind-1; | 29 | argv += optind - 1; |
22 | ); | 30 | ); |
23 | 31 | ||
24 | filename = *++argv; | 32 | filename = *++argv; |
diff --git a/modutils/modutils-24.c b/modutils/modutils-24.c index ae0afd44c..ecab193ce 100644 --- a/modutils/modutils-24.c +++ b/modutils/modutils-24.c | |||
@@ -3810,7 +3810,7 @@ static void print_load_map(struct obj_file *f UNUSED_PARAM) | |||
3810 | } | 3810 | } |
3811 | #endif | 3811 | #endif |
3812 | 3812 | ||
3813 | int FAST_FUNC bb_init_module_24(const char *m_filename, const char *options UNUSED_PARAM) | 3813 | int FAST_FUNC bb_init_module_24(const char *m_filename, const char *options) |
3814 | { | 3814 | { |
3815 | int k_crcs; | 3815 | int k_crcs; |
3816 | unsigned long m_size; | 3816 | unsigned long m_size; |
@@ -3906,13 +3906,13 @@ int FAST_FUNC bb_init_module_24(const char *m_filename, const char *options UNUS | |||
3906 | 3906 | ||
3907 | m_addr = create_module(m_name, m_size); | 3907 | m_addr = create_module(m_name, m_size); |
3908 | if (m_addr == (ElfW(Addr))(-1)) switch (errno) { | 3908 | if (m_addr == (ElfW(Addr))(-1)) switch (errno) { |
3909 | case EEXIST: | 3909 | case EEXIST: |
3910 | bb_error_msg_and_die("a module named %s already exists", m_name); | 3910 | bb_error_msg_and_die("a module named %s already exists", m_name); |
3911 | case ENOMEM: | 3911 | case ENOMEM: |
3912 | bb_error_msg_and_die("can't allocate kernel memory for module; needed %lu bytes", | 3912 | bb_error_msg_and_die("can't allocate kernel memory for module; needed %lu bytes", |
3913 | m_size); | 3913 | m_size); |
3914 | default: | 3914 | default: |
3915 | bb_perror_msg_and_die("create_module: %s", m_name); | 3915 | bb_perror_msg_and_die("create_module: %s", m_name); |
3916 | } | 3916 | } |
3917 | 3917 | ||
3918 | #if !LOADBITS | 3918 | #if !LOADBITS |
diff --git a/modutils/modutils.h b/modutils/modutils.h index 32ee18b06..ddd4e1790 100644 --- a/modutils/modutils.h +++ b/modutils/modutils.h | |||
@@ -23,7 +23,7 @@ const char *moderror(int err) FAST_FUNC; | |||
23 | llist_t *llist_find(llist_t *first, const char *str) FAST_FUNC; | 23 | llist_t *llist_find(llist_t *first, const char *str) FAST_FUNC; |
24 | void replace(char *s, char what, char with) FAST_FUNC; | 24 | void replace(char *s, char what, char with) FAST_FUNC; |
25 | char *replace_underscores(char *s) FAST_FUNC; | 25 | char *replace_underscores(char *s) FAST_FUNC; |
26 | int string_to_llist(char *string, llist_t **llist, const char *delim) FAST_FUNC ; | 26 | int string_to_llist(char *string, llist_t **llist, const char *delim) FAST_FUNC; |
27 | char *filename2modname(const char *filename, char *modname) FAST_FUNC; | 27 | char *filename2modname(const char *filename, char *modname) FAST_FUNC; |
28 | char *parse_cmdline_module_options(char **argv) FAST_FUNC; | 28 | char *parse_cmdline_module_options(char **argv) FAST_FUNC; |
29 | 29 | ||