summaryrefslogtreecommitdiff
path: root/package/base-files/files/etc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-01-23 21:58:01 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-01-23 21:58:01 +0000
commit3634de3b80e35576bbc5e3fa54c5e1dbfae8b4f9 (patch)
tree7514dcac67e120bccda8621019106653ab037dda /package/base-files/files/etc
parent1089b3213d5f1db9c1febb66ff1ab97284e434ae (diff)
downloadmtk-20170518-3634de3b80e35576bbc5e3fa54c5e1dbfae8b4f9.zip
mtk-20170518-3634de3b80e35576bbc5e3fa54c5e1dbfae8b4f9.tar.gz
mtk-20170518-3634de3b80e35576bbc5e3fa54c5e1dbfae8b4f9.tar.bz2
base-files: try to activate hotplugged partitions as swap and fall back to lazy mount (#6517)
SVN-Revision: 19300
Diffstat (limited to 'package/base-files/files/etc')
-rw-r--r--package/base-files/files/etc/hotplug.d/block/10-mount9
1 files changed, 5 insertions, 4 deletions
diff --git a/package/base-files/files/etc/hotplug.d/block/10-mount b/package/base-files/files/etc/hotplug.d/block/10-mount
index b0104dd..3896893 100644
--- a/package/base-files/files/etc/hotplug.d/block/10-mount
+++ b/package/base-files/files/etc/hotplug.d/block/10-mount
@@ -1,6 +1,5 @@
#!/bin/sh
-
-# Copyright (C) 2009 OpenWrt.org
+# Copyright (C) 2009-2010 OpenWrt.org
blkdev=`dirname $DEVPATH`
if [ `basename $blkdev` != "block" ]; then
@@ -8,8 +7,10 @@ if [ `basename $blkdev` != "block" ]; then
device=`basename $DEVPATH`
case "$ACTION" in
add)
- mkdir -p /mnt/$device
- mount /dev/$device /mnt/$device
+ swapon /dev/$device >/dev/null 2>/dev/null || (
+ mkdir -p /mnt/$device
+ mount /dev/$device /mnt/$device
+ )
;;
remove)
umount /dev/$device