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

1022 Commits

Author SHA1 Message Date
greg@kroah.com
5cd749f342 [PATCH] update RFC-dev.d docs due to DEVNODE to DEVNAME change 2005-04-26 21:35:13 -07:00
kay.sievers@vrfy.org
9b28a52a0a [PATCH] DEVPATH for netdev
Here we change the DEVPATH for netdev's in the environment of the dev.d/
scripts to the name the device is renamed to. The original name doesn't
exist in the kernel after rename.
2005-04-26 21:35:13 -07:00
kay.sievers@vrfy.org
bbbe503ec1 [PATCH] netdev - udevdb+dev.d changes
Here is a patch to change the netdev handling in the database and for
the dev.d/ calls. I applies on top of the udevd.patch, cause klibc has
no sysinfo().

 o netdev's are also put into our database now. I want this for the
   udevruler gui to get a list of all handled devices.
   All devices in the db are stamped with the system uptime value at
   the creation time. 'udevinfo -d' prints it.

 o the DEVPATH value is the key for udevdb, but if we rename
   a netdev, the name is replaced in the kernel, so we add
   the changed name to the db to match with the remove event.

   NOTE: The dev.d/ scripts still get the original name from the
   hotplug call. Should we replace DEVPATH with the new name too?

 o We now only add a device to the db, if we have successfully created
   the main node or successfully renamed a netdev. This is the main part
   of the patch, cause I needed to clean the retval passing trough all
   the functions used for node creation.

 o DEVNODE sounds a bit ugly for netdev's so I exported DEVNAME too.
   Can we change the name?

 o I've added a UDEV_NO_DEVD to possibly skip the script execution
   and used it in udev-test.pl.
   udevstart is the same horror now, if you have scripts with logging
   statements in dev.d/ it takes minutes to finish, can we skip the
   scripts here too?

 o The get_device_type() function is changed to be more strict, cause
   'udevinfo -a -p /block/' gets a class device for it and tries to
   print the major/minor values.

 o bugfix, the RESULT value has now a working newline removal and a test
   for this case.
2005-04-26 21:35:13 -07:00
kay.sievers@vrfy.org
e5a2989efb [PATCH] udevd race conditions and performance, assorted cleanups - take 2
here is a patch on top of your nice improvements.
I fixed the whitespace and it hopefully fixes the stupid timestamp bug in
udevd. Some stupid OS sets the hwclock to localtime and linux changes it
to UTC while starting. If any events are pending they may be delayed by
the users time distance from UTC :) So we use the uptime seconds now.
2005-04-26 21:35:13 -07:00
chris_friesen@sympatico.ca
f27125f98f [PATCH] udevd race conditions and performance, assorted cleanups
This patch covers a number of areas:

1) sysfs.h is fixed up to use the common dbg() macro.  This fixes the
case where DEBUG is defined but USE_LOG isn't.

2) udevstart.c is modified to include the proper headers, rather than
getting them indirectly which can break depending on Makefile flags

3) udevd.c gets some major changes:
a) I added a pipe from the signal handler.  This fixes the race
conditions that I mentioned earlier.  Basically, the point of the pipe
is to force the select() call to return immediately if a signal handler
fired before we actually started the select() call.  This then lets us
run the appropriate code based on flags set in the signal handler proper.
b) I added a number of flags to coalesce calls to common routines.  This
should make things slightly more efficient.
c) since most calls will tend to come in with a sequence number larger
than what has been received, I switched msg_queue_insert() to scan the
msg_list backwards to improve performance.

 filename="udevd.diff"
2005-04-26 21:35:13 -07:00
kay.sievers@vrfy.org
7b9b183921 [PATCH] udevinfo patch
On Fri, Mar 26, 2004 at 06:36:32PM +0500, Ananth N Mavinakayanahalli wrote:
> On Fri, Mar 26, 2004 at 11:24:39AM +0100, Kay Sievers wrote:
> > On Fri, Mar 26, 2004 at 11:21:29AM +0500, Ananth N Mavinakayanahalli wrote:
> > > On Fri, Mar 26, 2004 at 04:47:35AM +0100, Kay Sievers wrote:
> > > > On Fri, Mar 26, 2004 at 01:26:46AM +0100, Carl-Daniel Hailfinger wrote:
> > > > > Greg KH wrote:
> > > > > > On Tue, Mar 23, 2004 at 01:51:01PM -0800, Daniel Stekloff wrote:
> > > >
> > > > No, it breaks the net device handling. I think we should change
> > > > libsysfs instead, not to return a class device for '/block', if
> > > > we want to fix it.
> > >
> > > /sys/block is considered a sysfs "class" and not a class_device. So,
> > > going by udevinfo's help, -p expects path to a class_device and _not_
> > > a class itself and hence option /sys/block with -p is not a valid query.
> > >
> > > Kay?
> >
> > Yes, it's invalid, but we shouldn't print major minor for a invalid
> > path. sysfs_open_class_device_path("/block") returns a device. If this is
> > the right behavior for libsysfs, I will change the get_device_type("/block")
> > not to return a 'b'-type.
>
> Libsysfs validates the path given to it for opening a class_device to be
> a valid directory; it does not however validate if the path is a valid
> class_device path. So, in the case of udevinfo, a 'b' type should not
> be returned if the path is just /sys/block or /sys/block/

