1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 15:21:37 +03:00
Commit Graph

3558 Commits

Author SHA1 Message Date
Kay Sievers
99eb7c451c util_unlink_secure(): chmod() before chown() 2009-12-08 18:44:45 +01:00
David Zeuthen
7f4954d040 Export ID_WWN_VENDOR_EXTENSION and ID_WWN_WITH_EXTENSION
Some SCSI devices use the same WWN and have a WWN extension that we
need to take into account when creating the /dev/disk/by-id/wwn
symlinks. Thus, introduce ID_WWN_WITH_EXTENSION. This property will
contain either the WWN (if no extension is present) or the WWN with
the vendor extension appended.

Example:

 # /lib/udev/ata_id/ata_id --export /dev/sda |grep WWN
 ID_WWN=0x5001517387d61905
 ID_WWN_WITH_EXTENSION=0x5001517387d61905

 # /lib/udev/scsi_id --whitelisted --export -d /dev/sdb |grep WWN
 ID_WWN=0x600508b400105df7
 ID_WWN_VENDOR_EXTENSION=0x0000e00000d80000
 ID_WWN_WITH_EXTENSION=0x600508b400105df70000e00000d80000

 # /lib/udev/scsi_id --whitelisted --export -d /dev/sdc |grep WWN
 ID_WWN=0x600508b400105df7
 ID_WWN_VENDOR_EXTENSION=0x0000e00000db0000
 ID_WWN_WITH_EXTENSION=0x600508b400105df70000e00000db0000

Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-12-04 11:40:00 -05:00
Kay Sievers
07fb7fce66 release 149 2009-12-03 14:39:12 +01:00
Kay Sievers
baf2e222d5 fix both in-tree and out-of-tree builds
On Thu, Dec 3, 2009 at 14:31, Daniel Elstner <daniel.kitta@googlemail.com> wrote:
> However, I'd recommend to look first in the build directory, and then in
> the source directory to match the behavior of make with VPATH builds.
> The idea is that a file in the build tree, if it exists, overrides a
> file of the same name in the source tree.
2009-12-03 14:36:36 +01:00
Kay Sievers
83d288085f really really fix both in-tree and out-of-tree builds
The include is still missing:
  GEN    extras/gudev/GUdev-1.0.gir
  In file included from <stdin>:4:
  /home/kay/work/src/udev/extras/gudev/gudev.h:26:34: error: gudev/gudevenumtypes.h: No such file or directory

Also prepend $(builddir).
2009-12-03 13:58:18 +01:00
Daniel Elstner
a4035cce36 really fix both in-tree and out-of-tree builds
Makefile.am (extras/gudev/GUdev-1.0.gir): Look for gudevenumtypes.h
in both the build directory and the source directory, so that it works
in either case.
2009-12-03 13:57:44 +01:00
Kay Sievers
4cf3298e1f configure.ac: version bump 2009-12-03 13:31:43 +01:00
Kay Sievers
79ef2e97d9 libudev: doc - use #NULL 2009-12-03 13:31:27 +01:00
Martin Pitt
54d4f54e85 udev_device_get_parent_with_subsystem_devtype(): Clarify documentation
devtype can be NULL, in which case it is ignored for matching.
2009-12-03 13:25:19 +01:00
Dmitry Torokhov
89b6237342 input-id: identify touchscreens
Add detection of touchscreens to the input-id utility.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2009-12-03 13:20:10 +01:00
Martin Pitt
01db50919e input_id: Check mouse button for ID_INPUT_MOUSE
Before we bless an input device as a mouse, verify that it has a left button
(BTN_MOUSE).

Thanks to Dmitry Torokhov <dtor@mail.ru> for pointing out!
2009-12-03 13:15:50 +01:00
Martin Pitt
7c3db77111 input_id: check event mask
Check the capabilities/ev for the particular event class before testing bits in
that event class. This avoids testing potentially bogus data if the device does
not support that class of events at all.

Thanks to Dmitry Torokhov for pointing out!
2009-12-03 12:56:44 +01:00
Martin Pitt
175cb7b81d input_id: small optimization
In the parent traversal loop, use
udev_device_get_parent_with_subsystem_devtype() to only grab "input" class
devices.
2009-12-03 12:46:22 +01:00
Martin Pitt
b919e0ffee input_id: Do not tag non-input devices with ID_INPUT
Current rules only call it for input devices, but let's be correct.
2009-12-03 10:22:04 +01:00
Martin Pitt
22f9cb51c3 input_id: Fix endless loop for non-input devices
When being called on a device which is not in the "input" subsystem, or doesn't
have an "input" parent, it got stuck in an endless loop. Unfortunately this
includes the virtual/input/mice multiplexer, which exposes this bug on just
about every system.
2009-12-03 10:16:49 +01:00
Kay Sievers
2ad6af0fc0 release 148 2009-12-02 12:58:47 +01:00
Kay Sievers
17b9404053 Revert "Fix out-of-tree builds"
This reverts commit 326e15a8ed.

