chiark / gitweb /
elogind.git
15 years agorules: let empty strings added to buffer always return offset 0
Kay Sievers [Fri, 24 Oct 2008 06:07:37 +0000 (08:07 +0200)]
rules: let empty strings added to buffer always return offset 0

15 years agoskip SYMLINK rules for devices without a device node
Kay Sievers [Thu, 23 Oct 2008 19:42:23 +0000 (21:42 +0200)]
skip SYMLINK rules for devices without a device node

15 years agoudevd: fix WAIT_FOR_SYSFS execution order
Alan Jenkins [Thu, 23 Oct 2008 18:37:30 +0000 (19:37 +0100)]
udevd: fix WAIT_FOR_SYSFS execution order

The wait should be ordered after matching KERNEL, ENV, etc.
but before ATTR.

Without this, WAIT_FOR_SYSFS rules will be applied unconditionally
to all events.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
15 years agorule_generator: fix netif NAME= value extraction regex
Kay Sievers [Thu, 23 Oct 2008 13:44:34 +0000 (15:44 +0200)]
rule_generator: fix netif NAME= value extraction regex

  $ sed -n -r \
    -e 's/^#.*//' \
    -e 's/[[:space:],]NAME="(eth[0-9]*)"[[:space:]]*(,.*|\\|)$/\1/p' \
    /dev/null /etc/udev/rules.d/70-persistent-net.rules
  SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:16:41:e2:8d:c7", ATTR{type}=="1", KERNEL=="eth*",eth4

  $ sed -n -r \
    -e 's/^#.*//' \
    -e 's/.*[[:space:],]NAME="(eth[0-9]*)".*/\1/p' \
    /dev/null /etc/udev/rules.d/70-persistent-net.rules
  eth4

15 years agoudevd: fix memory leak
Alan Jenkins [Thu, 23 Oct 2008 09:27:36 +0000 (10:27 +0100)]
udevd: fix memory leak

Re: b99028c96307e729303be8f6750418979a7488b9 shrink struct udev_event

TEST 136: test multi matches 2
device '/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0' expecting node 'right'
==15011==
==15011== 7 bytes in 1 blocks are definitely lost in loss record 1 of 1
==15011==    at 0x47F9AB8: malloc (vg_replace_malloc.c:207)
==15011==    by 0x489CB5F: strdup (in /lib32/libc-2.7.so)
==15011==    by 0x8050F40: udev_rules_apply_to_event (udev-rules.c:1973)
==15011==    by 0x804A658: udev_event_execute_rules (udev-event.c:549)
==15011==    by 0x805A636: main (test-udev.c:100)
add:         ok
==15012==
==15012== 7 bytes in 1 blocks are definitely lost in loss record 1 of 1
==15012==    at 0x47F1AB8: malloc (vg_replace_malloc.c:207)
==15012==    by 0x4898B5F: strdup (in /lib32/libc-2.7.so)
==15012==    by 0x8050F40: udev_rules_apply_to_event (udev-rules.c:1973)
==15012==    by 0x804A9DF: udev_event_execute_rules (udev-event.c:658)
==15012==    by 0x805A636: main (test-udev.c:100)
remove:      ok

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
15 years agoshrink struct udev_event
Kay Sievers [Thu, 23 Oct 2008 00:57:08 +0000 (02:57 +0200)]
shrink struct udev_event

15 years agoshrink struct udev_event
Kay Sievers [Thu, 23 Oct 2008 00:34:22 +0000 (02:34 +0200)]
shrink struct udev_event

15 years agodo not create temporary node ($tempnode) if node already exists
Kay Sievers [Wed, 22 Oct 2008 23:13:52 +0000 (01:13 +0200)]
do not create temporary node ($tempnode) if node already exists

15 years agoreplace in-memory rules array with match/action token list
Kay Sievers [Wed, 22 Oct 2008 22:13:59 +0000 (00:13 +0200)]
replace in-memory rules array with match/action token list

The in-memory rule array of a common desktop distro install took:
  1151088 bytes
with the token list:
  109232 bytes tokens (6827 * 16 bytes), 71302 bytes buffer

