Commit Graph

30 Commits

Author SHA1 Message Date
kay.sievers@vrfy.org 3e54036862 [PATCH] introduce format char 'k' for kernel-name
Attached is a patch that introduces the format char 'k' to be replaced with
the kernel name. I like to have it in a callout script.

I've moved the build_kernel_name() back to namedev_name_device() since
we don't expect it growing cause of 'sdaj' :)
2005-04-26 21:13:09 -07:00
greg@kroah.com 7ac0feeb60 [PATCH] move all of the DBUS logic into one file and remove all of the #ifdef crud from the main code. 2005-04-26 21:13:06 -07:00
david@fubar.dk 5aebfbcb62 [PATCH] D-BUS patch for udev-008
Attached is a patch against udev-008 to send out a D-BUS message when a
device node is added or removed.

Using D-BUS lingo, udev acquires the org.kernel.udev service and sends
out a NodeCreated or NodeDeleted signal on the
org.kernel.udev.NodeMonitor interface. Each signal carries two
parameters: the node in question and the corresponding sysfs path.

[Note: the D-BUS concepts of service, interface, object can be a bit
confusing at first glance]

An example program listening for these messages looks like this

#!/usr/bin/python

import dbus
import gtk

def udev_signal_received(dbus_iface, member, service, object_path, message):
    [filename, sysfs_path] = message.get_args_list()
    if member=='NodeCreated':
        print 'Node %s created for %s'%(filename, sysfs_path)
    elif member=='NodeDeleted':
        print 'Node %s deleted for %s'%(filename, sysfs_path)

def main():
    bus = dbus.Bus(dbus.Bus.TYPE_SYSTEM)
    bus.add_signal_receiver(udev_signal_received,
                            'org.kernel.udev.NodeMonitor',  # interface
                            'org.kernel.udev',              # service
                            '/org/kernel/udev/NodeMonitor') # object

    gtk.mainloop()

if __name__ == '__main__':
    main()

and this is the output when hot-plugging some usb-storage.

[david@laptop udev-008]$ ~/node_monitor.py
Node /udev/sda created for /block/sda
Node /udev/sda1 created for /block/sda/sda1
Node /udev/sda1 deleted for /block/sda/sda1
Node /udev/sda deleted for /block/sda

The patch requires D-BUS 0.20 or later while the python example program
requires D-BUS from CVS as I only recently applied a patch against the
python bindings.
2005-04-26 21:13:06 -07:00
kay.sievers@vrfy.org 3d150dfb28 [PATCH] experimental (very simple) SYMLINK creation
> > here is a experimental symlink creation patch - for discussion,
> > in which direction we should go.
> > It is possible now to define SYMLINK= after the NAME= in udev.rules.
> > The link is relative to the node, but the path is not optimized now
> > if the node and the link are in the same nested directory.
> > Only one link is supported, cause i need to sleep now :)
> >
> > 06-simple-symlink-creation.diff
> >   simple symlink creation
> >   reorganized udev-remove to have access to the symlink field
> >   subdir creation/removal are functions now
> >   udev-test.pl tests for link creation/removal

Here is a new version with relative link target path optimization
an better tests in udev-test.pl:

LABEL, BUS="scsi", vendor="IBM-ESXS", NAME="1/2/a/b/node", SYMLINK="1/2/c/d/symlink"

  Dec  7 06:48:34 pim udev[13789]: create_node: symlink 'udev-root/1/2/c/d/symlink' to node '1/2/a/b/node' requested
  Dec  7 06:48:34 pim udev[13789]: create_path: created 'udev-root/1/2/c'
  Dec  7 06:48:34 pim udev[13789]: create_path: created 'udev-root/1/2/c/d'
  Dec  7 06:48:34 pim udev[13789]: create_node: symlink(../../a/b/node, udev-root/1/2/c/d/symlink)
2005-04-26 21:13:06 -07:00
greg@kroah.com 206d3623c6 [PATCH] enable default_mode ability to actually build 2005-04-26 21:13:05 -07:00
greg@kroah.com 3836a3c49a [PATCH] get rid of the majority of the debug environment variables.
Now there are only 3 valid environment test variables.  The rest can be
specified with the config file.
2005-04-26 21:13:05 -07:00
greg@kroah.com e8bacccab2 [PATCH] add support for a main udev config file, udev.conf.
the older udev.config file is now called udev.rules.
This allows us to better control configuration values, and move away from 
the environment variables.
2005-04-26 21:13:05 -07:00
arnd@arndb.de c076a2bde4 [PATCH] Build failure - missing linux/limits.h include?
On Tuesday 25 November 2003 00:12, Chris Larson wrote:
> udev fails to compile here unless I'm doing a KLIBC build.  The reason
> appears to be that the normal limits.h in the gcc inc dir doesn't pull
> in linux/limits.h, whereas the limits.h out in the klibc include dirs
> does.  I'd think it'd be best to add a #include <linux/limits.h> to
> udev.h directly, since it uses PATH_MAX.

