1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 20:25:38 +03:00
Commit Graph

3414 Commits

Author SHA1 Message Date
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
Lennart Poettering
ed1b2d9fc7 sound: include ALSA sound card id in ID_ID property
If two USB sound cards that have the same serial number are plugged in
make sure ID_ID is unique at least during runtime, by including the ALSA
card id in the ID_ID string.

Fixes issues like this one:
http://pulseaudio.org/ticket/661
2009-11-05 04:32:41 +01:00
Kay Sievers
081be002ea udevd: create /dev/.udev/rules.d/ before watching it wit inotify
This should also address:

On Tue, Nov 3, 2009 at 16:21, Marco d'Itri <md@linux.it> wrote:
> udev_rules_new() in udev/udev-rules.c unconditionally creates the
> directory.
> This is a problem because the function is called also by e.g. udevadm
> test, and creating /dev/.udev/ when it does not exist is an unacceptable
> side effect which will break everything else that checks for its
> existence to know if udev is running.
2009-11-04 17:06:52 +01:00
David Zeuthen
66094a4a7f ata_id: export more advanced ATA features 2009-11-04 16:37:06 +01:00
Martin Pitt
495d408b36 fix major fd leak in link handling
link_find_prioritized(): Properly close directory handles to fix a major fd
leak which caused hotplugging to fail entirely in many cases due to having too
many open files.

https://launchpad.net/bugs/463347
2009-11-03 00:03:43 +01:00
Martin Pitt
f0f7a43f4e extras/keymap/README.keymap.txt: Fix bug report link
udev-extras is gone, ask people to file bugs against udev.
2009-11-02 16:22:14 +01:00
Kay Sievers
bc3ec7bd45 unblock signals we might want to handle
On Thu, Oct 29, 2009 at 19:15, Christian P. Schmidt <schmidt@digadd.de> wrote:
> After the getty replaces itself with login the pam module pam_mount
> calls mount. This in turn determines that the partition to be mounted is
> LUKS encrypted, and calls cryptsetup. Cryptsetup receives the password,
> unlocks the partition, and calls udevadm settle in order to avoid some
> problems in interaction with LVM.
>
> udevadm settle never returns.
>
> The problem here is that SIGUSR1 and SIGALRM are both blocked in oldmask
> already, and never reach udevadm. No care is ever taken to ensure those
> signals are not blocked.
2009-10-31 11:53:41 +01:00
Alan Jenkins
88fbff03df udevd: queue-export - remove retry loop
These retry loops are required where create_path() could race with
delete_path().  But only the main udevd process writes to the queue,
so no races will happen here.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2009-10-30 12:39:04 +01:00
Kay Sievers
26347a4c55 use CLOEXEC flags instead of fcntl() 2009-10-30 12:39:04 +01:00
Martin Pitt
82c6558e01 Makefile.am: fix build with mawk
Don't use the [[:space:]] syntax in awk calls' regex, since that's GNU awk
specific. Thanks to Alan Jenkins for finding this.
2009-10-30 09:38:21 +01:00
David Zeuthen
5448cc56f6 gudev: remove G_UDEV_API_IS_SUBJECT_TO_CHANGE since API is now stable
Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-10-29 18:46:50 +01:00
Martin Pitt
1150c6e641 keymap: add HP 2230s
Taken from hal-info commit e6389d9fa.

