1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-11-01 09:21:11 +03:00
Commit Graph

56 Commits

Author SHA1 Message Date
Kay Sievers
ca0ac81f36 write "event_timeout" to db 2008-04-21 20:22:56 +02:00
Kay Sievers
c70560feef logging: add trailing newline to all strings 2008-04-20 21:07:06 +02:00
Kay Sievers
4278ab015d selinux: fix missing includes 2008-04-17 23:31:09 +02:00
Harald Hoyer
6056d9b340 selinux: more context settings
Signed-off-by: Harald Hoyer <harald@redhat.com>
2008-04-17 19:07:24 +02:00
Kay Sievers
e7e194a088 udevadm: info - resolve devpath if symlink is given 2008-03-29 16:12:41 +01:00
Kay Sievers
a2f2270eef track "move" events to rename database and failed files 2007-08-26 05:22:35 +02:00
Kay Sievers
019d666907 udevinfo: export all information stored in database 2007-04-06 19:50:19 +02:00
Kay Sievers
be8594ab14 udevinfo: relax check for the correct device if looked up by name 2007-03-23 17:17:18 +01:00
Kay Sievers
eff4a67369 udevtest: add --force mode 2007-03-21 11:55:26 +01:00
Kay Sievers
24f0605c1f priority based symlink handling
Symlinks can have priorities now, the priority is assigned to the device
and specified with OPTIONS="link_priority=100". Devices with higher
priorities overwrite the symlinks of devices with lower priorities.
If the device, that currently owns the link goes away, the symlink
will be removed, and recreated, pointing to the next device with the
highest actual priority.

This should solve the issue, that inserting an USB-stick may overwrite the
/dev/disk/by-id/-link of another disk, and removes the entire link after the
USB-stick is disconnected. If no priorities are specified, the new link will
overwrite the current one, and if the device goes away, it will restore
the old link. It should be possible to assign lower priorities to removable
devices, if needed.

In multipath setups, we see several devices, which all connect to the same
volume, and therefore all try to create the same metadata-links. The
different path-devices are combined into one device-mapper device, which also
contains the same metadata. It should be possible, to assign multipath-table
device-mapper devices a higher priority, so path-devices that appear and
disappear, will not overwrite or delete the device-mapper device links.
2007-03-18 12:51:57 +01:00
Kay Sievers
31de3a2ba1 read list of devices from index, make index private to database 2007-03-17 10:08:25 +01:00
Kay Sievers
6eee03ef45 cleanup already existing db-entries and db-index on device update 2007-03-16 17:24:39 +01:00
Kay Sievers
2afb8cb37a pick actual valid device in udev_db_lookup_name 2007-03-16 16:02:22 +01:00
Kay Sievers
2dbb47f860 add link_priority to rule options, and store it in database 2007-03-16 15:16:08 +01:00
Kay Sievers
fc6da921ad store devpath with the usual leading slash 2007-03-16 03:09:02 +01:00
Kay Sievers
fbda4babec maintain index over device-names to devpath relation 2007-03-15 02:09:39 +01:00
Kay Sievers
9c6ad9fbba encode db-file names, instead of just replacing '/' 2007-03-14 21:41:33 +01:00
Sergey Vlasov
e0c0807ab3 unlink old database file before creating a new one
udev_db_add_device() can be called when the corressponding database
entry already exists - it should overwrite the old entry in this case.
However, if the old entry was a symlink, fopen(filename, "w") will not
overwrite it properly - it will keep the symlink and create a file
named after the symlink target.  Calling unlink(filename) before
trying to create the database file fixes the problem.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
2007-01-23 19:55:38 +01:00
Kay Sievers
27b77df44d update source file headers 2006-08-28 00:29:11 +02:00
Kay Sievers
5780be9eab rename major/minor variable to maj/min to avoid warning 2006-08-24 10:25:34 +02:00
Kay Sievers
34bb5d057c udev_db.c: include <sys/stat.h> 2006-08-24 00:13:07 +02:00
Kay Sievers
e3e7358137 db: don't create a db file for only a node name to store 2006-08-21 02:38:48 +02:00
Kay Sievers
95776dc6ec consistent key naming to match only the event device or include all parent devices
This scheme is more consistent and makes it obvious if a match happens
against the event device only, or the full chain of parent devices.

The old key names are now:
  BUS -> SUBSYSTEMS
  ID -> KERNELS
  SYSFS -> ATTRS
  DRIVER -> DRIVERS

Match keys for the event device:
  KERNEL
  SUBSYSTEM
  ATTR
  DRIVER (in a future release, for now the same as DRIVERS)

Match keys for all devices along the parent device chain:
  KERNELS
  SUBSYSTEMS
  ATTRS
  DRIVERS

