1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 08:26:52 +03:00
Commit Graph

3904 Commits

Author SHA1 Message Date
Kay Sievers
cad40a5fe7 udevd: switch to common id_filename functions 2010-12-12 20:07:15 +01:00
Kay Sievers
24d1076696 udevd: simplify udev database and fix DEVNAME handling 2010-12-11 14:00:46 +01:00
Kay Sievers
2713e6ab0a udevd: always create /dev/{char,block}/$major:$minor 2010-12-10 13:27:03 +01:00
Kay Sievers
4281da1fa6 udevd: use dev_t or netif ifindex as database key
We need to preserve the database of network interfaces while we
rename them. Use the kernel's numbers wherever possible, instead
of the device names.

Fix wrong database filenames which contain a '/', translated
from '!' in the kernel name.

Fix segfault for kobject pathes where the subsystem can not be
determined from sysfs.
2010-12-10 01:18:15 +01:00
Kay Sievers
dc1791a9e6 udevadm: info - honor --export, --export-prefix= 2010-12-10 01:18:15 +01:00
Kay Sievers
88163971b9 udevadm: info - honor --export and --export-prefix for property query
The output will always be quoted:
  $ udevadm info --export --export-prefix=MY_ --query=property --name=sda
  MY_UDEV_LOG='3'
  MY_DEVPATH='/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda'
  MY_MAJOR='259'
  MY_MINOR='0'
  MY_DEVNAME='sda'
  MY_DEVTYPE='disk'
  MY_SUBSYSTEM='block'
2010-12-10 01:18:14 +01:00
Kay Sievers
8ba13ec1cd libudev: do not overwrite path with readlink() call 2010-12-10 01:18:14 +01: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
310f99d335 rules: revert bsg use until the event ordering problem is sorted out
The bsg devices node are created after the LUN, so we fail in the
hotplug case, but succeed at coldplug, and create inconsistent data
that way.

The bsg device event order will need to be sorted out, by changing the
kernel.
2010-11-30 11:48:08 +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
Kay Sievers
2b15b26dfa rules: drop OSS audio rule 2010-11-24 12:05:21 +01:00
Kay Sievers
01675fbbe8 rules: 78-sound-card - remove specific hardware matches, they do not belong here 2010-11-24 12:00:31 +01:00
Michal Soltys
1a6ab67030 udevd: create static nodes before /dev/null is needed 2010-11-22 13:55:20 +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
Harald Hoyer
851dd4ddc5 udev-rules.c: change import property buffer to 16384 bytes
import_program_into_properties() should have the same line length as
import_file_into_properties()

see also https://bugzilla.redhat.com/show_bug.cgi?id=652318
2010-11-12 14:42:35 +01:00
Jakub Wilk
b8015eea2d man: udev - workaraound -> workaround 2010-11-10 01:30:53 +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
2938220037 Run scsi_id and ata_id on the scsi_device object
In a multi-initiator setup, the HBA may very well export a SCSI device
for a device that another initiator has already logged into. But since
another initiator has already logged in, the kernel will not create a
block device.

Note that this is also the case for some RAID HBAs - for example, the
LSI 1068 series cards will export a SCSI device for a disk that is in
use by the HBAs RAID engine (no block device will be created here).

Running scsi_id and ata_id on the actual SCSI device means that we can
inquire the capabilities of the device. For example, we can check
whether ID_ATA_FEATURE_SET_SMART and ID_ATA_FEATURE_SET_SMART_ENABLED
is set and, if so, periodically poll the SMART status of the
disk. Even when other initiators has claimed the disk and if the disk
is in use by the RAID engine of the HBA.

