Skip to content

Commit

Permalink
module: add kernel param to force disable module load
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dave Young authored and Rusty Russell committed Mar 26, 2012
1 parent e22057c commit 02608be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
shutdown the other cpus. Instead use the REBOOT_VECTOR
irq.

nomodule Disable module load

nopat [X86] Disable PAT (page attribute table extension of
pagetables) support.

Expand Down
1 change: 1 addition & 0 deletions kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ struct list_head *kdb_modules = &modules; /* kdb needs the list of modules */

/* Block module loading/unloading? */
int modules_disabled = 0;
core_param(nomodule, modules_disabled, bint, 0);

/* Waiting for a module to finish initializing? */
static DECLARE_WAIT_QUEUE_HEAD(module_wq);
Expand Down

0 comments on commit 02608be

Please sign in to comment.