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

106 Commits

Author SHA1 Message Date
Marco d'Itri
9b6c6b5612 log an error when a message from the wrong version of udevadm is ignored 2010-07-19 10:56:37 +02:00
Kay Sievers
727b12d650 libudev: fix fd leak in udev_enumerate_scan_devices() when tags are searched
Thanks to Lennart for finding this.
2010-06-05 10:30:36 +02:00
Kay Sievers
a7d29d1509 libudev: doc - fix typo 2010-05-31 11:18:52 +02:00
Kay Sievers
c830e98d6a udevd: read debug settings from kernel commandline 2010-05-28 12:07:27 +02:00
Kay Sievers
87d55ff672 childs -> children 2010-05-27 17:27:56 +02:00
Kay Sievers
88cbfb09ee while (1) -> for (;;) 2010-05-27 15:11:00 +02:00
Kay Sievers
e0d9c042f8 libudev: fix udev_queue_get_seqnum_sequence_is_finished() with empty queue file
We an empty or garbage-collected queue file, we might not have a record
for the first sequence we wait for, and therefore must not wait for it.
2010-05-25 12:17:43 +02:00
Kay Sievers
cb9a0eeeab udevd: create standard symlinks and handle /lib/udev/devices 2010-05-20 09:04:26 +02:00
Kay Sievers
0c5c48040a libudev: add O_CLOEXEC 2010-05-14 14:52:18 +02:00
Kay Sievers
e85f5ec15f reset process priority before executing RUN+=
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581235
2010-05-12 08:46:56 +02:00
Kay Sievers
f712894dd4 libudev: add documentation for recently added functions 2010-05-07 23:04:42 +02:00
Kay Sievers
2793f4e34b export udev_device_get_tags_list_entry() 2010-04-23 16:05:38 +02:00
Kay Sievers
2a34f9c31e export tag functions 2010-04-23 10:46:00 +02:00
Kay Sievers
65f099c721 libudev: accept NULL in udev_device_get_tags_list_entry() 2010-04-23 09:22:42 +02:00
Kay Sievers
c1dbe11dc3 delete old tags when configuration changes 2010-04-23 09:01:56 +02:00
Kay Sievers
bfd88b1d7b fix logic on-demand loading logic for db and uevent 2010-04-22 18:50:43 +02:00
Kay Sievers
28460195c2 add TAG= to improve event filtering and device enumeration 2010-04-22 18:12:36 +02:00
Kay Sievers
60067cc75a more readlink buffer size handling 2010-04-21 14:44:33 +02:00
Kay Sievers
a89d342dfb remove "ignore_remove" option 2010-04-13 12:45:38 +02:00
Kay Sievers
1f084fe581 remove "all_partitions" option
We can not predict the major/minor of non-existing devices:
  $ grep . /sys/class/block/sd*/dev
  /sys/class/block/sda1/dev:259:524288
  /sys/class/block/sda2/dev:259:262144
  /sys/class/block/sda3/dev:259:786432
  /sys/class/block/sda4/dev:259:131072
  /sys/class/block/sda/dev:259:0
  /sys/class/block/sdb/dev:259:655360
  /sys/class/block/sdc/dev:259:393216

If this functionality is still needed for some broken hardware, it needs to be
solved with a tool not part of the udev package. Because such option is unreliable
and unsafe to use.
2010-04-13 08:52:48 +02:00
Kay Sievers
dbba7e4029 libudev: update documentation 2010-03-25 16:45:48 +01:00
Kay Sievers
23325a66cc add LGPL COPYING to libudev and GUdev 2010-03-18 09:57:44 +01:00
Kay Sievers
fc8d61c53d libudev: add udev_device_new_from_environment() 2010-03-17 17:42:35 +01:00
Kay Sievers
9d1a67e956 libudev: docs - .gitignore backup files 2010-03-11 13:01:48 +01:00
Kay Sievers
fbb31cd6e1 libbudev-private: rename udev_list_entry_get_flag() 2010-03-10 14:52:42 +01:00
David Zeuthen
e32d5237ea Increase UTIL_LINE_SIZE from 2048 to 16384
Recent udisks versions, for LVM2 integration, ships with probers that
produce very long lines such as

