From 85b201f54538e4198183126a9f00130e2fc01df0 Mon Sep 17 00:00:00 2001 From: mbm Date: Sat, 26 Aug 2006 01:04:43 +0000 Subject: clean up hotplug mounting scripts git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4673 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../default/etc/hotplug.d/block/01-mount | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 package/base-files/default/etc/hotplug.d/block/01-mount (limited to 'package/base-files/default/etc/hotplug.d/block/01-mount') diff --git a/package/base-files/default/etc/hotplug.d/block/01-mount b/package/base-files/default/etc/hotplug.d/block/01-mount new file mode 100755 index 000000000..b6275e5a2 --- /dev/null +++ b/package/base-files/default/etc/hotplug.d/block/01-mount @@ -0,0 +1,26 @@ +#!/bin/sh +# Copyright (C) 2006 OpenWrt.org + +DEV=${DEVPATH##*/} +{ +echo "ACTION=$ACTION DEVPATH=$DEVPATH $0 $*" +case "$ACTION" in +add) + echo -ne "waiting for $DEV" + while [ ! -b /dev/$DEV ]; do { + echo -ne "." + sleep 1 + time=$((time+1)); [ $time -gt 10 ] && break + }; done + + [ ${DEV%%[0-9]} != ${DEV} ] && { + mkdir -p /tmp/$DEV + mount /dev/$DEV /tmp/$DEV -t auto -o sync + } + ;; +remove) + umount /tmp/$DEV + rm -rf /dev/$DEV /tmp/$DEV + ;; +esac +} 2>&1 | logger -- cgit v1.2.3