This may prevent it.
2005-04-26 21:35:13 -07:00
atul.sabharwal@intel.com
c1f8ea9562 [PATCH] Add README for chassis_id 2005-04-26 21:35:13 -07:00
hare@suse.de
0536819cca [PATCH] fix SEGV in libsysfs/dlist.c
Hi all, Greg,

libsysfs/dlist.c: _dlist_mark_move()

is missing checks for empty lists and may (and indeed, does) crash when=20
called with empty dlists.
2005-04-26 21:35:13 -07:00
greg@kroah.com
0bcdc8498c [PATCH] clean up chassis_id coding style. 2005-04-26 21:35:13 -07:00
atul.sabharwal@intel.com
fa5acd760d [PATCH] Add chassis_id program to extras directory 2005-04-26 21:35:13 -07:00
greg@kroah.com
52a8572366 [PATCH] clean up the OSDL document formatting a bit 2005-04-26 21:35:13 -07:00
maryedie@osdl.org
4012ff38d8 [PATCH] add OSDL documentation for persistent naming 2005-04-26 21:35:13 -07:00
greg@kroah.com
150aa5aaf1 [PATCH] add netlink rules to devfs and gentoo rules files. 2005-04-26 21:35:13 -07:00
greg@kroah.com
b085ec0d56 [PATCH] added USB device rules to rules files. 2005-04-26 21:35:13 -07:00
greg@kroah.com
b579916fb5 [PATCH] clean up the gentoo rules file a bit more, adding dri rules. 2005-04-26 21:35:13 -07:00
greg@kroah.com
69b94397d3 [PATCH] fix up udev.rules to handle oss rules better.
Patch from Jordan <lx_xero@comcast.net>
2005-04-26 21:35:12 -07:00
greg@kroah.com
6d472fe777 [PATCH] 023_bk mark 2005-04-26 21:35:12 -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
949e32f224 [PATCH] apply all_partitions rule to main block device only
Rules with NAME{all_partitions}= are now applied only to the parent of a
block device. We no longer need to exclude the partitions or sg* devices.
2005-04-26 21:35:12 -07:00
md@Linux.IT
c2818554ce [PATCH] small ide-devfs.sh fix
The file may not exist and errors would be spewed on the console.
2005-04-26 21:35:12 -07:00
greg@kroah.com
d0dede8f9a [PATCH] fix udev.spec file for where udevtest should be placed. 2005-04-26 21:35:12 -07:00
greg@kroah.com
04b902d5bf [PATCH] v023 release 2005-04-26 21:35:12 -07:00
greg@kroah.com
df73b398de [PATCH] create the /etc/dev.d/ directories in 'make install' 2005-04-26 21:35:12 -07:00
greg@kroah.com
1f5caf43c8 [PATCH] actually have udev run files ending in .dev in the /etc/dev.d/ directory as documented. 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
3e33961b45 [PATCH] added RFC-dev.d document detailing how /etc/dev.d/ works. 2005-04-26 21:35:11 -07:00
greg@kroah.com
b658bc09a1 [PATCH] fixed up udev.spec to handle selinux stuff properly now. 2005-04-26 21:35:11 -07:00
greg@kroah.com
5476249ffd [PATCH] remove USE_DBUS and USE_SELINUX flags from the README as they are no longer present. 2005-04-26 21:35:11 -07:00
greg@kroah.com
7e2fb86463 [PATCH] remove selinux stuff from the main Makefile 2005-04-26 21:35:11 -07:00
greg@kroah.com
0384e43ad9 [PATCH] move udev_selinux into extras/selinux 2005-04-26 21:35:11 -07:00
greg@kroah.com
6fb7313bad [PATCH] fix dbus build in the udev.spec file. 2005-04-26 21:35:11 -07:00
greg@kroah.com
8860693949 [PATCH] remove dbus stuff from main Makefile
Not needed now that it's in extras.
2005-04-26 21:35:11 -07:00
greg@kroah.com
357f44a534 [PATCH] move udev_dbus to extras/dbus
Should build now, but might have linking problems.
2005-04-26 21:35:11 -07:00
greg@kroah.com
c5039077b7 [PATCH] udev_dbus can now compile properly, but linnking is another story... 2005-04-26 21:35:11 -07:00
greg@kroah.com
ddc8f83132 [PATCH] remove udev_dbus.h from Makefile 2005-04-26 21:35:11 -07:00
greg@kroah.com
b528cd4920 [PATCH] first cut at standalone udev_selinux program.
Will not work, need to finish working on this on a system with selinux installed...
2005-04-26 21:35:11 -07:00
greg@kroah.com
eddf1bca24 [PATCH] remove selinux support from udev core as it's no longer needed. 2005-04-26 21:35:11 -07:00
greg@kroah.com
3bfbe50bd8 [PATCH] first cut at standalone udev_dbus program.
Will not work, need to finish working on this on a system with dbus installed...
2005-04-26 21:35:11 -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
greg@kroah.com
7e371e86a4 [PATCH] remove dbus code from core udev code as it's no longer needed to be there. 2005-04-26 21:35:11 -07:00
greg@kroah.com
dd64e26b0c [PATCH] add /etc/dev.d/ support for udev add and remove events. 2005-04-26 21:35:11 -07:00
greg@kroah.com
615ba3e82b [PATCH] fix build error in namedev.c caused by previous patch. 2005-04-26 21:35:11 -07:00
dsteklof@us.ibm.com
a291a14b90 [PATCH] udevinfo patch
I think this is what you want for udevinfo. Patched against the latest BK
tree. I tested it and it seemed to work.

