aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modutils/modprobe.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index a6224fa63..c82eaa8d8 100644
--- a/modutils/modprobe.c
+++ b/modutils/modprobe.c
@@ -171,6 +171,7 @@ static const char modprobe_longopts[] ALIGN1 =
171/* "was seen in modules.dep": */ 171/* "was seen in modules.dep": */
172#define MODULE_FLAG_FOUND_IN_MODDEP 0x0004 172#define MODULE_FLAG_FOUND_IN_MODDEP 0x0004
173#define MODULE_FLAG_BLACKLISTED 0x0008 173#define MODULE_FLAG_BLACKLISTED 0x0008
174#define MODULE_FLAG_BUILTIN 0x0010
174 175
175struct globals { 176struct globals {
176 llist_t *probes; /* MEs of module(s) requested on cmdline */ 177 llist_t *probes; /* MEs of module(s) requested on cmdline */
@@ -217,7 +218,7 @@ static void add_probe(const char *name)
217 218
218 m = get_or_add_modentry(name); 219 m = get_or_add_modentry(name);
219 if (!(option_mask32 & (OPT_REMOVE | OPT_SHOW_DEPS)) 220 if (!(option_mask32 & (OPT_REMOVE | OPT_SHOW_DEPS))
220 && (m->flags & MODULE_FLAG_LOADED) 221 && (m->flags & (MODULE_FLAG_LOADED | MODULE_FLAG_BUILTIN))
221 ) { 222 ) {
222 DBG("skipping %s, it is already loaded", name); 223 DBG("skipping %s, it is already loaded", name);
223 return; 224 return;
@@ -413,8 +414,10 @@ static int do_modprobe(struct module_entry *m)
413 414
414 if (!(m->flags & MODULE_FLAG_FOUND_IN_MODDEP)) { 415 if (!(m->flags & MODULE_FLAG_FOUND_IN_MODDEP)) {
415 if (!(option_mask32 & INSMOD_OPT_SILENT)) 416 if (!(option_mask32 & INSMOD_OPT_SILENT))
416 bb_error_msg("module %s not found in modules.dep", 417 bb_error_msg((m->flags & MODULE_FLAG_BUILTIN) ?
417 humanly_readable_name(m)); 418 "module %s is builtin" :
419 "module %s not found in modules.dep",
420 humanly_readable_name(m));
418 return -ENOENT; 421 return -ENOENT;
419 } 422 }
420 DBG("do_modprob'ing %s", m->modname); 423 DBG("do_modprob'ing %s", m->modname);
@@ -618,6 +621,11 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv)
618 while (config_read(parser, &s, 1, 1, "# \t", PARSE_NORMAL & ~PARSE_GREEDY)) 621 while (config_read(parser, &s, 1, 1, "# \t", PARSE_NORMAL & ~PARSE_GREEDY))
619 get_or_add_modentry(s)->flags |= MODULE_FLAG_LOADED; 622 get_or_add_modentry(s)->flags |= MODULE_FLAG_LOADED;
620 config_close(parser); 623 config_close(parser);
624
625 parser = config_open2("modules.builtin", fopen_for_read);
626 while (config_read(parser, &s, 1, 1, "# \t", PARSE_NORMAL))
627 get_or_add_modentry(s)->flags |= MODULE_FLAG_BUILTIN;
628 config_close(parser);
621 } 629 }
622 630
623 if (opt & (OPT_INSERT_ALL | OPT_REMOVE)) { 631 if (opt & (OPT_INSERT_ALL | OPT_REMOVE)) {