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

3138 Commits

Author SHA1 Message Date
Kay Sievers
03733b04c3 add m4/ subdir 2009-02-26 14:11:43 +01:00
Kay Sievers
46f194cbde add "nowatch" to disable a default installed watch with a later rule 2009-02-25 11:18:15 +01:00
Kay Sievers
3d3a0a709a use the event udev_device to disable the watch on "remove" 2009-02-24 15:11:17 +01:00
Kay Sievers
d5d04d4f9f remove static local variable 2009-02-24 12:58:48 +01:00
Kay Sievers
58e495438b version bump 2009-02-23 21:27:03 +01:00
Scott James Remnant
80be8c48c5 Look at more inotify events in the buffer than just the first. 2009-02-23 18:33:49 +00:00
Scott James Remnant
b8e96d67a2 lookup the old watch handle; reload only if has a path 2009-02-23 17:59:01 +00:00
Scott James Remnant
c08337da5c Output watch handle in udevadm info. 2009-02-23 17:48:18 +00:00
Scott James Remnant
9ce462721a Put a log message in a more sensible place. 2009-02-23 17:46:00 +00:00
Scott James Remnant
047f88bca3 Use the udevdb to speed up watch clearing.
Also return a udev_device when looking up by handle as well, so
everything works the same way.
2009-02-23 17:43:53 +00:00
Scott James Remnant
25bdd197ec Store watch handle in db. 2009-02-23 17:34:07 +00:00
Scott James Remnant
d7ce7539d3 Allow watch handle to be stored in the udevdb. 2009-02-23 17:31:26 +00:00
Scott James Remnant
03e0170db3 Cleanup a little.
Move some of the checks into udev_watch_begin() and udev_watch_clear()
so we don't have to repeat them all the time.
2009-02-23 17:21:24 +00:00
Scott James Remnant
521b3a9211 Clear existing inotify watch before processing.
Likewise when re-processing an event, we want to drop the existing
inotify watch first to avoid side-effects.
2009-02-23 17:19:05 +00:00
Scott James Remnant
5ae82640c5 Don't add inotify watch until RUN rules processed.
The programs we RUN can open device nodes, and thus we can end up
chasing our own tail.
2009-02-23 17:17:20 +00:00
Kay Sievers
e8c84c98b9 release 138 2009-02-19 00:27:24 +01:00
David Zeuthen
ad88f9409a *_id: add model/vendor enc strings
So ID_MODEL and ID_VENDOR are pretty useful keys. However since we fix
them up (removing leading/trailing whitespace, converts spaces to
underscores) for use in device naming etc. we also force these fixups on
the desktop shell. And this looks pretty ugly.

The attached patch introduces the ID_MODEL_ENC and ID_VENDOR_ENC keys
that contains the encoded version of the raw strings obtained. It's
pretty similar in spirit to ID_FS_LABEL and its cousin ID_FS_LABEL_ENC.

With this patch a desktop shell can fix up these strings as it sees fit.
Note that some fixup is still needed though, for example

# /lib/udev/ata_id --export /dev/sda |grep ID_MODEL
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

Note the trailing and leading whitespace. Anyway with the attached patch
the desktop shell should be able to display "INTEL SSDSA2MH080G1GC"
rather than "INTEL_SSDSA2MH080G1GC" to the user.
2009-02-17 21:45:43 +01:00
Kay Sievers
dc9aa5e941 rules: include loop block devices in persistent links 2009-02-16 22:22:57 +01:00
Kay Sievers
64746532e8 rules: add "watch" option to dm and md rules 2009-02-13 16:02:36 +01:00
Kay Sievers
4aca304e48 use global "reload_config" flag 2009-02-11 21:56:35 +01:00
Kay Sievers
88ec7bb754 rules: move OPTIONS to separate rule
A failing IMPORT+ match would prevent the OPTIONS+= action
from being applied.
2009-02-11 21:54:43 +01:00
Scott James Remnant
f24036d63b rules: update persistent storage rules to use inotify watches 2009-02-11 17:44:03 +00:00
Scott James Remnant
bd284db142 udevd: optionally watch device nodes with inotify
This allows you to re-process the rules if the content of the device
has been changed, most useful for block subsystem to cause vol_id to
be run again.
2009-02-11 17:38:56 +00:00
Kay Sievers
10b2d011e7 fix NAME= and OPTION+="string_escape=..." logic
Scott discovered this silly bug.
2009-02-08 16:02:15 +01:00
Kay Sievers
9dc4a84a25 autogen.sh: add more warnings 2009-02-05 19:01:27 +01:00
Kay Sievers
b822542608 rules: fix md "change"/"remove" handling
On Thu, Feb 5, 2009 at 08:43, Harald Hoyer <harald@redhat.com> wrote:
> Radek Vykydal <rvykydal@redhat.com> encountered a problem with md devices.
> If the raid is about to be removed a "change" and "remove" event is sent.
2009-02-05 14:03:17 +01:00
Kay Sievers
a402404fb2 test: add test for empty and non-existent ATTR 2009-02-05 12:40:15 +01:00
Kay Sievers
198882e9ae rules: dm - add escape for uuid links with whitespace 2009-01-30 13:18:59 +01:00
Kay Sievers
647f7c49e8 fix NAME="" logic
Reported-By: Soh Kam Yung <sohkamyung@gmail.com>
2009-01-30 03:53:09 +01:00
Matthias Schwarzott
57d057d28d rules: Gentoo update 2009-01-27 11:56:45 +01:00
Kay Sievers
705e1c7ffe version bump 2009-01-25 21:25:41 +01:00
Kay Sievers
722af2d0d3 man: fix grammar
Reported-by: Robert Peterson <rpeterso@redhat.com>
2009-01-25 21:21:43 +01:00
Miklos Vajna
04f2a4fb6e doc: writing udev rules - refer to 'udevadm info' instead of 'udevinfo'
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
2009-01-24 15:24:01 +01:00
Karel Zak
7e5861ff70 vol_id: add missing id->type to swap0
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-01-24 15:21:15 +01:00
Karel Zak
3e2084614b vol_id: fix ddf version string
The version string in DDF suberblock does not include the null terminator
and the snprintf() function writes at most "size" bytes *including* the
null byte.