ID, BUS, SYSFS are no longer mentioned in the man page but still work.
DRIVER must be converted to DRIVERS to match the new scheme. For now,
an error is logged, if DRIVER is used. In a future release, the DRIVER
key behaviour will change.
2006-08-19 16:06:25 +02:00
Kay Sievers
554dde8e9a db: store devpath - node relationship for all devices
If we don't have any interesting values to store, we just use
a symlink (doesn't occupy a whole page on tmpfs like a file)
to store the name of the node belonging to a devpath. This will
allow udevinfo to resolve all names, even when we don't have a
full database entry.
2006-08-18 02:27:16 +02:00
Kay Sievers
1aa1e24848 replace libsysfs
We never used any of the libsysfs convenience features. Here we replace
it completely with 300 lines of code, which are much simpler and a bit
faster cause udev(d) does not open any syfs file for a simple event which
does not need any parent device information.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-01-09 21:18:00 +01:00
Kay Sievers
caa4fd85ae don't log error if database does not exist
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-12-20 11:23:08 +01:00
Kay Sievers
30473427e8 merge two consecutive static strlcat's
Thanks for Marco, who noticed it.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-11-24 20:06:22 +01:00
Kay Sievers
fc55cf68ca remove "udev_db" option from config file
All udev state is kept in /$udev_root/.udev/ now. No option to
configure that anymore, it will always be there.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-11-16 04:14:15 +01:00
Marco d'Itri
df4e89bfa6 move some logging from dbg() to info() 2005-11-07 18:52:03 +01:00
Marco d'Itri
ff3e4bed21 add strerror() to error logs 2005-11-07 18:44:18 +01:00
Kay Sievers
7104c558da don't store devpath in udevdb, we don't need it
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-27 23:27:43 +02:00
Kay Sievers
314edf3ca4 change parameter order of udev_db_search_name()
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-27 15:46:58 +02:00
Kay Sievers
db481105c2 prepare for new HAL udevdb dump
HAL soon wants to read the whole content of the udevdatabase while
starting up. This makes the whole udev structure available to the
udevinfo "dump".

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-27 02:59:20 +02:00
Kay Sievers
3ad7a5b1a5 fix lookup for name in the udevdb, it should return the devpath
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-26 22:43:49 +02:00
Kay Sievers
40caaeec51 cleanup some debug output and move to info level + unify select() loops
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-15 11:57:04 +02:00
Kay Sievers
853ccc433c fix more compiler warnings ...
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-13 00:18:44 +02:00
Kay Sievers
13d11705bf switch some strlcpy's to memcpy
strlcpy counts the sourec string lengt and is therefore not suitable
to copy a defined length of characters from one string to another.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-08 02:21:55 +02:00
Kay Sievers
e8d569b414 move code to its own files
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-07-22 12:35:58 -04:00
Kay Sievers
25103c4849 create udevdb files only if somehting interesting happened
Device nodes created with the default rule, without any symlink or option
are no longer saved to the udevdb. This saves us ~3 MB RAM for pretty much
useless files on tmpfs.
Note: HAL needs a fix to handle this correctly. It's already available on
the list.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-07-05 22:40:42 +02:00
Kay Sievers
b8476286d6 store the imported device information in the udevdb
Any program can query with udevinfo for persistent device
attributes evaluated on device discovery now.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-26 18:55:24 +02:00
kay.sievers@vrfy.org
8a4c0c32f4 [PATCH] fix klibc's broken strlcpy/strlcat
udevinfo segfaults cause klibc's strlcpy writes behind the specified
size of the destination string. strlcat truncates the destination
string which is also not what you expect from a concatenation function.
2005-04-26 23:54:59 -07:00
kay.sievers@vrfy.org
6b493a20e1 [PATCH] support log-priority levels in udev.conf 2005-04-26 23:54:59 -07:00
kay.sievers@vrfy.org
63f61c5cf6 [PATCH] replace strncpy()/strncat() by strlcpy()/strlcat() 2005-04-26 23:51:00 -07:00
kay.sievers@vrfy.org
845d4751ac [PATCH] udev_volume_id: version 39 2005-04-26 23:51:00 -07:00
kay.sievers@vrfy.org
599e17a3e6 [PATCH] udevinfo -d: speed-up device dump 2005-04-26 23:48:48 -07:00
kay.sievers@vrfy.org
e48fc108d9 [PATCH] allow unlimitied count of symlinks 2005-04-26 23:48:48 -07:00
kay.sievers@vrfy.org
237415b141 [PATCH] unmap db-file after use 2005-04-26 23:39:49 -07:00
kay.sievers@vrfy.org
9fe1a96d88 [PATCH] udevinfo: print devpath -> node relationship for all devices 2005-04-26 23:39:48 -07:00
kay.sievers@vrfy.org
f8a178a35b [PATCH] trivial rename of some variables 2005-04-26 23:36:14 -07:00
kay.sievers@vrfy.org
8f2f6e426f [PATCH] cleanup db functions 2005-04-26 23:36:13 -07:00