15 years agohandle numerical owner/group string in lookup_user/group()
Kay Sievers [Wed, 22 Oct 2008 21:59:53 +0000 (23:59 +0200)]
handle numerical owner/group string in lookup_user/group()

15 years agouse re-entrant variants of getpwnam and getgrnam
Alan Jenkins [Wed, 22 Oct 2008 14:13:08 +0000 (15:13 +0100)]
use re-entrant variants of getpwnam and getgrnam

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
15 years agoadd util_resolve_subsys_kernel()
Kay Sievers [Wed, 22 Oct 2008 16:03:38 +0000 (18:03 +0200)]
add util_resolve_subsys_kernel()

15 years agovolume_id: swap - larger PAGE_SIZE support
Matthias Koenig [Wed, 22 Oct 2008 09:45:27 +0000 (11:45 +0200)]
volume_id: swap - larger PAGE_SIZE support

15 years agoreplace strncpy() with strlcpy()
Alan Jenkins [Tue, 21 Oct 2008 21:42:15 +0000 (22:42 +0100)]
replace strncpy() with strlcpy()

The problem was strncpy() doesn't stop after writing the terminating
NUL; by definition it goes on to zero the entire buffer.

I spy another use of strncpy in udev_device_add_property_from_string(),
which is responsible for another ~1% user cpu time...

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
15 years agolibudev: device - 128 -> ENVP_SIZE
Kay Sievers [Tue, 21 Oct 2008 11:58:19 +0000 (13:58 +0200)]
libudev: device - 128 -> ENVP_SIZE

15 years agolibudev: allocate udev_device->envp[] dynamically
Alan Jenkins [Tue, 21 Oct 2008 10:11:41 +0000 (11:11 +0100)]
libudev: allocate udev_device->envp[] dynamically

Measured 2% _user_ cpu time reduction on EeePC coldplug.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
15 years agolibudev: util - optimize path_encode()
Alan Jenkins [Tue, 21 Oct 2008 10:12:57 +0000 (11:12 +0100)]
libudev: util - optimize path_encode()

Since we already know the length, use memcpy() instead.
Measured 2% _user_ cpu time reduction on EeePC coldplug.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
15 years agouse more appropriate alternatives to malloc()
Alan Jenkins [Tue, 21 Oct 2008 10:10:32 +0000 (11:10 +0100)]
use more appropriate alternatives to malloc()

Use calloc to request cleared memory instead.
Kernel and libc conspire to make this more efficient.

Also, replace one malloc() + strcpy() with strdup().

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
15 years agodo not use the new work-in-progress parser rule matcher
Kay Sievers [Tue, 21 Oct 2008 10:45:54 +0000 (12:45 +0200)]
do not use the new work-in-progress parser rule matcher

15 years agoadd "root" == 0 shortcuts to lookup_user/group()
Kay Sievers [Tue, 21 Oct 2008 10:43:07 +0000 (12:43 +0200)]
add "root" == 0 shortcuts to lookup_user/group()

15 years agoreplace missing get_attr_value() -> get_sysattr_value()
Kay Sievers [Tue, 21 Oct 2008 10:42:13 +0000 (12:42 +0200)]
replace missing get_attr_value() -> get_sysattr_value()

15 years agocdrom_id: remove ARRAY_SIZE() declaration
Kay Sievers [Tue, 21 Oct 2008 10:40:47 +0000 (12:40 +0200)]
cdrom_id: remove ARRAY_SIZE() declaration

15 years agolibudev: device - get_attr_value() -> get_sysattr_value()
Kay Sievers [Mon, 20 Oct 2008 16:12:36 +0000 (18:12 +0200)]
libudev: device - get_attr_value() -> get_sysattr_value()

15 years agopass make distcheck
Kay Sievers [Sat, 18 Oct 2008 18:33:06 +0000 (20:33 +0200)]
pass make distcheck

15 years agoprefix udev-util.c functions with util_*
Kay Sievers [Sat, 18 Oct 2008 18:12:55 +0000 (20:12 +0200)]
prefix udev-util.c functions with util_*

15 years agoselinux_init(udev) -> udev_selinux_init(udev)
Kay Sievers [Sat, 18 Oct 2008 17:30:42 +0000 (19:30 +0200)]
selinux_init(udev) -> udev_selinux_init(udev)

15 years agoudev_list_cleanup() -> udev_list_cleanup_entries()
Kay Sievers [Sat, 18 Oct 2008 17:27:38 +0000 (19:27 +0200)]
udev_list_cleanup() -> udev_list_cleanup_entries()

15 years agomove udev_rules_apply_format() to udev-event.c
Kay Sievers [Sat, 18 Oct 2008 17:19:56 +0000 (19:19 +0200)]
move udev_rules_apply_format() to udev-event.c

15 years agoudev_rules_run() -> udev_event_execute_run();
Kay Sievers [Sat, 18 Oct 2008 13:50:16 +0000 (15:50 +0200)]
udev_rules_run() -> udev_event_execute_run();

15 years agoudev_event_run() -> udev_event_execute_rules()
Kay Sievers [Sat, 18 Oct 2008 13:46:55 +0000 (15:46 +0200)]
udev_event_run() -> udev_event_execute_rules()

15 years agoudevd: avoid overhead of calling rmdir on non-empty directories
Alan Jenkins [Sat, 18 Oct 2008 12:39:04 +0000 (13:39 +0100)]
udevd: avoid overhead of calling rmdir on non-empty directories