No, don't include kernel headers directly if you can avoid it.
The problem you are referring to seems to be with old tool chains,
I have the same symptom with my s390 gcc-2.95/glibc-2.1.3.
Including <sys/param.h> instead of <limits.h> seems to fix it.
2005-04-26 21:13:04 -07:00
greg@kroah.com 49d72e4348 [PATCH] changed the default location of the database to /udev/.udev.tdb to be LSB compliant
Finally the Debian people can get off my back...
2005-04-26 21:13:04 -07:00
kay.sievers@vrfy.org f7b4eca455 [PATCH] overall whitespace + debug text conditioning
01-overall-whitespace+debug-text-conditioning.diff
  o cleanup whitespace
  o clarify a few comments
  o enclose all printed debug string values in ''
2005-04-26 21:13:03 -07:00
greg@kroah.com f3b04a2e0a [PATCH] added ability to put format specifiers in the CALLOUT program string. 2005-04-26 21:13:02 -07:00
arnd@arndb.de 70033702cd [PATCH] more robust config file parsing in namedev.c
After getting a number of different crashes for udev reading broken
udev.config files, I decided to try to make the parser a little
more robust.

The behaviour is changed to stop reading the configuration file
and logging the broken entry instead of silently ignoring it (is
that good? It's easy to just print and continue).
All strcpy()'s to a fixed length string are now implicitly limited
to the bounds of the target string.

I kept the -ENODEV return code for now, not sure if there should be
different ones.
2005-04-26 21:06:24 -07:00
greg@kroah.com 9d496c74f3 [PATCH] got rid of struct device_attr
namedev.c is still a mess, that's up next after testing...
2005-04-26 21:04:10 -07:00
greg@kroah.com d411208793 [PATCH] rename namedev.permissions and namedev.config to udev.permissions and udev.config
the namedev name didn't really make much sense anymore...
2005-04-26 21:04:09 -07:00
greg@kroah.com c056c5141b [PATCH] make config files, sysfs root, and udev root configurable from config variables
This will make running tests a lot simpler.
2005-04-26 21:01:42 -07:00
greg@kroah.com 5840bc63e2 [PATCH] major database cleanups
Now we standardise on a struct udevice to pass around, and store in the
database.  This cleaned up the database code a lot.
2005-04-26 21:01:42 -07:00
rml@tech9.net c2405f502c [PATCH] udev: mode should be mode_t
Unix file modes should be stored in a mode_t, not a standard type.  At
the moment it is actually unsigned, in fact, not a signed integer.

Attached patch does an s/int mode/mode_t mode/ and cleans up the
results.
2005-04-26 21:01:41 -07:00
greg@kroah.com 6739707df5 [PATCH] put config files and database in /etc/udev by default
Can be overridden on the makefile line.
2005-04-26 21:01:40 -07:00
patmans@us.ibm.com c27e69116d [PATCH] add callout config type to udev
This patch adds a callout config type to udev, so external programs can be
called to get serial numbers or id's that are not available as a sysfs
attribute.
2005-04-26 21:01:40 -07:00
greg@kroah.com 1331c889c3 [PATCH] cleanup the mknod code a bit. 2005-04-26 21:01:40 -07:00
greg@kroah.com ea70388c3c [PATCH] removed unneeded stuff from udev.h 2005-04-26 21:01:40 -07:00
greg@kroah.com ea733a2f00 [PATCH] split udev main logic into udev-add and udev-remove. 2005-04-26 21:01:39 -07:00
greg@kroah.com 19dc5d4ce1 [PATCH] Clean up the namedev interface a bit, making the code smaller... 2005-04-26 21:01:39 -07:00
greg@kroah.com 185a35a403 [PATCH] add initial libsysfs support...
needs lots more cleanup, but is much nicer than doing this by hand...
2005-04-26 21:01:39 -07:00
greg@kroah.com 032abea6fb [PATCH] make log_message spit out warnings so I don't have 2005-04-26 21:01:39 -07:00
greg@kroah.com 2232cac825 [PATCH] Initial namedev parsing of config files
.permission parsing works, .config needs more work.
2005-04-26 21:01:38 -07:00
greg@kroah.com f0952f66e6 [PATCH] pick a better default UDEV_ROOT 2005-04-26 21:01:38 -07:00
greg@kroah.com 85511f0246 [PATCH] Creating nodes actually works. 2005-04-26 21:00:40 -07:00
greg@kroah.com a507a01572 [PATCH] enabled debugging. 2005-04-26 21:00:23 -07:00
Greg KH f0083e3d4e added initial files. 2005-04-26 20:59:47 -07:00