1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 11:55:44 +03:00
Commit Graph

918 Commits

Author SHA1 Message Date
Kay Sievers
9602509521 selinux: firmware - do not label files in runtime dir 2011-04-08 03:08:16 +02:00
Seth Forshee
5e0ec43fc4 keymap: Support Dell Latitude XT2 tablet-mode navigation keys
The XT2 has a rocker (up/down/enter) and back button on the side
in tablet mode, none of which work currently. Add entries for
these keys.

There is some overlap here with scan codes used in other Dell
models, so these buttons are put in a new file specific to this
model.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2011-04-05 19:38:36 +02:00
Martin Pitt
55eb500cc5 Avoid spinning up CD on pressing eject button
When the CD tray door is locked and the hardware eject button is pressed, newer
kernels (2.6.38+) will send out a change event with a DISK_EJECT_REQUEST==1
property. Do not run cdrom_id and blkid in this case, as the media state and
contents does not change, and this only needlessly spins up the drive again
right before ejection.
2011-04-04 11:47:54 +02:00
Lee, Chun-Yi
ff4a035a8a Add rule for Acer Aspire One ZG8 to use acer-aspire_5720 keymap
Acer Aspire One ZG8's bluetooth HW key emit 0xD9 scancode, it must map
to KEY_BLUETOOTH like Acer Aspire 5720. So, add rule for Acer Aspire One
ZG8 use acer-aspire_5720 keymap.

Tested on Acer Aspire One ZG8 netbook.

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2011-03-31 16:37:31 +02:00
Seth Forshee
641842bce2 keymap: continue reading keymap after invalid scancodes
Reading of keymaps is aborted when EINVAL is returned from EVIOCGETKEYCODE.
Scan codes are not always continuous ranges of values starting at 0, so this
can result in not getting the full keymap for a device. Instead, continue
processing if EINVAL is returned.
2011-03-24 16:33:54 +01:00
Kay Sievers
4ec9c3e797 use /run/udev/ if possible and fall back to /dev/.udev/ 2011-03-23 02:31:09 +01:00
Kay Sievers
7a959f1b07 input_id: silent gcc warnings 2011-03-19 17:04:56 +01:00
Martin Pitt
1d8296d6ed input_id: Rewrite debug logging to use standard udev info() 2011-03-18 16:18:17 +01:00
Martin Pitt
792479aca5 input_id: Cover key devices which only have KEY_* > 255
We previously only tested the "key" capabilities for keys between 0 and 255 to
determine ID_INPUT_KEY. If there are none, also check for keys in the upper
block (KEY_OK/0x160 to KEY_TOUCHPAD_OFF/0x214).
2011-03-18 14:45:42 +01:00
Martin Pitt
88149f668e input_id: Avoid memory overflow with too long capability masks
Joey Lee <jlee@novell.com> reported a problem on an MSI laptop which reports a
too long capabilities/key:

E: EV==3
E: KEY==180000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

This is longer than KEY_MAX and thus caused a memory overflow. Guard against
this now and just ignore the excess blocks.
2011-03-18 13:56:32 +01:00
Martin Pitt
941c40bdc4 input_id: Add some debugging output
If $DEBUG is set, output the capability bitmaps to stderr.
2011-03-18 13:42:02 +01:00
Martin Pitt
7a86845ba1 input_id: Consistently use tabs for indentation 2011-03-18 13:32:55 +01:00
Harald Hoyer
5e199245f2 udev-acl/70-acl.rules: tag ID_REMOTE_CONTROL with acl
Used by "concordance" to access Logitech Harmony programmable remote
controls.

http://www.phildev.net/concordance/
2011-03-17 20:42:12 +01:00
David Zeuthen
98ab6a3772 cdrom_id: Don't ignore profiles when there is no media available
Just because the GET CONFIGURATION MMC-2 command returns the current
profile as 0 does not mean that we can ignore the profiles describing
the capabilities of the drive - it only means that there currently is
no recognized media in the drive. Therefore, do process the returned
profiles even when cur_profile is 0.

This fixes a bug where only

 ID_CDROM=1
 ID_CDROM_CD_R=1
 ID_CDROM_CD_RW=1
 ID_CDROM_DVD=1
 ID_CDROM_DVD_R=1
 ID_CDROM_DVD_RAM=1