Unfortunately the linux rmdir implementation unhashes the dentry
even when the directory is not removed.  This is apparently by
design (for filesystems that don't allow deleting open files).

Results from time(1) and oprofile follow.

Before:

0.35user 0.90system
samples  %        image name               symbol name
608       9.6738  vmlinux                  shrink_dcache_parent
293       4.6619  vmlinux                  copy_page_c
271       4.3119  vmlinux                  copy_page_range
257       4.0891  udevd                    udev_rules_iter_next

After:

0.31user 0.67system
samples  %        image name               symbol name
361       5.0419  vmlinux                  copy_page_range
322       4.4972  udevd                    udev_rules_iter_next
300       4.1899  vmlinux                  copy_page_c

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
15 years agomove run_program to util
Kay Sievers [Sat, 18 Oct 2008 13:25:05 +0000 (15:25 +0200)]
move run_program to util

15 years agomake struct udev_rules opaque
Kay Sievers [Sat, 18 Oct 2008 13:02:01 +0000 (15:02 +0200)]
make struct udev_rules opaque

15 years agomerge udev-rules.c and udev-rules-parse.c
Kay Sievers [Sat, 18 Oct 2008 12:33:37 +0000 (14:33 +0200)]
merge udev-rules.c and udev-rules-parse.c

15 years agodelete list.h
Kay Sievers [Fri, 17 Oct 2008 17:29:57 +0000 (19:29 +0200)]
delete list.h

15 years agocollect: use udev_list
Kay Sievers [Fri, 17 Oct 2008 17:29:02 +0000 (19:29 +0200)]
collect: use udev_list

15 years agoudevd: use udev_list_node
Kay Sievers [Fri, 17 Oct 2008 16:59:27 +0000 (18:59 +0200)]
udevd: use udev_list_node

15 years agolibudev: make list_node functions available
Kay Sievers [Fri, 17 Oct 2008 16:59:08 +0000 (18:59 +0200)]
libudev: make list_node functions available

15 years agolibudev: ctrl - change magic to integer
Kay Sievers [Fri, 17 Oct 2008 15:32:17 +0000 (17:32 +0200)]
libudev: ctrl - change magic to integer

15 years agolibudev: monitor - add set_receive_buffer_size()
Kay Sievers [Fri, 17 Oct 2008 14:49:27 +0000 (16:49 +0200)]
libudev: monitor - add set_receive_buffer_size()

15 years agotest: fix a few unintentially wrongly written rules which cause parse errors
Kay Sievers [Fri, 17 Oct 2008 11:54:50 +0000 (13:54 +0200)]
test: fix a few unintentially wrongly written rules which cause parse errors

15 years agolibudev: add sysnum to test program
Kay Sievers [Fri, 17 Oct 2008 11:54:14 +0000 (13:54 +0200)]
libudev: add sysnum to test program

15 years agolibudev: fix sysnum logic for digit-only device names
Alan Jenkins [Fri, 17 Oct 2008 11:19:54 +0000 (13:19 +0200)]
libudev: fix sysnum logic for digit-only device names

15 years agolibudev: list - prepend udev_* to all functions
Kay Sievers [Thu, 16 Oct 2008 23:39:10 +0000 (01:39 +0200)]
libudev: list - prepend udev_* to all functions

15 years agodelete udev-util-file.c
Kay Sievers [Thu, 16 Oct 2008 22:42:48 +0000 (00:42 +0200)]
delete udev-util-file.c

15 years agoupdate rules file parsing
Kay Sievers [Thu, 16 Oct 2008 22:40:03 +0000 (00:40 +0200)]
update rules file parsing

15 years agoupdate IMPORT= file/stdout property parsing
Kay Sievers [Thu, 16 Oct 2008 20:41:52 +0000 (22:41 +0200)]
update IMPORT= file/stdout property parsing

15 years agorun_program: prevent empty last argv entry
Kay Sievers [Thu, 16 Oct 2008 19:35:11 +0000 (21:35 +0200)]
run_program: prevent empty last argv entry

15 years agofix sorting of rules files
Kay Sievers [Thu, 16 Oct 2008 19:12:08 +0000 (21:12 +0200)]
fix sorting of rules files

15 years agodelete name_list, move common file functions
Kay Sievers [Thu, 16 Oct 2008 18:23:56 +0000 (20:23 +0200)]
delete name_list, move common file functions

15 years agoudev-rules-parse: name_list -> udev_list
Kay Sievers [Thu, 16 Oct 2008 18:12:16 +0000 (20:12 +0200)]
udev-rules-parse: name_list -> udev_list

15 years agoudev-node: name_list -> udev_list
Kay Sievers [Thu, 16 Oct 2008 17:23:07 +0000 (19:23 +0200)]
udev-node: name_list -> udev_list

15 years agolibudev: monitor - export MAJOR/MINOR only if available
Kay Sievers [Thu, 16 Oct 2008 16:56:19 +0000 (18:56 +0200)]
libudev: monitor - export MAJOR/MINOR only if available

15 years agolibudev: always add UDEV_LOG
Kay Sievers [Thu, 16 Oct 2008 16:51:05 +0000 (18:51 +0200)]
libudev: always add UDEV_LOG

15 years agorename udev source files
Kay Sievers [Thu, 16 Oct 2008 16:13:48 +0000 (18:13 +0200)]
rename udev source files

15 years agomove udev_device_db to libudev
Kay Sievers [Thu, 16 Oct 2008 15:30:06 +0000 (17:30 +0200)]
move udev_device_db to libudev

15 years agoudevd: use libudev
Kay Sievers [Thu, 16 Oct 2008 15:16:58 +0000 (17:16 +0200)]
udevd: use libudev

15 years agovolume_id: btrfs - update magic to latest disk format
Kay Sievers [Thu, 16 Oct 2008 15:10:47 +0000 (17:10 +0200)]
volume_id: btrfs - update magic to latest disk format

15 years agolibudev: device - copy global properties, unset empty properties
Kay Sievers [Thu, 16 Oct 2008 11:53:16 +0000 (13:53 +0200)]
libudev: device - copy global properties, unset empty properties

15 years agolibudev: add global property list
Kay Sievers [Thu, 16 Oct 2008 11:51:29 +0000 (13:51 +0200)]
libudev: add global property list

15 years agolibudev: ctrl - fix typo in set_env()
Kay Sievers [Thu, 16 Oct 2008 11:34:11 +0000 (13:34 +0200)]
libudev: ctrl - fix typo in set_env()

15 years agolibudev: list - handle update of key with NULL value
Kay Sievers [Thu, 16 Oct 2008 11:33:13 +0000 (13:33 +0200)]
libudev: list - handle update of key with NULL value

15 years agolibudev: device - export properties when values are set
Kay Sievers [Thu, 16 Oct 2008 09:37:22 +0000 (11:37 +0200)]
libudev: device - export properties when values are set

15 years agolibudev: device - lookup "subsystem" and "driver" only once
Kay Sievers [Wed, 15 Oct 2008 16:34:14 +0000 (18:34 +0200)]
libudev: device - lookup "subsystem" and "driver" only once

15 years agolibudev: update DEVLINKS property when properties are read
Kay Sievers [Wed, 15 Oct 2008 14:56:06 +0000 (16:56 +0200)]
libudev: update DEVLINKS property when properties are read

15 years agolibudev: monitor - do not mangle DEVLINKS property
Kay Sievers [Wed, 15 Oct 2008 14:55:04 +0000 (16:55 +0200)]
libudev: monitor - do not mangle DEVLINKS property

15 years agolibudev: do not include ctrl in libudev.so
Kay Sievers [Wed, 15 Oct 2008 14:54:06 +0000 (16:54 +0200)]
libudev: do not include ctrl in libudev.so

15 years agolibudev: device - add get_envp() to construct envp from property list
Kay Sievers [Wed, 15 Oct 2008 12:21:33 +0000 (14:21 +0200)]
libudev: device - add get_envp() to construct envp from property list

15 years agolibudev: monitor - fix send_device() property copying
Kay Sievers [Wed, 15 Oct 2008 12:20:27 +0000 (14:20 +0200)]
libudev: monitor - fix send_device() property copying

15 years agotest: move global ENV{ENV_KEY_TEST}="test" to local rule
Kay Sievers [Tue, 14 Oct 2008 17:55:57 +0000 (19:55 +0200)]
test: move global ENV{ENV_KEY_TEST}="test" to local rule

15 years agodelete simple-build-check.sh
Kay Sievers [Tue, 14 Oct 2008 17:55:22 +0000 (19:55 +0200)]
delete simple-build-check.sh

15 years agolibudev: handle ! in sysname, add sysnum, return allocated list_entry on add
Kay Sievers [Tue, 14 Oct 2008 17:53:47 +0000 (19:53 +0200)]
libudev: handle ! in sysname, add sysnum, return allocated list_entry on add

15 years agovol_id: update README
Kay Sievers [Mon, 13 Oct 2008 01:34:37 +0000 (03:34 +0200)]
vol_id: update README

15 years agovolume_id: support for GFS2 UUIDs
Steven Whitehouse [Fri, 10 Oct 2008 10:54:46 +0000 (11:54 +0100)]
volume_id: support for GFS2 UUIDs

15 years agolibudev: device - generate DEVNAME and DEVLINKS properties
Kay Sievers [Sat, 11 Oct 2008 16:40:33 +0000 (18:40 +0200)]
libudev: device - generate DEVNAME and DEVLINKS properties

15 years agolibudev: list - add flag
Kay Sievers [Sat, 11 Oct 2008 16:40:04 +0000 (18:40 +0200)]
libudev: list - add flag

15 years agolibudev: add udev_monitor_send_device()
Kay Sievers [Thu, 9 Oct 2008 21:38:30 +0000 (23:38 +0200)]
libudev: add udev_monitor_send_device()

15 years agolibudev: also prefix non-exported functions with udev_*
Kay Sievers [Thu, 9 Oct 2008 20:24:43 +0000 (22:24 +0200)]
libudev: also prefix non-exported functions with udev_*

15 years agolibudev: device - add device lookup by subsystem:sysname
Kay Sievers [Tue, 7 Oct 2008 18:20:34 +0000 (20:20 +0200)]
libudev: device - add device lookup by subsystem:sysname

15 years agoremove outdated docs/README-gcov_for_udev
Kay Sievers [Tue, 7 Oct 2008 16:10:35 +0000 (18:10 +0200)]
remove outdated docs/README-gcov_for_udev

15 years agorelease 130
Kay Sievers [Tue, 7 Oct 2008 12:32:33 +0000 (14:32 +0200)]
release 130

15 years agoreplace spaces in dm and md name symlinks
Kay Sievers [Mon, 6 Oct 2008 22:41:00 +0000 (00:41 +0200)]
replace spaces in dm and md name symlinks

We create multiple symlinks for dm names with spaces, which
isn't what we want.

15 years agoconnect /sys and /dev with /sys/dev/{block,char}/<maj>:<min> and /dev/{block,char...
Kay Sievers [Mon, 6 Oct 2008 22:18:55 +0000 (00:18 +0200)]
connect /sys and /dev with /sys/dev/{block,char}/<maj>:<min> and /dev/{block,char}/<maj>:<min>

15 years agolibudev: fix typo in "multiple entries in symlink" handling
Kay Sievers [Mon, 6 Oct 2008 16:17:27 +0000 (18:17 +0200)]
libudev: fix typo in "multiple entries in symlink" handling

15 years agovolume_id: more fat debugging
Kay Sievers [Mon, 6 Oct 2008 16:17:05 +0000 (18:17 +0200)]
volume_id: more fat debugging

15 years agostore node name and symlinks into db symlink target if they are small enough
Kay Sievers [Mon, 6 Oct 2008 11:52:43 +0000 (13:52 +0200)]
store node name and symlinks into db symlink target if they are small enough

15 years agolibudev: libudev.pc remove selinux
Kay Sievers [Mon, 6 Oct 2008 10:18:55 +0000 (12:18 +0200)]
libudev: libudev.pc remove selinux

15 years agovolume_id: add more vfat debugging information
Kay Sievers [Mon, 6 Oct 2008 10:17:47 +0000 (12:17 +0200)]
volume_id: add more vfat debugging information

15 years agodon not print error if GOTO jumps just to next rule
Kay Sievers [Sun, 5 Oct 2008 15:27:21 +0000 (17:27 +0200)]
don not print error if GOTO jumps just to next rule

15 years agolibudev: fix --enable-debug
Kay Sievers [Sun, 5 Oct 2008 14:18:21 +0000 (16:18 +0200)]
libudev: fix --enable-debug

15 years agoudevd: clarify deprecated sysfs layout warning
Kay Sievers [Sat, 4 Oct 2008 11:52:39 +0000 (13:52 +0200)]
udevd: clarify deprecated sysfs layout warning

15 years agovolume_id: use PRIu64i, PRIx64 macros
Kay Sievers [Fri, 3 Oct 2008 16:24:04 +0000 (18:24 +0200)]
volume_id: use PRIu64i, PRIx64 macros

15 years agovolume_id: add btrfs
Kay Sievers [Fri, 3 Oct 2008 15:23:12 +0000 (17:23 +0200)]
volume_id: add btrfs

15 years agovolume_id: better DDF raid detection
Kay Sievers [Fri, 3 Oct 2008 13:01:39 +0000 (15:01 +0200)]
volume_id: better DDF raid detection

15 years agovol_id: always use the safe string versions for unencoded label and uuid
Kay Sievers [Fri, 3 Oct 2008 12:58:02 +0000 (14:58 +0200)]
vol_id: always use the safe string versions for unencoded label and uuid

15 years agovol_id: fix logging glue
Kay Sievers [Fri, 3 Oct 2008 12:56:54 +0000 (14:56 +0200)]
vol_id: fix logging glue

15 years agovolume_id: add dbg() as noop to check for compile errors
Kay Sievers [Fri, 3 Oct 2008 12:50:57 +0000 (14:50 +0200)]
volume_id: add dbg() as noop to check for compile errors

15 years agomove selinux noops to udev.h
Kay Sievers [Fri, 3 Oct 2008 12:49:29 +0000 (14:49 +0200)]
move selinux noops to udev.h

15 years agovol_id: add size= option
Kay Sievers [Fri, 3 Oct 2008 09:42:47 +0000 (11:42 +0200)]
vol_id: add size= option

15 years agoudevadm: info - fix --query=all for devices without a device node
Kay Sievers [Fri, 3 Oct 2008 08:33:15 +0000 (10:33 +0200)]
udevadm: info - fix --query=all for devices without a device node