* Linux hotplug - doesn't seem to work
@ 2009-11-02 2:23 Sujith Sankar
2009-11-02 10:31 ` Alan Jenkins
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Sujith Sankar @ 2009-11-02 2:23 UTC (permalink / raw)
To: linux-hotplug
Hi,
In the embedded application that I'm working on, I need to mount USB
mass storage devices when they are plugged in.
After going through the documentation, it seems that Linux hotplug
could help in achieving this. For this, CONFIG_HOTPLUG was enabled
using make menuconfig. When Linux comes up, I see that
- "cat /proc/sys/kernel/hotplug" gives "/sbin/hotplug", but such
a file (/sbin/hotplug) is not there.
- Creating my own /sbin/hotplug which echoes "hotplug" to
/root/log does not echo "hotplug" to /root/log when I insert or remove
a USB mass storage device. This shows that /sbin/hotplug is not
getting invoked.
- If a USB mass storage device is plugged in, the USB subsystem
identifies it. After this, if busybox mdev (which, I believe, is a
scaled down version of udev, but not a daemon) is run,
/dev/device_file is getting created. The device could be mounted
using the command "mount -t vfat /dev/device_file /mnt". (busybox
mdev allows automating this mounting through its conf file)
1. Is there any other configuration that is required to make USB hotplug work?
2. To achieve USB hotplug, is there a better (in terms of memory
usage as well) way than hooking busybox mdev to USB hotplug trigger?
I feel that things could fall in place if I could get this USB hotplug
working. It would be great if someone could help me out with this.
Thanks,
-Sujith
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Linux hotplug - doesn't seem to work
2009-11-02 2:23 Linux hotplug - doesn't seem to work Sujith Sankar
@ 2009-11-02 10:31 ` Alan Jenkins
2009-11-02 15:55 ` Sujith Sankar
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Alan Jenkins @ 2009-11-02 10:31 UTC (permalink / raw)
To: linux-hotplug
On 11/2/09, Sujith Sankar <sujithsankar1@gmail.com> wrote:
> Hi,
>
> In the embedded application that I'm working on, I need to mount USB
> mass storage devices when they are plugged in.
>
> After going through the documentation, it seems that Linux hotplug
> could help in achieving this. For this, CONFIG_HOTPLUG was enabled
> using make menuconfig. When Linux comes up, I see that
> - "cat /proc/sys/kernel/hotplug" gives "/sbin/hotplug", but such
> a file (/sbin/hotplug) is not there.
> - Creating my own /sbin/hotplug which echoes "hotplug" to
> /root/log does not echo "hotplug" to /root/log when I insert or remove
> a USB mass storage device. This shows that /sbin/hotplug is not
> getting invoked.
Stupid question here - I take it you tried running /sbin/hotplug
manually, and checking that it does the right thing?
> - If a USB mass storage device is plugged in, the USB subsystem
> identifies it. After this, if busybox mdev (which, I believe, is a
> scaled down version of udev, but not a daemon) is run,
> /dev/device_file is getting created. The device could be mounted
> using the command "mount -t vfat /dev/device_file /mnt". (busybox
> mdev allows automating this mounting through its conf file)
>
> 1. Is there any other configuration that is required to make USB hotplug
> work?
I don't think so.
> 2. To achieve USB hotplug, is there a better (in terms of memory
> usage as well) way than hooking busybox mdev to USB hotplug trigger?
Hooking mdev seems a perfectly good way to do this. There's no
obvious alternative, unless you want to run the full udev daemon
instead... and I don't think that would make it any easier.
> I feel that things could fall in place if I could get this USB hotplug
> working. It would be great if someone could help me out with this.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Linux hotplug - doesn't seem to work
2009-11-02 2:23 Linux hotplug - doesn't seem to work Sujith Sankar
2009-11-02 10:31 ` Alan Jenkins
@ 2009-11-02 15:55 ` Sujith Sankar
2009-11-02 16:22 ` Greg KH
2009-11-02 16:33 ` Alan Jenkins
3 siblings, 0 replies; 5+ messages in thread
From: Sujith Sankar @ 2009-11-02 15:55 UTC (permalink / raw)
To: linux-hotplug
Hi Alan,
Thanks for the reply.
Yes, my /sbin/hotplug script works as intended if run manually.
Like you said, running the whole udev is not feasible due to the
memory constraints.
Regards,
-Sujith
On Mon, Nov 2, 2009 at 4:01 PM, Alan Jenkins
<sourcejedi.lkml@googlemail.com> wrote:
> On 11/2/09, Sujith Sankar <sujithsankar1@gmail.com> wrote:
>> Hi,
>>
>> In the embedded application that I'm working on, I need to mount USB
>> mass storage devices when they are plugged in.
>>
>> After going through the documentation, it seems that Linux hotplug
>> could help in achieving this. For this, CONFIG_HOTPLUG was enabled
>> using make menuconfig. When Linux comes up, I see that
>> - "cat /proc/sys/kernel/hotplug" gives "/sbin/hotplug", but such
>> a file (/sbin/hotplug) is not there.
>> - Creating my own /sbin/hotplug which echoes "hotplug" to
>> /root/log does not echo "hotplug" to /root/log when I insert or remove
>> a USB mass storage device. This shows that /sbin/hotplug is not
>> getting invoked.
>
> Stupid question here - I take it you tried running /sbin/hotplug
> manually, and checking that it does the right thing?
>
>> - If a USB mass storage device is plugged in, the USB subsystem
>> identifies it. After this, if busybox mdev (which, I believe, is a
>> scaled down version of udev, but not a daemon) is run,
>> /dev/device_file is getting created. The device could be mounted
>> using the command "mount -t vfat /dev/device_file /mnt". (busybox
>> mdev allows automating this mounting through its conf file)
>>
>> 1. Is there any other configuration that is required to make USB hotplug
>> work?
>
> I don't think so.
>
>> 2. To achieve USB hotplug, is there a better (in terms of memory
>> usage as well) way than hooking busybox mdev to USB hotplug trigger?
>
> Hooking mdev seems a perfectly good way to do this. There's no
> obvious alternative, unless you want to run the full udev daemon
> instead... and I don't think that would make it any easier.
>
>> I feel that things could fall in place if I could get this USB hotplug
>> working. It would be great if someone could help me out with this.
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Linux hotplug - doesn't seem to work
2009-11-02 2:23 Linux hotplug - doesn't seem to work Sujith Sankar
2009-11-02 10:31 ` Alan Jenkins
2009-11-02 15:55 ` Sujith Sankar
@ 2009-11-02 16:22 ` Greg KH
2009-11-02 16:33 ` Alan Jenkins
3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2009-11-02 16:22 UTC (permalink / raw)
To: linux-hotplug
On Mon, Nov 02, 2009 at 09:24:58PM +0530, Sujith Sankar wrote:
> Hi Alan,
>
> Thanks for the reply.
>
> Yes, my /sbin/hotplug script works as intended if run manually.
> Like you said, running the whole udev is not feasible due to the
> memory constraints.
Why? How much memory does udev take up that you can not handle? Lots
of tiny embedded systems run udev today just fine.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Linux hotplug - doesn't seem to work
2009-11-02 2:23 Linux hotplug - doesn't seem to work Sujith Sankar
` (2 preceding siblings ...)
2009-11-02 16:22 ` Greg KH
@ 2009-11-02 16:33 ` Alan Jenkins
3 siblings, 0 replies; 5+ messages in thread
From: Alan Jenkins @ 2009-11-02 16:33 UTC (permalink / raw)
To: linux-hotplug
On 11/2/09, Sujith Sankar <sujithsankar1@gmail.com> wrote:
> Hi Alan,
>
> Thanks for the reply.
>
> Yes, my /sbin/hotplug script works as intended if run manually.
> Like you said, running the whole udev is not feasible due to the
> memory constraints.
>
> Regards,
> -Sujith
Sorry, I have no idea what the problem is. If I had the system in
front of me... I'd be at the level of looking through the kernel
source code, and maybe testing what code gets run by sprinkling it
with printk() statements.
The generic code which actually calls /sbin/hotplug is in
lib/kobject_uevent.c. It already has a few pr_debug() calls (as
described in Documentation/dynamic-debug-howto.txt) . If it gets as
far as call_usermodehelper(), hopefully the return value would tell
you something interesting.
Alan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-11-02 16:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-02 2:23 Linux hotplug - doesn't seem to work Sujith Sankar
2009-11-02 10:31 ` Alan Jenkins
2009-11-02 15:55 ` Sujith Sankar
2009-11-02 16:22 ` Greg KH
2009-11-02 16:33 ` Alan Jenkins
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).