linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [ANNOUNCE] hotplug-ng 001 release
@ 2005-02-11  0:40 Greg KH
  2005-02-11  0:52 ` Greg KH
                   ` (4 more replies)
  0 siblings, 5 replies; 76+ messages in thread
From: Greg KH @ 2005-02-11  0:40 UTC (permalink / raw)
  To: linux-hotplug-devel, linux-kernel

I'd like to announce, yet-another-hotplug based userspace project:
linux-ng.  This collection of code replaces the existing linux-hotplug
package with very tiny, compiled executable programs, instead of the
existing bash scripts.

It currently provides the following:
	- a /sbin/hotplug multiplexer.  Works identical to the existing
	  bash /sbin/hotplug.
	- autoload programs for usb, scsi, and pci modules.  These
	  programs determine what module needs to be loaded when the
	  kernel emits a hotplug event for these types of devices.  This
	  works just like the existing linux-hotplug scripts, with a few
	  exceptions.

But why redo this all in .c code?  What's wrong with shell scripts?
Nothing is wrong with shell scripts, unless you don't want to have an
interpreter in your initramfs/initrd and you want to provide
/sbin/hotplug and autoload module functionality.  Or if you have a huge
box that spawns a zillion hotplug events all at once, and you need to be
able to handle all of that with the minimum amount of processing time
and memory.

So, how small are these programs?  Take a look:
   text    data     bss     dec     hex filename
   4669      32     124    4825    12d9 hotplug
   5077       8     348    5433    1539 module_pci
   4925       8     412    5345    14e1 module_scsi
   5349       8     348    5705    1649 module_usb

Those are all static binaries, linked with klibc (which is included in
the hotplug-ng package, just like udev.)

This compares to the following bash scripts:
-rwxr-xr-x  1 root root  4412 Feb 10 15:28 /sbin/hotplug
-rw-r--r--  1 root root   702 Sep 24 08:04 /etc/hotplug/blacklist
-rw-r--r--  1 root root  5293 Sep 24 08:04 /etc/hotplug/hotplug.functions
-rwxr-xr-x  1 root root  3739 Sep 24 08:04 /etc/hotplug/pci.agent
-rwxr-xr-x  1 root root  1459 Sep 24 08:04 /etc/hotplug/scsi.agent
-rwxr-xr-x  1 root root 13466 Sep 24 08:04 /etc/hotplug/usb.agent
-rw-r--r--  1 root root 39306 Sep 24 08:04 /etc/hotplug/usb.distmap
-rw-r--r--  1 root root  4364 Sep 24 08:04 /etc/hotplug/usb.handmap
-rw-r--r--  1 root root   189 Sep 24 08:04 /etc/hotplug/usb.usermap

All of which are loaded into memory for each hotplug event (for specific
hotplug events, only that bus type of file is loaded.)

But what about speed?  With a completely unscientific measurement on my
old, slow laptop, it takes about 2 seconds from the time I plug a usb
device into the machine, for the proper module to be loaded.  With the
hotplug-ng program, it takes less than a second.

And for those of you who might remember the old dietHotplug program that
also did the same thing in a tiny amount of space, this project
obsoletes that one.  dietHotplug had to be rebuilt for every kernel that
was used on the system, hotplug-ng uses the ability for modprobe to
determine the module that needs to be loaded based on the module
aliases[1].

The code can be found at:
	kernel.org/pub/linux/utils/kernel/hotplug/hotplug-ng-001.tar.gz
for those who wish to poke around in it.

I still have a few more programs to write to get it up to the same
functionality as the existing hotplug scripts (firmware, ieee1392, etc.)
but those will be done soon.  I'd like to get people's comments on the
idea, and welcome suggestions and even patches :)

hotplug-ng development is done in a BitKeeper repository located at:
	bk://linuxusb.bkbits.net/hotplug-ng

If anyone ever wants a tarball of the current bk tree, just email me.

thanks,

greg k-h

