summaryrefslogtreecommitdiff
path: root/package/block-mount/files/10-swap
diff options
context:
space:
mode:
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-06-21 16:53:00 +0000
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-06-21 16:53:00 +0000
commit1822375c7c5caa5d7a8622a9f9f95250c92a31aa (patch)
treee7bd0f969d9e65e8197087b9e238588c46a92ecd /package/block-mount/files/10-swap
parent21652532947588e4cf9ecc9493632b22097b6490 (diff)
block-mount: drop package, ubox now does the job for us
Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36988 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/block-mount/files/10-swap')
-rw-r--r--package/block-mount/files/10-swap78
1 files changed, 0 insertions, 78 deletions
diff --git a/package/block-mount/files/10-swap b/package/block-mount/files/10-swap
deleted file mode 100644
index 2837d2763e..0000000000
--- a/package/block-mount/files/10-swap
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2009-2010 OpenWrt.org
-# Copyright (C) 2010 Vertical Communications
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-. /lib/functions/block.sh
-
-blkdev=`dirname $DEVPATH`
-
-if [ `basename $blkdev` != "block" ]; then
-
- device=`basename $DEVPATH`
-
-
- case "$ACTION" in
- add)
- local autoswap_from_fstab
- local automount_from_fstab
- local from_fstab
- local anon_mount
- local anon_swap
- local anon_fsck
- local mds_mount_device
- local sds_swap_device
- local sds_swap_enabled
- local use_device
- local do_swap=0
-
- mount_dev_section_cb() {
- mds_mount_device="$3"
- }
-
- swap_dev_section_cb() {
- sds_swap_device="$2"
- sds_swap_enabled="$3"
- return 0
- }
-
- config_get_automount
- automount_from_fstab="$from_fstab"
-
- [ "$automount_from_fstab" -eq 1 ] && {
- config_get_mount_section_by_device "/dev/$device"
- }
-
- # skip trying swap if this device is defined as a mount point
- [ -z "$mds_mount_device" ] && {
- config_get_autoswap
- autoswap_from_fstab="$from_fstab"
-
- [ "$autoswap_from_fstab" -eq 1 ] && {
- config_get_swap_section_by_device "/dev/$device"
- use_device="$sds_swap_device"
- do_swap="$sds_swap_enabled"
- }
-
- [ -z "$use_device" ] && [ "$anon_swap" -eq 1 ] && {
- use_device="/dev/$device" && do_swap=1
- }
- }
-
- [ -n "$use_device" ] && [ "$do_swap" -eq 1 ] && {
- grep -q "$use_device" /proc/swaps || grep -q "$use_device" /proc/mounts || {
- swapon "$use_device"
- }
- }
- reset_dev_section_cb
- ;;
- remove)
- grep -q "/dev/$device" /proc/swaps && {
- swapoff "/dev/$device"
- }
- ;;
- esac
-fi
-