should the module script be invoked every time?
OK, I'm running SuSE 8.0 with a 2.4.18 kernel, and I removed the hotplug RPM and installed hotplug-2002_08_26
I'm trying to get my Palm m500 to hotsync in the USB cradle when I press the button. I've created a little script to do this using jpilot-sync from jpilot, and that part works just fine.
The script is now /etc/hotplug/usb/visor, since it's the visor module that supports the palms.
OK, now what documentation I've seen says that this script should be called *every* time the palm connects on the USB, which it does when it tries to initiate a hotsync. Is this right?
However, due to (I believe) a bug in load_drivers() in hotplug.functions, it only gets called when the visor module is first loaded, and never called again until that module is unloaded. I can provide a patch.
Which behavour is correct? And if the current behaviour is correct, then how do I get a script to run every time?
-gc
Signature · 13 lines
Gene Cash Server Technologies (Business Ops) Phone: 407-458-5237 Oracle Support Services (Orlando, FL USA) ------------------------------------------------------- This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 2 lines · Gene Cash
The script is now
/etc/hotplug/usb/visor, since it's the visor module that supports the palms.
If you give your script some other name, like 'palmsync' or something else, your script shall run everytime you plug in the device.
Is there a reason to name the hotplug scripts like the modules?
There was the same issue some time ago with the usb-midi firmware loader script, but now the script is named 'ezusbmidi' instead 'usb-midi', and our problems are gone.
Regards,
Pedro
Signature · 13 lines
ALSA Library Bindings for Pascal http://alsapas.alturl.com ------------------------------------------------------- This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 10 lines · Pedro Lopez-Cabanillas
Quoted 2 lines · Gene Cash
The script is now
/etc/hotplug/usb/visor, since it's the visor module that supports the palms.If you give your script some other name, like 'palmsync' or something else, your script shall run everytime you plug in the device.
Is there a reason to name the hotplug scripts like the modules?
Keeping things straight, and making it so you don't need to make any kind of error-prone modification to files in tha quirky syntax.
This is a bug that's been hanging around for a while. The fix should finally be in current CVS, along with a few other updates mostly for a bit more intelligence about how hotplug changed in 2.5 ...
- Dave
-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 5 lines · Pedro Lopez-Cabanillas
Quoted 2 lines · Gene Cash
The script is now
/etc/hotplug/usb/visor, since it's the visor module that supports the palms.
Quoted 8 lines
If you give your script some other name, like 'palmsync' or something else, your script shall run everytime you plug in the device.
Is there a reason to name the hotplug scripts like the modules?
There was the same issue some time ago with the usb-midi firmware loader script, but now the script is named 'ezusbmidi' instead 'usb-midi', and our problems are gone.
Yes, I named the script the same as the module, because the documentation led me to believe that I had to, in order to get my script run when "visor" style events happened.
I just renamed it palm_hotsync and now it doesn't work at all. So obviously that's not it.
-gc
Signature · 14 lines
Gene Cash Server Technologies (Business Ops) Phone: 407-458-5237 Oracle Support Services (Orlando, FL USA) ------------------------------------------------------- This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 3 lines · Gene Cash
OK, now what documentation I've seen says that this script should be called *every* time the palm connects on the USB, which it does when it tries to initiate a hotsync. Is this right?
That's my feeling as well. In my case, the device must have its firmware loaded via fxload, but it never works if the kernel module has alread been loaded. As a result, these devices never end up connecting to the kernel driver. The only workaround I've found is to disconnect all of those devices, unload its kernel module, then plug all device in simultaneously. Yuck!
Quoted 4 lines
However, due to (I believe) a bug in
load_drivers()in hotplug.functions, it only gets called when the visor module is first
loaded, and never called again until that module is unloaded. I can
provide a patch.
I just took a glance at that function, and I began to wonder if the problem stems from the 'if ! lsmod ..' never reaching its body. This would seem to be caused by the fact that both yours and my hotplug usb scripts are named the same as their corresponding kernel module. If you change the userspace script name by adding a '.sh' extension (and update the associated usermap), I think you will find the problem magically solved; at least, that has solved my problems. Hurrah!
Note: if you only have one usermap device entry to update, you probably want to call modprobe from within the visor.sh script. In my case, I have two device ids - one is the bare device, the other is provided by the newly loaded firmware. Previously, both usermap entries were named 'foo', now the pre-renumeration handler is called 'foo.sh'.
Quoted 2 lines
Which behavour is correct? And if the current behaviour is correct, then how do I get a script to run every time?
Personally, I believe the behaviour you are trying to acheive is correct, and the current behaviour is wrong. However, it's really more a matter of the documentation not clearly stating that you can't name the kernel driver the same as the hotplug script. :-p
Thanks for sending this message - I wouldn't have otherwise found the solution today, and I love crossing issues like this off my list. :)
Cheers,
Zach Welch
Superlucidity Services
-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 6 lines · Gene Cash
Yes, I named the script the same as the module, because the documentation led me to believe that I had to, in order to get my script run when "visor" style events happened.
I just renamed it
palm_hotsyncand now it doesn't work at all. So obviously that's not it.
Of course, you need to change also the script name in your '/etc/hotplug/usb.usermap' or '/etc/hotplug/usb/something.usermap' files.
Regards,
Pedro
Signature · 13 lines
ALSA Library Bindings for Pascal http://alsapas.alturl.com ------------------------------------------------------- This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 9 lines · David Brownell
Quoted 1 line · Pedro Lopez-Cabanillas
Is there a reason to name the hotplug scripts like the modules?
Keeping things straight, and making it so you don't need to make any kind of error-prone modification to files in tha quirky syntax.
This is a bug that's been hanging around for a while. The fix should finally be in current CVS, along with a few other updates mostly for a bit more intelligence about how hotplug changed in 2.5 ...
That's good, but IMHO there are several situations for hotplug to give some kind of support.
1. Scripts that need to run once, before or after modprobe. This is usually done with modules.conf (pre-install/post-install), but i would like to do that with hotplug also...
2. Scripts that need to run every time the device is plugged or unplugged, even if the driver is already loaded or not. That is the case of our ezusbmidi firmware loader.
BTW, there can be several drivers for the same device, i.e. 'usb-midi' is the OSS driver and 'snd-usb-audio' is the ALSA driver. Midiman MidisportNxN devices may work with both drivers, but some firmware is needed first. The name 'ezusbmidi' for the script is neutral, and associated to the EZ-USB devices, not the driver name.
I know another firmware for the same devices:
http://www.informatik.uni-halle.de/~ladischc/midisport_linux_firmware.html
That script is named 'midisport_fw', and i like that name.
Regards,
Pedro
-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 9 lines · Pedro Lopez-Cabanillas
...
Quoted 4 lines
This is a bug that's been hanging around for a while. The fix should finally be in current CVS, along with a few other updates mostly for a bit more intelligence about how hotplug changed in 2.5 ...
That's good, but IMHO there are several situations for hotplug to give some kind of support.
There are always new features that _could_ be added...
Quoted 3 lines
1. Scripts that need to run once, before or after modprobe. This is usually done with modules.conf (pre-install/post-install), but i would like to do that with hotplug also...
Why have two ways to do the same thing? Hotplug deals with devices, modutils deal with modules. Having two ways to do something means twice the testing, and exponential growth in the number of failure modes as you keep adding other ways...
Quoted 3 lines
2. Scripts that need to run every time the device is plugged or unplugged, even if the driver is already loaded or not. That is the case of our ezusbmidi firmware loader.
As I said, the fact that it _hasn't_ been happening that way is just a bug ... which should now be fixed.
- Dave
-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 8 lines · David Brownell
Quoted 3 lines · Pedro Lopez-Cabanillas
2. Scripts that need to run every time the device is plugged or unplugged, even if the driver is already loaded or not. That is the case of our ezusbmidi firmware loader.
As I said, the fact that it _hasn't_ been happening that way is just a bug ... which should now be fixed.
Why yes it is!! I got the latest from CVS and now my "visor" script gets called every single time it shows up on the bus. No action needed other than putting the script in /etc/hotplug/usb and making it executable. :-)
It's fairly simple, I have a tk/tcl wrapper around the jpilot-sync output, to make a little progress window.
-gc
Signature · 13 lines
Gene Cash Server Technologies (Business Ops) Phone: 407-458-5237 Oracle Support Services (Orlando, FL USA) ------------------------------------------------------- This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
I'm new to the list, bringing up an old topic becasue I too had the same issue and it doesn't seem to have been resolved on the list or in the docs.
Quoted 6 lines
Quoted 2 lines
The script is now
/etc/hotplug/usb/visor, since it's the visor module that supports the palms.If you give your script some other name, like 'palmsync' or something else, your script shall run everytime you plug in the device.
If you rename the module in distmap, the kernel module won't load. But if the kernel module is already loaded, the usermap won't get run at all.
The docs are WRONG on this! http://linux-hotplug.sourceforge.net/?selected=usb
"When your device support involves a kernel driver, instead of a purely user mode driver, name the script after that driver. Similar scripts can trigger when you connect a PDA, printer, or other device. "
This clearly implies that the script will run so long it has the same name as the module...period. no editing maps, no if's and's or but's. This is wrong.
What needs to be done is copy the visor line from the distmap to the handmap, renaming the module to your own name, then add the script of this new name.
Note that the usermap will NEVER get processed if the distmap or handmap sucessfully do something usefull, but distmap and handmap will both always be processed. From looking at the *.agent scripts, it also seems as though this feature ONLY applies to usb.
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 2 lines · Chris Weiss
I'm new to the list, bringing up an old topic becasue I too had the same issue and it doesn't seem to have been resolved on the list or in the docs.
The resolution should have been in the hotplug scripts, a while back.
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
The script is now
/etc/hotplug/usb/visor, since it's the visor module that supports the palms.If you give your script some other name, like 'palmsync' or something else, your script shall run everytime you plug in the device.
If you rename the module in distmap, the kernel module won't load. But if the kernel module is already loaded, the usermap won't get run at all.
Distmap is only for 2.2, which doesn't have /lib/modules/*/modules.usbmap.
Quoted 4 lines
The docs are WRONG on this! http://linux-hotplug.sourceforge.net/?selected=usb
"When your device support involves a kernel driver, instead of a purely user mode driver, name the script after that driver. Similar scripts can trigger when you connect a PDA, printer, or other device. "
The docs say what should happen; but there were bugs in older
versions of the hotplug software. If you have scripts that
don't do that, (a) update to the current software, (b) try to reproduce this, then (c) if it still doesn't work, report a bug.
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 4 lines
The docs say what should happen; but there were bugs in older
versions of the hotplug software. If you have scripts that
don't do that, (a) update to the current software, (b) try to reproduce this, then (c) if it still doesn't work, report a bug.
Being that I'm using debian woody (stable) (which for some reason is still using 2002_01_14) and Mandrake 9.1 (which i have not tested but uses 2002_04_01) would it be to much to ask to add a note to the docs stating such? Maybe even alert the distro's that they are using old bugy version of your package? My first thought here was that hotplug was a dodgy package that doesn't work as advertized and no one cares, only after bothering to correct this did I learn that the distro's are using old and buggy versions of your software.
Anyone got a "non broken" deb package of this somewhere? i'm still a bit weary of compiliing things in deb to replace "core" functions (yes, I see hotplug as core).
Thanks
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 5 lines · Chris Weiss
Being that I'm using debian woody (stable) (which for some reason is still using 2002_01_14) and Mandrake 9.1 (which i have not tested but uses 2002_04_01) would it be to much to ask to add a note to the docs stating such? Maybe even alert the distro's that they are using old bugy version of your package?
You can file bugs against those distros yourself ... :)
And as for doc updates, please send me (off-list) reasonably specific changes you'd like to see -- at the level of URL and paragraph that needs to mention such stuff. I'll do them at some point when I have a moment to spare for such.
- Dave
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 3 lines · Chris Weiss
Being that I'm using debian woody (stable) (which for some reason is still using 2002_01_14) and Mandrake 9.1 (which i have not tested but uses 2002_04_01) would it
I can only speak for Debian here. (I'm surprised that Mandrake 9.1 is using such an old hotplug since 9.1 is quite recent...)
Debian Woody is, as you noted "stable". It is frozen and _only_ gets updates for security issues and complete show-stopper bugs. That's it.
If you want newer, then you are free to run Testing or Unstable, or you can recompile newer packages to run under woody. You _may_ find the hotplug in testing/unstable (currently 0.0.20030117-7) runs fine on woody without problem.
Oh, you _may_ find there are fixes to big issues in the woody/updated/security archives. The main package version would not be incremented, just the Debian release no.
But please don't complain that an old frozen distribution is old. That's like complaining that the Pope is Catholic.
Oh, and what the distro's do with hotplug is not the hotplug projects responsibility. They can't be expected to constantly keep up with what the distros are using.
--
Paul
Quoted 13 lines
be to much to ask to add a note to the docs stating such? Maybe even alert the distro's that they are using old bugy version of your package? My first thought here was that hotplug was a dodgy package that doesn't work as advertized and no one cares, only after bothering to correct this did I learn that the distro's are using old and buggy versions of your software.
Anyone got a "non broken" deb package of this somewhere? i'm still a bit weary of compiliing things in deb to replace "core" functions (yes, I see hotplug as core).
Thanks
Quoted 8 lines
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel