Module Name: src
Committed By: pgoyette
Date: Sat Mar 22 00:41:20 UTC 2025
Modified Files:
src/sys/conf: files
src/sys/kern: kern_module.c
Log Message:
Allow MODDULAR_AUTOUNLOAD_UNSAFE as a kernel build option. Defaults to
false, so no change in current behaviour if not selected.
To generate a diff of this commit:
cvs rdiff -u -r1.1314 -r1.1315 src/sys/conf/files
cvs rdiff -u -r1.168 -r1.169 src/sys/kern/kern_module.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1314 src/sys/conf/files:1.1315
--- src/sys/conf/files:1.1314 Wed Jan 8 22:55:35 2025
+++ src/sys/conf/files Sat Mar 22 00:41:20 2025
@@ -1,4 +1,4 @@
-# $NetBSD: files,v 1.1314 2025/01/08 22:55:35 jmcneill Exp $
+# $NetBSD: files,v 1.1315 2025/03/22 00:41:20 pgoyette Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
version 20171118
@@ -26,6 +26,7 @@ defflag opt_ptrace.h PTRACE PTRACE_HOOK
defflag COREDUMP
defflag opt_modular.h MODULAR
defflag opt_modular.h MODULAR_DEFAULT_AUTOLOAD
+defflag opt_modular.h MODULAR_DEFAULT_AUTOUNLOAD_UNSAFE
defflag opt_modular.h MODULAR_DEFAULT_VERBOSE
defflag KEYLOCK
defparam opt_syslimits.h CHILD_MAX OPEN_MAX
Index: src/sys/kern/kern_module.c
diff -u src/sys/kern/kern_module.c:1.168 src/sys/kern/kern_module.c:1.169
--- src/sys/kern/kern_module.c:1.168 Fri Mar 21 07:09:58 2025
+++ src/sys/kern/kern_module.c Sat Mar 22 00:41:20 2025
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_module.c,v 1.168 2025/03/21 07:09:58 pgoyette Exp $ */
+/* $NetBSD: kern_module.c,v 1.169 2025/03/22 00:41:20 pgoyette 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.168 2025/03/21 07:09:58 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.169 2025/03/22 00:41:20 pgoyette Exp $");
#define _MODULE_INTERNAL
@@ -94,7 +94,11 @@ bool module_autoload_on = true;
#else
bool module_autoload_on = false;
#endif
-bool module_autounload_unsafe = 0;
+#ifdef MODULAR_DEFAULT_AUTOUNLOAD_UNSAFE
+bool module_autounload_unsafe = true;
+#else
+bool module_autounload_unsafe = false;
+#endif
u_int module_count;
u_int module_builtinlist;
u_int module_autotime = 10;