The issue in:
  http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=7fa9bb9dbf538bf3c8a25a6699f65a8ac9cc8bbf
still exists. We need to find a reliable way not to break
"make distcheck" here.
2009-12-02 12:56:06 +01:00
Martin Pitt
5b9204787f input_id: code cleanup
Now use libudev to clean up hardcoded /sys/ and /device/ paths, and to also
support direct input device arguments. Now both "input4" and "event4" will
work.
2009-12-02 11:14:19 +01:00
Scott James Remnant
326e15a8ed Fix out-of-tree builds
gudevenumtypes.h won't be under $(top_srcdir) when built out-of-tree
from GIT.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2009-12-02 01:20:03 +00:00
Dmitry Torokhov
e0ead3ba82 extras/input_id: Correctly identify touchpads
BTN_TOUCH (as well as ABS_PRESSURE) is used not only by touchpads but
by touchscreens as well. The proper check for a touchpad is presence
of BTN_TOOL_FINGER and absence of BTN_TOOL_PEN (the latter to filter
out some tablets that use BTN_TOOL_FINGER).

Tablet matching should be on either BTN_TOOL_PEN or BTN_STYLUS.
2009-11-30 23:03:05 +01:00
Martin Pitt
6722e19ab1 input: Deprecate ENV{ID_CLASS}
The ID_CLASS property on input devices has been replaced by the more accurate
set of flags ID_INPUT_{KEYBOARD,KEYS,MOUSE,TOUCHPAD,TABLET,JOYSTICK}.

Rewrite 60-persistent-input.rules to use the new properties now and not export
ID_CLASS any more, since it is not used by anything else any more.

Add note about migration to NEWS, in case this is being used in custom rules.
2009-11-30 19:16:09 +01:00
Martin Pitt
897c0f175d 70-acl.rules: Use new-style input properties
ID_CLASS is deprecated for input devices. Use new ID_INPUT_JOYSTICK instead.
2009-11-30 18:46:51 +01:00
Martin Pitt
a6cf773401 extras: Add input_id
input_id probes input/event devices for their class (keyboard, keys, mouse,
touchpad, tablet, joystick). This is based on the corresponding hal code in
hald/linux/device.c, input_test_{abs,rel,...}.

This should provide enough functionality to get hal-less X.org working (which
in particular needs to know exactly which devices are touchpads).

Replace the brittle hacks in 60-persistent-input.rules with checking for the
new ID_INPUT_* flags. This keeps the old ID_CLASS properties for now (but they
are to be removed later on).

