projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix swap{on,off} path
[openwrt.git]
/
package
/
base-files
/
files
/
etc
/
init.d
/
fstab
diff --git
a/package/base-files/files/etc/init.d/fstab
b/package/base-files/files/etc/init.d/fstab
index
2a63a5b
..
6dd52f2
100755
(executable)
--- a/
package/base-files/files/etc/init.d/fstab
+++ b/
package/base-files/files/etc/init.d/fstab
@@
-20,6
+20,16
@@
do_mount() {
}
}
}
}
+do_swapon() {
+ local cfg="$1"
+ config_get device "$cfg" device
+ [ -n "device" ] || return 0
+ config_get_bool enabled "$cfg" "enabled" '1'
+ [ "$enabled" -gt 0 ] && [ -x /sbin/swapon ] && {
+ /sbin/swapon $device
+ }
+}
+
do_unmount() {
local cfg="$1"
config_get target "$cfg" target
do_unmount() {
local cfg="$1"
config_get target "$cfg" target
@@
-30,13
+40,25
@@
do_unmount() {
}
}
}
}
+do_swapoff() {
+ local cfg="$1"
+ config_get device "$cfg" device
+ [ -n "device" ] || return 0
+ config_get_bool enabled "$cfg" "enabled" '1'
+ [ "$enabled" -gt 0 ] && [ -x /sbin/swapoff ] && {
+ /sbin/swapoff $device
+ }
+}
+
start() {
config_load fstab
config_foreach do_mount mount
start() {
config_load fstab
config_foreach do_mount mount
+ config_foreach do_swapon swap
}
stop() {
config_load fstab
config_foreach do_unmount mount
}
stop() {
config_load fstab
config_foreach do_unmount mount
+ config_foreach do_swapoff swap
}
}
This page took
0.024567 seconds
and
4
git commands to generate.