1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-10-07 10:10:58 +03:00
openwrt-xburst/package/base-files/files/etc/hotplug.d/block/10-mount
jow f5cd730117 [package] base-files: try to activate hotplugged partitions as swap and fall back to lazy mount (#6517)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19300 3c298f89-4303-0410-b956-a3cf2f4a3e73
2010-01-23 21:58:01 +00:00

21 lines
347 B
Bash

#!/bin/sh
# Copyright (C) 2009-2010 OpenWrt.org
blkdev=`dirname $DEVPATH`
if [ `basename $blkdev` != "block" ]; then
device=`basename $DEVPATH`
case "$ACTION" in
add)
swapon /dev/$device >/dev/null 2>/dev/null || (
mkdir -p /mnt/$device
mount /dev/$device /mnt/$device
)
;;
remove)
umount /dev/$device
;;
esac
fi