udev failed to automount USB memory stick on mpc8313

Zhigang Wang wzgllc at gmail.com
Thu Apr 8 08:33:57 EST 2010


I am using the latest LTIB BSP (2.6.23) for mpc8313 and want to use
udev to automatically mount and umount USB flash storage.

But it appears udev never executes the rule and the script file even
though it is called when a stick is attached. I can manually mount the
USB stick with no problem.
Here is the rule file and the script.

File: 10-local.rules
ACTION=="add", KERNEL=="sd[a-z][0-9]", SUBSYSTEM=="block",
RUN+="/root/usbmount.sh"

File: usbmount.sh

#!/bin/sh

if [ $ACTION == "add" ]
then
        mount -t vfat     /dev/sda1 /root/files
  elif [ $ACTION == "remove" ]

then
        umount -l /root/files
fi

Can someone tell me how to make it work?

Thanks.


More information about the Linuxppc-dev mailing list