Commit graph

57 commits

Author SHA1 Message Date
Kay Sievers bf50425b58 add OPTIONS+="event_timeout=<seconds>" 2008-04-21 19:00:54 +02:00
Kay Sievers c70560feef logging: add trailing newline to all strings 2008-04-20 21:07:06 +02:00
Kay Sievers 225cb03bd8 udevadm: merge all udev tools into a single binary 2007-11-08 17:51:59 +01:00
Kay Sievers 285e2a24f6 udevtrigger: allow to specify action string 2007-07-09 03:59:08 +02:00
Kay Sievers 92b229c727 no newline in log messages 2007-06-23 16:21:47 +02:00
Kay Sievers 3df3c93e25 allow to disable the replacement of unusual characters 2007-06-22 01:27:02 +02:00
Kay Sievers df97701ec6 udevtest: add --subsystem option 2007-06-02 10:14:50 +02:00
Kay Sievers 86fd6b4f61 udevtest: print message before log output 2007-05-21 07:02:04 +02:00
Kay Sievers 68d4af11ca udevtest: import uevent variables if possible 2007-04-06 19:18:33 +02:00
Kay Sievers 1c73ceeb94 udevtest: export ACTION string if given as option 2007-03-31 02:42:14 +02:00
Kay Sievers eff4a67369 udevtest: add --force mode 2007-03-21 11:55:26 +01:00
Kay Sievers 31de3a2ba1 read list of devices from index, make index private to database 2007-03-17 10:08:25 +01:00
Jean Tourrilhes 043c6f6d4a udevtest: export UDEV_LOG if we changed it 2007-03-16 01:09:47 +01:00
Kay Sievers 7b08597467 udevtest: print header that ENV{} can't work 2006-08-28 02:38:53 +02:00
Kay Sievers 27b77df44d update source file headers 2006-08-28 00:29:11 +02:00
Kay Sievers e3396a2d38 cleanup commandline argument handling
Print and log failure, but don't fail for tools which are
usually not used iteractively. Add '--help' to all tools.
2006-08-21 02:38:20 +02:00
Kay Sievers 2362eea601 udevinfo, udevtest: simplify '/sys' stripping from devpath argument 2006-08-18 02:33:46 +02:00
Alex Merry 878b47da74 udevtest: allow /sys in the devpath paramter 2006-08-17 21:14:45 +02:00
Kay Sievers ad27f5b396 udevtest: add udev_rules_apply_format() to RUN keys
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2006-01-25 02:18:13 +01: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 c86be870ce remove all built-in wait_for_sysfs logic
Most of the issues are fixed with the kernel we depend on, for the
remaing ones see the RELEASE-NOTES for a special rule to add.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-11-12 04:17:48 +01:00
Kay Sievers 287814b23c remove precompiled rules option
It was a workaround for speed up udev "coldplug", where ~800 events
happened a second time during bootup. No need for it with the rules
aleady parsed in the daemon.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-11-05 20:00:31 +01:00
Kay Sievers bfd1294892 add flag for reading of precompiled rules
Rules can be precompiled and stored on disk for initramfs, to avoid
parsing the rules with every event again and again. Also the OWNER and
GROUP names are already resolved to numerical values in the compiled
rules. This flag is used for the upcoming move of the rules parsing
into udevd:
  If the real root is mounted udevd is started and parses the rules
  only once. The event processes will inherit the already parsed rules
  from the daemon, so we want to ignore any precompiled rules and
  use the real rules files and watch the filesystem for changes to
  reload the rules automatically.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-08 17:43:42 +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 8bd41f36f7 pack parsed rules list
This cuts down our 600 rules file to 98 kb instead of 1.9 Mb memory
or file-size with precompiled rules.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-07-05 15:24:41 +02:00
Kay Sievers d27d3bb052 fix udevstart and let all events trvel trough udev
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-22 01:31:24 +02:00
kay.sievers@vrfy.org e03a196a0d [PATCH] fix udevtest to print the error if logging is disabled 2005-04-26 23:55:00 -07:00
kay.sievers@vrfy.org fb39f0566e [PATCH] move execute_program to utils + add action to init_device 2005-04-26 23:55:00 -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 e5e322bc62 [PATCH] rename namedev_dev to udev_rule 2005-04-26 23:53:17 -07:00
kay.sievers@vrfy.org e6764498e7 [PATCH] correct enum device_type 2005-04-26 23:53:17 -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 6c18b1fb87 [PATCH] rename LOG to USE_LOG in all places 2005-04-26 23:48:48 -07:00
kay.sievers@vrfy.org 5ef4268205 [PATCH] switch device type to enum 2005-04-26 23:36:13 -07:00
kay.sievers@vrfy.org 82ca88904d [PATCH] klibc supports LOG_PID now, so remove our own implementation 2005-04-26 23:17:47 -07:00
kay.sievers@vrfy.org d7190b0513 [PATCH] include missing header to udevtest.c 2005-04-26 23:13:47 -07:00
kay.sievers@vrfy.org 5ce120d366 [PATCH] prevent udev node creatinon for "class" registration
I've found a /dev/video4linux node and just realized, that libsysfs
searches all subdirs for an attribute name.
So it found /class/video4linux/video0/dev for the videodev class
creation event /class/video4linux and created a node.

