From 55d90fae576a4620c22945478b0a94cadf0e125a Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 28 Dec 2008 03:21:02 +0000 Subject: [PATCH] - Don't autounload modules loaded during boot. In my case, ffs got unloaded because my cdrom takes too long to initialize. - Consistently print error messages in all error cases. --- sys/kern/kern_module.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_module.c b/sys/kern/kern_module.c index 5b39ee909226..cd57cd8a7f2a 100644 --- a/sys/kern/kern_module.c +++ b/sys/kern/kern_module.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_module.c,v 1.37 2008/12/05 12:55:09 ad Exp $ */ +/* $NetBSD: kern_module.c,v 1.38 2008/12/28 03:21:02 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.37 2008/12/05 12:55:09 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.38 2008/12/28 03:21:02 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_ddb.h" @@ -230,7 +230,7 @@ module_init_class(modclass_t class) class != mi->mi_class) continue; module_do_load(mi->mi_name, false, 0, NULL, NULL, - class, true); + class, false); break; } } while (mod != NULL); @@ -480,6 +480,7 @@ module_do_builtin(const char *name, module_t **modp) } } if (error != 0) { + module_error("can't find `%s'", name); return error; } @@ -488,6 +489,7 @@ module_do_builtin(const char *name, module_t **modp) */ mod = kmem_zalloc(sizeof(*mod), KM_SLEEP); if (mod == NULL) { + module_error("out of memory for `%s'", name); return ENOMEM; } if (modp != NULL) { @@ -607,6 +609,7 @@ module_do_load(const char *name, bool isdep, int flags, } mod = kmem_zalloc(sizeof(*mod), KM_SLEEP); if (mod == NULL) { + module_error("out of memory for `%s'", name); depth--; return ENOMEM; }