From patchwork Sat Jan 15 20:23:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 481541 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0FKOuxK015041 for ; Sat, 15 Jan 2011 20:24:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751180Ab1AOUY0 (ORCPT ); Sat, 15 Jan 2011 15:24:26 -0500 Received: from adelie.canonical.com ([91.189.90.139]:47401 "EHLO adelie.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753933Ab1AOUYT (ORCPT ); Sat, 15 Jan 2011 15:24:19 -0500 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1PeCfa-0003hp-AT; Sat, 15 Jan 2011 20:24:18 +0000 Received: from [12.185.65.154] (helo=localhost.localdomain) by hutte.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1PeCfX-0006Bx-ET; Sat, 15 Jan 2011 20:24:18 +0000 From: Andy Whitcroft To: Dmitry Torokhov Cc: Andy Whitcroft , linux-input@vger.kernel.org, Greg Kroah-Hartman , Arnd Bergmann , Andrew Morton , linux-kernel@vger.kernel.org Subject: [PATCH 1/1] Input: sysrq -- ensure sysrq_enabled and __sysrq_enabled are consistent Date: Sat, 15 Jan 2011 20:23:57 +0000 Message-Id: <1295123037-2649-2-git-send-email-apw@canonical.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1295123037-2649-1-git-send-email-apw@canonical.com> References: <1295123037-2649-1-git-send-email-apw@canonical.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 15 Jan 2011 20:24:56 +0000 (UTC) diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index c556ed9..ba8cf87 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -46,7 +46,7 @@ #include /* Whether we react on sysrq keys or just ignore them */ -static int __read_mostly sysrq_enabled = 1; +static int __read_mostly sysrq_enabled = CONFIG_MAGIC_SYSRQ_DEFAULT; static bool __read_mostly sysrq_always_enabled; static bool sysrq_on(void) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index bc86bb3..85fd935 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -170,7 +170,8 @@ static int proc_taint(struct ctl_table *table, int write, #endif #ifdef CONFIG_MAGIC_SYSRQ -static int __sysrq_enabled; /* Note: sysrq code ises it's own private copy */ +/* Note: sysrq code uses it's own private copy */ +static int __sysrq_enabled = CONFIG_MAGIC_SYSRQ_DEFAULT; static int sysrq_sysctl_handler(ctl_table *table, int write, void __user *buffer, size_t *lenp, diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 2d05adb..459105e 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -50,6 +50,15 @@ config MAGIC_SYSRQ keys are documented in . Don't say Y unless you really know what this hack does. +config MAGIC_SYSRQ_DEFAULT + int "Magic SysRq key default" + default 1 + range 0 1 + help + Set the default value for the sysrq sysfs control to this value. + Setting this to 1 will enable sysrq on boot, to 0 will disable + sysrq on boot. + config STRIP_ASM_SYMS bool "Strip assembler-generated symbols during link" default n