One other question, shouldn't udevinfo.c:print_all_attributes() check to
make sure attr->method is SYSFS_METHOD_SHOW along with checking to see
if attr->value != NULL or doesn't that matter?

Here's the libsysfs fix for print_device_chain():
2005-04-26 21:35:10 -07:00
kay.sievers@vrfy.org
ddd5b5dc48 [PATCH] correct apply_format() for symlink only rules
Patch from Andrey, which restores the ability to use RESULT values in a
"symlink only" rule. We need to call apply_format() directly after
the matching rule, otherwise the RESULT value may be lost.
2005-04-26 21:35:10 -07:00
kay.sievers@vrfy.org
2a94c8777e [PATCH] don't init namedev on remove
Is there any reason to parse the rules for a remove event?
Without it, our test script needs only 2.1 seconds instead of 2.5,
so we have 19 percent more time for testing now :)
2005-04-26 21:35:10 -07:00
olh@suse.de
4474484153 [PATCH] uninitialized variable for mknod and friend
mknod gets an uninitialized variable, which leads to interesting file
modes. the bug is in namedev, devices with no match must not use the
uninitialized stuff were dev points to.
2005-04-26 21:35:10 -07:00
greg@kroah.com
fdcfcec707 [PATCH] 022_bk tag 2005-04-26 21:35:10 -07:00
greg@kroah.com
93e6b62cbd [PATCH] fix 'make spotless' to really do that in klibc.
bah, this took me forever to figure out why I couldn't build with klibc on
on box...
2005-04-26 21:35:10 -07:00
kay.sievers@vrfy.org
b608ade8e4 [PATCH] first stupid try for a rule compose gui
On Mon, Mar 15, 2004 at 09:28:17PM +0100, Kay Sievers wrote:
> Here is a first simple and pretty stupid try to make a simple tool for
> composing of a udev rule.
>
> It reads the udevdb to get all currently handled devices and presents a
> list, where you can choose the device to compose the rule for.
>
> The composed rule is just printed out in a window, nothing else by now.
>
> Do we want something like this?
> Nevermind, I always wanted to know, how this newt thing works :)

Here is the next step, I still can't sleep and there are to many patches
pending to make something useful :)
Cause nobody wanted to play with me, I've made a screenshot.
The device list is sorted in alphabetical order now and if there are only
a few recently discovered devices, they are placed on top of the list.

For those who want to have a look:

  http://vrfy.org/projects/udev/udevruler.png

The patch applies on top of today's mmap() patch. The db format is
changed to have the file and line number of the applied rule. So it
should be easy to edit the matching rule with this beast. It compiles
with "make all udevruler".
2005-04-26 21:35:10 -07:00
greg@kroah.com
166612d79d [PATCH] add a question/answer about automounting usb devices to the FAQ.
Thanks to bert hubert <ahu@ds9a.nl> for the text.
2005-04-26 21:35:10 -07:00