* [ANNOUNCE] udev 016 release
@ 2004-02-03 20:13 Greg KH
2004-02-03 20:49 ` Martin Schlemmer
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Greg KH @ 2004-02-03 20:13 UTC (permalink / raw)
To: linux-hotplug-devel, linux-kernel
I've released the 016 version of udev. It can be found at:
kernel.org/pub/linux/utils/kernel/hotplug/udev-016.tar.gz
rpms built against Red Hat FC1 are available at:
kernel.org/pub/linux/utils/kernel/hotplug/udev-016-1.i386.rpm
with the source rpm at:
kernel.org/pub/linux/utils/kernel/hotplug/udev-016-1.src.rpm
udev allows users to have a dynamic /dev and provides the ability to
have persistent device names. It uses sysfs and /sbin/hotplug and runs
entirely in userspace. It requires a 2.6 kernel with CONFIG_HOTPLUG
enabled to run. Please see the udev FAQ for any questions about it:
kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ
For any udev vs devfs questions anyone might have, please see:
kernel.org/pub/linux/utils/kernel/hotplug/udev_vs_devfs
Major changes from the 015 version:
- udev is now in 3 pieces:
udevsend - is called by /sbin/hotplug and bundles up the
hotplug event and sends it off to the udevd
daemon.
udevd - receives the hotplug messages from udevsend, sorts
them in the proper order, and runs udev for the
different devices.
udev - still the same. Does the actual device node creation
and removal.
This has been one of the major pieces missing for udev, and I
really want to thank Kay Sievers for all of his hard work on
this.
Right now, udevsend and udev are built against klibc (udevsend
is only 2.5Kb big), and udevd is linked dynamically against
glibc, due to it using pthreads. This is ok, as udev can
still be placed into initramfs and run at early boot, it's
only after init starts up that udevsend and udevd will kick
in.
Thanks also to everyone who has send me patches for this release, a full
list of everyone, and their changes is below.
udev development is done in a BitKeeper repository located at:
bk://linuxusb.bkbits.net/udev
Daily snapshots of udev from the BitKeeper tree can be found at:
http://www.codemonkey.org.uk/projects/bitkeeper/udev/
If anyone ever wants a tarball of the current bk tree, just email me.
thanks,
greg k-h
Summary of changes from v015 to v016
============================================
<elkropac:students.zcu.cz>:
o get_dev_number() in extras/ide-devfs.sh
<rrm3:rrm3.org>:
o FAQ udev.rules.devfs
Greg Kroah-Hartman:
o add udevd and udevsend to the spec file
o make /etc/hotplug.d/default/udev.hotplug symlink point to udevsend now
o add KERNEL_DIR option so that the distros will be happy
o make udevsend binary even smaller
o udevsend now almost compiles with klibc, struct sockaddr_un is only problem now
o fix up logging code so that it can be built without it being enabled
o rework the logging code so that each program logs with the proper name in the syslog
o remove logging.c as it's no longer needed
o kill the last examples that contained the %D option
o remove a __KLIBC__ tests in libsysfs, as klibc now supports getpagesize()
o udevd - remove stupid locking error I wrote
o update to klibc version 0.101, fixing the stdin bug
o fix Makefile typo for USE_LSB install
o 015_bk mark
o allow dbus code to actually build again
o v015 release TAG: v015
Kay Sievers:
o let udevsend build with klibc
o udevd - config cleanup
o udevd - cleanup and better timeout handling
o fix possible buffer overflow
o udevd - next round of fixes
o udevinfo - missing options for man page
o udev - trivial style cleanup
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 016 release
2004-02-03 20:13 [ANNOUNCE] udev 016 release Greg KH
@ 2004-02-03 20:49 ` Martin Schlemmer
2004-02-03 23:14 ` Greg KH
2004-02-03 21:28 ` Martin Schlemmer
2004-02-03 21:43 ` Martin Schlemmer
2 siblings, 1 reply; 14+ messages in thread
From: Martin Schlemmer @ 2004-02-03 20:49 UTC (permalink / raw)
To: Greg KH; +Cc: linux-hotplug-devel, Linux Kernel Mailing Lists
[-- Attachment #1: Type: text/plain, Size: 544 bytes --]
On Tue, 2004-02-03 at 22:13, Greg KH wrote:
>
> Right now, udevsend and udev are built against klibc (udevsend
> is only 2.5Kb big), and udevd is linked dynamically against
> glibc, due to it using pthreads. This is ok, as udev can
> still be placed into initramfs and run at early boot, it's
> only after init starts up that udevsend and udevd will kick
> in.
>
I am guessing this breaks group names (and not gid's) in
udev.permissions? Or was support added to klibc?
Thanks,
--
Martin Schlemmer
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 016 release
2004-02-03 20:13 [ANNOUNCE] udev 016 release Greg KH
2004-02-03 20:49 ` Martin Schlemmer
@ 2004-02-03 21:28 ` Martin Schlemmer
2004-02-03 23:03 ` Martin Schlemmer
2004-02-03 21:43 ` Martin Schlemmer
2 siblings, 1 reply; 14+ messages in thread
From: Martin Schlemmer @ 2004-02-03 21:28 UTC (permalink / raw)
To: Greg KH; +Cc: linux-hotplug-devel, Linux Kernel Mailing Lists
[-- Attachment #1: Type: text/plain, Size: 1831 bytes --]
On Tue, 2004-02-03 at 22:13, Greg KH wrote:
Except if I miss something major, udevsend and udevd still do not
work:
--
# (export ACTION=add; export DEVPATH=/class/vc/vcsa7; strace -ff udevsend vc)
execve("/sbin/udevsend", ["udevsend", "vc"], [/* 55 vars */]) = 0
uname({sys="Linux", node="nosferatu", ...}) = 0
brk(0) = 0x804a000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000
open("/etc/ld.so.preload", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
close(3) = 0
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=79499, ...}) = 0
mmap2(NULL, 79499, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40018000
close(3) = 0
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\31Y\1\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1573165, ...}) = 0
mmap2(NULL, 1256716, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4002c000
mmap2(0x40159000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x12c) = 0x40159000
mmap2(0x4015d000, 7436, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4015d000
close(3) = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0x40017a80, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
munmap(0x40018000, 79499) = 0
open("/dev/urandom", O_RDONLY) = 3
read(3, "\31\317w\302n\v\0354\261\232\247\251\314\3\351O\256Yd\347"..., 32) = 32
close(3) = 0
exit_group(1) = ?
--
Btw - using NPTL over here ...
--
Martin Schlemmer
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 016 release
2004-02-03 20:13 [ANNOUNCE] udev 016 release Greg KH
2004-02-03 20:49 ` Martin Schlemmer
2004-02-03 21:28 ` Martin Schlemmer
@ 2004-02-03 21:43 ` Martin Schlemmer
2004-02-11 22:13 ` Greg KH
2 siblings, 1 reply; 14+ messages in thread
From: Martin Schlemmer @ 2004-02-03 21:43 UTC (permalink / raw)
To: Greg KH; +Cc: linux-hotplug-devel, Linux Kernel Mailing Lists
[-- Attachment #1.1: Type: text/plain, Size: 758 bytes --]
On Tue, 2004-02-03 at 22:13, Greg KH wrote:
Once again, patch to make logging a config option.
Reason for this (since you asked for it =):
- In our setup it is easy (although still annoying) .. just
edit the ebuild, add logging support (or remove it) and rebuild.
For say a binary distro, having the logging is useful for debugging
some times, but its more a once of, or rare thing, as you do not
add or change config files every day. Sure, we can have logging
by default, but many do not want ~300 lines of extra debugging in
their logs is not pleasant, and they will complain. Rebuilding
the package for that binary package (given the users it is targeted
to) is usually not within most users grasp.
Thanks,
--
Martin Schlemmer
[-- Attachment #1.2: udev-016-logging-config-option.patch --]
[-- Type: text/x-patch, Size: 4176 bytes --]
diff -uprN udev-016/Makefile udev-016.logging/Makefile
--- udev-016/Makefile 2004-02-03 22:55:30.201851776 +0200
+++ udev-016.logging/Makefile 2004-02-03 23:03:55.869978536 +0200
@@ -239,6 +239,7 @@ udev_version.h:
@echo \#define UDEV_CONFIG_FILE \"$(configdir)\udev.conf\" >> $@
@echo \#define UDEV_RULES_FILE \"$(configdir)\udev.rules\" >> $@
@echo \#define UDEV_PERMISSION_FILE \"$(configdir)\udev.permissions\" >> $@
+ @echo \#define UDEV_LOG_DEFAULT \"yes\" >> $@
@echo \#define UDEV_BIN \"$(DESTDIR)$(sbindir)/udev\" >> $@
@echo \#define UDEVD_BIN \"$(DESTDIR)$(sbindir)/udevd\" >> $@
@echo \#define UDEVD_SOCK \"$(udevdir)/\.udevd.sock\" >> $@
diff -uprN udev-016/etc/udev/udev.conf.in udev-016.logging/etc/udev/udev.conf.in
--- udev-016/etc/udev/udev.conf.in 2004-02-03 22:58:34.939767344 +0200
+++ udev-016.logging/etc/udev/udev.conf.in 2004-02-03 22:56:46.535247336 +0200
@@ -29,3 +29,6 @@ default_owner="root"
# explicit match in the permissions file
default_group="root"
+# udev_log - set to "yes" if you want logging, else "no"
+udev_log="yes"
+
diff -uprN udev-016/logging.h udev-016.logging/logging.h
--- udev-016/logging.h 2004-02-02 11:34:49.000000000 +0200
+++ udev-016.logging/logging.h 2004-02-03 23:04:51.204566400 +0200
@@ -33,6 +33,9 @@
#include <stdarg.h>
#include <syslog.h>
+#include "udev.h"
+#include "udev_version.h"
+
#undef info
#define info(format, arg...) \
do { \
@@ -62,6 +65,9 @@ static inline void log_message (int leve
{
va_list args;
+ if (0 != strncmp(udev_log_str, UDEV_LOG_DEFAULT, BOOL_SIZE))
+ return;
+
va_start(args, format);
vsyslog(level, format, args);
va_end(args);
diff -uprN udev-016/udev.h udev-016.logging/udev.h
--- udev-016/udev.h 2004-01-26 22:24:42.000000000 +0200
+++ udev-016.logging/udev.h 2004-02-03 23:03:25.682567720 +0200
@@ -32,6 +32,8 @@
#define OWNER_SIZE 30
#define GROUP_SIZE 30
#define MODE_SIZE 8
+#define BOOL_SIZE 5 /* 'yes', 'no' and possibly 'true' or 'false'
+ in future */
struct udevice {
char name[NAME_SIZE];
@@ -72,5 +74,6 @@ extern char udev_rules_filename[PATH_MAX
extern char default_mode_str[MODE_SIZE];
extern char default_owner_str[OWNER_SIZE];
extern char default_group_str[GROUP_SIZE];
+extern char udev_log_str[BOOL_SIZE];
#endif
diff -uprN udev-016/udev_config.c udev-016.logging/udev_config.c
--- udev-016/udev_config.c 2004-02-03 23:00:40.438688608 +0200
+++ udev-016.logging/udev_config.c 2004-02-03 22:56:46.649230008 +0200
@@ -48,6 +48,7 @@ char udev_config_filename[PATH_MAX+NAME_
char default_mode_str[MODE_SIZE];
char default_owner_str[OWNER_SIZE];
char default_group_str[GROUP_SIZE];
+char udev_log_str[BOOL_SIZE];
static void init_variables(void)
@@ -60,6 +61,7 @@ static void init_variables(void)
strfieldcpy(udev_config_filename, UDEV_CONFIG_FILE);
strfieldcpy(udev_rules_filename, UDEV_RULES_FILE);
strfieldcpy(udev_permissions_filename, UDEV_PERMISSION_FILE);
+ strfieldcpy(udev_log_str, UDEV_LOG_DEFAULT);
}
#define set_var(_name, _var) \
@@ -156,6 +158,7 @@ static int parse_config_file(void)
set_var("default_mode", default_mode_str);
set_var("default_owner", default_owner_str);
set_var("default_group", default_group_str);
+ set_var("udev_log", udev_log_str);
}
dbg_parse("%s:%d:%Zd: error parsing '%s'", udev_config_filename,
lineno, temp - line, temp);
@@ -191,6 +194,7 @@ static void get_dirs(void)
dbg_parse("udev_db_filename = %s", udev_db_filename);
dbg_parse("udev_rules_filename = %s", udev_rules_filename);
dbg_parse("udev_permissions_filename = %s", udev_permissions_filename);
+ dbg_parse("udev_log_str = %s", udev_log_str);
parse_config_file();
dbg_parse("udev_root = %s", udev_root);
@@ -198,6 +202,7 @@ static void get_dirs(void)
dbg_parse("udev_db_filename = %s", udev_db_filename);
dbg_parse("udev_rules_filename = %s", udev_rules_filename);
dbg_parse("udev_permissions_filename = %s", udev_permissions_filename);
+ dbg_parse("udev_log_str = %s", udev_log_str);
}
void udev_init_config(void)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 016 release
2004-02-03 21:28 ` Martin Schlemmer
@ 2004-02-03 23:03 ` Martin Schlemmer
2004-02-03 23:13 ` Greg KH
0 siblings, 1 reply; 14+ messages in thread
From: Martin Schlemmer @ 2004-02-03 23:03 UTC (permalink / raw)
To: Greg KH; +Cc: linux-hotplug-devel, Linux Kernel Mailing Lists
[-- Attachment #1.1: Type: text/plain, Size: 791 bytes --]
On Tue, 2004-02-03 at 23:28, Martin Schlemmer wrote:
> On Tue, 2004-02-03 at 22:13, Greg KH wrote:
>
> Except if I miss something major, udevsend and udevd still do not
> work:
>
Skip that, it does work if SEQNUM is set :P
Anyhow, is it _really_ needed for SEQNUM to be set? What about
the attached patch?
Then, order I have not really checked yet, but there are two things
that bother me:
1) latency is even higher than before (btw Greg, is there going to be
more sysfs/whatever fixes to get udev even faster, or is this the
limit?)
2) events gets missing. If you for example use udevsend in the
initscript that populate /dev (/udev), the amount of nodes/links
created is off with about 10-50 (once about 250) entries.
Thanks,
--
Martin Schlemmer
[-- Attachment #1.2: udev-016-udevsend-missing-seqnum.patch --]
[-- Type: text/x-patch, Size: 405 bytes --]
--- udev-016/udevsend.c 2004-02-04 00:55:23.522428312 +0200
+++ udev-016.seqnum/udevsend.c 2004-02-04 00:57:37.898000120 +0200
@@ -149,10 +149,14 @@
seqnum = get_seqnum();
if (seqnum == NULL) {
+#if 0
dbg("no seqnum");
goto exit;
+#endif
+ seq = 1;
+ } else {
+ seq = atoi(seqnum);
}
- seq = atoi(seqnum);
sock = socket(AF_LOCAL, SOCK_STREAM, 0);
if (sock == -1) {
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 016 release
2004-02-03 23:03 ` Martin Schlemmer
@ 2004-02-03 23:13 ` Greg KH
2004-02-04 0:01 ` Kay Sievers
2004-02-04 4:25 ` Martin Schlemmer
0 siblings, 2 replies; 14+ messages in thread
From: Greg KH @ 2004-02-03 23:13 UTC (permalink / raw)
To: Martin Schlemmer; +Cc: linux-hotplug-devel, Linux Kernel Mailing Lists
On Wed, Feb 04, 2004 at 01:03:33AM +0200, Martin Schlemmer wrote:
> On Tue, 2004-02-03 at 23:28, Martin Schlemmer wrote:
> > On Tue, 2004-02-03 at 22:13, Greg KH wrote:
> >
> > Except if I miss something major, udevsend and udevd still do not
> > work:
> >
>
> Skip that, it does work if SEQNUM is set :P
>
> Anyhow, is it _really_ needed for SEQNUM to be set? What about
> the attached patch?
Yes it is necessary, as that is what the kernel spits out. It's also
the whole reason we need udevd :)
If you don't want to give a SEQNUM, just call udev directly.
> Then, order I have not really checked yet, but there are two things
> that bother me:
>
> 1) latency is even higher than before (btw Greg, is there going to be
> more sysfs/whatever fixes to get udev even faster, or is this the
> limit?)
Care to measure the latency somehow? The first event is a bit slow, but
everything after that is as fast as I ever remember it being.
> 2) events gets missing. If you for example use udevsend in the
> initscript that populate /dev (/udev), the amount of nodes/links
> created is off with about 10-50 (once about 250) entries.
Hm, that's not good. I'll go test that and see what's happening.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 016 release
2004-02-03 20:49 ` Martin Schlemmer
@ 2004-02-03 23:14 ` Greg KH
0 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2004-02-03 23:14 UTC (permalink / raw)
To: Martin Schlemmer; +Cc: linux-hotplug-devel, Linux Kernel Mailing Lists
On Tue, Feb 03, 2004 at 10:49:51PM +0200, Martin Schlemmer wrote:
> On Tue, 2004-02-03 at 22:13, Greg KH wrote:
>
> >
> > Right now, udevsend and udev are built against klibc (udevsend
> > is only 2.5Kb big), and udevd is linked dynamically against
> > glibc, due to it using pthreads. This is ok, as udev can
> > still be placed into initramfs and run at early boot, it's
> > only after init starts up that udevsend and udevd will kick
> > in.
> >
>
> I am guessing this breaks group names (and not gid's) in
> udev.permissions? Or was support added to klibc?
Sorry, that should have read something to the effect that the .rpm is
built using klibc, and that udevd can't be build against it yet due to
pthreads being used.
It's entirely possible to build everything against glibc, and then you
get back the group name stuff for the udev.permission file.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 016 release
2004-02-03 23:13 ` Greg KH
@ 2004-02-04 0:01 ` Kay Sievers
2004-02-04 4:25 ` Martin Schlemmer
1 sibling, 0 replies; 14+ messages in thread
From: Kay Sievers @ 2004-02-04 0:01 UTC (permalink / raw)
To: Greg KH; +Cc: Martin Schlemmer, linux-hotplug-devel, Linux Kernel Mailing Lists
On Tue, Feb 03, 2004 at 03:13:41PM -0800, Greg KH wrote:
> On Wed, Feb 04, 2004 at 01:03:33AM +0200, Martin Schlemmer wrote:
> > On Tue, 2004-02-03 at 23:28, Martin Schlemmer wrote:
> > > On Tue, 2004-02-03 at 22:13, Greg KH wrote:
> > >
> > > Except if I miss something major, udevsend and udevd still do not
> > > work:
> > >
> >
> > Skip that, it does work if SEQNUM is set :P
> >
> > Anyhow, is it _really_ needed for SEQNUM to be set? What about
> > the attached patch?
>
> Yes it is necessary, as that is what the kernel spits out. It's also
> the whole reason we need udevd :)
>
> If you don't want to give a SEQNUM, just call udev directly.
Oh, never use this udevsend in any script. It expects the SEQNUM from
the kernel, not a random one from you! You will always get timeouts
everytime you use your own SEQNUM, like the timeout after the start of udevd.
If you really need udevsend, I can't imagine for what case, we need to
add some logic to it, to bypass the event ordering and waiting to put
the event straight to the exec_queue.
> > 2) events gets missing. If you for example use udevsend in the
> > initscript that populate /dev (/udev), the amount of nodes/links
> > created is off with about 10-50 (once about 250) entries.
Your are calling udevsend with your script?
> Hm, that's not good. I'll go test that and see what's happening.
thanks,
Kay
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 016 release
2004-02-03 23:13 ` Greg KH
2004-02-04 0:01 ` Kay Sievers
@ 2004-02-04 4:25 ` Martin Schlemmer
2004-02-08 11:27 ` Martin Schlemmer
1 sibling, 1 reply; 14+ messages in thread
From: Martin Schlemmer @ 2004-02-04 4:25 UTC (permalink / raw)
To: Greg KH; +Cc: linux-hotplug-devel, Linux Kernel Mailing Lists
[-- Attachment #1.1: Type: text/plain, Size: 1915 bytes --]
On Wed, 2004-02-04 at 01:13, Greg KH wrote:
> On Wed, Feb 04, 2004 at 01:03:33AM +0200, Martin Schlemmer wrote:
> > On Tue, 2004-02-03 at 23:28, Martin Schlemmer wrote:
> > > On Tue, 2004-02-03 at 22:13, Greg KH wrote:
> > >
> > > Except if I miss something major, udevsend and udevd still do not
> > > work:
> > >
> >
> > Skip that, it does work if SEQNUM is set :P
> >
> > Anyhow, is it _really_ needed for SEQNUM to be set? What about
> > the attached patch?
>
> Yes it is necessary, as that is what the kernel spits out. It's also
> the whole reason we need udevd :)
>
> If you don't want to give a SEQNUM, just call udev directly.
>
Ok, was just thinking it could lead to confusion with debug usually not
compiled in. Maybe a more visible error (as we then know it was outside
the kernel)?
> > Then, order I have not really checked yet, but there are two things
> > that bother me:
> >
> > 1) latency is even higher than before (btw Greg, is there going to be
> > more sysfs/whatever fixes to get udev even faster, or is this the
> > limit?)
>
> Care to measure the latency somehow? The first event is a bit slow, but
> everything after that is as fast as I ever remember it being.
>
Hmm, Ok, it seems it is much better on batch jobs (or if udevd is
running) then from clean start, sorry.
> > 2) events gets missing. If you for example use udevsend in the
> > initscript that populate /dev (/udev), the amount of nodes/links
> > created is off with about 10-50 (once about 250) entries.
>
> Hm, that's not good. I'll go test that and see what's happening.
>
Script is attached. If I was being silly here, let me know. Some
quick testing again, it seems like the missing events is more with
the echo not commented, but could be just some fluke (there was
still however more than 5 usually missing).
Thanks,
--
Martin Schlemmer
[-- Attachment #1.2: foo.sh --]
[-- Type: text/x-sh, Size: 1249 bytes --]
#!/bin/bash
SEQNUM=0
call_udev() {
export SEQNUM=$((SEQNUM + 1))
#echo "DEVPATH=$DEVPATH, CLASS=$1, SEQNUM=$SEQNUM"
/sbin/udevsend $1
}
populate_udev() {
local x=
local y=
local CLASS=
# Propogate /dev from /sys - we only need this while we do not
# have initramfs and an early user-space with which to do early
# device bring up
export ACTION=add
# Add block devices and their partitions
for x in /sys/block/*
do
# Add each drive
export DEVPATH="${x#/sys}"
call_udev block
# Add each partition, on each device
for y in ${x}/*
do
if [ -f "${y}/dev" ]
then
export DEVPATH="${y#/sys}"
call_udev block
fi
done
done
# All other device classes
for x in /sys/class/*
do
for y in ${x}/*
do
if [ -f "${y}/dev" ]
then
CLASS="$(echo "${x#/sys}" | cut --delimiter='/' --fields=3-)"
export DEVPATH="${y#/sys}"
call_udev ${CLASS}
fi
done
done
unset ACTION DEVPATH
return 0
}
populate_udev
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 016 release
2004-02-04 4:25 ` Martin Schlemmer
@ 2004-02-08 11:27 ` Martin Schlemmer
2004-02-08 13:01 ` Martin Schlemmer
0 siblings, 1 reply; 14+ messages in thread
From: Martin Schlemmer @ 2004-02-08 11:27 UTC (permalink / raw)
To: Greg KH; +Cc: linux-hotplug-devel, Linux Kernel Mailing Lists
[-- Attachment #1: Type: text/plain, Size: 825 bytes --]
On Wed, 2004-02-04 at 06:25, Martin Schlemmer wrote:
> > > 2) events gets missing. If you for example use udevsend in the
> > > initscript that populate /dev (/udev), the amount of nodes/links
> > > created is off with about 10-50 (once about 250) entries.
> >
> > Hm, that's not good. I'll go test that and see what's happening.
> >
>
> Script is attached. If I was being silly here, let me know. Some
> quick testing again, it seems like the missing events is more with
> the echo not commented, but could be just some fluke (there was
> still however more than 5 usually missing).
>
Btw, I also get this now and then for /dev/snd/* stuff. I had a few
times already where controlC0 was not created (and this is after the
script runs to generate /dev ...).
Thanks,
--
Martin Schlemmer
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 016 release
2004-02-08 11:27 ` Martin Schlemmer
@ 2004-02-08 13:01 ` Martin Schlemmer
0 siblings, 0 replies; 14+ messages in thread
From: Martin Schlemmer @ 2004-02-08 13:01 UTC (permalink / raw)
To: Greg KH; +Cc: linux-hotplug-devel, Linux Kernel Mailing Lists, Kay Sievers
[-- Attachment #1: Type: text/plain, Size: 1132 bytes --]
On Sun, 2004-02-08 at 13:27, Martin Schlemmer wrote:
> On Wed, 2004-02-04 at 06:25, Martin Schlemmer wrote:
>
> > > > 2) events gets missing. If you for example use udevsend in the
> > > > initscript that populate /dev (/udev), the amount of nodes/links
> > > > created is off with about 10-50 (once about 250) entries.
> > >
> > > Hm, that's not good. I'll go test that and see what's happening.
> > >
> >
> > Script is attached. If I was being silly here, let me know. Some
> > quick testing again, it seems like the missing events is more with
> > the echo not commented, but could be just some fluke (there was
> > still however more than 5 usually missing).
> >
>
> Btw, I also get this now and then for /dev/snd/* stuff. I had a few
> times already where controlC0 was not created (and this is after the
> script runs to generate /dev ...).
>
I should clarify here - /dev is generated, and only _after_ that the
sound modules is loaded which should then get /dev/snd/* created. It
is thus not as many nodes as /dev creation that also causes missing
events ...
--
Martin Schlemmer
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 016 release
2004-02-03 21:43 ` Martin Schlemmer
@ 2004-02-11 22:13 ` Greg KH
2004-02-11 22:27 ` Martin Schlemmer
0 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2004-02-11 22:13 UTC (permalink / raw)
To: Martin Schlemmer; +Cc: linux-hotplug-devel, Linux Kernel Mailing Lists
On Tue, Feb 03, 2004 at 11:43:22PM +0200, Martin Schlemmer wrote:
> On Tue, 2004-02-03 at 22:13, Greg KH wrote:
>
> Once again, patch to make logging a config option.
>
> Reason for this (since you asked for it =):
> - In our setup it is easy (although still annoying) .. just
> edit the ebuild, add logging support (or remove it) and rebuild.
> For say a binary distro, having the logging is useful for debugging
> some times, but its more a once of, or rare thing, as you do not
> add or change config files every day. Sure, we can have logging
> by default, but many do not want ~300 lines of extra debugging in
> their logs is not pleasant, and they will complain. Rebuilding
> the package for that binary package (given the users it is targeted
> to) is usually not within most users grasp.
Ok, I applied this patch.
And then I went back and fixed it so it actually would work :(
Here's the changes I had to make to get everything to build properly,
and to let us have a boolean type for the config files.
thanks,
greg k-h
# fix log option code so that it actually works for all udev programs.
# Also introduce boolean type for config file to use.
diff -Nru a/logging.h b/logging.h
--- a/logging.h Wed Feb 11 14:10:36 2004
+++ b/logging.h Wed Feb 11 14:10:36 2004
@@ -34,9 +34,6 @@
#include <unistd.h>
#include <syslog.h>
-#include "udev.h"
-#include "udev_version.h"
-
#undef info
#define info(format, arg...) \
do { \
@@ -60,22 +57,23 @@
} while (0)
#endif
+/* each program must declare this variable and function somewhere */
+extern unsigned char logname[42];
+extern int log_ok(void);
+
static void log_message (int level, const char *format, ...)
__attribute__ ((format (printf, 2, 3)));
static inline void log_message (int level, const char *format, ...)
{
va_list args;
- if (0 != strncmp(udev_log_str, UDEV_LOG_DEFAULT, BOOL_SIZE))
+ if (!log_ok())
return;
va_start(args, format);
vsyslog(level, format, args);
va_end(args);
}
-
-/* each program must declare this variable somewhere */
-extern unsigned char logname[42];
#undef init_logging
static inline void init_logging(char *program_name)
diff -Nru a/test/ignore_test b/test/ignore_test
--- a/test/ignore_test Wed Feb 11 14:10:36 2004
+++ b/test/ignore_test Wed Feb 11 14:10:36 2004
@@ -16,6 +16,7 @@
udev_db="$PWD/udev/.udev.tdb"
udev_rules="$PWD/$RULES"
udev_permissions="$PWD/udev.permissions"
+udev_log="true"
EOF
mkdir udev
diff -Nru a/udev.c b/udev.c
--- a/udev.c Wed Feb 11 14:10:36 2004
+++ b/udev.c Wed Feb 11 14:10:36 2004
@@ -40,6 +40,11 @@
char **main_envp;
unsigned char logname[42];
+int log_ok(void)
+{
+ return udev_log;
+}
+
static void sig_handler(int signum)
{
dbg("caught signal %d", signum);
diff -Nru a/udev.h b/udev.h
--- a/udev.h Wed Feb 11 14:10:36 2004
+++ b/udev.h Wed Feb 11 14:10:36 2004
@@ -32,8 +32,6 @@
#define OWNER_SIZE 30
#define GROUP_SIZE 30
#define MODE_SIZE 8
-#define BOOL_SIZE 5 /* 'yes', 'no' and possibly 'true' or 'false'
- in future */
struct udevice {
char name[NAME_SIZE];
@@ -74,6 +72,6 @@
extern char default_mode_str[MODE_SIZE];
extern char default_owner_str[OWNER_SIZE];
extern char default_group_str[GROUP_SIZE];
-extern char udev_log_str[BOOL_SIZE];
+extern int udev_log;
#endif
diff -Nru a/udev_config.c b/udev_config.c
--- a/udev_config.c Wed Feb 11 14:10:36 2004
+++ b/udev_config.c Wed Feb 11 14:10:36 2004
@@ -48,9 +48,18 @@
char default_mode_str[MODE_SIZE];
char default_owner_str[OWNER_SIZE];
char default_group_str[GROUP_SIZE];
-char udev_log_str[BOOL_SIZE];
+int udev_log;
+static int string_is_true(char *str)
+{
+ if (strcasecmp(str, "true") == 0)
+ return 1;
+ if (strcasecmp(str, "yes") == 0)
+ return 1;
+ return 0;
+}
+
static void init_variables(void)
{
/* fill up the defaults.
@@ -61,7 +70,7 @@
strfieldcpy(udev_config_filename, UDEV_CONFIG_FILE);
strfieldcpy(udev_rules_filename, UDEV_RULES_FILE);
strfieldcpy(udev_permissions_filename, UDEV_PERMISSION_FILE);
- strfieldcpy(udev_log_str, UDEV_LOG_DEFAULT);
+ udev_log = string_is_true(UDEV_LOG_DEFAULT);
}
#define set_var(_name, _var) \
@@ -70,6 +79,12 @@
strncpy(_var, value, sizeof(_var)); \
}
+#define set_bool(_name, _var) \
+ if (strcasecmp(variable, _name) == 0) { \
+ dbg_parse("%s = '%s'", _name, value); \
+ _var = string_is_true(value); \
+ }
+
int parse_get_pair(char **orig_string, char **left, char **right)
{
char *temp;
@@ -158,7 +173,7 @@
set_var("default_mode", default_mode_str);
set_var("default_owner", default_owner_str);
set_var("default_group", default_group_str);
- set_var("udev_log", udev_log_str);
+ set_bool("udev_log", udev_log);
}
dbg_parse("%s:%d:%Zd: error parsing '%s'", udev_config_filename,
lineno, temp - line, temp);
@@ -194,7 +209,7 @@
dbg_parse("udev_db_filename = %s", udev_db_filename);
dbg_parse("udev_rules_filename = %s", udev_rules_filename);
dbg_parse("udev_permissions_filename = %s", udev_permissions_filename);
- dbg_parse("udev_log_str = %s", udev_log_str);
+ dbg_parse("udev_log = %d", udev_log);
parse_config_file();
dbg_parse("udev_root = %s", udev_root);
@@ -202,7 +217,7 @@
dbg_parse("udev_db_filename = %s", udev_db_filename);
dbg_parse("udev_rules_filename = %s", udev_rules_filename);
dbg_parse("udev_permissions_filename = %s", udev_permissions_filename);
- dbg_parse("udev_log_str = %s", udev_log_str);
+ dbg_parse("udev_log_str = %d", udev_log);
}
void udev_init_config(void)
diff -Nru a/udevd.c b/udevd.c
--- a/udevd.c Wed Feb 11 14:10:36 2004
+++ b/udevd.c Wed Feb 11 14:10:36 2004
@@ -40,7 +40,6 @@
#include "udevd.h"
#include "logging.h"
-unsigned char logname[42];
static int expected_seqnum = 0;
volatile static int children_waiting;
volatile static int msg_q_timeout;
@@ -51,6 +50,13 @@
static void exec_queue_manager(void);
static void msg_queue_manager(void);
+
+unsigned char logname[42];
+
+int log_ok(void)
+{
+ return 1;
+}
static void msg_dump_queue(void)
{
diff -Nru a/udevinfo.c b/udevinfo.c
--- a/udevinfo.c Wed Feb 11 14:10:36 2004
+++ b/udevinfo.c Wed Feb 11 14:10:36 2004
@@ -40,6 +40,11 @@
int main_argc;
unsigned char logname[42];
+int log_ok(void)
+{
+ return 1;
+}
+
static int print_all_attributes(const char *path)
{
struct dlist *attributes;
diff -Nru a/udevsend.c b/udevsend.c
--- a/udevsend.c Wed Feb 11 14:10:36 2004
+++ b/udevsend.c Wed Feb 11 14:10:36 2004
@@ -42,6 +42,11 @@
unsigned char logname[42];
+int log_ok(void)
+{
+ return 1;
+}
+
static inline char *get_action(void)
{
char *action;
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 016 release
2004-02-11 22:13 ` Greg KH
@ 2004-02-11 22:27 ` Martin Schlemmer
2004-02-12 1:19 ` Greg KH
0 siblings, 1 reply; 14+ messages in thread
From: Martin Schlemmer @ 2004-02-11 22:27 UTC (permalink / raw)
To: Greg KH; +Cc: linux-hotplug-devel, Linux Kernel Mailing Lists
[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]
On Thu, 2004-02-12 at 00:13, Greg KH wrote:
> On Tue, Feb 03, 2004 at 11:43:22PM +0200, Martin Schlemmer wrote:
> > On Tue, 2004-02-03 at 22:13, Greg KH wrote:
> >
> > Once again, patch to make logging a config option.
> >
> > Reason for this (since you asked for it =):
> > - In our setup it is easy (although still annoying) .. just
> > edit the ebuild, add logging support (or remove it) and rebuild.
> > For say a binary distro, having the logging is useful for debugging
> > some times, but its more a once of, or rare thing, as you do not
> > add or change config files every day. Sure, we can have logging
> > by default, but many do not want ~300 lines of extra debugging in
> > their logs is not pleasant, and they will complain. Rebuilding
> > the package for that binary package (given the users it is targeted
> > to) is usually not within most users grasp.
>
> Ok, I applied this patch.
>
> And then I went back and fixed it so it actually would work :(
>
> Here's the changes I had to make to get everything to build properly,
> and to let us have a boolean type for the config files.
>
Interest sake ... when did it actually fail? (When linking with
klibc maybe? Been using here without problems).
Thanks,
--
Martin Schlemmer
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [ANNOUNCE] udev 016 release
2004-02-11 22:27 ` Martin Schlemmer
@ 2004-02-12 1:19 ` Greg KH
0 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2004-02-12 1:19 UTC (permalink / raw)
To: Martin Schlemmer; +Cc: linux-hotplug-devel, Linux Kernel Mailing Lists
On Thu, Feb 12, 2004 at 12:27:09AM +0200, Martin Schlemmer wrote:
> On Thu, 2004-02-12 at 00:13, Greg KH wrote:
> > On Tue, Feb 03, 2004 at 11:43:22PM +0200, Martin Schlemmer wrote:
> > > On Tue, 2004-02-03 at 22:13, Greg KH wrote:
> > >
> > > Once again, patch to make logging a config option.
> > >
> > > Reason for this (since you asked for it =):
> > > - In our setup it is easy (although still annoying) .. just
> > > edit the ebuild, add logging support (or remove it) and rebuild.
> > > For say a binary distro, having the logging is useful for debugging
> > > some times, but its more a once of, or rare thing, as you do not
> > > add or change config files every day. Sure, we can have logging
> > > by default, but many do not want ~300 lines of extra debugging in
> > > their logs is not pleasant, and they will complain. Rebuilding
> > > the package for that binary package (given the users it is targeted
> > > to) is usually not within most users grasp.
> >
> > Ok, I applied this patch.
> >
> > And then I went back and fixed it so it actually would work :(
> >
> > Here's the changes I had to make to get everything to build properly,
> > and to let us have a boolean type for the config files.
> >
>
> Interest sake ... when did it actually fail? (When linking with
> klibc maybe? Been using here without problems).
Did you build udevinfo? udevsend? udevd? None of those files ended up
including the udev_log_* variable.
Anyway, it's cleaner this way :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2004-02-12 1:21 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-03 20:13 [ANNOUNCE] udev 016 release Greg KH
2004-02-03 20:49 ` Martin Schlemmer
2004-02-03 23:14 ` Greg KH
2004-02-03 21:28 ` Martin Schlemmer
2004-02-03 23:03 ` Martin Schlemmer
2004-02-03 23:13 ` Greg KH
2004-02-04 0:01 ` Kay Sievers
2004-02-04 4:25 ` Martin Schlemmer
2004-02-08 11:27 ` Martin Schlemmer
2004-02-08 13:01 ` Martin Schlemmer
2004-02-03 21:43 ` Martin Schlemmer
2004-02-11 22:13 ` Greg KH
2004-02-11 22:27 ` Martin Schlemmer
2004-02-12 1:19 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox