From fd76ae7d5c8d7ecd8e9ebee17785e881eef15e9b Mon Sep 17 00:00:00 2001 From: Antoine Leca Date: Sun, 7 Aug 2011 12:52:00 +0200 Subject: [PATCH] Disable debug keys in ttycX Function keys in any virtual console create some dump on main console (first virtual, /dev/console); unless debug_fkeys=0 is set in boot monitor, in which case no function keys generate dump. With this patch, you can restrict the virtual console where dumps are produced; with debug_fkeys=0, none generates dumps (unchanged); with debug_fkeys=1 (most useful setting), only the first virtual console, which is the one which gets the dumps, can generate output; on second and further consoles (/dev/ttyc?), the function keys are passed to applications. --- drivers/tty/arch/i386/keyboard.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/arch/i386/keyboard.c b/drivers/tty/arch/i386/keyboard.c index 181cd29f1..6a50fdcf7 100644 --- a/drivers/tty/arch/i386/keyboard.c +++ b/drivers/tty/arch/i386/keyboard.c @@ -150,7 +150,7 @@ static struct kbd_outack static int kbd_watchdog_set= 0; static int kbd_alive= 1; static long sticky_alt_mode = 0; -static long debug_fkeys = 1; +static long debug_fkeys = NR_CONS; static timer_t tmr_kbd_wd; static void handle_req(struct kbd *kbdp, message *m); @@ -594,7 +594,7 @@ int try; } /* Function keys are being used for debug dumps (if enabled). */ - if (debug_fkeys && func_key(scode)) continue; + if (debug_fkeys>ccurrent && func_key(scode)) continue; /* Perform make/break processing. */ @@ -613,7 +613,7 @@ int try; (void) in_process(tp, buf, 3, scode); } else if ((F1 <= ch && ch <= F12) || (SF1 <= ch && ch <= SF12) || - (CF1 <= ch && ch <= CF12 && !debug_fkeys)) { + (CF1 <= ch && ch <= CF12 && (debug_fkeys<=ccurrent))) { /* An escape sequence generated by function keys. */ if (F1 <= ch && ch <= F12) { ch -= F1;