Commit graph

47 commits

Author SHA1 Message Date
Kay Sievers fb6e4c2824 add DEVLINKS to the event environment
Multiple symlinks are separated by a space character.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-12-17 16:20:51 +01:00
Kay Sievers c602535043 remove default settings in udev.conf
Changing the default values in udev.conf will render allmost
all current systems unusable. So just remove the settings that
can't be changed anyway.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-12-16 21:16:32 +01:00
Kay Sievers fc55cf68ca remove "udev_db" option from config file
All udev state is kept in /$udev_root/.udev/ now. No option to
configure that anymore, it will always be there.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-11-16 04:14:15 +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
Marco d'Itri df4e89bfa6 move some logging from dbg() to info() 2005-11-07 18:52:03 +01:00
Marco d'Itri ff3e4bed21 add strerror() to error logs 2005-11-07 18:44:18 +01:00
Kay Sievers 40caaeec51 cleanup some debug output and move to info level + unify select() loops
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-15 11:57:04 +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 c44563817a fake also kernel-name if we renamed a netif
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-07-03 14:32:22 +02:00
Kay Sievers 57663b364b remove device node, when type block/char has changed
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-18 10:57:10 +02:00
Kay Sievers c07669bd66 udev: handle all events - not only class and block devices
Handle all events with rules. If udev is expected to handle hotplug.d/
the exernal helper must be called.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-06-05 15:55:29 +02:00
kay.sievers@vrfy.org 024780c2ed [PATCH] selinux: fix handling during creation of symlinks
Patch from: Dan Walsh <dwalsh@redhat.com>
2005-04-26 23:55:01 -07:00
tklauser@access.unizh.ch 15139b8a62 [PATCH] fix stupid all_partitions bug
> On Mon, 2005-04-11 at 14:55 +0200, Norbert Preining wrote:
> > On Mon, 11 Apr 2005, Kay Sievers wrote:
> > > > brw-rw----  1 root root 8, 0 2005-04-10 14:58 /dev/sdcard
> > > > brw-rw----  1 root root 8, 1 2005-04-10 14:58 /dev/sdcard1
> > > > brw-rw----  1 root root 8, 1 2005-04-10 14:58 /dev/sdcard2
> > > > brw-rw----  1 root root 8, 1 2005-04-10 14:58 /dev/sdcard3
> > > 
> > > This looks broken.
> > 
> > Good to hear.

Yeah, I guess it's broken. In create_node() in udev_add.c there is
always added 1 to the minor number, thus the error. The attached patch
should fix this.
2005-04-26 23:55:01 -07:00
kay.sievers@vrfy.org 821d0ec803 [PATCH] add RUN key to be able to run rule based notification
SUBSYSTEM=="block", RUN="/sbin/program"
  will execute the program only for block device events.

ACTION="remove", SUBSYSTEM=="block", RUN"/sbin/program"
  will execute the program, if a block device is removed.
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 68c2c0b5b1 [PATCH] fix bad typo that prevents the GROUP to be applied
Thanks to Jim Gifford <maillist@jg555.com> for catching it.
2005-04-26 23:53:53 -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
Greg KH 4d7726399b selinux merge fixups again... 2005-04-26 23:52:14 -07:00
kay.sievers@vrfy.org 783272f045 [PATCH] don't lookup "root" in the userdb 2005-04-26 23:51:00 -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 57e1a2770c [PATCH] remove Makefile magic for klibc integration
The new libsysfs and klibc don't need that anymore.
Wrap getpwnam(), so we can use the built-in /etc/passwd
parser for statically compiled glibc binaries too.
2005-04-26 23:48:48 -07:00
kay.sievers@vrfy.org 03fd7a3ad3 [PATCH] replace weird defines by real code 2005-04-26 23:48:48 -07:00
kay.sievers@vrfy.org e48fc108d9 [PATCH] allow unlimitied count of symlinks 2005-04-26 23:48:48 -07:00
Greg KH 7eb92135c6 more merge fixups, looks like i missed a selinux patch somewhere... 2005-04-26 23:48:29 -07:00
pebenito@gentoo.org b55e654026 [PATCH] udev selinux fix
Here is a fix for the SELinux part of udev.

Setfscreatecon() overrides the default labeling behavior of SELinux when
creating files, so it should only be used for as short of a time as
possible, around the mknod or symlink calls.  Without this, the files in
udev_db get the wrong label because the fscreatecon is reset after the
udev_db file creation instead of before.  I'm guessing the Redhat people
missed this because they modify udev_db to be one big file instead of a
directory of small files (at least that's what I'm told).  I created
selinux_resetfscreatecon() to reset the fscreatecon asap after the
file/node is created.

