Date: Thu, 20 Sep 2001 05:26:04 -0700 (PDT) From: HARASHINO Makoto <harashi@jazz.email.ne.jp> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/30683: [PATCH] loader(8) fails to load module which has dependencies Message-ID: <200109201226.f8KCQ4J67002@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 30683
>Category: misc
>Synopsis: [PATCH] loader(8) fails to load module which has dependencies
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Sep 20 05:30:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: HARASHINO Makoto
>Release:
>Organization:
>Environment:
4.4-RC FreeBSD 4.4-RC #0: Tue Sep 18 11:02:56 JST 2001
>Description:
When loader(8) try to load module which has dependencies
if the dependencies already loaded, invalidate the whole.
>How-To-Repeat:
try this in the /boot/loader command line
load miibus
load if_xl
or
load snd_pcm
load snd_ds1
and so on.
>Fix:
Apply patch included below.
diff -ru boot.orig/common/module.c boot/common/module.c
--- boot.orig/common/module.c Wed Jun 13 03:10:35 2001
+++ boot/common/module.c Thu Sep 20 09:24:37 2001
@@ -365,12 +365,20 @@
return (0);
error = 0;
do {
+ char* tmp;
dmodname = (char *)md->md_data;
- if (mod_findmodule(NULL, dmodname) == NULL) {
+ tmp = malloc(strlen(dmodname) + 3 + 1);
+ strcpy(tmp, dmodname);
+ strcat(tmp, ".ko");
+ if (mod_findmodule(tmp, NULL) == NULL) {
+ free(tmp);
printf("loading required module '%s'\n", dmodname);
error = mod_load(dmodname, 0, NULL);
if (error && error != EEXIST)
break;
+ error = 0;
+ } else {
+ free(tmp);
}
md = metadata_next(md, MODINFOMD_DEPLIST);
} while (md);
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109201226.f8KCQ4J67002>