was returned when there is no media in the drive instead of

 ID_CDROM=1
 ID_CDROM_CD=1
 ID_CDROM_CD_R=1
 ID_CDROM_CD_RW=1
 ID_CDROM_DVD=1
 ID_CDROM_DVD_R=1
 ID_CDROM_DVD_RW=1
 ID_CDROM_DVD_RAM=1
 ID_CDROM_DVD_PLUS_R=1
 ID_CDROM_DVD_PLUS_RW=1
 ID_CDROM_DVD_PLUS_R_DL=1
 ID_CDROM_BD=1
 ID_CDROM_BD_R=1
 ID_CDROM_BD_RE=1
 ID_CDROM_HDDVD=1

as is returned now.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-03-15 12:33:35 -04:00
Kay Sievers
5f59fa0900 move /dev/.udev/ to /dev/.run/udev/ and convert old udev database at udevd startup 2011-03-15 17:26:08 +01:00
Lee, Chun-Yi
52d54f237d Remap MSI Laptop touchpad on/off key to F22 and F23
MSI Laptop driver will query the real touchpad state then emit
KEY_TOUCHPAD_ON/OFF key.

Currently, X has defined F22 for touchpad on and F23 for touchpad
off. This patch aligns MSI Laptop driver's key with F22 and F23.

Tested on MSI U160 netbook using msi-laptop driver.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2011-03-10 08:51:06 +01:00
Kay Sievers
71e65e8683 udev-acl: move sg rule to optical drive rule 2011-03-07 16:10:50 +01:00
Andrey Borzenkov
37d3d6abde udev-acl: add /dev/sgX nodes for CD-ROM
Current wine is using /dev/sgX to access CD-ROM devices. Since
distributions switched to using ACL instead of group membership
to control device access, wine is not able to access them.

Add ACL to device nodes that already get GROUP="cdrom".

Ref: https://qa.mandriva.com/show_bug.cgi?id=62114

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
2011-03-07 16:09:38 +01:00
Lee, Chun-Yi
30c2b6f10f Remap Acer WMI touchpad toggle key to F21 used by X
Currently, Acer WMI driver generates KEY_F22 but this
will soon change to KEY_TOUCHPAD_TOOGLE.

X has defined F21 for the purpose of touchpad toggle and other
udev keymaps align with this meaning.  Patch aligns Acer WMI
hotkey drivers with F21.

Tested on Acer TravelMate 8572 notebook using acer-wmi driver.

Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2011-03-01 12:54:00 +01:00
Harald Hoyer
551b143e13 cdrom_id: cd_media_toc() extend toc size to 65536
Seems like an iDRAC reports a lot of toc entries.

"For cd_media_toc() will have to be modified to handle larger
tables right now it has an "unsigned char toc[2048]" but the toc
can be up to 65536 bytes long . I got a TOC length of 4610 bytes,
causing cd_media_toc() to fail."

https://bugzilla.redhat.com/show_bug.cgi?id=660367

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2011-02-24 16:59:21 +01:00
Martin Pitt
7ae8a463be keymap: Fix Acer Aspire 5920G media key
From downstream bug: "In Windows this button launch Acer Arcade or Acer Arcade
Deluxe application - it's media center like XBMC."

https://launchpad.net/bugs/637695
2011-02-20 17:58:55 +01:00
Kay Sievers
89284ddac4 v4l_id: remove left-over variable 2011-02-15 17:27:29 +01:00
Kay Sievers
4ace8a43ac v4l_id: kill the v4l1 ioctl
Recent kernels do not have v4l1 anymore.
2011-02-15 17:24:32 +01:00
Matthew Garrett
0028a9224f keymap: Remove wlan from Dell
The Dell rfkill key is handled by hardware and the dell-laptop driver catches
the i8042 event in order to update the rfkill state. Sending wlan to userspace
will just result in userspace trying to revert the change the hardware has
just made.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2011-02-10 06:42:01 +01:00
Kay Sievers
46df5b1bae ata_id: do not print empty serial numbers to avoid unwanted trailing '_' 2011-02-09 22:12:15 +01:00
Jürgen Kaiser
54453a9510 keymap: Add Acer Aspire 8930
http://bugs.debian.org/612512

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2011-02-09 17:10:32 +01:00
Kay Sievers
b6910d2251 extras: qemu - fix typo 2011-01-25 21:46:12 +01:00
Gerd Hoffmann
4e54f5334e extras: add rules for qemu guests
These patches enable usb autosuspend for the qemu emulated HID devices.
This reduces the cpu load for idle guests with a hid device attached
because the linux kernel will suspend the usb bus then and qemu can stop
running a 1000 Hz to emulate the (active) UHCI controller.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-25 16:14:04 +01:00
Martin Pitt
2514465f6a keymap: Explain how to end the program
Pressing Escape will only actually work if keymap is currently examining the
primary keyboard. For other devices the user needs to press Control-C instead.
2011-01-16 21:12:32 +01:00
Martin Pitt
90f182c3d6 keymap: More robust state machine
Some drivers, like thinkpad_acpi, do not send a scan code at all (for known
keys), and some send the key code first, then the scan code. Implement a better
state machine which acceps them in any order and wait until a SYN event. If the
driver does not send SYN events, keymap will also handle this and print out
that fact.