Note that we run scsi_id and ata_id on /dev/bsg/* nodes - this is safe
to do because the scsi core guarantees that the bsg device has been
created before the actual add uevent for the scsi_device is emitted.

Since the block device is a direct child of the scsi_device we can
avoid running scsi_id and ata_id again by simply importing the
resulting ID_* properties from the parent.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-10-30 13:04:35 -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
Martin Pitt
81956ed1dc keymap: Add some more Sony Vaio VGN-* models
https://launchpad.net/bugs/627890
2010-10-25 22:11:37 -04:00
Martin Pitt
2f151e0fbf keymap: Add Sony Vaio VGN71
https://launchpad.net/bugs/625770
2010-10-25 22:01:03 -04:00
Kay Sievers
be9c0d5740 version bump 2010-10-23 15:35:35 +02:00
Kay Sievers
9bc26156e0 release 164 2010-10-23 15:13:57 +02:00
Kay Sievers
cdb1d7608a libudev: return kernel provided devnode when asked before we handled any rules 2010-10-22 13:56:16 +02:00
Martin Pitt
a74beafdcc keymap: Add Toshiba Satellite U500
https://launchpad.net/bugs/271706
2010-10-22 12:52:45 +02:00
Kay Sievers
1c2311c556 return proper error code in rename_netif()
<Md>  kay: can you look at rename_netif()? it returns -errno in a place,
      but I think that it may by changed by err() (at least)
<kay> Md: yeah, that doesn't look correct
2010-10-18 12:55:06 +02:00
Martin Pitt
60d19551d8 keymap: Apply force-release rules to all Samsung models.
The force-release list for Samsung is already an ultralong monster, and
reportedly still incomplete (see https://launchpad.net/bugs/574250).
Give up and instead apply the force-release quirk to all Samsung models. The
worst that can happen is that autorepeat behaves a bit weird, but that's much
better than a complete freeze after each keypress.
2010-10-13 18:08:41 +02:00
Kay Sievers
fc416258f3 udevd: do not wrongly delay events for devices with swapped names
Renaming network devices might delay events for the other device, which has
the same devpath in the meantime as the original event. Causing a delay until
the timout of the event is reached.

Look at the ifindex/devnum of the devices to check if they are really
the same devices.
2010-10-13 13:08:29 +02:00
Kay Sievers
457c67e7c1 version bump 2010-10-13 13:08:29 +02:00
David Zeuthen
18f5c802df Install libgudev-1.0.so in prefix / instead of prefix /usr
This is to match where libudev.so is installed and it works because
all dependent libraries are already installed in / instead of /usr on
most distros:

 $ ldd /usr/lib64/libgudev-1.0.so
         linux-vdso.so.1 =>  (0x00007fff44dff000)
         libudev.so.0 => /lib64/libudev.so.0 (0x0000003bf2600000)
         libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x0000003fb5200000)
         libgthread-2.0.so.0 => /lib64/libgthread-2.0.so.0 (0x0000003fb4e00000)
         libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003d5b000000)
         librt.so.1 => /lib64/librt.so.1 (0x0000003d5b800000)
         libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x0000003fb4a00000)
         libc.so.6 => /lib64/libc.so.6 (0x0000003d5ac00000)
         /lib64/ld-linux-x86-64.so.2 (0x0000003d5a800000)

With this change it is possible to write libgudev applications that
can be installed in /bin or /sbin and can run without /usr being
mounted. This is needed for e.g. udisks, NetworkManager and other
subsystem-specific daemons.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-10-11 12:10:02 -04:00
Harald Hoyer
d7cd2b1611 cdrom_id: request the drive profile features with a dynamic length
Some drives don't like huge feature buffers, so we query twice. First
run for the current profile and to get the length.
Second time we query the whole profile feature set.
2010-10-07 17:43:05 +02:00
Kay Sievers
d7628fbfcd release 163 2010-10-07 15:07:48 +02:00
Kay Sievers
392ef7a28a udevd: add sd-daemon.c 2010-10-07 14:59:11 +02:00
Kay Sievers
d8b9a5c12b systemd: sort before basic.target 2010-10-07 10:49:13 +02:00
Martin Pitt
1ebd2a5620 cdrom_id: Don't read beyond "last track" in TOC
Read the first and last track from the TOC header, and do not go beyond that
stated number of tracks when reading the TOC. Otherwise we interpret random
data which leads to bogus tracks. (Reported on an IronKey, which reported 1
data track, and 4 audio tracks which weren't actually present.)
2010-10-05 17:56:19 +02:00
Martin Pitt
678df8a461 cdrom_id: Fall back to CDROM_DRIVE_STATUS if all MMC commands fail
Reportedly, some "when I'm grown up I want to be a CD drive" fake USB CD sticks
like the IronKey neither support the SCSI "GET CONFIGURATION" nor the older
(pre-MMC2) "READ DISC INFORMATION" command. In that case, check if
cd_media_compat() detected that there is a disc present, and assume that we
have a CD-ROM medium.
2010-10-05 14:59:51 +02:00
Martin Pitt
13e0fca5df Revert "cdrom_id: Try reading the medium if all MMC commands fail"
Turns out we can do this much simpler by assuming that cd_media_compat() works,
which seems to be the case for the IronKey.

This reverts commit ea88774a92.
2010-10-05 14:57:04 +02:00
Martin Pitt
ea88774a92 cdrom_id: Try reading the medium if all MMC commands fail
Reportedly, some "when I'm grown up I want to be a CD drive" fake USB CD sticks
like the IronKey neither support the SCSI "GET CONFIGURATION" nor the older
(pre-MMC2) "READ DISC INFORMATION" command. In that case, check if we can read
data from the drive, and assume that we have a CD-ROM medium if it succeeds.
2010-10-05 14:34:55 +02:00
Kay Sievers
0bd77e2acd systemd: hook into basic.target instead of sysinit.target 2010-09-29 00:49:24 +02:00
Lee, Chun-Yi
e17f9c3cd5 keymap: Add alternate MSI vendor name
Add new vendor name "Micro-Star International" in 95-keymap.rules.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2010-09-25 11:29:08 +02:00
Martin Pitt
b2ad12eb02 Add automatic rules syntax check
Add test/rule-syntax-check.py, a script for checking the syntax of all udev
rules files passed as command line arguments.

Add a wrapper test/rules-test.sh which calls rule-syntax-check.py on all udev
rules that we ship, but does nothing if Python is not available. Integrate this
into make check/distcheck.
2010-09-21 12:45:52 +02:00
Martin Pitt
c112a41a43 fix various syntax errors in rules 2010-09-21 12:14:50 +02:00
Martin Pitt
1079014420 Clarify WAIT_FOR documentation
The path is relative to the sysfs device, so this provides an easy way to wait
for an attribute to appear.
2010-09-21 12:12:01 +02:00