diff options
Diffstat (limited to 'meta/packages/linux-hotplug/files/mmc.agent')
-rwxr-xr-x | meta/packages/linux-hotplug/files/mmc.agent | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/meta/packages/linux-hotplug/files/mmc.agent b/meta/packages/linux-hotplug/files/mmc.agent new file mode 100755 index 0000000000..a80daa4603 --- /dev/null +++ b/meta/packages/linux-hotplug/files/mmc.agent | |||
@@ -0,0 +1,52 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # H3600 Sleeve hotplug policy agent for Linux 2.4 kernels | ||
4 | # | ||
5 | # Kernel NET hotplug params include: | ||
6 | # | ||
7 | # ACTION=%s [add or remove] | ||
8 | # MEDIA=%s | ||
9 | # SLOT=%d | ||
10 | # | ||
11 | |||
12 | . /etc/hotplug/hotplug.functions | ||
13 | #DEBUG=yes export DEBUG | ||
14 | |||
15 | echo "Executing $0 action=$ACTION, media=$MEDIA ($SLOT)" > /dev/console | ||
16 | |||
17 | MMC_MOUNT_OPTIONS="-t auto -o sync,noatime" | ||
18 | |||
19 | if [ -f /etc/sysconfig/hotplug ] ; then | ||
20 | . /etc/sysconfig/hotplug | ||
21 | fi | ||
22 | |||
23 | case `uname -r` in | ||
24 | 2.4*) | ||
25 | devpath=mmc/part | ||
26 | ;; | ||
27 | *) | ||
28 | devpath=mmcblk0p | ||
29 | ;; | ||
30 | esac | ||
31 | |||
32 | if [ "$ACTION" = "add" ] ; then | ||
33 | sleep 4 | ||
34 | echo -n add > /dev/console | ||
35 | for n in 1 2 3 4 ; do | ||
36 | device=/dev/$devpath$n | ||
37 | if [ "$n" = "1" ] ; then | ||
38 | card=/mnt/card | ||
39 | else | ||
40 | card=/mnt/card$n | ||
41 | fi | ||
42 | [ -b $device ] || break | ||
43 | echo " flash on $device" > /dev/console | ||
44 | [ -d $card ] || mkdir -p $card | ||
45 | mount $MMC_MOUNT_OPTIONS $device $card | ||
46 | done | ||
47 | |||
48 | else | ||
49 | for card in /mnt/card*; do | ||
50 | umount $card | ||
51 | done | ||
52 | fi | ||