SysRq key equivalent needed

Bug #262408 reported by Harlan
158
This bug affects 31 people
Affects Status Importance Assigned to Milestone
Mactel Support
New
Low
Unassigned
linux (Ubuntu)
Confirmed
Undecided
Unassigned
Declined for Jaunty by Brian Murray

Bug Description

MacBook keyboards and other Apple keyboards lack a SysRq key and therefore lack important kernel functionality that is designed to save catastrophic data loss if the computer freezes. An equivalent keystroke should be assigned, for example Fn + Eject, to preserve the functionality of the Magic SysRq key in linux on a Mactel. I believe this is a bug and not a feature request because the current implementation assumes that all keyboards have a SysRq key which is an incorrect assumption and therefore a mistake, or bug.

Workaround:
https://askubuntu.com/a/896806/21005

Changed in mactel-support:
importance: Undecided → Low
Revision history for this message
Harlan (hflagg) wrote :

This bug should be marked critical, not low. Isn't catastrophic data loss enough of a reason? A freeze and cold reboot could lead to an Irreparable partition and a bricked system. This could be easily avoided if this bug did not exist.

Revision history for this message
Ricky Campbell (cyberdork33) wrote :

Don't worry about the level on mactel-support. that is just for the team's reference.

It is not a bug since it is not a failure of anything in the code. This is actually more of a feature request (no that it is not a good feature to have). You need to talk to the Linux kernel developers as this functionality should be added there.

Revision history for this message
ikus060 (ikus060-renamed) wrote :

Bump,

Here a list of keys that are not 'present' on the Apple Keyboard. Important feature are related to it.

- Insert
- Print Screen
- SysRq
- NumLock
- Scroll Lock
- Pause
- Break

Revision history for this message
Ricky Campbell (cyberdork33) wrote :

ikus, incase you did not know, 'Insert' should be mapped to the 'help' key, and 'NumLock' should be mapped to 'clear'. This is, of course, on the full keyboards... If you are talking about the Macbook keyboards, or the wireless aluminum, then those keys may not exist there either.

Revision history for this message
ikus060 (ikus060-renamed) wrote :

I have an Apple Slim Aluminium keayboard. I joint a picture.
I don't have any 'help' key.

Is there any way I can map those key at the kernel level so it's effective everywhere ? If it's include so edit the code, plz point me into the right direction.

Revision history for this message
Ricky Campbell (cyberdork33) wrote :

yep the fn key took it's place.

Revision history for this message
ikus060 (ikus060-renamed) wrote :

Your right, 'fn' key is at the location where I expect to find 'Insert' key. But the 'fn' key doesn't behave like an Insert key.

Revision history for this message
ikus060 (ikus060-renamed) wrote :

Here a file to patch the kernel. It's modifying the hid_apple.c file to map F13, F14, F15 to PrintSc, ScrollLock and Pause. This modification apply only to Apple Slim Aluminium Keyboard (0003:05AC:0220.0004). I'm sure the modification can be apply to many more apple keyboard, so modify the patch as your wish.

affects: linux (Ubuntu) → linux-meta (Ubuntu)
Changed in linux-meta (Ubuntu):
assignee: nobody → colin-king
Changed in linux-meta (Ubuntu):
assignee: Colin King (colin-king) → Canonical Kernel Team (canonical-kernel-team)
Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

[This is an automated message. Apologies if it has reached you inappropriately.]

This bug was reported against the linux-meta package when it likely should have been reported against the linux package instead. We are automatically transitioning this to the linux kernel package so that the appropriate teams are notified and made aware of this issue. Thanks.

affects: linux-meta (Ubuntu) → linux (Ubuntu)
Revision history for this message
Dmitry Torokhov (dtor) wrote :

The HID driver now supports adjusting keymaps from userspace via EVIOCSKEYCODE ioctl and HAL utilizes that; I recommend doing the same here in leu of patching kernel.

Brad Figg (brad-figg)
tags: added: kj-triage
Revision history for this message
altima (timashkov) wrote :

Dmitry Torokhov, please, tell me how do you do this (or refer to a man)?

Revision history for this message
PasNox (pasnox) wrote :

Still problems with F13 / F14 / F15, kde khotkey correctly print 'Print' key when i press it ( by example for launching ksnapshot ).
But then on the desktop, if i press F13 ( emulating Print ), nothing appear ...
Please any help?

Revision history for this message
wvengen (wvengen) wrote :
Revision history for this message
papukaija (papukaija) wrote :

This bug report is being marked as confirmed because it is affecting more than one person. For future reference you can manage the status of your own bugs by clicking on the current status in the yellow line and then choosing a new status in the revealed drop down box. You can learn more about bug statuses at https://wiki.ubuntu.com/Bugs/Status . Please submit any future bugs you may find.

tags: added: patch
Changed in linux (Ubuntu):
status: New → Confirmed
Brad Figg (brad-figg)
Changed in linux (Ubuntu):
assignee: Canonical Kernel Team (canonical-kernel-team) → nobody
Revision history for this message
João Hornburg (joaohornburg) wrote :

Doesn't fn+shift+F11 work? As in http://support.apple.com/kb/HT1171

Revision history for this message
Colin D Bennett (colinb) wrote :

@João Hornburg:
No, fn+Shift+F11 doesn't work. Tested in Ubuntu 12.04, it doesn't even work as a regular Print Screen key. The key mappings in the Apple page you reference are apparently not all implemented by the Linux “apple” key layout. Also, if fn+Shift+F11 were Print Screen/SysRq, would it be possible to add the Alt modifier?

Revision history for this message
pjv (pjv) wrote :

Best way to go currently is to install (manually compile) the keyfuzz program and put

echo "786616 99" | keyfuzz -s -d /dev/input/by-id/usb-Apple_Inc._Apple_Internal_Keyboard___Trackpad-event-kbd

in your /etc/profile for instance. This maps Alt-Eject on a typical Apple Macbook Pro (mine is mid-2010, 6,2), to the Alt-SysRq combination.

Revision history for this message
ceg (ceg) wrote :

For a full set of keyboard workarounds see https://aur.archlinux.org/packages/un-apple-keyboard .

A real fix will require a patches to the hid_apple kernel module that add appropriate parameter options.

Additionally, the "swapmodifiers" option from this patch https://patchwork.kernel.org/patch/10259 to improve the usability of the typical linux keybord modifier combinations.

Revision history for this message
ceg (ceg) wrote :

Hello ikus060,
could you adapt your patch to provide a configurable parameter as iso_layout and fnmode do? (maybe see the patchwork link from last post for an example)

Revision history for this message
ceg (ceg) wrote :

As macbooks do not seem to have F13-F15 keys, also provide some alternatives.
For example, map alt-eject to SysRq.
scancodes: http://ubuntuforums.org/archive/index.php/t-762665.html

Revision history for this message
pjv (pjv) wrote :

Actually I put

echo "786616 99" | keyfuzz -s -d /dev/input/by-id/usb-Apple_Inc._Apple_Internal_Keyboard___Trackpad-event-kbd

in my /etc/rc.local

Revision history for this message
Ville Aakko (wildpenguin) wrote :

Hi,

being a puritanist I tried creating a .deb for my own personal usage and using the init scripts that come with keyfuzz.

The init script needed to be patched, since the /dev/input/eventX nodes are created in different order at least sometimes (attached).

Revision history for this message
Ville Aakko (wildpenguin) wrote :

Attatched a keyfuzz file for usage with MBP.

With the patch in previous comment, one can put the symlink in:
/etc/keyfuzz/by-id/usb-Apple_Inc._Apple_Internal_Keyboard___Trackpad-event-kbd

instead of /etc/keyfuzz/eventX (the latter was unreliable in my case).

Jarno Suni (jarnos)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.