[Buildroot] package/hotplug

H Hartley Sweeten hartleys at visionengravers.com
Thu Aug 19 18:38:15 UTC 2010

On Thursday, August 19, 2010 10:58 AM, Will Newton wrote:
> On Thu, Aug 19, 2010 at 6:10 PM, H Hartley Sweeten wrote:
>> But, how to I get mdev to mount the drive after it's detected?
> it may be possible with the mdev config file. It seems to only be
> documented in the source:
> http://git.busybox.net/busybox/tree/util-linux/mdev.c
> See the section that mentions executing a command.

I figured it had something to do with the mdev.conf file.  I did
some grep'ing and found the KwikByte target handles this with a
custom '/sbin/automount.script' that is called by mdev.

I have modified my setup and it appears to be working.  When I plug
in the USB drive it is now detected and mounted.  The only issue I
have now is when the drive is removed.  mdev does call the script
to unmount the drive but I get two kernel errors:

usb 2-1.4: USB disconnect, address 4
FAT: bread failed in fat_clusters_flush
FAT: bread failed in fat_clusters_flush

I think these are generated because the drive is actually not present
when umount tries to unmount it.  I'm using the -f option (force unmount)
but that doesn't seem to prevent the error.

Thanks for the help,

More information about the buildroot mailing list