Thanks to Seth Forshee for pointing out how this really works!

https://launchpad.net/bugs/702407
2011-01-16 21:10:03 +01:00
Martin Pitt
45019c0e88 keymap: Move reading of event in separate function 2011-01-16 19:25:04 +01:00
Martin Pitt
9b444cb29a keymap: Add Lenovo ThinkPad X201 tablet
https://launchpad.net/bugs/702426
2011-01-13 10:10:27 -06:00
Martin Pitt
e302c4b33d keymap: Update README.keymap.txt
Drop orig-map.txt requirement, we don't really use it in practice. Also ask for
sending stuff to the mailing list instead of Launchpad.
2011-01-07 12:12:57 +01:00
Martin Pitt
df6b2cf573 keymap: Add Acer TravelMate C310
Thanks to Dieter Herrmann for the report!
2011-01-07 12:09:45 +01:00
Chris Bagwell
0d8b6be5f5 Remap Eee PC touchpad toggle key to F21 used by X
Currently, Eee PC have a hotkey that generates KEY_F13 but this
will soon change to KEY_TOUCHPAD_TOOGLE.  Both cases do not
work well with X.

X has defined F21 for the purpose of touchpad toggle and other
udev keymaps align with this meaning.  Patch aligns Eee PC
hotkey drivers with F21.

Tested on Eee PC 1005PE using both eeepc-wmi and eeepc-laptop driver
(with acpi_osi="!Windows 2009").

Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2011-01-03 09:31:45 +01:00
David Zeuthen
d4c2307cc2 gudev: Add Device.get_usec_since_initialized
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-12-15 10:46:34 -05:00
David Zeuthen
ab17a7ef55 Add g_udev_device_get_is_initialized() method
Also nuke the "Index of deprecated symbols" since we have no
deprecated symbols just yet.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-12-14 12:50:04 -05:00
David Zeuthen
0976fd063e Add GUdevEnumerator type and Device.get_tags() method
Also add JS example to check the added API works.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-12-14 12:37:40 -05:00
Martin Pitt
329239f506 keymap: Fix struck Touchpad key on Dell Precision M series
https://launchpad.net/bugs/686662
2010-12-08 18:41:42 +01:00
Martin Pitt
a2f8d21431 keymap: Fix struck Touchpad key on Dell Latitude E series
https://launchpad.net/bugs/686662
2010-12-08 16:21:02 +01:00
Kay Sievers
5113029acb rules: drop alsa jack-plug input devices 2010-11-29 12:01:58 +01:00
David Henningsson
53c5ceff08 Add ACLs for FFADO supported sound cards
https://launchpad.net/bugs/681755

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2010-11-26 15:31:42 +01:00
Andy Whitcroft
046d09f322 keymap: Add release quirks for two Zepto Znote models and AMILO Xi 2428
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2010-11-26 14:08:28 +01:00
Martin Pitt
0e6546c11f Add ACL for media player USB devices
Originally we added an ACL for some particular mobile phone product IDs to
enable users to run e. g. the Android SDK as non-root. This was removed in
232f180 as we don't want to maintain product/vendor ID lists in udev.

However, we already know from media-player-info that devices like this are
media players. There is little reason to deny user access to those, so add back
a generic rule which adds an ACL to media player raw USB devices.

https://launchpad.net/bugs/316215
2010-11-22 10:49:12 +01:00
Harald Hoyer
d69207c3f2 70-acl.rules: add ACLs for ID_PDA devices 2010-11-12 15:44:34 +01:00
Bastien Nocera
a1ca5f60e0 extras/keymap: Make touchpad buttons consistent
We'll need to standardise on the Touchpad related keys in udev, kernel, and
X.org. I selected F21 for XF86TouchpadToggle, F22 for XF86TouchpadOn and F23
for XF86TouchpadOff.

See:
https://bugs.freedesktop.org/show_bug.cgi?id=31333

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2010-11-06 12:31:24 -04:00
Bastien Nocera
ecfad20871 keymap: Add force release for HP touchpad off
Force the touchpad off/on keys getting released, as they usually
only send a "repeat".

