diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-01-23 21:58:01 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-01-23 21:58:01 +0000 |
commit | 94e23a1c5622e047887d05425e5993cb546b4c22 (patch) | |
tree | eb7de7647cf470d7bc4f8d7f8d418a667fa0d7cc | |
parent | 5073caab200123720eebe3e7e69dd6fadd37dab6 (diff) | |
download | upstream-94e23a1c5622e047887d05425e5993cb546b4c22.tar.gz upstream-94e23a1c5622e047887d05425e5993cb546b4c22.tar.bz2 upstream-94e23a1c5622e047887d05425e5993cb546b4c22.zip |
[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
-rw-r--r-- | package/base-files/files/etc/hotplug.d/block/10-mount | 9 |
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 b0104ddfd6..38968933fa 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 |