linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* why kernel not call /sbin/hotplug ?
@ 2008-10-09  9:25 Grzegorz Heldt
  2008-10-09  9:43 ` Kay Sievers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Grzegorz Heldt @ 2008-10-09  9:25 UTC (permalink / raw)
  To: linux-hotplug

Hello everybody

I have embedded system based on sh4-cpu with kernel 2.6.17.14.  I have
build latest rt73.ko module which is usb-wifi driver. This driver also
need firmware to be loaded into device during initialization.

Basing on information that I found, i put following script in /sbin/hotplug:

#cat /sbin/hotplug
#!/bin/sh
echo hotplug script is runned !

HOTPLUG_FW_DIR=/lib/firmware/

                echo 1 > /sys/$DEVPATH/loading
                cat $HOTPLUG_FW_DIR/$FIRMWARE > /sysfs/$DEVPATH/data
                echo 0 > /sys/$DEVPATH/loading

this file has following flags;

# ls -l /sbin/hotplug
-rwxrwxrwx    1 502      502          1006 Oct  8  2008 /sbin/hotplug

sysfs looks to be correctly configured for this script:

# cat /sys/kernel/uevent_helper
/sbin/hotplug
#

As I supposed when i'm inserting any usb device, I should see "hotplug
script is runned !" message, but there is no message.
After inserting usb-wifi module i see only this:


# rt73: Failed to request_firmware. Check your firmware file location
rt73: Failed to load Firmware.

Firmware is located in:
# ls -l /lib/firmware/
-rwxr--r--    1 501      501          2048 Oct  6  2008 rt73.bin

as expected in my /sbin/hotplug script.

after inserting regular usb-flash-disk device i see only this:

# sdb: assuming drive cache: write through
sdb: assuming drive cache: write through

I suppose that if /sys/kernel/uevent_helper exists then kernel is
correctly configured for supporting hotplug.

Why my /sbin/hotplug is not running ?

Where I may make mistake ?

Thanks for any help !

-- 
Please consider the environment before printing this email.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: why kernel not call /sbin/hotplug ?
  2008-10-09  9:25 why kernel not call /sbin/hotplug ? Grzegorz Heldt
@ 2008-10-09  9:43 ` Kay Sievers
  2008-10-09 11:39 ` Grzegorz Heldt
  2008-10-09 15:19 ` Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2008-10-09  9:43 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Oct 9, 2008 at 11:25 AM, Grzegorz Heldt
<grzegorz.heldt@gmail.com> wrote:

> I have embedded system based on sh4-cpu with kernel 2.6.17.14.  I have
> build latest rt73.ko module which is usb-wifi driver. This driver also
> need firmware to be loaded into device during initialization.
>
> Basing on information that I found, i put following script in /sbin/hotplug:
>
> #cat /sbin/hotplug
> #!/bin/sh
> echo hotplug script is runned !
>
> HOTPLUG_FW_DIR=/lib/firmware/
>
>                echo 1 > /sys/$DEVPATH/loading
>                cat $HOTPLUG_FW_DIR/$FIRMWARE > /sysfs/$DEVPATH/data

/sysfs/... ?

And do not use echo on stdout, kernel forked process don't have that,
and also check for $ACTION­d.

Kay

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: why kernel not call /sbin/hotplug ?
  2008-10-09  9:25 why kernel not call /sbin/hotplug ? Grzegorz Heldt
  2008-10-09  9:43 ` Kay Sievers
@ 2008-10-09 11:39 ` Grzegorz Heldt
  2008-10-09 15:19 ` Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Grzegorz Heldt @ 2008-10-09 11:39 UTC (permalink / raw)
  To: linux-hotplug

Thank you Kay !

I repair my hotplug script, now it looks like that:



# cat /sbin/hotplug
#!/bin/sh
echo hotplug script is runned !

HOTPLUG_FW_DIR=/lib/firmware/
touch /dtv/hotplug_log

echo  $ACTION $DEVPATH $PRODUCT $INTERFACE $TYPE >> /dtv/hotplug_log

                echo 1 > /sys/$DEVPATH/loading
                cat $HOTPLUG_FW_DIR/$FIRMWARE > /sys/$DEVPATH/data
                echo 0 > /sys/$DEVPATH/loading

now I see that this script is runned because I see this in log. After
reboot the log looks like that:

# cat /dtv/hotplug_log
add /block/sda
add /block/sda

after putting and removing usb-flash-disk it look's like that:
# cat /dtv/hotplug_log
add /block/sda
add /block/sda
add /block/sdb/sdb1
add /block/sdb

remove /block/sdb
remove /block/sdb/sdb1

but there is no change after putting my usb-wifi card. I know that
kernel see that i put it into usb socket because I still have message
that it cannot find firmware file.

I'm confused.

Any advice for me ?

Thanx
Greg.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: why kernel not call /sbin/hotplug ?
  2008-10-09  9:25 why kernel not call /sbin/hotplug ? Grzegorz Heldt
  2008-10-09  9:43 ` Kay Sievers
  2008-10-09 11:39 ` Grzegorz Heldt
@ 2008-10-09 15:19 ` Greg KH
  2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2008-10-09 15:19 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Oct 09, 2008 at 01:39:59PM +0200, Grzegorz Heldt wrote:
> Thank you Kay !
> 
> I repair my hotplug script, now it looks like that:
> 
> 
> 
> # cat /sbin/hotplug
> #!/bin/sh
> echo hotplug script is runned !
> 
> HOTPLUG_FW_DIR=/lib/firmware/
> touch /dtv/hotplug_log
> 
> echo  $ACTION $DEVPATH $PRODUCT $INTERFACE $TYPE >> /dtv/hotplug_log
> 
>                 echo 1 > /sys/$DEVPATH/loading
>                 cat $HOTPLUG_FW_DIR/$FIRMWARE > /sys/$DEVPATH/data
>                 echo 0 > /sys/$DEVPATH/loading
> 
> now I see that this script is runned because I see this in log. After
> reboot the log looks like that:
> 
> # cat /dtv/hotplug_log
> add /block/sda
> add /block/sda
> 
> after putting and removing usb-flash-disk it look's like that:
> # cat /dtv/hotplug_log
> add /block/sda
> add /block/sda
> add /block/sdb/sdb1
> add /block/sdb
> 
> remove /block/sdb
> remove /block/sdb/sdb1
> 
> but there is no change after putting my usb-wifi card. I know that
> kernel see that i put it into usb socket because I still have message
> that it cannot find firmware file.
> 
> I'm confused.
> 
> Any advice for me ?

Use a newer kernel version?  Your 2.6.17 kernel is almost 3 years old
now.  If it is a vendor-supplied kernel, they should be able to help you
out with this issue.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-10-09 15:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-09  9:25 why kernel not call /sbin/hotplug ? Grzegorz Heldt
2008-10-09  9:43 ` Kay Sievers
2008-10-09 11:39 ` Grzegorz Heldt
2008-10-09 15: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;
as well as URLs for NNTP newsgroup(s).