http://bugs.freedesktop.org/show_bug.cgi?id=21527
2009-10-29 13:23:14 +01:00
Martin Pitt
5f4f842a82 keymap: add HP Pavillion dv6315ea
Taken from hal-info commit eba65779.
2009-10-29 13:21:07 +01:00
Kay Sievers
bfbf65aad0 remove "last_rule" option
Its use breaks too many things which expect to be run from independent
later rules, and is an idication that something needs to be fixed
properly instead.
2009-10-28 11:45:32 +01:00
Kay Sievers
6834a44299 break loops if util_create_path() returns error
Dangling symlinks in path components return -ENOENT. Do not retry
to create the file in a loop in such case.
2009-10-28 11:37:20 +01:00
Matthias Schwarzott
d316d27c17 rules: Gentoo update 2009-10-21 04:02:04 +09:00
Peter Rajnoha
1230d021bd libudev: allow to store negative values in the udev database 2009-10-20 06:55:42 +09:00
Martin Pitt
0ddfae5fff keymap: Add Logitech Wave cordless
https://launchpad.net/bugs/215035
2009-10-15 00:13:17 +02:00
Martin Pitt
e13eecbdf3 keymap: make USB keyboards really work
Calling usb_id and GOTO in one rule did not make sense at all.
2009-10-11 20:02:11 +02:00
Martin Pitt
e8f04b65f3 keymap: fix usb_id invocation
For deciding whether to call usb_id, test the property which we are actually
querying further down.

https://launchpad.net/215035
2009-10-11 18:18:43 +02:00
Martin Pitt
df3e07d6a8 keymap: add missing map file
This fixes commit a05cd7ea3e
2009-10-08 21:45:09 +02:00
Martin Pitt
5fa1d79421 keymap: Add Logitech Wave USB
This introduces a new rules section for USB keyboards, too.

https://launchpad.net/bugs/215035
2009-10-08 21:43:38 +02:00
Kay Sievers
19711e1933 udevd: serialize events for with the same major/minor
On Wed, Oct 7, 2009 at 21:46, Alan Jenkins <sourcejedi.lkml@googlemail.com> wrote:
> Udev would have avoided the race prior to
>
> 82c785e "udevd: remove check for dev_t, DEVPATH_OLD takes care of that"
>
> (the "check" removed here used to serialize events based on the device
> major:minor number).

On Wed, Oct 7, 2009 at 22:31, Michael Guntsche <mike@it-loops.com> wrote:
> add      /module/8250_pnp (module)
> remove /devices/platform/serial8250/tty/ttyS0 (tty)
> add      /devices/pnp0/00:05/tty/ttyS0 (tty)
2009-10-08 00:06:23 +02:00
Maxim Levitsky
a05cd7ea3e keymap for Acer Aspire 5720 2009-10-07 14:47:20 +02:00
Martin Pitt
ca2bf8007d 50-udev-default.rules: fix printer MODE
Prefix with a 0 to be consistent with other rules.

