3 include $(TOPDIR
)/rules.mk
7 PKG_BUILD_DIR
:= $(BUILD_DIR
)/linux-modules
15 ifeq ($$(strip $(4)),)
21 PKG_
$(1) := $(PACKAGE_DIR
)/kmod-
$(2)_
$(LINUX_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
22 I_
$(1) := $(PKG_BUILD_DIR
)/ipkg
/$(2)
24 ifeq ($$(KDEPEND_
$(1)),m
)
25 ifneq ($(BR2_PACKAGE_KMOD_
$(1)),)
26 TARGETS
+= $$(PKG_
$(1))
28 ifeq ($(BR2_PACKAGE_KMOD_
$(1)),y
)
29 INSTALL_TARGETS
+= $$(PKG_
$(1))
33 $$(PKG_
$(1)): $(LINUX_DIR
)/.modules_done
34 mkdir
-p
$$(I_
$(1))/lib
/modules
/$(LINUX_VERSION
)
35 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$$(I_
$(1)) control
/kmod-
$(2).control
$(LINUX_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
36 cp
$(3) $$(I_
$(1))/lib
/modules
/$(LINUX_VERSION
)
37 $(IPKG_BUILD
) $$(I_
$(1)) $(PACKAGE_DIR
)
41 $(eval
$(call KMOD_template
,BRCM_WL
,brcm-wl
,\
42 $(MODULES_DIR
)/kernel
/drivers
/net
/wl
/wl.o \
44 $(eval
$(call KMOD_template
,BRCM_ET
,brcm-et
,\
45 $(MODULES_DIR
)/kernel
/drivers
/net
/et
/et.o \
47 $(eval
$(call KMOD_template
,ARPT
,arptables
,\
48 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/arp
*.o \
49 ,CONFIG_IP_NF_ARPTABLES
))
50 $(eval
$(call KMOD_template
,EBT
,ebtables
,\
51 $(MODULES_DIR
)/kernel
/net
/bridge
/netfilter
/*.o \
52 ,CONFIG_BRIDGE_NF_EBTABLES
))
53 $(eval
$(call KMOD_template
,IPT4
,iptables-extra
,\
54 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/ip
*.o \
56 $(eval
$(call KMOD_template
,IPT6
,ip6tables
,\
57 $(MODULES_DIR
)/kernel
/net
/ipv6
/netfilter
/ip
*.o \
58 ,CONFIG_IP6_NF_IPTABLES
))
59 $(eval
$(call KMOD_template
,IPV6
,ipv6
,\
60 $(MODULES_DIR
)/kernel
/net
/ipv6
/ipv6.o \
62 $(eval
$(call KMOD_template
,CIFS
,cifs
,\
63 $(MODULES_DIR
)/kernel
/fs
/cifs
/cifs.o \
65 $(eval
$(call KMOD_template
,NFS
,nfs
,\
66 $(MODULES_DIR
)/kernel
/fs
/lockd
/*.o \
67 $(MODULES_DIR
)/kernel
/fs
/nfs
/*.o \
68 $(MODULES_DIR
)/kernel
/net
/sunrpc
/*.o \
70 $(eval
$(call KMOD_template
,USB
,usb-core
,\
71 $(MODULES_DIR
)/kernel
/drivers
/usb
/usbcore.o \
73 $(eval
$(call KMOD_template
,USB_UHCI
,usb-uhci
,\
74 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/uhci.o \
75 ,CONFIG_USB_UHCI_ALT
))
76 $(eval
$(call KMOD_template
,USB_OHCI
,usb-ohci
,\
77 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/usb-ohci.o \
79 $(eval
$(call KMOD_template
,USB2
,usb2
,\
80 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/ehci-hcd.o \
81 ,CONFIG_USB_EHCI_HCD
))
82 $(eval
$(call KMOD_template
,USB_STORAGE
,usb-storage
,\
83 $(MODULES_DIR
)/kernel
/drivers
/scsi
/*.o \
84 $(MODULES_DIR
)/kernel
/drivers
/usb
/storage
/*.o \
86 $(eval
$(call KMOD_template
,USB_PRINTER
,usb-printer
,\
87 $(MODULES_DIR
)/kernel
/drivers
/usb
/printer.o \
89 $(eval
$(call KMOD_template
,LP
,lp
,\
90 $(MODULES_DIR
)/kernel
/drivers
/parport
/parport.o \
91 $(MODULES_DIR
)/kernel
/drivers
/parport
/parport_splink.o \
92 $(MODULES_DIR
)/kernel
/drivers
/char
/lp.o \
94 $(eval
$(call KMOD_template
,VFAT
,vfat
,\
95 $(MODULES_DIR
)/kernel
/fs
/vfat
/vfat.o \
96 $(MODULES_DIR
)/kernel
/fs
/fat
/fat.o \
97 $(MODULES_DIR
)/kernel
/fs
/msdos
/msdos.o \
99 $(eval
$(call KMOD_template
,CRYPTO
,crypto
,\
100 $(MODULES_DIR
)/kernel
/crypto
/*.o \
102 $(eval
$(call KMOD_template
,PPP
,ppp
,\
103 $(MODULES_DIR
)/kernel
/drivers
/net
/ppp_async.o \
104 $(MODULES_DIR
)/kernel
/drivers
/net
/ppp_generic.o \
105 $(MODULES_DIR
)/kernel
/drivers
/net
/slhc.o \
107 $(eval
$(call KMOD_template
,MPPE
,mppe
,\
108 $(MODULES_DIR
)/kernel
/drivers
/net
/ppp_mppe_mppc.o \
109 ,CONFIG_PPP_MPPE_MPPC
))
110 $(eval
$(call KMOD_template
,PPPOE
,pppoe
,\
111 $(MODULES_DIR
)/kernel
/drivers
/net
/pppoe.o \
112 $(MODULES_DIR
)/kernel
/drivers
/net
/pppox.o \
114 $(eval
$(call KMOD_template
,TUN
,tun
,\
115 $(MODULES_DIR
)/kernel
/drivers
/net
/tun.o \
117 $(eval
$(call KMOD_template
,GRE
,gre
,\
118 $(MODULES_DIR
)/kernel
/net
/ipv4
/ip_gre.o \
120 $(eval
$(call KMOD_template
,SCHED
,sched
,\
121 $(MODULES_DIR
)/kernel
/net
/sched
/*.o \
124 $(TARGETS
): $(PACKAGE_DIR
)
127 mkdir
-p
$(PACKAGE_DIR
)
130 prepare
: $(LINUX_DIR
)/.configured
131 compile
: $(LINUX_DIR
)/.modules_done
$(TARGETS
)
133 install: compile
$(TARGET_MODULES_DIR
)
134 @
[ "$(INSTALL_TARGETS)" != "" ] && $(IPKG
) install $(INSTALL_TARGETS
) || true
136 clean: linux-dirclean