old version:
	ID_FS_VERSION=02.00.0
new version:
	ID_FS_VERSION=02.00.00

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-01-24 15:20:37 +01:00
Kay Sievers
9ad0d7370c release 137 2009-01-23 03:05:05 +01:00
Kay Sievers
c2de781ef0 udevadm: settle - fix typo 2009-01-23 02:19:12 +01:00
Kay Sievers
e339233993 usb_id: handle ATAPI devices like SCSI devices
Some weird mass storage devices identify the disks as ATAPI/cdrom
devices, and all disks in such enclusure get the same ids which
overwrite each other, in such cases, get the typ of device from the
scsi device, which has more knowledge what kind of device it really
is.
2009-01-22 19:23:33 +01:00
Kay Sievers
5db88229d1 udevd: add back SA_RESTART
<Keybuk> poll, select, ppoll, pselect, epoll, etc. are *explicitly* NOT restarted in case of signal
<kay> ok
2009-01-21 18:55:59 +01:00
Kay Sievers
6469c77216 split up long line 2009-01-21 15:11:38 +01:00
Kay Sievers
4b0faa2aa0 Merge commit '9032f119f07ad3b5116b3d4858816d851d4127de' 2009-01-21 14:43:22 +01:00
Kay Sievers
2c7b88c4a5 Merge commit '5f03ed8a56d308af72db8a48ab66ed68667af2c6'
Conflicts:
	udev/udevd.c
2009-01-21 14:42:30 +01:00
Kay Sievers
c807ad918c increase netif renaming timeout from 30 to 90 seconds 2009-01-21 11:17:58 +01:00
Olaf Kirch
d1cc6562f3 reap children faster
udevd's event_queue_manager loop is pretty sensitive to the
delays of exiting child processes. I found that it helps boot
times if we try to reap children as quickly as possible.

This patch changes event_queue_manager to call sigchilds_waiting
if it finds a signal has been received.

Signed-off-by: Olaf Kirch <okir@suse.de>
2009-01-21 11:17:11 +01:00
Kay Sievers
e9a77fd828 open-code pollfd setup 2009-01-21 11:09:27 +01:00
Scott James Remnant
9032f119f0 Expose delayed name resolution
udevd had the ability to delay name resolution until the event, but this
was never exposed.  Add a --resolve-names=late option to do so.
2009-01-20 21:36:09 +00:00
Scott James Remnant
5f03ed8a56 Allow user and group lookup to be disabled.
In certain cut-down situations such as an installer or inside the
initramfs, we simply don't have any kind of name service.  While we
could use rules without OWNER or GROUP, it's better to have the same
rules as a full system and have udevd ignore those parts of the rules.

Adds a --resolve-names=never switch to udevd that has this effect.
2009-01-20 21:33:02 +00:00
Olaf Kirch
3210a72ba3 udevd: use ppoll instead of signal pipes
udevd uses a rather old-fashioned way of handling signals
while waiting for input through select (ie by using an unnamed
pipe, to which the signal handler writes one byte for every signal
received). This is rather awkward and may potentially even block
if we receive more signals than the kernel's pipe buffer.

This patch replaces all of that with ppoll, which was designed
for this purpose.

It also removes the SA_RESTART flag from all installed signal
handlers, because otherwise the ppoll call would just be restarted
after handling eg a SIGCHLD.

Signed-off-by: Olaf Kirch <okir@suse.de>
2009-01-20 12:49:20 +01:00
Alan Jenkins
a3ab20722d remove stray initializer
Picked up by "gcc -Wextra".

udevadm.c:83: warning: initialized field overwritten
udevadm.c:83: warning: (near initialization for ‘cmds[2].help’)

This is just a cleanup.  It doesn't change the code generated by gcc.
2009-01-16 21:33:33 +01:00
Alan Jenkins
e5e641518b man: typo fixes 2009-01-16 21:32:25 +01:00