tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/tests/modules



On Tue, Mar 20, 2012 at 05:50:11AM +0000, Jukka Ruohonen wrote:
> Module Name:  src
> Committed By: jruoho
> Date:         Tue Mar 20 05:50:11 UTC 2012
> 
> Modified Files:
>       src/tests/modules: t_abi_uvm.sh t_modload.sh
> 
> Log Message:
> Skip Xen. XXX: There should be a reliable way to detect MODULAR.

This (untested) would add one (sysctl kern.module.modular would say 0 for
non-modular kernels, or 1 otherwise).

What do folks think?

Martin
Index: kern_module.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_module.c,v
retrieving revision 1.86
diff -u -r1.86 kern_module.c
--- kern_module.c       4 Dec 2011 19:24:59 -0000       1.86
+++ kern_module.c       21 Mar 2012 12:23:46 -0000
@@ -428,6 +428,17 @@
                SYSCTL_DESCR("Enable verbose output"),
                NULL, 0, &module_verbose_on, 0,
                CTL_CREATE, CTL_EOL);
+       sysctl_createv(&module_sysctllog, 0, &node, NULL,
+               CTLFLAG_PERMANENT | CTLFLAG_IMMEDIATE | CTLFLAG_READONLY,
+               CTLTYPE_BOOL, "modular",
+               SYSCTL_DESCR("The kernel is compiled to allow loading "
+                   "of modules"), NULL, 
+#ifdef MODULAR
+               true,
+#else
+               false,
+#endif
+               NULL, 0, CTL_CREATE, CTL_EOL);
 }
 
 /*


Home | Main Index | Thread Index | Old Index