2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
10 LINUX_VERSION
:=<LINUX_VERSION
>
12 -include $(TOPDIR
)/.kernel.mk
14 ifneq (,$(findstring 2.4.
,$(LINUX_VERSION
)))
18 ifneq (,$(findstring 2.6.
,$(LINUX_VERSION
)))
23 LINUX_KARCH
:=$(shell echo
$(ARCH
) | sed
-e
's/i[3-9]86/i386/' \
31 KERNEL_BUILD_DIR
:=$(BUILD_DIR
)/linux-
$(KERNEL
)-$(BOARD
)
32 LINUX_DIR
:= $(KERNEL_BUILD_DIR
)/linux-
$(LINUX_VERSION
)
34 MODULES_SUBDIR
:=lib
/modules
/$(LINUX_VERSION
)
35 MODULES_DIR
:= $(KERNEL_BUILD_DIR
)/modules
/$(MODULES_SUBDIR
)
36 TARGET_MODULES_DIR
:= $(LINUX_TARGET_DIR
)/$(MODULES_SUBDIR
)
37 KMOD_BUILD_DIR
:= $(KERNEL_BUILD_DIR
)/linux-modules
39 LINUX_KERNEL
:=$(KERNEL_BUILD_DIR
)/vmlinux
42 # FIXME: remove this crap
44 ifeq ($$(strip $(4)),)
50 IDEPEND_
$(1):=kernel
($(LINUX_VERSION
)-$(BOARD
)-$(LINUX_RELEASE
)) $(foreach pkg
,$(5),", $(pkg)")
52 PKG_
$(1) := $(PACKAGE_DIR
)/kmod-
$(2)_
$(LINUX_VERSION
)-$(BOARD
)-$(LINUX_RELEASE
)_
$(ARCH
).ipk
53 I_
$(1) := $(KMOD_BUILD_DIR
)/ipkg
/$(2)
55 ifeq ($$(KDEPEND_
$(1)),m
)
56 ifneq ($$(CONFIG_PACKAGE_KMOD_
$(1)),)
57 TARGETS
+= $$(PKG_
$(1))
59 ifeq ($$(CONFIG_PACKAGE_KMOD_
$(1)),y
)
60 INSTALL_TARGETS
+= $$(PKG_
$(1))
64 $$(PKG_
$(1)): $(LINUX_DIR
)/.modules_done
66 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$$(I_
$(1)) ..
/control
/kmod-
$(2).control
$(LINUX_VERSION
)-$(BOARD
)-$(LINUX_RELEASE
) $(ARCH
)
67 echo
"Depends: $$(IDEPEND_$(1))" >> $$(I_
$(1))/CONTROL
/control
68 ifneq ($(strip $(3)),)
69 mkdir
-p
$$(I_
$(1))/lib
/modules
/$(LINUX_VERSION
)
70 $(CP
) $(3) $$(I_
$(1))/lib
/modules
/$(LINUX_VERSION
)
73 mkdir
-p
$$(I_
$(1))/etc
/modules.d
74 for module in
$(7); do \
75 echo
$$$$module >> $$(I_
$(1))/etc
/modules.d
/$(6)-$(2); \
77 echo
"#!/bin/sh" >> $$(I_
$(1))/CONTROL
/postinst
78 echo
"[ -z \"\$$$$IPKG_INSTROOT\" ] || exit" >> $$(I_
$(1))/CONTROL
/postinst
79 echo
". /etc/functions.sh" >> $$(I_
$(1))/CONTROL
/postinst
80 echo
"load_modules /etc/modules.d/$(6)-$(2)" >> $$(I_
$(1))/CONTROL
/postinst
81 chmod
0755 $$(I_
$(1))/CONTROL
/postinst
84 $(IPKG_BUILD
) $$(I_
$(1)) $(PACKAGE_DIR
)
This page took 0.045584 seconds and 5 git commands to generate.