linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Young <dyoung@redhat.com>
To: rusty@rustcorp.com.au, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] add kernel param to force disable module load
Date: Wed, 1 Feb 2012 10:33:14 +0800	[thread overview]
Message-ID: <20120201023314.GA9722@darkstar.nay.redhat.com> (raw)

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>
Cc: Rusty Russell <rusty@rustcorp.com.au>
---
 Documentation/kernel-parameters.txt |    2 ++
 kernel/module.c                     |    1 +
 2 files changed, 3 insertions(+)

--- linux-2.6.orig/Documentation/kernel-parameters.txt	2012-01-31 13:07:06.000000000 +0800
+++ linux-2.6/Documentation/kernel-parameters.txt	2012-01-31 13:07:09.393362159 +0800
@@ -1833,6 +1833,8 @@ bytes respectively. Such letter suffixes
 			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.
 
--- linux-2.6.orig/kernel/module.c	2012-01-31 13:07:06.000000000 +0800
+++ linux-2.6/kernel/module.c	2012-01-31 13:07:34.196695573 +0800
@@ -105,6 +105,7 @@ struct list_head *kdb_modules = &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);

             reply	other threads:[~2012-02-01  2:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-01  2:33 Dave Young [this message]
2012-02-02 20:28 ` [PATCH 2/2] add kernel param to force disable module load Rusty Russell
  -- strict thread matches above, loose matches on Subject: below --
2012-02-01  2:32 Dave Young
2012-02-01  2:35 ` Dave Young

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120201023314.GA9722@darkstar.nay.redhat.com \
    --to=dyoung@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).