3 include $(TOPDIR
)/rules.mk
7 PKG_BUILD_DIR
:= $(BUILD_DIR
)/linux-modules
16 ifeq ($$(strip $(4)),)
22 PKG_
$(1) := $(PACKAGE_DIR
)/kmod-
$(2)_
$(LINUX_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
23 I_
$(1) := $(PKG_BUILD_DIR
)/ipkg
/$(2)
25 ifeq ($$(KDEPEND_
$(1)),m
)
26 ifneq ($(BR2_PACKAGE_KMOD_
$(1)),)
27 TARGETS
+= $$(PKG_
$(1))
29 ifeq ($(BR2_PACKAGE_KMOD_
$(1)),y
)
30 INSTALL_TARGETS
+= $$(PKG_
$(1))
34 $$(PKG_
$(1)): $(LINUX_DIR
)/.modules_done
35 mkdir
-p
$$(I_
$(1))/lib
/modules
/$(LINUX_VERSION
)
36 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$$(I_
$(1)) control
/kmod-
$(2).control
$(LINUX_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
37 cp
$(3) $$(I_
$(1))/lib
/modules
/$(LINUX_VERSION
)
38 $(IPKG_BUILD
) $$(I_
$(1)) $(PACKAGE_DIR
)
42 $(eval
$(call KMOD_template
,DIAG
,diag
,\
43 $(MODULES_DIR
)/kernel
/drivers
/net
/diag
/diag.o \
45 $(eval
$(call KMOD_template
,BRCM_WL
,brcm-wl
,\
46 $(MODULES_DIR
)/kernel
/drivers
/net
/wl
/wl.o \
48 $(eval
$(call KMOD_template
,BRCM_ET
,brcm-et
,\
49 $(MODULES_DIR
)/kernel
/drivers
/net
/et
/et.o \
51 $(eval
$(call KMOD_template
,ARPT
,arptables
,\
52 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/arp
*.o \
53 ,CONFIG_IP_NF_ARPTABLES
))
54 $(eval
$(call KMOD_template
,EBT
,ebtables
,\
55 $(MODULES_DIR
)/kernel
/net
/bridge
/netfilter
/*.o \
56 ,CONFIG_BRIDGE_NF_EBTABLES
))
57 $(eval
$(call KMOD_template
,IPT4
,iptables-extra
,\
58 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/ip
*.o \
60 $(eval
$(call KMOD_template
,IPT6
,ip6tables
,\
61 $(MODULES_DIR
)/kernel
/net
/ipv6
/netfilter
/ip
*.o \
62 ,CONFIG_IP6_NF_IPTABLES
))
63 $(eval
$(call KMOD_template
,IPV6
,ipv6
,\
64 $(MODULES_DIR
)/kernel
/net
/ipv6
/ipv6.o \
66 $(eval
$(call KMOD_template
,CIFS
,cifs
,\
67 $(MODULES_DIR
)/kernel
/fs
/cifs
/cifs.o \
69 $(eval
$(call KMOD_template
,NFS
,nfs
,\
70 $(MODULES_DIR
)/kernel
/fs
/lockd
/*.o \
71 $(MODULES_DIR
)/kernel
/fs
/nfs
/*.o \
72 $(MODULES_DIR
)/kernel
/net
/sunrpc
/*.o \
74 $(eval
$(call KMOD_template
,USB
,usb-core
,\
75 $(MODULES_DIR
)/kernel
/drivers
/usb
/usbcore.o \
77 $(eval
$(call KMOD_template
,USB_UHCI
,usb-uhci
,\
78 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/uhci.o \
79 ,CONFIG_USB_UHCI_ALT
))
80 $(eval
$(call KMOD_template
,USB_OHCI
,usb-ohci
,\
81 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/usb-ohci.o \
83 $(eval
$(call KMOD_template
,USB2
,usb2
,\
84 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/ehci-hcd.o \
85 ,CONFIG_USB_EHCI_HCD
))
86 $(eval
$(call KMOD_template
,USB_STORAGE
,usb-storage
,\
87 $(MODULES_DIR
)/kernel
/drivers
/scsi
/*.o \
88 $(MODULES_DIR
)/kernel
/drivers
/usb
/storage
/*.o \
90 $(eval
$(call KMOD_template
,USB_PRINTER
,usb-printer
,\
91 $(MODULES_DIR
)/kernel
/drivers
/usb
/printer.o \
93 $(eval
$(call KMOD_template
,LP
,lp
,\
94 $(MODULES_DIR
)/kernel
/drivers
/parport
/parport.o \
95 $(MODULES_DIR
)/kernel
/drivers
/parport
/parport_splink.o \
96 $(MODULES_DIR
)/kernel
/drivers
/char
/lp.o \
98 $(eval
$(call KMOD_template
,EXT2
,ext2
,\
99 $(MODULES_DIR
)/kernel
/fs
/ext2
/*.o \
101 $(eval
$(call KMOD_template
,EXT3
,ext3
,\
102 $(MODULES_DIR
)/kernel
/fs
/ext3
/*.o \
103 $(MODULES_DIR
)/kernel
/fs
/jbd
/*.o \
105 $(eval
$(call KMOD_template
,XFS
,xfs
,\
106 $(MODULES_DIR
)/kernel
/fs
/xfs
/*.o \
108 $(eval
$(call KMOD_template
,HFSPLUS
,hfsplus
,\
109 $(MODULES_DIR
)/kernel
/fs
/hfsplus
/*.o \
111 $(eval
$(call KMOD_template
,VFAT
,vfat
,\
112 $(MODULES_DIR
)/kernel
/fs
/vfat
/vfat.o \
113 $(MODULES_DIR
)/kernel
/fs
/fat
/fat.o \
115 $(eval
$(call KMOD_template
,CRYPTO
,crypto
,\
116 $(MODULES_DIR
)/kernel
/crypto
/*.o \
118 $(eval
$(call KMOD_template
,PPP
,ppp
,\
119 $(MODULES_DIR
)/kernel
/drivers
/net
/ppp_async.o \
120 $(MODULES_DIR
)/kernel
/drivers
/net
/ppp_generic.o \
121 $(MODULES_DIR
)/kernel
/drivers
/net
/slhc.o \
123 $(eval
$(call KMOD_template
,MPPE
,mppe
,\
124 $(MODULES_DIR
)/kernel
/drivers
/net
/ppp_mppe_mppc.o \
125 ,CONFIG_PPP_MPPE_MPPC
))
126 $(eval
$(call KMOD_template
,PPPOE
,pppoe
,\
127 $(MODULES_DIR
)/kernel
/drivers
/net
/pppoe.o \
128 $(MODULES_DIR
)/kernel
/drivers
/net
/pppox.o \
130 $(eval
$(call KMOD_template
,TUN
,tun
,\
131 $(MODULES_DIR
)/kernel
/drivers
/net
/tun.o \
133 $(eval
$(call KMOD_template
,GRE
,gre
,\
134 $(MODULES_DIR
)/kernel
/net
/ipv4
/ip_gre.o \
136 $(eval
$(call KMOD_template
,SCHED
,sched
,\
137 $(MODULES_DIR
)/kernel
/net
/sched
/*.o \
140 $(TARGETS
): $(PACKAGE_DIR
)
143 mkdir
-p
$(PACKAGE_DIR
)
146 prepare
: $(LINUX_DIR
)/.configured
147 compile
: $(LINUX_DIR
)/.modules_done
$(TARGETS
)
149 install: compile
$(TARGET_MODULES_DIR
)
150 @
[ "$(INSTALL_TARGETS)" != "" ] && $(IPKG
) install $(INSTALL_TARGETS
) || true
152 clean: linux-dirclean