Just ignore the SUBSYSTEM="class" events now.
2005-04-26 23:13:47 -07:00
kay.sievers@vrfy.org 45a7b668ec [PATCH] remove unused variables
Remove udev.bus, cause it's currently unused and newer kernels will pass
it in the hotplug environment as PHYSDEVBUS.

Remove udev.action, cause it's unused.

Rename udev_set_values() to udev_init_device().
2005-04-26 23:00:29 -07:00
kay.sievers@vrfy.org a0294b7625 [PATCH] update the man pages and correct Usage: hints
Add UDEV_LOG to the man udev man page. Remove mention of specific
variables from the udevd/udevsend man page as we changed to pass
the whole environment.

Correct printed Usage: of udevtest and udevinfo.

Init the config in udevtest earlier to accept input with and without
the sysfs mount point.
2005-04-26 23:00:29 -07:00
kay.sievers@vrfy.org 9af5bb2f8f [PATCH] rename udev_lib to udev_utils and dev_d to udev_multiplex 2005-04-26 22:44:02 -07:00
kay.sievers@vrfy.org 02fa9ae589 [PATCH] rename udevdb* to udev_db* 2005-04-26 22:25:14 -07:00
kay.sievers@vrfy.org af4b05d491 [PATCH] make the udev object available to more processing stages
Remove the overwriting of main_argv[] hack and use the values
from the udev object.
  
Pass the udev object to call_foreach_file().
  
In the udevstart case, export SUBSYSTEM and UDEVSTART to the
environment.
2005-04-26 22:24:38 -07:00
kay.sievers@vrfy.org c6478ec1e1 [PATCH] add ACTION to udev object to expose it to the whole process 2005-04-26 22:24:10 -07:00
kay.sievers@vrfy.org e5e2ea95a4 [PATCH] Exit, if udevtest cannot open the device (segfault). 2005-04-26 22:09:26 -07:00
kay.sievers@vrfy.org 5d24c6ca36 [PATCH] cleanup netif handling and netif-dev.d/ events
Here we supress the dev.d/ execution if we didn't change a network
interface's name with a rule. This should solve the issue of two
running dhclients for the same interface, cause the
/etc/dev.d/net/hotplug.dev script that fakes the hotplug event runs
with every udevstart for every interface and fakes a second identical
hotplug event on bootup.

With this patch netif interfaces are no longer stored in the udevdb.
It is not needed, cause we don't have permissions or symlinks :) and
all information is available in sysfs.

This patch also moves the dev_d execution calls out of the
udev_add/udev_remove. As with the former api-cleanup-patch we have
all processed data in one udev struct and can place the execution
calls where needed.
2005-04-26 22:02:46 -07:00
kay.sievers@vrfy.org 7a947ce515 [PATCH] big cleanup of internal udev api
Here is the first patch to cleanup the internal processing of the
various stages of an udev event. It should not change any behavior,
but if your system depends on udev, please always test it before reboot :)

We pass only one generic structure around between add, remove,
namedev, db and dev_d handling and make all relevant data available
to all internal stages. All udev structures are renamed to "udev".

We replace the fake parameter by a flag in the udev structure.

We open the class device in the main binaries and not in udev_add, to
make it possible to use libsysfs for udevstart directory crawling.

The last sleep parameters are removed.
2005-04-26 22:02:46 -07:00
greg@kroah.com 41bc97a0ad [PATCH] fix compiler warning in udevtest.c 2005-04-26 21:37:00 -07:00
kay.sievers@vrfy.org aee380b6d8 [PATCH] Fix naming ethernet devices in udevstart
On Tue, Sep 07, 2004 at 12:46:43PM +0200, Kay Sievers wrote:
> On Mon, 2004-09-06 at 20:18 -0700, Tom Rini wrote:
> > I noticed somewhat recently that my enet devices weren't being renamed
> > on boot anymore.  I don't quite know when this got broken (or rather, if
> > it was supposed to be working.  I swear it worked for me once..), but
> > the following seems to do it.
>
> I think it never worked in the udevstart case. It worked only with the
> hotplug-event-udev, I expect.
>
> > In udev_scan_class(), look for not just
> > %s/%s/dev (which everything with a dev node has), but %s/%s/dev* (both
> > of my enet devices, sis900 & 3c59x only have device) and if that
> > exists, pass this along to udev.
>
> Yeah, network devices don't have a devnode and therefore no "dev", but
> they are all in /sys/class/net/. We may just test if we are there
> instead of the "device" match.

How about something like this. It adds all the net devices without
looking at the attributes and keeps the remaining logic like it is.

It also removes certain levels of indirection and much simplifies the
udevstart process. We surely don't need to open and close the udevdb
for every node while iterating over the list. (We are about 5% faster on
my box)

It's not well tested, so it would be nice if someone can have a look
at it, before a broken udevstart renders any system unbootable.
2005-04-26 21:37:00 -07:00
greg@kroah.com ce4256bdc5 [PATCH] handle the subsytem if provided in udevtest.
this is needed to test the /etc/dev.d/ stuff properly.
2005-04-26 21:35:14 -07:00
greg@kroah.com 30ccd6a3e1 [PATCH] fix udevtest to build properly after the big udev_lib change. 2005-04-26 21:35:10 -07:00