diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -483,7 +483,7 @@ */ if (error != ENOENT) { foundfile = 1; - if (error == EEXIST) + if (error == EEXIST || error == EUNSDEP) break; } if (lf) { @@ -541,7 +541,7 @@ * can recognize this special case and not post bogus * dialog boxes. */ - if (error != EEXIST) + if (error != EEXIST && error != EUNSDEP) error = ENOEXEC; } else error = ENOENT; /* Nothing found */ @@ -1227,6 +1227,8 @@ *fileid = lf->id; } linker_kldload_unbusy(LINKER_UB_LOCKED); + if (error == EUNSDEP) + error = ENOEXEC; return (error); } @@ -2355,8 +2357,33 @@ } error = linker_load_module(NULL, modname, lf, verinfo, NULL); if (error) { - printf("KLD %s: depends on %s - not available or" - " version mismatch\n", lf->filename, modname); + switch (error) { + case ENOENT: + printf("KLD %s: depends on %s - not available\n", + lf->filename, modname); + break; + case EEXIST: + printf("KLD %s: depends on %s - version mismatch\n", + lf->filename, modname); + break; + case ENOEXEC: + printf("KLD %s: depends on %s - file format unrecognized\n", + lf->filename, modname); + break; + case ENOMEM: + printf("KLD %s: depends on %s - no memory\n", + lf->filename, modname); + break; + case EUNSDEP: + printf("KLD %s: depends on %s - transitive dependency error\n", + lf->filename, modname); + break; + default: + printf("KLD %s: depends on %s - can not load, error %d\n", + lf->filename, modname, error); + } + + error = EUNSDEP; break; } } @@ -2364,7 +2391,7 @@ if (error) return (error); linker_addmodules(lf, start, stop, 0); - return (error); + return (0); } static int