diff options
author | Dave Young <dyoung@redhat.com> | 2012-01-31 21:33:14 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-03-25 22:20:50 -0400 |
commit | 02608bef8f774c058779546926889a2f2717a499 (patch) | |
tree | fdbdd5918c0d9a9f142c6c88535a2b18f13ce02c | |
parent | e22057c8599373e5caef0bc42bdb95d2a361ab0d (diff) |
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>
-rw-r--r-- | Documentation/kernel-parameters.txt | 2 | ||||
-rw-r--r-- | kernel/module.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 58eac231fe69..e2f8c297a8a4 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -1869,6 +1869,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
1869 | shutdown the other cpus. Instead use the REBOOT_VECTOR | 1869 | shutdown the other cpus. Instead use the REBOOT_VECTOR |
1870 | irq. | 1870 | irq. |
1871 | 1871 | ||
1872 | nomodule Disable module load | ||
1873 | |||
1872 | nopat [X86] Disable PAT (page attribute table extension of | 1874 | nopat [X86] Disable PAT (page attribute table extension of |
1873 | pagetables) support. | 1875 | pagetables) support. |
1874 | 1876 | ||
diff --git a/kernel/module.c b/kernel/module.c index 2c932760fd33..7e31da9750c0 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -105,6 +105,7 @@ struct list_head *kdb_modules = &modules; /* kdb needs the list of modules */ | |||
105 | 105 | ||
106 | /* Block module loading/unloading? */ | 106 | /* Block module loading/unloading? */ |
107 | int modules_disabled = 0; | 107 | int modules_disabled = 0; |
108 | core_param(nomodule, modules_disabled, bint, 0); | ||
108 | 109 | ||
109 | /* Waiting for a module to finish initializing? */ | 110 | /* Waiting for a module to finish initializing? */ |
110 | static DECLARE_WAIT_QUEUE_HEAD(module_wq); | 111 | static DECLARE_WAIT_QUEUE_HEAD(module_wq); |