include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=base-files
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=base-files
PKG_FILE_DEPEND:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
PKG_FILE_DEPEND:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
option fstype ext3
option options rw,sync
option enabled 0
option fstype ext3
option options rw,sync
option enabled 0
+
+config swap
+ option device /dev/sda2
+ option enabled 0
+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 /usr/sbin/swapon ] && {
+ /usr/sbin/swapon $device
+ }
+}
+
do_unmount() {
local cfg="$1"
config_get target "$cfg" target
do_unmount() {
local cfg="$1"
config_get target "$cfg" target
+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 /usr/sbin/swapoff ] && {
+ /usr/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