Note: The current code has several hacks still, which are to be replaced with
proper libudev calls later on.
2009-11-30 18:38:43 +01:00
David Zeuthen
d6b5571c12 Also create /dev/disk/by-id/wwn-0x..-part%n symlinks for partitions
# ls -l /dev/disk/by-id/wwn-0x500
 wwn-0x500000e01b83f360        wwn-0x50014ee25578924f-part1
 wwn-0x500000e01b83f440        wwn-0x50014ee25578924f-part2
 wwn-0x500000e01b83f520        wwn-0x50014ee2aabdc41b
 wwn-0x500000e01b843d90        wwn-0x50014ee2aabdc41b-part1
 wwn-0x5000c50016359fd1        wwn-0x50014ee2aabdc41b-part2
 wwn-0x50014ee0016eb4f5        wwn-0x5001517958cabd77
 wwn-0x50014ee0016eb572        wwn-0x5001517958cabd77-part1
 wwn-0x50014ee055d524e2        wwn-0x5001517958cabd77-part2
 wwn-0x50014ee055d524e2-part1  wwn-0x5001517958d6a74e
 wwn-0x50014ee055d524e2-part2  wwn-0x5001517958d6a74e-part1
 wwn-0x50014ee1003d9c50        wwn-0x5001517958d6a74e-part2
 wwn-0x50014ee1003d9c50-part1  wwn-0x50024e9200c0c693
 wwn-0x50014ee1003d9c50-part2  wwn-0x50024e9200c0c694
 wwn-0x50014ee1aac30d4e        wwn-0x50024e9200c0c6ae
 wwn-0x50014ee1aac30d4e-part1  wwn-0x50024e9200c0c6af
 wwn-0x50014ee1aac30d4e-part2  wwn-0x50024e9200c0c6b0
 wwn-0x50014ee25578924f        wwn-0x50024e9200c0c6b1

Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-11-25 11:17:54 -05:00
David Zeuthen
28c7463999 Create /dev/disk/by-id/wwn-0x... symlinks
Now that both ata_id and scsi_id exports the World Wide Name in the
ID_WWN property, use this to create persistent symlinks. Example

 /dev/disk/by-id/wwn-0x500000e01b83f360 -> ../../sdn
 /dev/disk/by-id/wwn-0x500000e01b83f440 -> ../../sdm

Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-11-25 11:10:47 -05:00
Daniel Mierswa
de408510ec Fix typo in NEWS, ConsoleKit-0.4.11 -> 0.4.1
Signed-off-by: Daniel Mierswa <impulze@impulze.org>
2009-11-25 08:43:59 +01:00
Dan Williams
73045f9d39 modem-modeswitch: 61-option-modem-modeswitch.rules is only for Option NV devices
Make people aware that they shouldn't add devices not manufactured by
Option NV to 61-option-modem-modeswitch.rules.  modem-modeswitch only
supports ejecting the fake CD for Option NV devices at this time.
People should be using (and fixing) usb_modeswitch instead of
modem-modeswitch.
2009-11-23 13:54:35 -08:00
Dan Williams
8a993fab2f Revert "extras/modem-modeswitch: Add Huawei E1550 GSM modem"
This reverts commit 53842b5382.

The 'option-zerocd' method should *only* be used with Option NV devices
since other manufacturers have completely different methods for killing
their fake driver CD.
2009-11-23 13:52:08 -08:00
Dan Williams
a07d103e63 Revert "modem-modeswitch: add a device"
This reverts commit 5052297b6a.

The 'option-zerocd' method should *only* be used with Option NV devices
since other manufacturers have completely different methods for killing
their fake driver CD.
2009-11-23 13:51:11 -08:00
David Zeuthen
4e9fdfccbd scsi_id: Export WWN and Unit Serial Number
Since the Unit Serial Number and the WWN are useful bits of
information export them as properties in the udev database. These
bits of information are often printed on the physical disk, see

http://people.freedesktop.org/~david/FUJITSU-MAY2036RC-sas-disk-picture.jpg

and displaying them separately in the UI (or in /dev/disk) might help
users identify the physical disk. This patch exports these bits of
information as ID_WWN and ID_SCSI_SERIAL.

Note that ata_id also use the ID_WWN property since commit
66094a4a7f (2009-11-04).

Also print out ID_SCSI=1 so users of the udev database knows the disk
speaks SCSI.

Here's the scsi_id output from one of my SAS disks with these changes:

 ID_SCSI=1
 ID_VENDOR=FUJITSU
 ID_VENDOR_ENC=FUJITSU\x20
 ID_MODEL=MAY2036RC
 ID_MODEL_ENC=MAY2036RC\x20\x20\x20\x20\x20\x20\x20
 ID_REVISION=0103
 ID_TYPE=disk
 ID_SERIAL=3500000e01b83f520
 ID_SERIAL_SHORT=500000e01b83f520
 ID_WWN=0x500000e01b83f520
 ID_SCSI_SERIAL=B3G1P8500RWT

Unfortunately we can't overload ID_SERIAL for two reasons

 1. ID_SERIAL (and ID_SERIAL_SHORT) exported by scsi_id isn't really
    the unit serial number (as defined by SCSI) - it is sometimes the
    WWN (since it is more unique than the Unit Serial Number) and
    complex rules (to make the serial unique) govern what value to
    use.

 2. It would break existing setups if the value of ID_SERIAL changed

Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-11-23 21:38:21 +01:00
Martin Pitt
5d490002b3 README.keymap.txt: small clarification 2009-11-20 18:22:53 -06:00
Kay Sievers
160b069c25 ata_id: skip ATA commands if we find an optical drive
Some drives are reported to erase CD-RW media with the ATA
commands we send.

Thanks to Christoph Stritt <phoenix@jobob.com> for his debugging.