https://bugzilla.redhat.com/show_bug.cgi?id=623239

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2010-11-06 09:16:23 -04:00
David Zeuthen
560de57514 Use ata_id, not scsi_id, on ATAPI devices
The major benefit here, is that we get the ATAPI device serial
number. With SCSI ID we didn't get this since it's not part of the
SCSI INQUIRY command. Specifically this means that we get symlinks to
empty optical drives, e.g.

 /dev/disk/by-id/ata-VBOX_CD-ROM_VB2-01700376

which we didn't get earlier. So this is a major win.

Also make ata_id work on CD-ROM devices when using /dev/bsg nodes so
this works on both the scsi_device as well as the block device. We do
this, basically, by issuing the ATA IDENTIFY PACKET DEVICE command
instead of the ATA IDENTIFY command. We also use 16-byte pass-through
ATA passthrough instead of 12-byte passthrough to avoid clashing with
the MMC BLANK command.

This means that we get this output

 # udevadm info -q all -p /sys/devices/pci0000:00/0000:00:01.1/host3/target3:0:0/3:0:0:0
 P: /devices/pci0000:00/0000:00:01.1/host3/target3:0:0/3:0:0:0
 E: UDEV_LOG=3
 E: DEVPATH=/devices/pci0000:00/0000:00:01.1/host3/target3:0:0/3:0:0:0
 E: DEVTYPE=scsi_device
 E: DRIVER=sr
 E: MODALIAS=scsi:t-0x05
 E: SUBSYSTEM=scsi
 E: ID_ATA=1
 E: ID_TYPE=cd
 E: ID_BUS=ata
 E: ID_MODEL=VBOX_CD-ROM
 E: ID_MODEL_ENC=VBOX\x20CD-ROM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x 20\x20\x20\x20\x20\x20\x20
 E: ID_REVISION=1.0
 E: ID_SERIAL=VBOX_CD-ROM_VB2-01700376
 E: ID_SERIAL_SHORT=VB2-01700376

instead of just

 # udevadm info -q all -p /sys/devices/pci0000:00/0000:00:01.1/host3/target3:0:0/3:0:0:0
 P: /devices/pci0000:00/0000:00:01.1/host3/target3:0:0/3:0:0:0
 E: UDEV_LOG=3
 E: DEVPATH=/devices/pci0000:00/0000:00:01.1/host3/target3:0:0/3:0:0:0
 E: DEVTYPE=scsi_device
 E: DRIVER=sr
 E: MODALIAS=scsi:t-0x05
 E: SUBSYSTEM=scsi
 E: ID_SCSI=1
 E: ID_VENDOR=VBOX
 E: ID_VENDOR_ENC=VBOX\x20\x20\x20\x20
 E: ID_MODEL=CD-ROM
 E: ID_MODEL_ENC=CD-ROM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
 E: ID_REVISION=1.0
 E: ID_TYPE=cd

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-11-04 13:29:38 -04:00
David Zeuthen
6992637e31 ata_id: Support SG_IO version 4 interface
This makes it possible to use /dev/bsg/* nodes for ata_id:

 # /lib/udev/ata_id --export /dev/bsg/0\:0\:0\:0
 ID_ATA=1
 ID_TYPE=disk
 ID_BUS=ata
 ID_MODEL=INTEL_SSDSA2MH080G1GC
 ID_MODEL_ENC=INTEL\x20SSDSA2MH080G1GC\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
 ID_REVISION=045C8802
 [...]

This means that our cd-rom detection as per commit

 http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=160b069c25690bfb0c785994c7c3710289179107

needs to be reworked since we can't just use the CDROM_GET_CAPABILITY
ioctl on a /dev/bsg node (which is a character device). We do this by
just sending the SCSI INQUIRY command and checking the type (CD-ROM's
are all type 0x05 and disks are type 0x00) before we issue the ATA
IDENTIFY command through the SCSI command ATA PASS_THROUGH (12).

 (Yes, it's a bit perverse how we have to tunnel our ATA commands
 through a SCSI command  but that's how Linux currently work.)

We still support for SG_IO version 3 (we fail back if version 4 fails
with EINVAL) because testing reveals that some drivers (such as
mpt2sas) still only support version 3 on the block nodes.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-10-30 13:03:00 -04:00
Jan Drzewiecki
d43e5e5b5a cdrom_id: Fix media state for unreadable DVDs
If the disc is unreadable and reading of the first 32 blocks fails set the
cd_media status to 0 (not present). This will prevent udev from executing blkid
next that tries to determine fs on the disc and which in this case may seem to
hang forever locking the drive.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2010-10-26 12:10:57 -04:00