Commit graph

11 commits

Author SHA1 Message Date
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
mbuesch@freenet.de e5a5b54ab6 [PATCH] fix asmlinkage
This patch fixes the reintroduced bug with the
sig_handler(), if we link against a -mregparm=3 compiled
klibc on i386.
It also fixes some compiler warnings about redefined
asmlinkage on some systems.
Also some (broken?) compilers on distros throw out warnings
if asmlinkage is before "static void". This fixes it, too.
2005-04-26 21:55:39 -07:00
harald@redhat.com 6e3e3c3416 [PATCH] PATCH udev close on exec
selinux wants a clean fd set, so better close all open fds
2005-04-26 21:37:03 -07:00
kay.sievers@vrfy.org cdc60e8afb [PATCH] switch udev's seqnum to u64
The kernel will use a u64 for the sequence number, so we want the same.
2005-04-26 21:37:01 -07:00
kay.sievers@vrfy.org 3169e8d1ee [PATCH] pass SEQNUM trough udevd
here we change udevd to pass the SEQNUM from the hotplug environment
to udev and the dev.d/ scripts. We need this for HAL to match the
hotplug event with the dev.d/ events.

It also changes the type from int to long to match the kernel.
2005-04-26 21:37:00 -07:00
kay.sievers@vrfy.org aef6bb132e [PATCH] udev default config layout changes
Here we catch up, after the default config changes.

o the man page is updated to reflect the new default config

o /etc/udev/rules.d/ + permissions.d/ dirs are created now

o udev.rules is installed in /etc/udev/rules.d/50-udev.rules
  so the user can easily order the files by prepending a number.
  (RedHat has the same name in the last rpm.)

o defined directory names in the Makefile are all without slashes now,
  not the first half with and the remaining without.

o all binaries are uninstalled now

o leading slashes in config values are now removed or prepended while the
  config is parsed, so we are more robust if the usere changes something.

o replaced the macros from udev_config.c with real code, cause we can
  skip if the value matches and not useless iterate over the remaining
  fields.

o config parsing errors are logged with info() now, fixes the bug where
  we report a error with debug_parse(), even when there isn't one
2005-04-26 21:35:17 -07:00
sjoerd@spring.luon.net 4b06c852cb [PATCH] DEVNODE -> DEVNAME transition fixes
It seems that the transition from DEVNODE to DEVNAME wasn't done
  everywhere. This broke udev_dbus for me.

  Attached patch does the transition in the places it wasn't done yet.
2005-04-26 21:35:15 -07:00
kay.sievers@vrfy.org 4a539daf1e [PATCH] dev_d.c file sorting and cleanup
On Thu, Mar 25, 2004 at 02:52:13AM +0100, Kay Sievers wrote:
> Please have look if it still works for you, I only did a very quick
> test.

Here is a unified version, with all the functions moved to udev_lib.c.
We have a generic function now, to call a given fnct(char *) for every
file ending with a specific suffix, sorted in lexical order. We use it
to execute the dev.d/ files and read our rules.d/ files. The binary
should be a bit smaller now.

I've also changed it, to not do the dev.d/ exec for net devices.
2005-04-26 21:35:12 -07:00
kay.sievers@vrfy.org f61d732a02 [PATCH] hmm, handle net devices with udev?
Hmm, Arndt Bergmann sent a patch like this one a few weeks ago and
I want to bring the question back, if we want to handle net device
naming with udev.

With this patch it is actually possible to specify something like this
in udev.rules:

  KERNEL="dummy*", SYSFS{address}="00:00:00:00:00:00", SYSFS{features}="0x0", NAME="blind%n"
  KERNEL="eth*", SYSFS{address}="00:0d:60:77:30:91", NAME="private"

and you will get:

  [root@pim udev.kay]# cat /proc/net/dev
  Inter-|   Receive                                                | Transmit
   face |bytes    packets errs drop fifo frame compressed multicast|bytes   packets errs drop fifo colls carrier compressed
       lo:    1500     30    0    0    0     0          0         0    1500      30    0    0    0     0       0          0
  private:  278393   1114    0    0    0     0          0         0  153204    1468    0    0    0     0       0          0
     sit0:       0      0    0    0    0     0          0         0       0       0    0    0    0     0       0          0
   blind0:       0      0    0    0    0     0          0         0       0       0    0    0    0     0       0          0


The udevinfo program is also working:

  [root@pim udev.kay]# ./udevinfo -a -p /sys/class/net/private
    looking at class device '/sys/class/net/private':
      SYSFS{addr_len}="6"
      SYSFS{address}="00:0d:60:77:30:91"
      SYSFS{broadcast}="ff:ff:ff:ff:ff:ff"
      SYSFS{features}="0x3a9"
      SYSFS{flags}="0x1003"
      SYSFS{ifindex}="2"
      SYSFS{iflink}="2"
      SYSFS{mtu}="1500"
      SYSFS{tx_queue_len}="1000"
      SYSFS{type}="1"

  follow the class device's "device"
    looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:02:01.0':
      BUS="pci"
      ID="0000:02:01.0"
      SYSFS{class}="0x020000"
      SYSFS{detach_state}="0"
      SYSFS{device}="0x101e"
      SYSFS{irq}="11"
      SYSFS{subsystem_device}="0x0549"
      SYSFS{subsystem_vendor}="0x1014"
      SYSFS{vendor}="0x8086"


The matching device will be renamed to the given name. The device name
will not be put into the udev database, cause the kernel renames the
device and the sysfs name disappears.

I like it, cause it plugs in nicely. We have all the naming features
and sysfs queries and walks inside of  udev. The sysfs timing races
are already solved and the management tools are working for net devices
too. nameif can only match the MAC address now. udev can match any sysfs
value of the device tree the net device is connected to.
But right, net devices do not have device nodes :)
2005-04-26 21:35:12 -07:00
greg@kroah.com 89fe4e00fe [PATCH] add get_devnode() helper to udev_lib for udev_dbus program 2005-04-26 21:35:11 -07:00
kay.sievers@vrfy.org c81b35c08b [PATCH] replace fgets() with mmap() and introduce udev_lib.[hc]
Here we replace the various fgets() with a mmap() call for the config
file reading, due to the reported performance problems with klibc.

Thanks to Patrick's testing, it makes a very small, close to nothing
speed gain for libc users, but a 6 times speed increase for klibc users
with a 1000 line config file.

I've created a udev_lib.[hc] for this and also moved all the generic
stuff from udev.h in there and uninlined the functions.
2005-04-26 21:35:10 -07:00