Jerone Young [Wed, 21 Apr 2010 17:19:37 +0000 (12:19 -0500)]
Fix volume keys not releasing for Pegatron platform
Pegatron has a new platform coming out being sold by many small
manufacturers. This platform has volume keys that are not sending a key
release. This patch ensures those keys send release.
Signed-off-by: Jerone Young <jerone.young@canonical.com> Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
readlink does not write a nul character to the end of the
string it returns. Therefore ask for one fewer character
than the buffer size so there's always room for an extra \0.
Signed-off-by: Mathias Nyman <mathias.nyman@nokia.com> Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com> Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
Kamal Mostafa [Mon, 19 Apr 2010 06:48:34 +0000 (08:48 +0200)]
keymap: Unite laptop models needing common volume-key release quirk
Many laptop models need the same volume-key release quirk. Currently, two
models have identical force-release-maps/ keymap files (dell-studio-1557 and
fujitsu-amilo-si1848) and two more need to be added (Mitac and Coolbox QBook).
This replaces the identical force-release-maps files with one
'common-volume-keys' file to make adding new models easier.
There is no obvious DMI commonality between the models needing the quirk (i.e.
they do not all share the same BIOS), so it will remain necessary to scan for
each model separately in 95-keyboard-force-release.rules.
https://launchpad.net/bugs/565459
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
Kay Sievers [Sat, 17 Apr 2010 17:31:44 +0000 (19:31 +0200)]
cdrom_id: set ID_CDROM_MEDIA=1 only for known media
On Sat, Apr 17, 2010 at 18:26, Mike Brudevold <mike@brudevold.com> wrote:
> My CD-RW drive experiences a problem in that it automatically closes
> after opening if there is media in the drive. This only happens if
> there was media in the drive when it was last closed (an empty drive
> stays open).
...
> cd_profiles: current profile 0x02
> cd_profiles: profile 0x02 <ignored>
...
Do not pretend to have a media, when we receive a profile like 0x02,
which just means "Removable disk".
Martin Pitt [Thu, 15 Apr 2010 19:25:57 +0000 (21:25 +0200)]
cdrom_id: Swap media state and TOC info probing
Blank CDs do not have a TOC, thus will fail cd_media_toc() (at least with the
"Do not ignore errors from scsi_cmd_run()" fix). Thus probe the media state
first, so that we can properly detect blank media.
Martin Pitt [Thu, 15 Apr 2010 06:56:48 +0000 (08:56 +0200)]
cdrom_id: Do not ignore errors from scsi_cmd_run()
scsi_cmd_run() can return positive error messages if we have CHECK_CONDITION
set and get the error code from the SCSI command result. So check the result
for non-zero, not for being negative.
This should fix another cause for "phantom" media in empty CD-ROM drives.
Thanks to Mike Brudevold <mike@brudevold.com> for spotting this!
Martin Pitt [Tue, 13 Apr 2010 13:25:48 +0000 (15:25 +0200)]
cdrom_id: Fix uninitialized buffers
Commit 5c6954f is actually a no-op, since static variables are already zero'ed
by default anyway (but we keep it for clarity). The real difference was that a
build with -O0 wor while a build with -O2 didn't.
Turns out that some ioctls do not actually touch the result buffer in some
cases, so we need to zero the result buffers to avoid interpreting random da as
CD properties.
Martin Pitt [Tue, 13 Apr 2010 08:49:24 +0000 (10:49 +0200)]
cdrom_id: Fix uninitialized variables
In cases where cdrom_id does not go through the entire code path and one of the
probing functions returns -1 or exits early, the remaining variables were never
initialized. This caused effects like "phantom" audio CDs on empty drives, or
bogus data like ID_CDROM_MEDIA_TRACK_COUNT=22528.
Initialize the variables right away to avoid that.
Kay Sievers [Tue, 13 Apr 2010 06:52:48 +0000 (08:52 +0200)]
remove "all_partitions" option
We can not predict the major/minor of non-existing devices:
$ grep . /sys/class/block/sd*/dev
/sys/class/block/sda1/dev:259:524288
/sys/class/block/sda2/dev:259:262144
/sys/class/block/sda3/dev:259:786432
/sys/class/block/sda4/dev:259:131072
/sys/class/block/sda/dev:259:0
/sys/class/block/sdb/dev:259:655360
/sys/class/block/sdc/dev:259:393216
If this functionality is still needed for some broken hardware, it needs to be
solved with a tool not part of the udev package. Because such option is unreliable
and unsafe to use.
Kay Sievers [Wed, 7 Apr 2010 07:24:25 +0000 (09:24 +0200)]
cdrom_id: retry to open the device, if EBUSY
We might fight about the device with polling processes, or other
users who probe the device. Retry a few times if the other one goes
away in the meantime.
Jerone Young [Mon, 5 Apr 2010 23:45:35 +0000 (18:45 -0500)]
Revert special casing 0xD8 to latitude XT only
Now that Dell has changed the functionality of upcoming machines with
touchpad toggle to only use keycode 0xD9 .. and not 0xD8 & 0xD9. It
seems best to add this back to the general map of Dell buttons. Just
incase a machine in the future uses this later.
Signed-off-by: Jerone Young <jerone.young@canonical.com> Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
Jerone Young [Thu, 25 Mar 2010 01:14:23 +0000 (20:14 -0500)]
Fix Keymapping for upcoming Dell Laptops
This patch fixes it so that new upcoming Dell machines will work
correctly if users presses the touchpad toggle key.
Currently 0xD8 is being mapped to sleep. Though this is only done by the
Latitude XT* laptops. Many upcoming Laptops from Dell are mapping this
key to "toogle touchpad off" .. giving the OS notification that it has
just turned off the touchpad.
Though their is an issue in that if this key is mapped the hardware
first toogles .. then the software tries to do the samething after, if
they fall out of sync ... no more touchpad. So leave out mapping these
keys for now.
Signed-off-by: Jerone Young <jerone.young@canonical.com> Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
Martin Pitt [Wed, 3 Mar 2010 23:48:59 +0000 (00:48 +0100)]
udev-acl: Correctly handle ENV{ACL_MANAGE}==0
When a custom rule sets ACL_MANAGE to 0 to disable ACL management for a
particular device, handle this as "disabled", by explicitly checking against
"1" instead of "nonempty".
A common use (e.g. in Ubuntu) for udevadm monitor is to log the events
received by udev during boot; events can be lost of the buffer size isn't
increased as udevd does.
Signed-off-by: Scott James Remnant <scott@ubuntu.com>