Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Print the parent module that asked for the builtin ...
details: https://anonhg.NetBSD.org/src/rev/07f0407c3256
branches: trunk
changeset: 346811:07f0407c3256
user: christos <christos%NetBSD.org@localhost>
date: Thu Aug 04 06:13:15 2016 +0000
description:
Print the parent module that asked for the builtin to be loaded and failed.
XXX: if a driver is built-in why can't it ask for a filesystem module to
be loaded?
diffstat:
sys/kern/kern_module.c | 30 +++++++++++++++++-------------
1 files changed, 17 insertions(+), 13 deletions(-)
diffs (95 lines):
diff -r eda3cbcd1b53 -r 07f0407c3256 sys/kern/kern_module.c
--- a/sys/kern/kern_module.c Thu Aug 04 05:35:18 2016 +0000
+++ b/sys/kern/kern_module.c Thu Aug 04 06:13:15 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_module.c,v 1.115 2016/07/07 06:55:43 msaitoh Exp $ */
+/* $NetBSD: kern_module.c,v 1.116 2016/08/04 06:13:15 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.115 2016/07/07 06:55:43 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.116 2016/08/04 06:13:15 christos Exp $");
#define _MODULE_INTERNAL
@@ -93,7 +93,8 @@
static int module_do_load(const char *, bool, int, prop_dictionary_t,
module_t **, modclass_t modclass, bool);
static int module_do_unload(const char *, bool);
-static int module_do_builtin(const char *, module_t **, prop_dictionary_t);
+static int module_do_builtin(const module_t *, const char *, module_t **,
+ prop_dictionary_t);
static int module_fetch_info(module_t *);
static void module_thread(void *);
@@ -266,8 +267,8 @@
/* finally, init (if required) */
if (init) {
for (i = 0; i < nmodinfo; i++) {
- rv = module_do_builtin(modp[i]->mod_info->mi_name,
- NULL, NULL);
+ rv = module_do_builtin(modp[i],
+ modp[i]->mod_info->mi_name, NULL, NULL);
/* throw in the towel, recovery hard & not worth it */
if (rv)
panic("builtin module \"%s\" init failed: %d",
@@ -506,7 +507,8 @@
* MODFLG_MUST_FORCE, don't try to override that!)
*/
if ((mod->mod_flags & MODFLG_MUST_FORCE) ||
- module_do_builtin(mi->mi_name, NULL, NULL) != 0) {
+ module_do_builtin(mod, mi->mi_name, NULL,
+ NULL) != 0) {
TAILQ_REMOVE(&module_builtins, mod, mod_chain);
TAILQ_INSERT_TAIL(&bi_fail, mod, mod_chain);
}
@@ -746,7 +748,8 @@
* already linked into the kernel.
*/
static int
-module_do_builtin(const char *name, module_t **modp, prop_dictionary_t props)
+module_do_builtin(const module_t *pmod, const char *name, module_t **modp,
+ prop_dictionary_t props)
{
const char *p, *s;
char buf[MAXMODNAME];
@@ -785,7 +788,8 @@
* cases (such as nfsserver + nfs), the dependee can be
* succesfully linked without the dependencies.
*/
- module_error("can't find builtin dependency `%s'", name);
+ module_error("%s: can't find builtin dependency `%s'",
+ pmod->mod_info->mi_name, name);
return ENOENT;
}
@@ -804,12 +808,12 @@
if (buf[0] == '\0')
break;
if (mod->mod_nrequired == MAXMODDEPS - 1) {
- module_error("too many required modules "
- "%d >= %d", mod->mod_nrequired,
- MAXMODDEPS - 1);
+ module_error("%s: too many required modules "
+ "%d >= %d", pmod->mod_info->mi_name,
+ mod->mod_nrequired, MAXMODDEPS - 1);
return EINVAL;
}
- error = module_do_builtin(buf, &mod2, NULL);
+ error = module_do_builtin(mod, buf, &mod2, NULL);
if (error != 0) {
return error;
}
@@ -913,7 +917,7 @@
depth--;
return EPERM;
} else {
- error = module_do_builtin(name, modp, props);
+ error = module_do_builtin(mod, name, modp, props);
depth--;
return error;
}
Home |
Main Index |
Thread Index |
Old Index