Commit 02608bef8f774c058779546926889a2f2717a499

Authored by Dave Young
Committed by Rusty Russell
1 parent e22057c859

module: add kernel param to force disable module load

Sometimes we need to test a kernel of same version with code or config
option changes.

We already have sysctl to disable module load, but add a kernel
parameter will be more convenient.

Since modules_disabled is int, so here use bint type in core_param.
TODO: make sysctl accept bool and change modules_disabled to bool

Signed-off-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Showing 2 changed files with 3 additions and 0 deletions Side-by-side Diff

Documentation/kernel-parameters.txt
... ... @@ -1869,6 +1869,8 @@
1869 1869 shutdown the other cpus. Instead use the REBOOT_VECTOR
1870 1870 irq.
1871 1871  
  1872 + nomodule Disable module load
  1873 +
1872 1874 nopat [X86] Disable PAT (page attribute table extension of
1873 1875 pagetables) support.
1874 1876  
... ... @@ -105,6 +105,7 @@
105 105  
106 106 /* Block module loading/unloading? */
107 107 int modules_disabled = 0;
  108 +core_param(nomodule, modules_disabled, bint, 0);
108 109  
109 110 /* Waiting for a module to finish initializing? */
110 111 static DECLARE_WAIT_QUEUE_HEAD(module_wq);