Diet /sbin/hotplug package released
I'd like to announce the initial version of the Diet /sbin/hotplug package. It can be found at:
http://prdownloads.sourceforge.net/linux-hotplug/diethotplug-0.1.tar.gz
Q: What is it?
A: It's a replacement for the current linux-hotplug script package. It
is written in C and if compiled with dietLibc[0], can produce a very small program.
For instance, on my machine the /lib/modules/2.4.9-ac3/modules.usbmap is 59221 bytes. The current linux-hotplug system needs this file, plus all of the linux-hotplug scripts and bash and awk to work. diethotplug compiles to about 20K on my machine and does not need modules.usbmap or any other helper programs to work.
Q: Will this replace the current linux-hotplug script package?
A: NO! The current linux-hotplug scripts work quite well in a general
purpose machine. They do not need to be modified for each kernel version, and allow users to add their own scripts quite easily.
The diethotplug program is only useful for systems that have memory constraints, do not have awk or bash, and do not change kernel versions (as the modules.pcimap and modules.usbmap are compiled into the program.) Embedded systems and the upcoming 2.5 initrd method of kernel booting are good applications for this program.
Currently usb module loading works (tested on my limited range of devices.) More testing on other usb devices is most welcome. PCI loading of modules is next on the list of things to do.
thanks,
greg k-h
Quoted 2 lines · Greg KH
is 59221 bytes. The current linux-hotplug system needs this file, plus all of the linux-hotplug scripts and bash and awk to work.
Hrm, why does it use bash-specific shell features? That's very bad. POSIX would be a much cleaner spec to conform to.
Quoted 6 lines · Aaron Lehmann
Quoted 2 lines · Greg KH
is 59221 bytes. The current linux-hotplug system needs this file, plus all of the linux-hotplug scripts and bash and awk to work.
Hrm, why does it use bash-specific shell features? That's very bad. POSIX would be a much cleaner spec to conform to.
I don't know if it uses bash-specific features, I haven't tried it on any other shell (and am not the main author of the shell scripts).
Why would POSIX "cleanness" matter for these scripts?
thanks,
greg k-h
Quoted 1 line · Greg KH
Why would POSIX "cleanness" matter for these scripts?
Believe it or not, some people don't use bash as /bin/sh, or at all. I notice that /etc/hotplug/hotplug.functions uses #!/bin/bash, which is better than pretending to be an "sh" script and using bashisms.
Quoted 6 lines · Aaron Lehmann
Quoted 1 line · Greg KH
Why would POSIX "cleanness" matter for these scripts?
Believe it or not, some people don't use bash as
/bin/sh, or at all. I notice that/etc/hotplug/hotplug.functionsuses #!/bin/bash, which is better than pretending to be an "sh" script and using bashisms.
I realize that not all /bin/sh is really bash, that's why the scripts explicitly ask for bash. I'm guessing some bashisms are in there :)
thanks,
greg k-h
Hi Greg!
Quoted 2 lines · On Wed, 29 Aug 2001 Greg KH wrote:
I realize that not all
/bin/shis really bash, that's why the scripts explicitly ask for bash. I'm guessing some bashisms are in there :)
Does it really make any sense to optimize for size and at the same time force the user to install a bash compatible shell?
Stefan
Quoted 2 lines · --On Thursday, August 30, 2001 12:47 PM +0200 Stefan Fleiter…
Does it really make any sense to optimize for size and at the same time force the user to install a bash compatible shell?
No, that's why diet /sbin/hotplug didn't require any shell (as I understood it), whereas the normal hotplug suite does.
--
Alex Bligh
Quoted 10 lines · Alex Bligh - linux-kernel
--On Thursday, August 30, 2001 12:47 PM +0200 Stefan Fleiter
Quoted 2 lines · <[email protected]> wrote:
Does it really make any sense to optimize for size and at the same time force the user to install a bash compatible shell?
No, that's why diet
/sbin/hotplugdidn't require any shell (as I understood it), whereas the normal hotplug suite does.
Exactly. diethotplug does not require any shell or awk to be present to work. It compiles to a binary which is smaller than the existing modules.usbmap file is (and can get smaller, I haven't started to optimize for space yet.)
To help clear up a few questions I've been getting, diethotplug is for systems that care about space, like embedded or boot rescue discs. It will also be handy for loading PCI and USB kernel modules at boot time based on what devices are present in the system, with the upcoming 2.5 initrd method.
It is not a replacement for the current linux-hotplug scrips, but another alternative for situations that they didn't make sense.
thanks,
greg k-h
Hi Alex!
Quoted 4 lines · On Thu, 30 Aug 2001 Alex Bligh - linux-kernel wrote:
Quoted 2 lines
Does it really make any sense to optimize for size and at the same time force the user to install a bash compatible shell?
No, that's why diet
/sbin/hotplugdidn't require any shell (as I understood it), whereas the normal hotplug suite does.
Oh. That really makes sense...
Stefan, a bit ashamed...