Original bug is here:
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=556635
2009-11-20 03:03:27 +01:00
Kay Sievers
ecf61aa7fd rules: remove support for IDE (hd*) devices
The kernel IDE drivers get deprecated now:
  http://article.gmane.org/gmane.linux.ide/43151

Almost everybody has switched over to libata devices long ago.
Recent services do not work with the now deprecated IDE drivers
at all and require libata drivers and SCSI infrastructure.

Systems who care about the old stuff need to add the rules to the
compat rules.
2009-11-19 16:25:18 +01:00
Kay Sievers
f49a6b223e udev-test.pl: catch-up with recent changes 2009-11-16 23:48:58 +01:00
Kay Sievers
86f77493bd test-udev: remove "ignore_device" code 2009-11-16 23:40:27 +01:00
Kay Sievers
6d87ee2e00 print warning for BUS=, SYSFS{}=, ID= 2009-11-16 23:39:33 +01:00
Kay Sievers
cdae488a3f remove "ignore_device"
There is no way to ignore an event these days. Libudev events can
not be suppressed. It only prevents RUN keys from being executed,
which results in an inconsistent behavior in current setups.
2009-11-16 15:22:17 +01:00
Harald Hoyer
5052297b6a modem-modeswitch: add a device 2009-11-12 22:17:47 +01:00
Kay Sievers
d93fb59c50 rules: set mode of floppy device nodes to 0660 2009-11-12 21:56:27 +01:00
David Zeuthen
7505831b7e cdrom_id: Still check profiles even if there is no media
Even when there is no medium in the drive, we should still check the
profiles supported by the drive. Otherwise we fail to detect things
like Blu-ray drives. See

 https://bugzilla.gnome.org/show_bug.cgi?id=600273

for more information.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-11-10 12:32:38 -05:00
Kay Sievers
86f380dd29 release 147 2009-11-10 15:35:11 +01:00
Kay Sievers
7fa9bb9dbf Revert "gudev: fix out-of-tree build"
This reverts commit b15b089138.

This breaks "make distcheck". The header is distributed in the tarball,
and does not live in builddir.
2009-11-10 15:09:27 +01:00
Kay Sievers
04da95b1c4 update NEWS 2009-11-10 06:49:48 +01:00
Marco d'Itri
b15b089138 gudev: fix out-of-tree build 2009-11-10 06:49:48 +01:00
Kay Sievers
882bcd951c gudev: fix pkg-config call to work with "make distcheck" 2009-11-10 06:49:48 +01:00
Lennart Poettering
088fbefafd Revert "sound: include ALSA sound card id in /dev/snd/by-id/ links"
This reverts commit 68bffc607f.

After discussing this with Kay we decided to drop this again as by-id
links only make sense for devices that have a unique serial id. If they
don't any attempts to make them unique have the side effect of
nourishing assumptions by users that cannot be met, as the by-id device
link of a device could differ depending on the history of simultaneously
plugged in device.

So, to make sure that all device nodes follow the same rules for by-id/
symlinks, drop this patch again.
2009-11-09 23:19:04 +01:00
David Zeuthen
58e31304a4 gudev: Remove LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE from priv header
Since libudev is no longer unstable either.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-11-09 16:31:26 -05:00
Lennart Poettering
68bffc607f sound: include ALSA sound card id in /dev/snd/by-id/ links
If two USB sound cards that have the same serial number are plugged in
make sure the by-id/ device node symlink is unique at least during
runtime, by including the ALSA card id in the symlink name.

This is a followup to ed1b2d9fc7.
2009-11-09 22:11:29 +01:00
David Zeuthen
4e3664f22b gudev: Fix up GUdevDeviceNumber
Actually dev_t is an unsigned quad type (e.g. 64-bit even on 32-bit
x86) so defining it to be an integer is wrong and not future
proof. Thus, redefine it to actually be a dev_t (as originally wanted)
and instead add a work-around for GNOME bug #584517, see

https://bugzilla.gnome.org/show_bug.cgi?id=584517

for details. This way, GObject Introspection will still work.

This change is technically an API/ABI break but

 - all released GUdev versions requires the user to understand that
   the API/ABI is unstable by requiring the G_UDEV_API_IS_SUBJECT_TO_CHANGE
   symbols to be defined

 - functions using GUdevDeviceNumber are rarely used

so we don't bump the so number.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-11-08 12:31:35 -05:00
Martin Pitt
368d325ba8 modem-modeswitch: fix ZTE MF6xx rule
https://launchpad.net/bugs/281335
2009-11-06 00:12:21 +01:00