Re: udevsend and hotplug
On 7/12/05, kareemy <[EMAIL PROTECTED]> wrote: > On 7/11/05, Dan McGhee <[EMAIL PROTECTED]> wrote: > > kareemy wrote: > > > > Thank you. I have read that. It provided some insight as to how > udev+hotplug are supposed to work but didn't quite solve my issue. In > the meantime I found two possible solutions that have worked for me. > > 1) Keep /sbin/udevsend as the hotplug handler. Compile the > run_directory extras in the udev source code by issuing the command > "make EXTRAS=extras/run_directory". This will generate a > udev_run_hotplugd binary. Copy that binary to /sbin and add the > following rule to 50-udev.rules: > > ENV{UDEVD_EVENT}=="1", RUN+="/sbin/udev_run_hotplugd" > This is the correct option - from udev-059 onwards, the hotplug handling is being done differently, with the udev rules being expanded to allow calling of hotplug scripts from the udev rules file. It will take a while to get a properly grip on the new functionality. Ideally, the hotplug scripts will go away entirely, and be replaced by udev rules that can call modprobe directly, etc. - that will take some time however. -- - Steve Crosby -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: udevsend and hotplug
On 7/11/05, Dan McGhee <[EMAIL PROTECTED]> wrote: > kareemy wrote: > > >Hello, > > > >I noticed that the lfs bootscripts changed to echo /sbin/udevsend into > >/proc/sys/kernel/hotplug instead of /sbin/hotplug. > > > >Does hotplug ever get called anymore in this case? > > > >My problem is with my digital camera. It does not have a /dev entry. > >When I plug it in, a new entry is created in /proc/bus/usb along with > >some very hidden usb entry in the /sys filesystem usually > >/sys/class/usb_host/usb2/device/usb2/2-1 or something to that effect. > >That is all that happens when the camera is plugged in. On my old > >system when /sbin/hotplug was used, the usb scripts properly found the > >/proc/bus/usb entry and my usbcam script properly set the permissions > >so I could use the camera as my normal user. I have always used gphoto > >and it seems to communicate to the camera through this /proc entry. > >Now that /sbin/udevsend is used, nothing is happening. My usb hotplug > >scripts are never called and udevinfo prints nothing about a camera > >device. So I have a few questions about how to best solve this. > > > >Why was the switch made to use /sbin/udevsend? On my old system using > >/sbin/hotplug, buth udev and hotplug worked great. Now hotplug does > >not seem to work. > > > >Can I switch back to /sbin/hotplug? Will there be any adverse effects? > > > >Is there a better way to get my digital camera to work than using > >hotplug with a usbcam script? Perhaps a udev rule (The camera never > >used a /dev entry in the past at all, so I don't know if this is > >possible) ? > > > >I read the udevsend manpage and it seems that udevsend is supposed to > >be called by hotplug, but that doesn't seem to be happening. Is there > >a way to get use /sbin/hotplug and have it call udevsend or even have > >/sbin/udevsend call /sbin/hotplug so both tools can work? > > > >Thanks, > >Kareem > > > > > Kareem, > > Let me point you to this series of messages in the archives: > > http://archives.linuxfromscratch.org/mail-archives/lfs-support/2005-July/027542.html > > This message and the next three or four replies to it may answer your > questions. > > Dan > Thank you. I have read that. It provided some insight as to how udev+hotplug are supposed to work but didn't quite solve my issue. In the meantime I found two possible solutions that have worked for me. 1) Keep /sbin/udevsend as the hotplug handler. Compile the run_directory extras in the udev source code by issuing the command "make EXTRAS=extras/run_directory". This will generate a udev_run_hotplugd binary. Copy that binary to /sbin and add the following rule to 50-udev.rules: ENV{UDEVD_EVENT}=="1", RUN+="/sbin/udev_run_hotplugd" I added that at the end of the file. I copied it from the gentoo udev.rules file that was included in the udev source code. My understanding of this method is that udev will handle all hotplug events, however, if it is given an event that does not match any of its rules then it will run udev_run_hotplugd which is a simple binary that traverses the /etc/hotplug.d directory running any scripts in there. So now when I plug my digital camera in, udev matches this final rule I created and activates hotplug which sets the permissions correctly for me. 2) Use /sbin/hotplug as the hotplug event handler and in /etc/hotplug.d/default/ simply add a symlink to /sbin/udevsend. So when an event occurs, hotplug handles it but will call udevsend first and then continue with the hotplug scripts. I'd like some feedback about these method. Will there be any adverse side effects or issues ...? I simply don't see a way udev can handle setting up my digital camera with the correct permissions without the help of a hotplug script. In addition i have a usbcam.usermap file that hotplug uses which identifies hundreds of digital cameras it will handle without issue. Also, I used the LFS development version from July 9 when I compiled my system and with the default setup I don't believe the hotplug scripts were called at all during an hotplug event until I added that udev rule above. I know they are still used for coldplugging at boot. I am wondering if that is intentional or an oversight. Thanks, Kareem -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
Re: udevsend and hotplug
kareemy wrote: Hello, I noticed that the lfs bootscripts changed to echo /sbin/udevsend into /proc/sys/kernel/hotplug instead of /sbin/hotplug. Does hotplug ever get called anymore in this case? My problem is with my digital camera. It does not have a /dev entry. When I plug it in, a new entry is created in /proc/bus/usb along with some very hidden usb entry in the /sys filesystem usually /sys/class/usb_host/usb2/device/usb2/2-1 or something to that effect. That is all that happens when the camera is plugged in. On my old system when /sbin/hotplug was used, the usb scripts properly found the /proc/bus/usb entry and my usbcam script properly set the permissions so I could use the camera as my normal user. I have always used gphoto and it seems to communicate to the camera through this /proc entry. Now that /sbin/udevsend is used, nothing is happening. My usb hotplug scripts are never called and udevinfo prints nothing about a camera device. So I have a few questions about how to best solve this. Why was the switch made to use /sbin/udevsend? On my old system using /sbin/hotplug, buth udev and hotplug worked great. Now hotplug does not seem to work. Can I switch back to /sbin/hotplug? Will there be any adverse effects? Is there a better way to get my digital camera to work than using hotplug with a usbcam script? Perhaps a udev rule (The camera never used a /dev entry in the past at all, so I don't know if this is possible) ? I read the udevsend manpage and it seems that udevsend is supposed to be called by hotplug, but that doesn't seem to be happening. Is there a way to get use /sbin/hotplug and have it call udevsend or even have /sbin/udevsend call /sbin/hotplug so both tools can work? Thanks, Kareem Kareem, Let me point you to this series of messages in the archives: http://archives.linuxfromscratch.org/mail-archives/lfs-support/2005-July/027542.html This message and the next three or four replies to it may answer your questions. Dan -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
udevsend and hotplug
Hello, I noticed that the lfs bootscripts changed to echo /sbin/udevsend into /proc/sys/kernel/hotplug instead of /sbin/hotplug. Does hotplug ever get called anymore in this case? My problem is with my digital camera. It does not have a /dev entry. When I plug it in, a new entry is created in /proc/bus/usb along with some very hidden usb entry in the /sys filesystem usually /sys/class/usb_host/usb2/device/usb2/2-1 or something to that effect. That is all that happens when the camera is plugged in. On my old system when /sbin/hotplug was used, the usb scripts properly found the /proc/bus/usb entry and my usbcam script properly set the permissions so I could use the camera as my normal user. I have always used gphoto and it seems to communicate to the camera through this /proc entry. Now that /sbin/udevsend is used, nothing is happening. My usb hotplug scripts are never called and udevinfo prints nothing about a camera device. So I have a few questions about how to best solve this. Why was the switch made to use /sbin/udevsend? On my old system using /sbin/hotplug, buth udev and hotplug worked great. Now hotplug does not seem to work. Can I switch back to /sbin/hotplug? Will there be any adverse effects? Is there a better way to get my digital camera to work than using hotplug with a usbcam script? Perhaps a udev rule (The camera never used a /dev entry in the past at all, so I don't know if this is possible) ? I read the udevsend manpage and it seems that udevsend is supposed to be called by hotplug, but that doesn't seem to be happening. Is there a way to get use /sbin/hotplug and have it call udevsend or even have /sbin/udevsend call /sbin/hotplug so both tools can work? Thanks, Kareem -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page