modprobe: remove 2k limit on /proc/cmdline
function old new delta do_modprobe 365 520 +155 parse_and_add_kcmdline_module_options 149 - -149 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
9341fd2d30
commit
197202d435
@ -230,20 +230,17 @@ static const char *humanly_readable_name(struct module_entry *m)
|
|||||||
|
|
||||||
static char *parse_and_add_kcmdline_module_options(char *options, const char *modulename)
|
static char *parse_and_add_kcmdline_module_options(char *options, const char *modulename)
|
||||||
{
|
{
|
||||||
/* defined in arch/<architecture>/include/asm/setup.h
|
char *kcmdline_buf;
|
||||||
* (maximum is 2048 for IA64 and SPARC) */
|
|
||||||
char kcmdline_buf[2048];
|
|
||||||
char *kcmdline;
|
char *kcmdline;
|
||||||
char *kptr;
|
char *kptr;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
len = open_read_close("/proc/cmdline", kcmdline_buf, 2047);
|
kcmdline_buf = xmalloc_open_read_close("/proc/cmdline", NULL);
|
||||||
if (len <= 0)
|
if (!kcmdline_buf)
|
||||||
return options;
|
return options;
|
||||||
kcmdline_buf[len] = '\0';
|
|
||||||
|
|
||||||
len = strlen(modulename);
|
|
||||||
kcmdline = kcmdline_buf;
|
kcmdline = kcmdline_buf;
|
||||||
|
len = strlen(modulename);
|
||||||
while ((kptr = strsep(&kcmdline, "\n\t ")) != NULL) {
|
while ((kptr = strsep(&kcmdline, "\n\t ")) != NULL) {
|
||||||
if (strncmp(modulename, kptr, len) != 0)
|
if (strncmp(modulename, kptr, len) != 0)
|
||||||
continue;
|
continue;
|
||||||
@ -257,6 +254,7 @@ static char *parse_and_add_kcmdline_module_options(char *options, const char *mo
|
|||||||
options = gather_options_str(options, kptr);
|
options = gather_options_str(options, kptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
free(kcmdline_buf);
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user