IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
Rules can be precompiled and stored on disk for initramfs, to avoid
parsing the rules with every event again and again. Also the OWNER and
GROUP names are already resolved to numerical values in the compiled
rules. This flag is used for the upcoming move of the rules parsing
into udevd:
If the real root is mounted udevd is started and parses the rules
only once. The event processes will inherit the already parsed rules
from the daemon, so we want to ignore any precompiled rules and
use the real rules files and watch the filesystem for changes to
reload the rules automatically.
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
RUN="socket:<name>" will send the environment in the kernel uevent
format to the named destination. Using the socket instead of the program
to pass the hotplug events to the HAL daemon, cuts down the running
time of udevstart from 0.8 to 0.4 seconds on my box.
env -i ACTION=add DEVPATH=/block/hda/hda1 strace -s10000 ./udev block
sendto(3, "add@/block/hda/hda1\0
ACTION=add\0DEVPATH=/block/hda/hda1\0UDEV_LOG=3\0
ID_TYPE=disk\0ID_MODEL=HTS726060M9AT00\0ID_SERIAL=MRH401M4G6UM9B\0
ID_REVISION=MH4OA6BA\0ID_BUS=ata\0ID_PATH=pci-0000:00:1f.1-ide-0:0\0
ID_FS_USAGE=other\0ID_FS_TYPE=swap\0ID_FS_VERSION=2\0
ID_FS_UUID=9352cfef-7687-47bc-a2a3-34cf136f72e1\0
ID_FS_LABEL=ThisIsSwap\0ID_FS_LABEL_SAFE=ThisIsSwap\0
DEVNAME=/dev/hda1\0"
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
This cuts down our 600 rules file to 98 kb instead of 1.9 Mb memory
or file-size with precompiled rules.
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Any program can query with udevinfo for persistent device
attributes evaluated on device discovery now.
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
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>
Modern rules are expected to call notification and postprocessing with
the RUN key. For compatibility the current behavior can be emulated
with an external helper.
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
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.
The slow logging facilites on some systems are a reason for
the reported slowness of udevstart. On one of my boxes udevstart
is down from 9 second to 0.3 seconds.
Remove the overwriting of main_argv[] hack and use the values
from the udev object.
Pass the udev object to call_foreach_file().
In the udevstart case, export SUBSYSTEM and UDEVSTART to the
environment.
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.
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.
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.
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.
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>
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>
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.
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"
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.
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.
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 :)