Fixed a memory leak in selinux_init.  Getfscreatecon() allocates memory
for the context, and the udev code was immediately setting the pointer
(security_context_t is actually a typedef'ed char*) to NULL after the
call regardless of success/failure.  If you're wondering about the case
where there's effectively a setfscreatecon(NULL), this is ok, as its
used to tell SELinux to do the default labeling behavior.

Renamed selinux_restore() to selinux_exit() due to the changed behavior.

Fixed a couple of dbg() messages.
2005-04-26 23:39: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 7e720bd4ad [PATCH] switch major/minor to dev_t 2005-04-26 23:36:13 -07:00
kay.sievers@vrfy.org fd9efc00a2 [PATCH] introduce OPTIONS=ignore_device, ignore_remove, all_partitions" key
Here we move all possible options into a own key to make it possible
to have options-only rules.

The options on the NAME key are removed from the man page and will
be removed from a future version of udev.

For ignore rules, OPTIONS="ignore" should be used.

The rule:
  SUBSYSTEM="block", SYSFS{removable}="1", OPTIONS="all_partitions"

will create all partitions for a block device which is known to have
removable media (a check for cdrom drives would be needed too).
2005-04-26 23:36:12 -07:00
kay.sievers@vrfy.org 6a24dc7477 [PATCH] fix special file mode mask for temporary device node 2005-04-26 23:33:50 -07:00
kay.sievers@vrfy.org 6d56416665 [PATCH] create /block/*/range count of partitons for all_partitions 2005-04-26 23:27:41 -07:00
kay.sievers@vrfy.org c1ab046124 [PATCH] provide temporary device node for callouts to access the device
%N will create a temporary node for a callout a be sustituted with the
name of the node.
2005-04-26 23:27:32 -07:00
kay.sievers@vrfy.org fbda4a34d8 [PATCH] selinux: cleanup udev integration
Move code into a .c-file instead of big inline functions in a header file.
Pass the device name down instead of relying that the node name is equal
to the kernel name.
2005-04-26 23:24:19 -07:00
mbuesch@freenet.de 85a953c0ee [PATCH] The attached patch fixes the code path if namedev_name_device() fails. 2005-04-26 23:24:19 -07:00
kay.sievers@vrfy.org eabfc97367 [PATCH] handle renamed network interfaces properly if we manage hotplug.d/
If we take over the hotplug call and manage the events we don't need
to call the event fake script in dev.d/. Just set all expected values
to the new network interface name and call hotplug.d/. This way the
device renaming is completely handled inside of udev and userspace
can't get confused.
2005-04-26 23:19:09 -07:00
kay.sievers@vrfy.org 65ab133412 [PATCH] simplify permission application
We have only one source of permissions now, so apply the default
permissions at udev init.
2005-04-26 23:19:09 -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 8673dcb842 [PATCH] Make dev.d/ handling a separate processing stage
Move the logic when and how to call the dev.d/ scripts into the
main processing path.
2005-04-26 22:25:09 -07:00
kay.sievers@vrfy.org 2b41e68a08 [PATCH] replace tdb database by simple lockless file database
This makes the udev operation completely lockless by storing a
file for every node in /dev/.udevdb/* This solved the problem
with deadlocking concurrent udev processes waiting for each other
to release the file lock under heavy load.
2005-04-26 22:16:40 -07:00
kay.sievers@vrfy.org f8c1ccde6a [PATCH] improve klibc fixup integration 2005-04-26 22:06:44 -07:00
kay.sievers@vrfy.org 9cd1b46a13 [PATCH] $local user
We once implemented the devfsd feature to set the owner of a device node
to the "local" user. This was before we had the dev.d/ scripts. We discussed
a similar issue with D-BUS recently and this should be better handled depending
on the distributions way to do such a thing.

I'm for removing this here as this can be easily covered by a dev.d/
script.

Here is the patch if nobody objects :)
2005-04-26 22:02:46 -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
kay.sievers@vrfy.org 707680b1cf [PATCH] remove sleeps from udev as it is external now
Here we remove all the sysfs sleep loops from udev as wait_for_sysfs
will do this for us and any other hotplug user. We still keep a small
blacklist of subsystems we don't care about but any missing entry here
will no longer lead to a spinning udev waiting for files.
2005-04-26 22:02:44 -07:00
kay.sievers@vrfy.org 7e89a569cc [PATCH] prevent deadlocks on an corrupt udev database
Here is the patch, that should prevent all of the known deadlocks with
corrupt tdb databases we discovered.
Thanks to Frank Steiner <fsteiner-mail@bio.ifi.lmu.de>, who tested all this
endlessly with a NFS mounted /dev. The conclusion is, that udev will not work
on filesystems without proper record locking, but we should prevent the
endless loops anyway. This patch implements:

o recovery from a corrupted udev database. udev will continue
  without database support now, instead of doing nothing. So the node should
  be generated in any case, remove will obviously not work for custom names.

o added iteration limits to the tdb-code at the places we discovered endless
  loops. In the case tdb tries to find more than 100.000 entries with the
  same hash, we better give up :)

o prevent a {all_partitions} loop caused by corrupt db data

o log all tdb errors to syslog

o switch sleep() to usleep() cause we want to use alarm()
2005-04-26 21:47:44 -07:00
greg@kroah.com c850706e84 [PATCH] rename files to have '_' instead of '-' in them.
We should be consistent in our madness...
2005-04-26 21:47:44 -07:00
Renamed from udev-add.c (Browse further)