[1] modprobe as it currently works stops loading modules when it finds
an alias that matches.  This does not work for drivers that claim to
support "all devices" and then later on fail on devices that they really
don't support.  For that, all matching drivers need to be loaded for the
system to work properly.  The linux-hotplug scripts handle this
correctly, so if you rely on this functionality, please stick with that
package for now.  I'll be modifying modprobe to add this feature in the
near future.


^ permalink raw reply	[flat|nested] 76+ messages in thread
* Re: [ANNOUNCE] hotplug-ng 001 release
@ 2005-02-14 10:29 Michal Rokos
  0 siblings, 0 replies; 76+ messages in thread
From: Michal Rokos @ 2005-02-14 10:29 UTC (permalink / raw)
  To: linux-kernel

Hello,

I was unable to compile hotplug-ng against klibc until this patch went
in:

--- /dev/null   2005-02-14 09:23:10.000000000 +0100
+++ hotplug-ng/klibc/include/features.h 2005-02-11 16:18:35.000000000
+0100
@@ -0,0 +1,5 @@
+#ifndef        _FEATURES_H
+#define        _FEATURES_H     1
+
+#endif /* features.h  */
+

My system is debian (sid);
gcc version 3.3.5 (Debian 1:3.3.5-8)
libc6-2.3.2.ds1-20

The same goes for udev + klibc.

Or is there other trick?

Michal

PS: Error message was:
Precompiling hotplug.c:                                               [ERROR]
gcc -pipe -DLOG -Os -fomit-frame-pointer -D_GNU_SOURCE -Wall -nostdinc 
-mregpar
m=3 -DREGPARM=3 -march=i386 -Os -g -falign-functions=0 -falign-jumps=0 
-falign-
loops=0 -D__KLIBC__ -fno-builtin-printf 
-I/home/michal/WORK/devel/bk/hotplug-ng
/klibc_fixups 
-include /home/michal/WORK/devel/bk/hotplug-ng/klibc_fixups/klibc
_fixups.h -I/home/michal/WORK/devel/bk/hotplug-ng/klibc/include 
-I/home/michal/
WORK/devel/bk/hotplug-ng/klibc/include/arch/i386 
-I/home/michal/WORK/devel/bk/h
otplug-ng/klibc/include/bits32 -I/usr/lib/gcc-lib/i486-linux/3.3.5/include 
-I/l
ib/modules/2.6.11-rc4-mr/build/include 
-I/home/michal/WORK/devel/bk/hotplug-ng/
libsysfs/sysfs -I/home/michal/WORK/devel/bk/hotplug-ng/libsysfs -c -o 
hotplug.o
 hotplug.c
In file included 
from /lib/modules/2.6.11-rc4-mr/build/include/linux/posix_type
s.h:47,
                 from /home/michal/WORK/devel/bk/hotplug-ng/klibc/include/sys/t
ypes.h:15,
                 from /home/michal/WORK/devel/bk/hotplug-ng/klibc/include/unist
d.h:11,
                 from /home/michal/WORK/devel/bk/hotplug-ng/klibc_fixups/klibc_
fixups.h:7,
                 from <command line>:8:
/usr/lib/gcc-lib/i486-linux/3.3.5/include/asm/posix_types.h:13:22: features.h:
No such file or directory
make: *** [hotplug.o] Error 1

^ permalink raw reply	[flat|nested] 76+ messages in thread
[parent not found: <20050211211028.GB21512@suse.de>]

end of thread, other threads:[~2005-02-20  2:09 UTC | newest]

