[patch] add support for the ACPI eject hotkey on Lenovo laptops

Bug #194609 reported by sibidiba
10
Affects Status Importance Assigned to Milestone
acpi-support (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Binary package hint: acpi-support

The attached file /etc/acpi/events/thinkpad-eject makes the eject button (Fn + F9) work on Lenovo laptops.

Tested on Thinkpad R61i .

Related branches

Revision history for this message
sibidiba (sibidiba) wrote :
Changed in acpi-support:
status: New → Confirmed
Revision history for this message
Jerone Young (jerone) wrote :

This patch is bad. You should not call a command but allow userspace to call the command. Here is a much better patch to solve this issue. It was derived from here:

http://www.thinkwiki.org/wiki/Installing_Ubuntu_7.10_(Gutsy_Gibbon)_on_a_ThinkPad_R61

I tested this on my Thinkpad T61 under Gutsy, and it works!

Signed-off-by: Jerone Young <email address hidden>

diff --git a/events/lenovo-eject b/events/lenovo-eject
new file mode 100644
--- /dev/null
+++ b/events/lenovo-eject
@@ -0,0 +1,6 @@
+# /etc/acpi/events/lenovo-eject
+# This is called when the user presses the eject button
+# /etc/acpi/ejectbtn.sh to fake the key input
+
+event=ibm/hotkey HKEY 00000080 00001009
+action=/etc/acpi/ejectbtn.sh

Revision history for this message
Jerone Young (jerone) wrote :

There appears to be an issue with HAL or something with Gnome in Hardy that is perventing this and other key actions to be caught by Gnome. This works fine under Gutsy .. but is not getting picked up by Gnome in Hardy. The same goes for the FN+F3 (battery button), it is picked up in Gutsy and the little battery in the notification bar will display info on your battery, but under Hardy this is not happening. I checked gnome-power-manager source code and this functionality has not been removed from the battery. So this points me to something in HAL or somewhere.

Never the less this should go ahead and be included as it does work (just not under Hardy .. because of something in gnome)

Revision history for this message
sibidiba (sibidiba) wrote :

If you have already tracked down a regression in Gnome, could you please open a new bugreport for that?

Daniel Hahler (blueyed)
Changed in acpi-support:
assignee: nobody → blueyed
importance: Undecided → Wishlist
status: Confirmed → In Progress
Revision history for this message
Jerone Young (jerone) wrote :

I'll file a bug as soon as I figure out the exact component. It is definetly gnome though.
1) acpi-support daemon is catching the acpi event and running the eject.bn which does acpi_fakekey
2) when I try to run acpi_fakekey (with the eject key parm) as root .. gnome does nothing
3) acpi_fakekey isn't broken because running "acpi_fakey 2" puts a "1" in my terminal terminal window (this is equivalent of pressing the 1 key on the keyboard).

Anyone with a laptop or is using acpi events that then use acpi_fakekey are going to see this. Now it's a matter of what in Gnome regressed to cause it not to pick up certain special keys.

Revision history for this message
Jerone Young (jerone) wrote :

Ok a little more info (I am getting to filing that bug) .. so just tried the latest Kunutu hardy build. KDE is picking things up like FN+F3 (battery button) .. so this does nail it to definitely a gnome issue. Getting closer to the root of why know isn't working.

But things do work under Kubuntu .. so this patch will work for Kubuntu .. just need to figure out exactly what s causing gnome not to see this before can file a bug.

Revision history for this message
Jerone Young (jerone) wrote :

filed a bugzilla with the issue:
bugzilla #195638

https://bugs.launchpad.net/ubuntu/+source/meta-gnome2/+bug/195638

Revision history for this message
Chris Jones (cmsj) wrote :

Why is this a GNOME bug? the eject key on thinkpads is *NOT* for ejecting a CD drive, it's for ejecting the laptop from a docking cradle (I know, I have a cradle, and the eject button doesn't prepare the laptop for removal from the dock anymore. The button on the dock to do the same thing does work though).

Revision history for this message
Daniel Hahler (blueyed) wrote :

The patch/fix has been included in the debdiff at bug 193842, and is waiting for sponsorship.

Changed in acpi-support:
assignee: blueyed → nobody
status: In Progress → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package acpi-support - 0.106

---------------
acpi-support (0.106) hardy; urgency=low

  * Cherrypicked bugfix patches from Launchpad (LP: #193842)
  * lib/state-funcs: make wireless led work with asus-laptop (the new module);
    patch from Nicolò Chieffo (LP: #189889)
  * Add events/asus-video to support asus switch video hotkey; patch from
    Nicolò Chieffo (LP: #138228)
  * events/asus-wireless-2, asus-wireless-2.sh:
    Support Fn+F2 on Asus A8Js; patch from Matteo Collina (LP: #105929)
  * Fix the value range in sonybright.sh (0-7 instead of 1-8); patch from unggnu
    (LP: #136380)
  * "lib/FUJITSU SIEMENS.config":
    - Enable suspend for Fujitsu-Siemens C1110 (LP: #52970)
    - Enable STR for Fujitsu-Siemens Lifebook S7020, S7110
  * resume.d/50-time.sh, suspend.d/88-time.sh:
    Fix handling of hardware clock before/after suspend; patch from Rodrigo
    Novo (LP: #36815)
  * events/asus-*: Fix event key names for ASUS (HOTK); patch from
    Jeroen van der Vegt (LP: #25784)
  * Fix names in comments for events/panasonic-{mute,volume-down,volume-up}
  * debian/rules, README.toshiba: Drop toshiba_acpi.modprobe, which only
    contained an invalid/obsolete option "hotkeys_over_acpi" (LP: #180678)
  * debian/control: Standards-Version 3.7.3
  * Drop thinkpad_acpi.modprobe: the workarounds therein are not needed for
    thinkpad_acpi in Hardy anymore; investigations by Jerone Young (LP: #194679)
  * Add events/lenovo-eject to handle the Thinkpad eject button (Fn+F9); patch
    from Jerone Young (LP: #194609)

 -- Daniel Hahler <email address hidden> Thu, 06 Mar 2008 02:15:54 +0100

Changed in acpi-support:
status: Triaged → Fix Released
Revision history for this message
Matthew Garrett (mjg59) wrote :

As noted, this is a dock eject button and not a CD eject button. This patch is wrong and needs to be reverted.

Changed in acpi-support:
status: Fix Released → Confirmed
Steve Langasek (vorlon)
Changed in acpi-support:
milestone: none → ubuntu-8.04
Daniel Hahler (blueyed)
Changed in acpi-support:
assignee: nobody → blueyed
status: Confirmed → In Progress
Revision history for this message
Daniel Hahler (blueyed) wrote :

The removal of this patch is included in the debdiff for bug 199888.

Changed in acpi-support:
assignee: blueyed → nobody
status: In Progress → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package acpi-support - 0.108

---------------
acpi-support (0.108) hardy; urgency=low

  [ Daniel Hahler ]
  * /etc/modprobe.d/toshiba_acpi.modprobe, debian/rules, README.toshiba:
    Fix regression for toshiba, which should not have been removed
    (LP: #199888)
  * events/lenovo-eject, debian/preinst:
    Drop events/lenovo-eject again: it's a dock eject button and not a CD
    eject button (LP: #194609)

  [ Steve Langasek ]
  * lib/state-funcs: update isAnyWirelessPoweredOn() to recognize
    devices exporting only the new rf_kill status interface.
    LP: #180598.

 -- Steve Langasek <email address hidden> Fri, 21 Mar 2008 16:51:13 -0700

Changed in acpi-support:
status: Triaged → Fix Released
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.