UDISKS_LVM2_PV_VG_PV_LIST=
  uuid=98lyZl-Ya7U-p26Z-Ia7b-xf8u-xZqP-jc4njb;size=2000397795328;allocated_size=2000397795328
  uuid=iFs0cM-sxCF-ceQK-hZl1-kbwo-ZTjq-gSewQR;size=2000397795328;allocated_size=2000397795328
  [...]

e.g. roughly 100 bytes per LVM2 physical volume for each LVM2
PV encountered.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-03-02 17:11:10 -05:00
David Zeuthen
3a19299202 Use UTIL_LINE_SIZE, not UTIL_PATH_SIZE to truncate properties
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-03-02 17:07:14 -05:00
David Zeuthen
ecd42de2c5 Decrease buffer size when advancing past NUL byte
Otherwise we'll overflow the buffer if space is tight. Also add a comment explaining this.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-03-02 17:06:33 -05:00
Scott James Remnant
a571c23e95 libudev: export udev_monitor_set_receive_buffer_size()
This function is useful for anything that's likely to be running
alongside udevd during cold-plugging, and is using libudev to
receive the events.

It makes little sense for it to be private, or to require other
software to relearn how to adjust the buffer size.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2010-02-17 15:26:00 +00:00
Kay Sievers
7c34949019 libudev: device - create db file atomically
We need to prevent that libudev parses half-written database files.

Also for "change" events, we need to make sure, that database files
always exist to be read by libudev, and that they are not first deleted
before they are re-created.
2010-01-13 13:26:56 +01:00
Kay Sievers
43cb1551d5 work around gtk-doc which breaks distcheck 2010-01-07 17:11:06 +01:00
Kay Sievers
1a259f1ac8 libudev: doc - add symbols to sections.txt 2010-01-07 16:42:23 +01:00
Thomas de Grenier de Latour
9bdcffd738 libudev: enumerate - fix move_later logic
The move_later_prefix variable was reset to zero on each
loop iteration, and thus the move_later entry (if any) was
not added right after changing to another syspath prefix,
but rather after exiting the enumeration loop.
2009-12-30 16:21:59 +01:00
Kay Sievers
f46d2e54a8 remove UDEV_RUN environment variable
It handles only RUN but not IMPORT and PROGRAM. There is no sane way
to suppress program execution. Most important programs run with IMPORT
these days. Also events can no longer suppressed with the libudev
netlink messages, so UDEV_RUN does nothing useful and is just
inconsistent.
2009-12-25 15:23:45 +01:00
Kay Sievers
1d67ec16c4 fix typo in log message priority handling 2009-12-25 14:47:59 +01:00
Kay Sievers
58b533f417 remove remaining support for CONFIG_SYSFS_DEPRECATED 2009-12-24 22:10:40 +01:00
Martin Pitt
b73bf332c2 Speed up udev_enumerate_scan_*
Check property match earlier, to avoid lots of readlink() and stat()
calls when we check property matches.
2009-12-21 15:41:25 +01:00
Kay Sievers
3c1898863f remove remaining support for CONFIG_SYSFS_DEPRECATED 2009-12-15 16:14:14 +01:00
Daniel Elstner
3fac12b9a0 libudev: wrap in extern "C" block for C++
When libudev.h is included from C++ code, wrap the declarations in an
extern "C" { ... } block.  This tells the C++ compiler that symbols
are exported with C linkage and no name-mangling.
2009-12-15 12:49:25 +01:00
Kay Sievers
99eb7c451c util_unlink_secure(): chmod() before chown() 2009-12-08 18:44:45 +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
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
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
Peter Rajnoha
1230d021bd libudev: allow to store negative values in the udev database 2009-10-20 06:55:42 +09: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
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
Kay Sievers
6c29f2b942 simplify "symlink name stack"
With well defined and kernel-supplied node names, we no longer need
to support a possible stack of conflicting symlinks and node names.
Only symlinks with identical names can be claimed by multiple devices.

This shrinks the former /dev/.udev/names/ significantly.

Also the /dev/{block,char}/MAJ:MIN" links are excluded from the name
stack - they are unique and can not conflict.
2009-09-09 18:49:07 +02:00