CHROMIUM: sysrq: treat F10 as magic sysrq key
authorSameer Nanda <snanda@chromium.org>
Thu, 2 Aug 2012 23:10:31 +0000 (16:10 -0700)
committerGerrit <chrome-bot@google.com>
Fri, 3 Aug 2012 01:11:24 +0000 (18:11 -0700)
Chrome OS keyboards don't have a sysrq key. This means we lose magic
sysrq functionality on systems that don't have external USB keyboards
attached to them, i.e., default configuration for Chromebooks.

This change treats F10 key as sysrq key for sysrq filtering purposes.
With this change in place, as an example, alt-F10-c will cause a kernel
crash, reboot system and generate a kcrash file.

Note that this change only impacts systems in dev mode since the sysrq
functionality is only enabled in dev mode currently.

BUG=chromium-os:32987
TEST=hit 'alt-F10-c' key combination.  This should cause a kernel panic
and the system will reboot.  Kernel crash file will be be present under
/var/spool/crash.

Change-Id: Ic795023927f4411964a2040ff407dc115e0960ec
Signed-off-by: Sameer Nanda <snanda@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/29110
Reviewed-by: Puneet Kumar <puneetster@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
drivers/tty/sysrq.c

index 0572889..4a63a4d 100644 (file)
@@ -642,6 +642,7 @@ static bool sysrq_filter(struct input_handle *handle,
                        break;
 
                case KEY_SYSRQ:
+               case KEY_F10:
                        if (value == 1 && sysrq->alt != KEY_RESERVED) {
                                sysrq->active = true;
                                sysrq->alt_use = sysrq->alt;