2011/04/12

SD card automount for Embedded Linux

If we want to using SD card auto mount.

Please reference manual page of command "mdev".

#  mdev --helpBusyBox v1.18.4 (2011-04-01 22:32:35 CST) multi-call binary.
Usage: mdev [-s]
-s      Scan /sys and populate /dev during system boot
It can be run by kernel as a hotplug helper. To activate it: echo /sbin/mdev > /proc/sys/kernel/hotplug

It uses /etc/mdev.conf with lines[-]DEVNAME UID:GID PERM [>|=PATH] [@|$|*PROG]

 

Follow above information.

step 1. make sure build the feature "hotplug" to kernel

step 2. edit /etc/mdev.conf like below :

sd.*    0:0     660     */sbin/automount.sh     $MDEV

mmc.*   0:0     660     */sbin/automount.sh     $MDEV

step 3. add /sbin/automount.sh like below:

 

automount

 

step 4.  Add command at /etc/rc.d/rc.sysinit

# echo /sbin/mdev > /proc/sys/kernel/hotplug

沒有留言:

張貼留言