Thread overview: 76+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-11  0:40 [ANNOUNCE] hotplug-ng 001 release Greg KH
2005-02-11  0:52 ` Greg KH
2005-02-11  1:30   ` Kasper Sandberg
2005-02-11  6:41     ` Greg KH
2005-02-11 11:47       ` Kasper Sandberg
2005-02-11 17:06         ` Greg KH
2005-02-12  0:02           ` Kasper Sandberg
2005-02-11  1:07 ` Patrick McFarland
2005-02-11  1:16   ` Greg KH
2005-02-11 20:40     ` Vojtech Pavlik
2005-02-14  4:06     ` Lee Revell
2005-02-14  8:32       ` Paolo Ciarrocchi
2005-02-14  8:51         ` Prakash Punnoor
2005-02-14 23:04           ` Lee Revell
2005-02-14 23:16             ` Greg KH
2005-02-14 23:28               ` Lee Revell
2005-02-15 15:15                 ` Stefan Seyfried
2005-02-15 20:12                   ` kernel
2005-02-14 23:21             ` Roland Dreier
2005-02-14 23:45               ` [OT] speeding boot process (was Re: [ANNOUNCE] hotplug-ng 001 release) Lee Revell
2005-02-15  0:16                 ` Tim Bird
2005-02-15  1:17                   ` Lee Revell
2005-02-15  1:45                     ` Kyle Moffett
2005-02-15  7:32                       ` Gábor Lénárt
2005-02-15  8:34                         ` Paolo Ciarrocchi
2005-02-15  9:27                           ` [OT] speeding boot process Bernd Petrovitsch
2005-02-15  8:55                       ` [OT] speeding boot process (was Re: [ANNOUNCE] hotplug-ng 001 release) Helge Hafting
2005-02-15  9:33                         ` Bernd Petrovitsch
2005-02-15 13:20                           ` Helge Hafting
2005-02-15 13:28                             ` Paulo Marques
2005-02-15 13:50                             ` Bernd Petrovitsch
2005-02-16  1:54                             ` Miquel van Smoorenburg
2005-02-15  3:38                     ` Jim Crilly
2005-02-15  5:52                       ` Nigel Cunningham
2005-02-15  6:15                         ` Jim Crilly
2005-02-15  6:39                           ` Nigel Cunningham
2005-02-15 19:32                           ` Lee Revell
2005-02-17 18:37                     ` jlnance
2005-02-17 19:18                       ` Chris Larson
2005-02-19  5:53                         ` Jim Crilly
2005-02-17 20:00                       ` Helge Hafting
2005-02-19  5:56                         ` Jim Crilly
2005-02-19 22:47                           ` Helge Hafting
2005-02-20  2:09                             ` Jim Crilly
2005-02-15  8:33                 ` Paolo Ciarrocchi
2005-02-14 23:43             ` [ANNOUNCE] hotplug-ng 001 release Diego Calleja
2005-02-15 19:51               ` Lee Revell
2005-02-15 21:02                 ` Diego Calleja
2005-02-15 21:32                   ` Chris Friesen
2005-02-15 21:09                 ` Valdis.Kletnieks
2005-02-15 19:56               ` Optimizing disk-I/O [was Re: [ANNOUNCE] hotplug-ng 001 release] Linas Vepstas
2005-02-15 20:46                 ` Adam Goode
2005-02-15 21:11                   ` Diego Calleja
2005-02-15 21:21                 ` Valdis.Kletnieks
2005-02-11  3:18 ` [ANNOUNCE] hotplug-ng 001 release Bill Nottingham
2005-02-11  6:46   ` Greg KH
2005-02-11 16:19     ` Christian Bornträger
2005-02-11 17:01       ` Greg KH
2005-02-11 19:01         ` Erik Andersen
2005-02-11 19:23           ` Greg KH
2005-02-11 21:37             ` Erik van Konijnenburg
2005-02-11 21:49               ` Greg KH
2005-02-11 22:06                 ` Erik van Konijnenburg
2005-02-11 22:13                   ` Greg KH
2005-02-12  0:48                     ` Ingo Oeser
2005-02-14 22:43                       ` Greg KH
2005-02-11  9:52 ` Olivier Galibert
2005-02-11 17:08   ` Greg KH
2005-02-11 20:06 ` Harald Dunkel
2005-02-11 21:01   ` Greg KH
2005-02-12  8:30     ` Harald Dunkel
2005-02-14 22:36       ` Greg KH
2005-02-15  5:39         ` Harald Dunkel
2005-02-15  7:14           ` Greg KH
2005-02-14 10:29 Michal Rokos
     [not found] <20050211211028.GB21512@suse.de>
2005-02-17  6:46 ` Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).