2009-07-26 02:05:51 +03:00
|
|
|
#
|
2010-04-23 14:27:29 +03:00
|
|
|
# Copyright (C) 2009-2010 OpenWrt.org
|
2009-07-26 02:05:51 +03:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
|
|
|
|
|
|
|
PKG_NAME:=compcache
|
2010-03-19 18:34:41 +02:00
|
|
|
PKG_VERSION:=0.6.2
|
2010-08-06 18:46:13 +03:00
|
|
|
PKG_RELEASE:=2
|
2009-07-26 02:05:51 +03:00
|
|
|
PKG_SOURCE_URL:=http://compcache.googlecode.com/files/
|
2010-03-19 18:34:41 +02:00
|
|
|
PKG_MD5SUM:=27aec78dc50e34fb800c74e879057743
|
2009-07-26 02:05:51 +03:00
|
|
|
|
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
2010-05-13 14:36:38 +03:00
|
|
|
define KernelPackage/ramzswap
|
2009-07-26 02:05:51 +03:00
|
|
|
SUBMENU:=Other modules
|
2011-06-04 16:35:48 +03:00
|
|
|
DEPENDS:=@BUSYBOX_CONFIG_SWAPONOFF @!(LINUX_2_6_38||LINUX_2_6_39)
|
2009-07-26 02:05:51 +03:00
|
|
|
TITLE:=Driver for compressed ram swap device
|
|
|
|
VERSION:=$(LINUX_VERSION)-$(BOARD)-$(LINUX_RELEASE)+$(PKG_RELEASE)
|
2010-08-06 18:46:13 +03:00
|
|
|
FILES:=$(PKG_BUILD_DIR)/ramzswap.ko \
|
|
|
|
$(PKG_BUILD_DIR)/sub-projects/compression/lzo-kmod/lzo1x.ko
|
2010-04-23 14:27:29 +03:00
|
|
|
URL:=http://code.google.com/p/compcache/
|
2009-07-26 02:05:51 +03:00
|
|
|
endef
|
|
|
|
|
2010-05-13 14:36:38 +03:00
|
|
|
define Package/compcache
|
|
|
|
SECTION:=util
|
|
|
|
CATEGORY:=Utilities
|
|
|
|
DEPENDS:=+kmod-ramzswap
|
|
|
|
TITLE:=Compressed ram swap device
|
|
|
|
URL:=http://code.google.com/p/compcache/
|
|
|
|
MENU:=1
|
|
|
|
endef
|
2010-03-19 18:34:41 +02:00
|
|
|
|
2010-03-05 02:56:05 +02:00
|
|
|
include $(INCLUDE_DIR)/kernel-defaults.mk
|
|
|
|
|
2010-08-06 18:46:13 +03:00
|
|
|
LZO = sub-projects/compression/lzo-kmod
|
2010-03-19 18:34:41 +02:00
|
|
|
RZSC = sub-projects/rzscontrol
|
2009-07-26 02:05:51 +03:00
|
|
|
|
2010-08-06 18:46:13 +03:00
|
|
|
BUILDFLAGS:=-DCONFIG_RAMZSWAP_STATS \
|
|
|
|
-I$(PKG_BUILD_DIR)/$(LZO) \
|
|
|
|
-Wall
|
|
|
|
|
2010-03-19 18:34:41 +02:00
|
|
|
RZSCFLAGS:=-I$(PKG_BUILD_DIR)/$(RZSC)/../include \
|
|
|
|
-I$(PKG_BUILD_DIR)/$(RZSC)/../..
|
2009-07-26 02:05:51 +03:00
|
|
|
|
2010-08-06 18:46:13 +03:00
|
|
|
define Build/Compile
|
|
|
|
$(MAKE) $(KERNEL_MAKEOPTS) EXTRA_CFLAGS="$(BUILDFLAGS)" M="$(PKG_BUILD_DIR)" modules
|
2010-03-19 18:34:41 +02:00
|
|
|
$(TARGET_CC) $(TARGET_CFLAGS) $(RZSCFLAGS) $(PKG_BUILD_DIR)/$(RZSC)/rzscontrol.c -o $(PKG_BUILD_DIR)/rzscontrol
|
2010-08-06 18:46:13 +03:00
|
|
|
endef
|
2009-07-26 02:05:51 +03:00
|
|
|
|
2010-05-13 14:36:38 +03:00
|
|
|
define Package/compcache/install
|
2009-07-26 02:05:51 +03:00
|
|
|
$(INSTALL_DIR) $(1)/etc/config
|
|
|
|
$(INSTALL_DATA) ./files/compcache.config $(1)/etc/config/compcache
|
2009-11-24 00:30:42 +02:00
|
|
|
$(SED) 's,%ENABLED%,$(if $(CONFIG_COMPCACHE_ENABLE),1,0),g' \
|
|
|
|
-e 's,%RAM_REPORTED%,$(call qstrip,$(CONFIG_COMPCACHE_RAM_REPORTED)),g' \
|
|
|
|
-e 's,%BACKUP_DEV%,$(call qstrip,$(CONFIG_COMPCACHE_BACKUP_DEV)),g' \
|
|
|
|
$(1)/etc/config/compcache
|
2009-07-26 02:05:51 +03:00
|
|
|
$(INSTALL_DIR) $(1)/etc/init.d
|
|
|
|
$(INSTALL_BIN) ./files/compcache.init $(1)/etc/init.d/compcache
|
2010-03-19 18:34:41 +02:00
|
|
|
$(INSTALL_DIR) $(1)/sbin
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/rzscontrol $(1)/sbin/rzscontrol
|
2009-07-26 02:05:51 +03:00
|
|
|
endef
|
|
|
|
|
2010-05-13 14:36:38 +03:00
|
|
|
define Package/compcache/config
|
2009-11-24 00:30:42 +02:00
|
|
|
source "$(SOURCE)/Config.in"
|
|
|
|
endef
|
|
|
|
|
2010-05-13 14:36:38 +03:00
|
|
|
$(eval $(call BuildPackage,compcache))
|
|
|
|
$(eval $(call KernelPackage,ramzswap))
|