PERFORCE change 38229 for review

Andrew Reisse areisse at FreeBSD.org
Thu Sep 18 14:58:43 GMT 2003


http://perforce.freebsd.org/chv.cgi?CH=38229

Change 38229 by areisse at areisse_tislabs on 2003/09/18 07:58:07

	new tunable: kern.linker.require_preloads
	if set, panic when preloaded modules don't load.

Affected files ...

.. //depot/projects/trustedbsd/sebsd/sys/kern/kern_linker.c#6 edit

Differences ...

==== //depot/projects/trustedbsd/sebsd/sys/kern/kern_linker.c#6 (text+ko) ====

@@ -62,6 +62,9 @@
  */
 static const char 	*linker_basename(const char *path);
 
+static int require_preload = 0;
+TUNABLE_INT ("kern.linker.require_preloads", &require_preload);
+
 /* Metadata from the static kernel */
 SET_DECLARE(modmetadata_set, struct mod_metadata);
 
@@ -1274,6 +1277,8 @@
 	 */
 	TAILQ_FOREACH(lf, &loaded_files, loaded) {
 		printf("KLD file %s is missing dependencies\n", lf->filename);
+		if (require_preload)
+			panic ("Required modules failed to load");
 		linker_file_unload(lf);
 		TAILQ_REMOVE(&loaded_files, lf, loaded);
 	}
@@ -1316,6 +1321,8 @@
 		if (error) {
 			printf("KLD file %s - could not finalize loading\n",
 			    lf->filename);
+			if (require_preload)
+				panic ("Required modules failed to load");
 			linker_file_t next = TAILQ_NEXT (lf, loaded);
 			linker_file_unload(lf);
 			lf = next;
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list