Commit graph

18 commits

Author SHA1 Message Date
kay.sievers@vrfy.org f608f8ac16 [PATCH] fix problems using scsi_id with udevstart
when udevstart was running we didn't set the environment and the
subsystem argument for the callouts the dev.d/ scripts.

Here is a fix, that sets that with every udevstart iteration, corrects
argv[0] to be the basename() only not the whole path  and adds a test
for invoking callouts without arguments.
2005-04-26 21:37:03 -07:00
harald@redhat.com a551c7b0ce [PATCH] PATCH some cleanups and security fixes
posted by Steve Grubb on https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=130351
2005-04-26 21:37:03 -07:00
greg@kroah.com 70f630f64b [PATCH] add a "first" list to udevstart and make it contain the class/mem/ devices
Seems some programs really want /dev/null to work properly :)
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
trini@kernel.crashing.org 2410242aa4 [PATCH] fix UDEV_NO_SLEEP
Move setting UDEV_NO_SLEEP into main().  I thought about moving
udev_init_config() around, but it still must be invoked in both udev and
udevstart cases, and before udev_hotplug() is called.  An alternative
would be to have main() do:
if (is_udevstart) {
	... current ...
} else {
	udev_init_config();
	return udev_hotplug();
}

And move setting UDEV_NO_SLEEP into udev_start().  I can redo it that
way, if you prefer.

Signed-off-by: Tom Rini <trini@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2005-04-26 21:36:59 -07:00
trini@kernel.crashing.org eb6c7cd036 [PATCH] Make udev/udevstart be one binary
Hi,

The following patch makes udev/udevstart be a common binary.  First,
doing this grows udev by a total of 1.8kB (ppc32, stripped) whereas
udevstart by itself is 6.4kB.  I know you mentioned being able to
replace udevstart with a script, but at 1.8kB I don't think it'll be
easy to beat this with size there.  Next, the following are by-eye
timings of before, after, and with devfs on a slow, but still usable
embedded platform (config stripped down to more-or-less bare for
ramdisk):
-- Embedded Planet RPX LITE, 64Mhz MPC 823e --
devfs         : 15.333s, 15.253s, 14.988s (15.191s avg)
udev-pristine : 18.675s, 18.079s, 18.418s (18.390s avg)
udev-multi    : 14.587s, 14.747s, 14.868s (14.734s avg)

The patch ends up being rather large to add this, as in doing so I ended
up making all refs (that I hit..) to devpath/subsystem be marked as
'const'.


Signed-off-by: Tom Rini <trini@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2005-04-26 21:36:59 -07:00
greg@kroah.com 462be028f1 [PATCH] fix stupid off-by-one bug that caused udevstart to die on x86-64 boxes. 2005-04-26 21:36:59 -07:00
greg@kroah.com fd87429578 [PATCH] fix dumb bug I added to udevstart 2005-04-26 21:36:59 -07:00
greg@kroah.com 0e306d087d [PATCH] make a "last list" of devices for udevstart to operate on last.
Should fix the dm startup issues, hopefully...
2005-04-26 21:36:59 -07:00
greg@kroah.com 57218a0873 [PATCH] reverse order of scanning of udevstart to look at class before block.
this should fix the startup issue for lvm, hopefully...
2005-04-26 21:36:21 -07:00
greg@kroah.com e13fa59953 [PATCH] udevstart: close open directories.
Based on a munged patch from Olaf Hering <olh@suse.de>
2005-04-26 21:35:17 -07:00
kay.sievers@vrfy.org 5df33ccd8e [PATCH] udevstart fix
Sorry, udevstart needs a small cleanup after my recent copy/pastes.
2005-04-26 21:35:14 -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
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
md@Linux.IT 3f20eac0a5 [PATCH] udevstart fixes
udevstart_no_retval: currently udevstart will always return rc=22
because of the error handling code. I completely removed it because it
is not used, and returning a generic error to the init script is not
much useful anyway.
2005-04-26 21:35:08 -07:00
kay.sievers@vrfy.org d00bd1724b [PATCH] overall trivial trivial cleanup
Here I try to make the style a bit more consistant in the different
files, so that new patches just copy the 'right' one :)

Some "magic" numbers are replaced and udevtest.c is catched up with udev.
2005-04-26 21:35:08 -07:00
kay.sievers@vrfy.org e4dc0e11c1 [PATCH] cleanup udevstart
I just wanted to terminate the snprintf() strings, cause I can see a
overflow with closed eyes after all the audit :)

But then I changed a bit more to bring it in line with the style of the
other files. I replaced the exec_udev() function with the one from
udevd, cause we don't need to read the stdout from udev.

Please have a look if it still works for you too and not
only for usernames with 3 characters :)
2005-04-26 21:35:07 -07:00
greg@kroah.com 82b9a63782 [PATCH] add udevstart program based on a old patch from Harald Hoyer <harald@redhat.com>
This can be used instead of the start_udev script for systems
that do not have a shell, or some other problem...
2005-04-26 21:35:07 -07:00