diff options
author | Richard Purdie <richard@openedhand.com> | 2006-07-21 10:10:31 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2006-07-21 10:10:31 +0000 |
commit | b2f192faabe412adce79534e22efe9fb69ee40e2 (patch) | |
tree | 7076c49d4286f8a1733650bd8fbc7161af200d57 /meta/packages/linux-hotplug/files/mmc.agent | |
parent | 2cf0eadf9f730027833af802d7e6c90b44248f80 (diff) | |
download | openembedded-core-b2f192faabe412adce79534e22efe9fb69ee40e2.tar.gz |
Rename /openembedded/ -> /meta/
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@530 311d38ba-8fff-0310-9ca6-ca027cbcb966
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 @@ +#!/bin/sh +# +# H3600 Sleeve hotplug policy agent for Linux 2.4 kernels +# +# Kernel NET hotplug params include: +# +# ACTION=%s [add or remove] +# MEDIA=%s +# SLOT=%d +# + +. /etc/hotplug/hotplug.functions +#DEBUG=yes export DEBUG + + echo "Executing $0 action=$ACTION, media=$MEDIA ($SLOT)" > /dev/console + +MMC_MOUNT_OPTIONS="-t auto -o sync,noatime" + +if [ -f /etc/sysconfig/hotplug ] ; then + . /etc/sysconfig/hotplug +fi + +case `uname -r` in +2.4*) + devpath=mmc/part + ;; +*) + devpath=mmcblk0p + ;; +esac + +if [ "$ACTION" = "add" ] ; then + sleep 4 + echo -n add > /dev/console + for n in 1 2 3 4 ; do + device=/dev/$devpath$n + if [ "$n" = "1" ] ; then + card=/mnt/card + else + card=/mnt/card$n + fi + [ -b $device ] || break + echo " flash on $device" > /dev/console + [ -d $card ] || mkdir -p $card + mount $MMC_MOUNT_OPTIONS $device $card + done + +else + for card in /mnt/card*; do + umount $card + done +fi |