2006-07-18 16:17:19 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
|
|
|
|
|
|
|
PKG_NAME:=kernel
|
|
|
|
PKG_VERSION:=$(LINUX_VERSION)-$(BOARD)
|
2006-08-27 13:08:53 +00:00
|
|
|
PKG_RELEASE:=$(LINUX_RELEASE)
|
2006-07-18 16:17:19 +00:00
|
|
|
|
|
|
|
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/packages
|
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
ifeq ($(DUMP),)
|
|
|
|
-include $(LINUX_DIR)/.config
|
2006-07-22 12:33:28 +00:00
|
|
|
NF_KMOD:=1
|
2006-07-18 16:17:19 +00:00
|
|
|
include $(INCLUDE_DIR)/netfilter.mk
|
|
|
|
endif
|
|
|
|
|
|
|
|
define Build/Prepare
|
|
|
|
mkdir -p $(PKG_BUILD_DIR)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/Compile
|
|
|
|
endef
|
|
|
|
|
|
|
|
define KernelPackage/Defaults
|
|
|
|
FILES:=
|
2006-07-21 22:51:02 +00:00
|
|
|
KCONFIG:=m
|
2006-07-18 16:17:19 +00:00
|
|
|
AUTOLOAD:=
|
|
|
|
endef
|
|
|
|
|
|
|
|
define ModuleAutoLoad
|
|
|
|
export modules=; \
|
|
|
|
add_module() { \
|
|
|
|
mkdir -p $(2)/etc/modules.d; \
|
|
|
|
echo "$$$$$$$$2" > $(2)/etc/modules.d/$$$$$$$$1-$(1); \
|
|
|
|
modules="$$$$$$$${modules:+$$$$$$$$modules }$$$$$$$$1-$(1)"; \
|
|
|
|
}; \
|
|
|
|
$(3) \
|
2006-07-18 16:35:03 +00:00
|
|
|
if [ -n "$$$$$$$$modules" ]; then \
|
2006-07-18 16:17:19 +00:00
|
|
|
mkdir -p $(2)/etc/modules.d; \
|
2006-07-30 17:06:02 +00:00
|
|
|
echo "#!/bin/sh" > $(2)/CONTROL/postinst; \
|
|
|
|
echo "[ -z \"\$$$$$$$$IPKG_INSTROOT\" ] || exit 0" >> $(2)/CONTROL/postinst; \
|
2006-07-18 16:17:19 +00:00
|
|
|
echo ". /etc/functions.sh" >> $(2)/CONTROL/postinst; \
|
|
|
|
echo "load_modules $$$$$$$$modules" >> $(2)/CONTROL/postinst; \
|
|
|
|
chmod 0755 $(2)/CONTROL/postinst; \
|
2006-07-18 16:35:03 +00:00
|
|
|
fi
|
2006-07-18 16:17:19 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
|
|
define KernelPackage
|
|
|
|
NAME:=$(1)
|
|
|
|
$(eval $(call KernelPackage/Defaults))
|
|
|
|
$(eval $(call KernelPackage/$(1)))
|
|
|
|
$(eval $(call KernelPackage/$(1)/$(KERNEL)))
|
|
|
|
|
|
|
|
define Package/kmod-$(1)
|
|
|
|
TITLE:=$(TITLE)
|
|
|
|
SECTION:=kernel
|
|
|
|
CATEGORY:=Kernel modules
|
2006-07-21 22:51:02 +00:00
|
|
|
DEFAULT:=m
|
2006-07-18 16:17:19 +00:00
|
|
|
DESCRIPTION:=$(DESCRIPTION)
|
2006-08-23 21:05:42 +00:00
|
|
|
EXTRA_DEPENDS:='kernel (=$(PKG_VERSION)-$(PKG_RELEASE))'
|
2006-07-21 22:51:02 +00:00
|
|
|
$(call KernelPackage/$(1))
|
|
|
|
$(call KernelPackage/$(1)/$(KERNEL))
|
2006-07-18 16:17:19 +00:00
|
|
|
endef
|
|
|
|
|
2006-07-23 14:21:26 +00:00
|
|
|
ifeq ($(findstring m,$(KCONFIG)),m)
|
2006-07-25 14:44:54 +00:00
|
|
|
ifneq ($(strip $(FILES)),)
|
2006-07-23 14:21:26 +00:00
|
|
|
define Package/kmod-$(1)/install
|
|
|
|
mkdir -p $$(1)/lib/modules/$(LINUX_VERSION)
|
|
|
|
$(CP) $$(FILES) $$(1)/lib/modules/$(LINUX_VERSION)/
|
|
|
|
$(call ModuleAutoLoad,$(1),$$(1),$(AUTOLOAD))
|
|
|
|
endef
|
|
|
|
endif
|
2006-07-25 14:44:54 +00:00
|
|
|
endif
|
2006-07-18 16:17:19 +00:00
|
|
|
$$(eval $$(call BuildPackage,kmod-$(1)))
|
|
|
|
endef
|
|
|
|
|
|
|
|
define AutoLoad
|
|
|
|
add_module $(1) "$(2)";
|
|
|
|
endef
|
|
|
|
|
|
|
|
include ./modules.mk
|
|
|
|
|