https://launchpad.net/bugs/438114
2009-10-05 11:38:44 +02:00
Martin Pitt
8d12968558 make raw USB printer devices world-readable again
Commit f61e72d8 made raw USB printers accessible for the lp group. However,
chmoding them to 0660 is a bit over-zealous, since by default raw USB devices
are world-readable. Not being so breaks lsusb unnecessarily. Now set
permissions to 0664.
2009-09-30 11:10:24 +02:00
William Jon McCann
bded570432 udev-acl: catch up with ConsoleKit 0.4.1 2009-09-27 06:37:26 -07:00
Marco d'Itri
61c666c6b0 gudev: gir-scanner workaround for out of tree builds
Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=562885
2009-09-24 10:55:55 -07:00
Andrew Church
4daa146bf7 fix wrong parameter size on ioctl FIONREAD
On Wed, Sep 23, 2009 at 23:11, Matthias Schwarzott <zzam@gentoo.org> wrote:
> It is about ioctl failures on amd64:
>   http://bugs.gentoo.org/show_bug.cgi?id=286041
>
> A bad parameter type to an ioctl() call causes udev-146 to generate "error
> getting buffer for inotify" messages in syslog.  The offending code is
> roughly:
>
>    ssize_t nbytes, pos;
>    // ...
>    ioctl(fd, FIONREAD, &nbytes);
>
> where ssize_t is 64 bits on amd64, but the kernel code for FIONREAD (at least
> through gentoo-sources-2.6.31) uses type int:
>
>    p = (void __user *) arg;
>    switch (cmd) {
>    case FIONREAD:
>        // ...
>        ret = put_user(send_len, (int __user *) p);
>
> so the upper 32 bits of "nbytes" are left uninitialized, and the subsequent
> malloc(nbytes) fails unless those 32 bits happen to be zero (or the system has
> a LOT of memory).
2009-09-24 10:53:10 -07:00
Scott James Remnant
49c3a01d44 util_run_program: *really* restore signal mask before executing event RUN commands
The previous patch was almost, but not quite, correct.  Rather than
restoring the signal mask it actually tried to make an even more
restrictive signal mask (had SIGALRM been blocked when udevd started,
anyway).

Fix it harder.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2009-09-22 14:39:23 -07:00
Martin Pitt
6e1a152d1c fix previous commit for CD detection
Do not run blkid twice. *brown paperbag*
2009-09-20 19:21:04 +02:00
Martin Pitt
ce096702ec fix single-session CD detection
ID_CDROM_MEDIA_SESSION_LAST_OFFSET is not set for CDs with only a single
session (i. e. for the vast majority of CDs out there). The previous rules ran
blkid with invalid arguments for these, causing CD detection to fail in
DK-disks and gvfs.

Now check whether we actually have ID_CDROM_MEDIA_SESSION_LAST_OFFSET, and if
not, call blkid without -O for specifying the offset.

Many thanks to Maxim Levitsky for tracking this down!

https://launchpad.net/bugs/431055
2009-09-20 19:07:51 +02:00
Matthias Schwarzott
4dd9057209 rules: Gentoo update 2009-09-19 19:19:15 +02:00
Harald Hoyer
6068553195 rename interfaces to <iface>_rename if rename fails 2009-09-18 13:14:30 +02:00
Harald Hoyer
676cea155a scsi_id: prevent buffer overflow in check_fill_0x83_prespc3()
see https://bugzilla.redhat.com/show_bug.cgi?id=516920
2009-09-17 00:06:03 +02:00
Kay Sievers
91554cf9a1 update TODO, NEWS 2009-09-16 20:27:30 +02:00
Kay Sievers
4b4409b1ee rules: drop almost all NAME= keys
The drivers in kernel 2.6.31 supply the names for custom node names if
needed.
2009-09-16 20:08:50 +02:00
Kay Sievers
8a483b0cb2 rules: remove remaining NAME="%k" 2009-09-16 19:41:09 +02:00
Kay Sievers
bcb8b2315b fix SYMLINK{} option parsing 2009-09-16 18:14:03 +02:00
Kay Sievers
24355313dc scsi_id: delete copy of bsg.h
It's provided by the kernel since 2.6.23.
2009-09-14 14:33:26 +02:00
Kay Sievers
ca508dd94d udevadm: control - remove compat code 2009-09-14 14:29:05 +02:00
Marco d'Itri
2079b52e17 udevadmi: control = exit with rc=2 if there is some system error 2009-09-14 14:05:31 +02:00
Marco d'Itri
bbfeee28fc udevadm: print all messages to stderr with priority higher or equal than LOG_ERR
It is needed to prevent errors in udev from going unnoticed (e.g.
when udevd is not running).
2009-09-14 13:56:38 +02:00
Kay Sievers
b6a2637524 put util_create_path() and file creastion in a retry loop
On 8/29/09, Florian Zumbiehl <florz@florz.de> wrote:
> Could it happen that > util_create_path() and util_delete_path()
> do run in parallel for > the same directory? After all, util_create_path()
> does handle > the case where creation of the directory happens in parallel
> to it running, so it doesn't seem all that unlikely to me ...
2009-09-10 02:08:05 +02:00
Kay Sievers
676d294c23 reorder create_path() and node/link creation to be called in a direct sequence 2009-09-10 01:35:48 +02:00