2 # Linux 2.6 kernel target for the OpenWRT project
4 include $(TOPDIR
)/rules.mk
8 LINUX_VERSION
:=2.6.15-rc6
9 LINUX_KERNEL_MD5SUM
:=eeead0b884811411fd2df8520744b253
10 LINUX_SITE
=http
://www.fi.kernel.org
/pub
/linux
/kernel
/v2.6
/testing \
11 http
://www.fr.kernel.org
/pub
/linux
/kernel
/v2.6
/testing \
12 http
://www.kernel.org
/pub
/linux
/kernel
/v2.6
/testing \
13 http
://www.de.kernel.org
/pub
/linux
/kernel
/v2.6
/testing
14 MODULES_SUBDIR
:=lib
/modules
/$(LINUX_VERSION
)
15 LINUX_KCONFIG
:=.
/config
/$(BOARD
)
16 LINUX_BUILD_DIR
:=$(BUILD_DIR
)/linux-2.6
-$(BOARD
)
17 LINUX_TARGET_DIR
:=$(LINUX_BUILD_DIR
)/root
18 LINUX_KERNEL
:=$(LINUX_BUILD_DIR
)/vmlinux
19 LINUX_KARCH
:=$(shell echo
$(ARCH
) | sed
-e
's/i[3-9]86/i386/' \
25 LINUX_SOURCE
:= linux-
$(LINUX_VERSION
).
tar.bz2
26 LINUX_SOURCE_DIR
:= $(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
)
27 MODULES_DIR
:= $(LINUX_BUILD_DIR
)/modules
/$(MODULES_SUBDIR
)
28 TARGET_MODULES_DIR
:= $(LINUX_TARGET_DIR
)/lib
/modules
/$(LINUX_VERSION
)
29 IPKG_KERNEL
:=IPKG_TMP
=$(BUILD_DIR
)/tmp IPKG_INSTROOT
=$(LINUX_TARGET_DIR
) IPKG_CONF_DIR
=$(LINUX_BUILD_DIR
) $(SCRIPT_DIR
)/ipkg
-force-defaults
-force-depends
31 PKG_BUILD_DIR
:= $(LINUX_BUILD_DIR
)/linux-modules
34 KERNEL_IPKG
:=$(LINUX_BUILD_DIR
)/kernel_
$(LINUX_VERSION
)-$(BOARD
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
35 KERNEL_IDIR
:=$(LINUX_BUILD_DIR
)/kernel-ipkg
37 KPKG_MAKEOPTS
:= IPKG
="$(IPKG_KERNEL)" \
39 TARGET_DIR
="$(LINUX_TARGET_DIR)" \
40 BUILD_DIR
="$(LINUX_BUILD_DIR)" \
41 KERNEL_DIR
="$(LINUX_SOURCE_DIR)" \
42 LINUX_VERSION
="$(LINUX_VERSION)" \
43 KERNEL_RELEASE
="$(PKG_RELEASE)"
45 include $(LINUX_KCONFIG
)
47 INSTALL_TARGETS
:= $(KERNEL_IPKG
)
54 include ..
/netfilter.mk
58 $(eval
$(call KMOD_template
,ATM
,atm
,\
59 $(MODULES_DIR
)/kernel
/net
/atm
/atm.ko \
60 $(MODULES_DIR
)/kernel
/net
/atm
/br2684.ko \
63 $(eval
$(call KMOD_template
,GRE
,gre
,\
64 $(MODULES_DIR
)/kernel
/net
/ipv4
/ip_gre.ko \
67 $(eval
$(call KMOD_template
,IMQ
,imq
,\
68 $(MODULES_DIR
)/kernel
/net
/*/netfilter
/*IMQ
*.ko \
69 $(MODULES_DIR
)/kernel
/drivers
/net
/imq.ko \
72 $(eval
$(call KMOD_template
,IPV6
,ipv6
,\
73 $(MODULES_DIR
)/kernel
/net
/ipv6
/ipv6.ko \
74 ,CONFIG_IPV6
,,20,ipv6
))
76 $(eval
$(call KMOD_template
,PPP
,ppp
,\
77 $(MODULES_DIR
)/kernel
/drivers
/net
/ppp_async.ko \
78 $(MODULES_DIR
)/kernel
/drivers
/net
/ppp_generic.ko \
79 $(MODULES_DIR
)/kernel
/drivers
/net
/slhc.ko \
82 #$(eval $(call KMOD_template,MPPE,mppe,\
83 # $(MODULES_DIR)/kernel/drivers/net/ppp_mppe_mppc.ko \
84 #,CONFIG_PPP_MPPE_MPPC))
86 $(eval
$(call KMOD_template
,PPPOATM
,pppoatm
,\
87 $(MODULES_DIR
)/kernel
/net
/atm
/pppoatm.ko \
90 $(eval
$(call KMOD_template
,PPPOE
,pppoe
,\
91 $(MODULES_DIR
)/kernel
/drivers
/net
/pppoe.ko \
92 $(MODULES_DIR
)/kernel
/drivers
/net
/pppox.ko \
95 $(eval
$(call KMOD_template
,SCHED
,sched
,\
96 $(MODULES_DIR
)/kernel
/net
/sched
/*.ko \
99 $(eval
$(call KMOD_template
,TUN
,tun
,\
100 $(MODULES_DIR
)/kernel
/drivers
/net
/tun.ko \
101 ,CONFIG_TUN
,,20,tun
))
104 # Filtering / Firewalling
106 $(eval
$(call KMOD_template
,ARPTABLES
,arptables
,\
107 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/arp
*.ko \
108 ,CONFIG_IP_NF_ARPTABLES
))
110 $(eval
$(call KMOD_template
,EBTABLES
,ebtables
,\
111 $(MODULES_DIR
)/kernel
/net
/bridge
/netfilter
/*.ko \
112 ,CONFIG_BRIDGE_NF_EBTABLES
))
114 # metapackage for compatibility ...
115 $(eval
$(call KMOD_template
,IPTABLES_EXTRA
,iptables-extra
,\
116 ,,kmod-ipt-conntrack kmod-ipt-extra kmod-ipt-filter kmod-ipt-ipopt kmod-ipt-ipsec kmod-ipt-nat kmod-ipt-nat-extra kmod-ipt-queue kmod-ipt-ulogd
))
118 $(eval
$(call KMOD_template
,IPT_CONNTRACK
,ipt-conntrack
,\
119 $(foreach mod
,$(IPT_CONNTRACK-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
122 $(eval
$(call KMOD_template
,IPT_EXTRA
,ipt-extra
,\
123 $(foreach mod
,$(IPT_EXTRA-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
126 $(eval
$(call KMOD_template
,IPT_FILTER
,ipt-filter
,\
127 $(foreach mod
,$(IPT_FILTER-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
130 $(eval
$(call KMOD_template
,IPT_IPOPT
,ipt-ipopt
,\
131 $(foreach mod
,$(IPT_IPOPT-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
134 $(eval
$(call KMOD_template
,IPT_IPSEC
,ipt-ipsec
,\
135 $(foreach mod
,$(IPT_IPSEC-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
138 $(eval
$(call KMOD_template
,IPT_NAT
,ipt-nat
,\
139 $(foreach mod
,$(IPT_NAT-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
142 $(eval
$(call KMOD_template
,IPT_NAT_EXTRA
,ipt-nat-extra
,\
143 $(foreach mod
,$(IPT_NAT_EXTRA-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
144 ,,,40,$(IPT_NAT_EXTRA-m
)))
146 $(eval
$(call KMOD_template
,IPT_QUEUE
,ipt-queue
,\
147 $(foreach mod
,$(IPT_QUEUE-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
150 $(eval
$(call KMOD_template
,IPT_ULOG
,ipt-ulog
,\
151 $(foreach mod
,$(IPT_ULOG-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
154 $(eval
$(call KMOD_template
,IP6TABLES
,ip6tables
,\
155 $(MODULES_DIR
)/kernel
/net
/ipv6
/netfilter
/ip
*.ko \
156 ,CONFIG_IP6_NF_IPTABLES
,kmod-ipv6
))
161 $(eval
$(call KMOD_template
,IDE
,ide
,\
162 $(MODULES_DIR
)/kernel
/drivers
/ide
/*.ko \
163 $(MODULES_DIR
)/kernel
/drivers
/ide
/*/*.ko \
166 $(eval
$(call KMOD_template
,LOOP
,loop
,\
167 $(MODULES_DIR
)/kernel
/drivers
/block
/loop.ko \
168 ,CONFIG_BLK_DEV_LOOP
,,20,loop
))
170 $(eval
$(call KMOD_template
,NBD
,nbd
,\
171 $(MODULES_DIR
)/kernel
/drivers
/block
/nbd.ko \
172 ,CONFIG_BLK_DEV_NBD
,,20,nbd
))
177 $(eval
$(call KMOD_template
,CRYPTO
,crypto
,\
178 $(MODULES_DIR
)/kernel
/crypto
/*.ko \
184 $(eval
$(call KMOD_template
,FS_CIFS
,fs-cifs
,\
185 $(MODULES_DIR
)/kernel
/fs
/cifs
/cifs.ko \
186 ,CONFIG_CIFS
,kmod-nls-base
,30,cifs
))
188 $(eval
$(call KMOD_template
,FS_EXT2
,fs-ext2
,\
189 $(MODULES_DIR
)/kernel
/fs
/ext2
/ext2.ko \
190 ,CONFIG_EXT2_FS
,,30,ext2
))
192 $(eval
$(call KMOD_template
,FS_EXT3
,fs-ext3
,\
193 $(MODULES_DIR
)/kernel
/fs
/ext3
/ext3.ko \
194 $(MODULES_DIR
)/kernel
/fs
/jbd
/jbd.ko \
195 ,CONFIG_EXT3_FS
,,30,jbd ext3
))
197 $(eval
$(call KMOD_template
,FS_HFSPLUS
,fs-hfsplus
,\
198 $(MODULES_DIR
)/kernel
/fs
/hfsplus
/hfsplus.ko \
199 ,CONFIG_HFSPLUS_FS
,kmod-nls-base
,30,hfsplus
))
201 $(eval
$(call KMOD_template
,FS_NFS
,fs-nfs
,\
202 $(MODULES_DIR
)/kernel
/fs
/lockd
/lockd.ko \
203 $(MODULES_DIR
)/kernel
/fs
/nfs
/nfs.ko \
204 $(MODULES_DIR
)/kernel
/net
/sunrpc
/sunrpc.ko \
205 ,CONFIG_NFS_FS
,,30,sunrpc lockd nfs
))
207 $(eval
$(call KMOD_template
,FS_VFAT
,fs-vfat
,\
208 $(MODULES_DIR
)/kernel
/fs
/fat
/fat.ko \
209 $(MODULES_DIR
)/kernel
/fs
/vfat
/vfat.ko \
210 ,CONFIG_VFAT_FS
,kmod-nls-base
,30,fat vfat
))
212 $(eval
$(call KMOD_template
,FS_XFS
,fs-xfs
,\
213 $(MODULES_DIR
)/kernel
/fs
/xfs
/xfs.ko \
214 ,CONFIG_XFS_FS
,,30,xfs
))
219 $(eval
$(call KMOD_template
,PWC
,pwc
,\
220 $(MODULES_DIR
)/kernel
/drivers
/usb
/media
/pwc
/pwc.ko \
221 ,CONFIG_USB_PWC
,kmod-videodev
,63,pwc
))
223 $(eval
$(call KMOD_template
,SOUNDCORE
,soundcore
,\
224 $(MODULES_DIR
)/kernel
/sound
/soundcore.ko \
225 ,CONFIG_SOUND
,,30,soundcore
))
227 $(eval
$(call KMOD_template
,VIDEODEV
,videodev
,\
228 $(MODULES_DIR
)/kernel
/drivers
/media
/video
/v4l1-compat.ko \
229 $(MODULES_DIR
)/kernel
/drivers
/media
/video
/v4l2-common.ko \
230 $(MODULES_DIR
)/kernel
/drivers
/media
/video
/videodev.ko \
231 ,CONFIG_VIDEO_DEV
,,62,videodev
))
236 $(eval
$(call KMOD_template
,NLS_BASE
,nls-base
,\
237 $(MODULES_DIR
)/kernel
/fs
/nls
/nls_base.ko \
238 ,CONFIG_NLS
,,20,nls_base
))
240 $(eval
$(call KMOD_template
,NLS_CP437
,nls-cp437
,\
241 $(MODULES_DIR
)/kernel
/fs
/nls
/nls_cp437.ko \
242 ,CONFIG_NLS_CODEPAGE_437
,,20,nls_cp437
))
244 $(eval
$(call KMOD_template
,NLS_CP850
,nls-cp850
,\
245 $(MODULES_DIR
)/kernel
/fs
/nls
/nls_cp850.ko \
246 ,CONFIG_NLS_CODEPAGE_850
,,20,nls_cp850
))
248 $(eval
$(call KMOD_template
,NLS_ISO8859_1
,nls-iso8859-1
,\
249 $(MODULES_DIR
)/kernel
/fs
/nls
/nls_iso8859-1.ko \
250 ,CONFIG_NLS_ISO8859_1
,,20,nls_iso8859-1
))
252 $(eval
$(call KMOD_template
,NLS_ISO8859_15
,nls-iso8859-15
,\
253 $(MODULES_DIR
)/kernel
/fs
/nls
/nls_iso8859-15.ko \
254 ,CONFIG_NLS_ISO8859_15
,,20,nls_iso8859-15
))
256 $(eval
$(call KMOD_template
,NLS_UTF8
,nls-utf8
,\
257 $(MODULES_DIR
)/kernel
/fs
/nls
/nls_utf8.ko \
258 ,CONFIG_NLS_UTF8
,,20,nls_utf8
))
263 $(eval
$(call KMOD_template
,NET_3C59X
,net-3c59x
,\
264 $(MODULES_DIR
)/kernel
/drivers
/net
/3c59x.ko \
265 ,CONFIG_VORTEX
,,10,3c59x
))
267 $(eval
$(call KMOD_template
,NET_8139TOO
,net-8139too
,\
268 $(MODULES_DIR
)/kernel
/drivers
/net
/8139too.ko \
269 ,CONFIG_8139TOO
,,10,8139too
))
271 $(eval
$(call KMOD_template
,NET_AIRO
,net-airo
,\
272 $(MODULES_DIR
)/kernel
/drivers
/net
/wireless
/airo.ko \
273 ,CONFIG_AIRO
,,10,airo
))
275 $(eval
$(call KMOD_template
,NET_B44
,net-b44
,\
276 $(MODULES_DIR
)/kernel
/drivers
/net
/b44.ko \
277 ,CONFIG_B44
,,10,b44
))
279 $(eval
$(call KMOD_template
,NET_E100
,net-e100
,\
280 $(MODULES_DIR
)/kernel
/drivers
/net
/e100.ko \
281 ,CONFIG_E100
,,10,e100
))
283 $(eval
$(call KMOD_template
,NET_HERMES
,net-hermes
,\
284 $(MODULES_DIR
)/kernel
/drivers
/net
/wireless
/hermes.ko \
285 $(MODULES_DIR
)/kernel
/drivers
/net
/wireless
/orinoco.ko \
286 ,CONFIG_HERMES
,,10,hermes orinoco
))
288 $(eval
$(call KMOD_template
,NET_HERMES_PCI
,net-hermes-pci
,\
289 $(MODULES_DIR
)/kernel
/drivers
/net
/wireless
/orinoco_pci.ko \
290 ,CONFIG_PCI_HERMES
,kmod-net-hermes
,11,orinoco_pci
))
292 $(eval
$(call KMOD_template
,NET_HERMES_PCI
,net-hermes-plx
,\
293 $(MODULES_DIR
)/kernel
/drivers
/net
/wireless
/orinoco_plx.ko \
294 ,CONFIG_PLX_HERMES
,kmod-net-hermes
,11,orinoco_plx
))
296 $(eval
$(call KMOD_template
,NET_NATSEMI
,net-natsemi
,\
297 $(MODULES_DIR
)/kernel
/drivers
/net
/natsemi.ko \
298 ,CONFIG_NATSEMI
,,10,natsemi
))
300 $(eval
$(call KMOD_template
,NET_PRISM54
,net-prism54
,\
301 $(MODULES_DIR
)/kernel
/drivers
/net
/wireless
/prism54
/prism54.ko \
302 ,CONFIG_PRISM54
,,10,prism54
))
307 $(eval
$(call KMOD_template
,PCMCIA_CORE
,pcmcia-core
,\
308 $(MODULES_DIR
)/kernel
/drivers
/pcmcia
/pcmcia.ko \
309 $(MODULES_DIR
)/kernel
/drivers
/pcmcia
/pcmcia_core.ko \
310 $(MODULES_DIR
)/kernel
/drivers
/pcmcia
/yenta_socket.ko \
311 $(MODULES_DIR
)/kernel
/drivers
/pcmcia
/rsrc_nonstatic.ko \
312 ,CONFIG_PCMCIA
,,50,pcmcia_core pcmcia yenta_socket rsrc_nonstatic
))
314 $(eval
$(call KMOD_template
,PCMCIA_SERIAL
,pcmcia-serial
,\
315 $(MODULES_DIR
)/kernel
/drivers
/serial
/serial_cs.ko \
316 ,CONFIG_SERIAL_8250_CS
))
321 $(eval
$(call KMOD_template
,USB
,usb-core
,\
322 $(MODULES_DIR
)/kernel
/drivers
/usb
/core
/usbcore.ko \
323 ,CONFIG_USB
,,50,usbcore
))
325 $(eval
$(call KMOD_template
,USB_OHCI
,usb-ohci
,\
326 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/ohci-hcd.ko \
327 ,CONFIG_USB_OHCI_HCD
,kmod-usb-core
,60,ohci-hcd
))
329 $(eval
$(call KMOD_template
,USB_UHCI
,usb-uhci
,\
330 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/uhci.ko \
331 ,CONFIG_USB_UHCI_ALT
,kmod-usb-core
,60,uhci
))
333 $(eval
$(call KMOD_template
,USB2
,usb2
,\
334 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/ehci-hcd.ko \
335 ,CONFIG_USB_EHCI_HCD
,kmod-usb-core
,60,ehci-hcd
))
337 $(eval
$(call KMOD_template
,USB_ACM
,usb-acm
,\
338 $(MODULES_DIR
)/kernel
/drivers
/usb
/class
/cdc-acm.ko \
341 #$(eval $(call KMOD_template,USB_AUDIO,usb-audio,\
342 # $(MODULES_DIR)/kernel/drivers/usb/class/audio.ko \
343 #,CONFIG_USB_AUDIO,kmod-soundcore kmod-usb-core,61,audio))
345 $(eval
$(call KMOD_template
,USB_PRINTER
,usb-printer
,\
346 $(MODULES_DIR
)/kernel
/drivers
/usb
/class
/usblp.ko \
347 ,CONFIG_USB_PRINTER
,kmod-usb-core
,60,usblp
))
349 $(eval
$(call KMOD_template
,USB_SERIAL
,usb-serial
,\
350 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/usbserial.ko \
351 ,CONFIG_USB_SERIAL
,kmod-usb-core
,60,usbserial
))
353 $(eval
$(call KMOD_template
,USB_SERIAL_BELKIN
,usb-serial-belkin
,\
354 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/belkin_sa.ko \
355 ,CONFIG_USB_SERIAL_BELKIN
,kmod-usb-serial
,61,belkin_sa
))
357 $(eval
$(call KMOD_template
,USB_SERIAL_FTDI
,usb-serial-ftdi
,\
358 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/ftdi_sio.ko \
359 ,CONFIG_USB_SERIAL_FTDI_SIO
,kmod-usb-serial
,61,ftdi_sio
))
361 $(eval
$(call KMOD_template
,USB_SERIAL_MCT_U232
,usb-serial-mct-u232
,\
362 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/mct_u232.ko \
363 ,CONFIG_USB_SERIAL_MCT_U232
,kmod-usb-serial
,61,mct_u232
))
365 $(eval
$(call KMOD_template
,USB_SERIAL_PL2303
,usb-serial-pl2303
,\
366 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/pl2303.ko \
367 ,CONFIG_USB_SERIAL_PL2303
,kmod-usb-serial
,61,pl2303
))
369 $(eval
$(call KMOD_template
,USB_SERIAL_VISOR
,usb-serial-visor
,\
370 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/visor.o \
371 ,CONFIG_USB_SERIAL_VISOR
,kmod-usb-serial
,61,visor
))
373 $(eval
$(call KMOD_template
,USB_STORAGE
,usb-storage
,\
374 $(MODULES_DIR
)/kernel
/drivers
/scsi
/scsi_mod.ko \
375 $(MODULES_DIR
)/kernel
/drivers
/scsi
/sd_mod.ko \
376 $(MODULES_DIR
)/kernel
/drivers
/usb
/storage
/usb-storage.ko \
377 ,CONFIG_USB_STORAGE
,kmod-usb-core
,60,scsi_mod sd_mod usb-storage
))
382 $(eval
$(call KMOD_template
,AX25
,ax25
,\
383 $(MODULES_DIR
)/kernel
/net
/ax25
/ax25.ko \
384 $(MODULES_DIR
)/kernel
/drivers
/net
/hamradio
/mkiss.ko \
385 ,CONFIG_AX25
,,90,ax25 mkiss
))
387 $(eval
$(call KMOD_template
,BLUETOOTH
,bluetooth
,\
388 $(MODULES_DIR
)/kernel
/net
/bluetooth
/bluetooth.ko \
389 $(MODULES_DIR
)/kernel
/net
/bluetooth
/l2cap.ko \
390 $(MODULES_DIR
)/kernel
/net
/bluetooth
/sco.ko \
391 $(MODULES_DIR
)/kernel
/net
/bluetooth
/rfcomm
/rfcomm.ko \
392 $(MODULES_DIR
)/kernel
/drivers
/bluetooth
/hci_uart.ko \
396 $(TARGETS
): $(PACKAGE_DIR
)
399 mkdir
-p
$(PACKAGE_DIR
)
401 $(DL_DIR
)/$(LINUX_SOURCE
):
403 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(LINUX_SOURCE
) $(LINUX_KERNEL_MD5SUM
) $(LINUX_SITE
) $(MAKE_TRACE
)
405 $(LINUX_DIR
)/.unpacked
: $(DL_DIR
)/$(LINUX_SOURCE
)
406 -mkdir
-p
$(LINUX_BUILD_DIR
)
407 bzcat
$(DL_DIR
)/$(LINUX_SOURCE
) |
tar -C
$(LINUX_BUILD_DIR
) $(TAR_OPTIONS
) -
409 ln
-s
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
) $(LINUX_DIR
)
410 touch
$(LINUX_DIR
)/.unpacked
412 $(LINUX_DIR
)/.patched
: $(LINUX_DIR
)/.unpacked
413 $(PATCH
) $(LINUX_DIR
) .
/patches
/generic
$(MAKE_TRACE
)
414 [ -d .
/patches
/$(BOARD
) ] && $(PATCH
) $(LINUX_DIR
) .
/patches
/$(BOARD
) $(MAKE_TRACE
)
415 touch
$(LINUX_DIR
)/.patched
417 $(LINUX_DIR
)/.configured
: $(LINUX_DIR
)/.patched
418 -cp
$(LINUX_KCONFIG
) $(LINUX_DIR
)/.config
419 $(MAKE
) -C
$(LINUX_DIR
) ARCH
=$(LINUX_KARCH
) oldconfig
$(MAKE_TRACE
)
420 touch
$(LINUX_DIR
)/.configured
422 $(LINUX_DIR
)/vmlinux
: $(LINUX_DIR
)/.configured
423 $(MAKE
) -C
$(LINUX_DIR
) CROSS_COMPILE
=$(TARGET_CROSS
) ARCH
=$(LINUX_KARCH
) PATH
=$(TARGET_PATH
) $(MAKE_TRACE
)
425 $(LINUX_KERNEL
): $(LINUX_DIR
)/vmlinux
426 $(TARGET_CROSS
)objcopy
-O binary
-R .reginfo
-R .note
-R .comment
-R .mdebug
-S
$< $@
$(MAKE_TRACE
)
427 touch
-c
$(LINUX_KERNEL
)
429 $(LINUX_DIR
)/.modules_done
: $(LINUX_KERNEL
) $(LINUX_IMAGE
)
430 rm -rf
$(LINUX_BUILD_DIR
)/modules
431 $(MAKE
) -C
$(LINUX_DIR
) CROSS_COMPILE
=$(TARGET_CROSS
) ARCH
=$(LINUX_KARCH
) PATH
=$(TARGET_PATH
) modules
$(MAKE_TRACE
)
432 $(MAKE
) -C
$(LINUX_DIR
) CROSS_COMPILE
=$(TARGET_CROSS
) ARCH
=$(LINUX_KARCH
) PATH
=$(TARGET_PATH
) DEPMOD
=true INSTALL_MOD_PATH
=$(LINUX_BUILD_DIR
)/modules modules_install
$(MAKE_TRACE
)
433 touch
$(LINUX_DIR
)/.modules_done
435 $(STAGING_DIR
)/include/linux
/version.h
: $(LINUX_DIR
)/.configured
436 mkdir
-p
$(STAGING_DIR
)/include
437 tar -ch
-C
$(LINUX_DIR
)/include -f
- linux |
tar -xf
- -C
$(STAGING_DIR
)/include/
438 tar -ch
-C
$(LINUX_DIR
)/include -f
- asm |
tar -xf
- -C
$(STAGING_DIR
)/include/
440 $(STAMP_DIR
)/.linux-compile
: $(LINUX_DIR
)/.modules_done
441 @mkdir
-p
$(STAMP_DIR
)
443 ln
-sf
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
) $(LINUX_DIR
)
444 @
$(TRACE
) target
/linux
/package
445 $(MAKE
) -C
$(TOPDIR
)/target
/linux
/package \
450 $(TARGET_MODULES_DIR
):
451 -mkdir
-p
$(TARGET_MODULES_DIR
)
454 rm -rf
$(KERNEL_IDIR
)
455 mkdir
-p
$(KERNEL_IDIR
)/etc
456 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(KERNEL_IDIR
) ..
/control
/kernel.control
$(LINUX_VERSION
)-$(BOARD
)-$(PKG_RELEASE
) $(ARCH
)
457 if
[ -f .
/config
/$(BOARD
).modules
]; then \
458 cp .
/config
/$(BOARD
).modules
$(KERNEL_IDIR
)/etc
/modules
; \
460 $(IPKG_BUILD
) $(KERNEL_IDIR
) $(LINUX_BUILD_DIR
) $(MAKE_TRACE
)
462 source
: $(DL_DIR
)/$(LINUX_SOURCE
)
463 prepare
: $(LINUX_DIR
)/.configured
465 $(MAKE
) $(STAMP_DIR
)/.linux-compile
$(MAKE_TRACE
)
467 install: compile
$(TARGET_MODULES_DIR
) $(KERNEL_IPKG
)
468 rm -rf
$(LINUX_BUILD_DIR
)/root
*
469 cp
-fpR
$(BUILD_DIR
)/root
$(LINUX_BUILD_DIR
)/
470 echo
-e
'dest root /\noption offline_root $(LINUX_BUILD_DIR)/root' > $(LINUX_BUILD_DIR
)/ipkg.conf
471 $(MAKE
) -C
$(TOPDIR
)/target
/linux
/package \
474 @
{ [ "$(INSTALL_TARGETS)" != "" ] && $(IPKG_KERNEL
) install $(INSTALL_TARGETS
) || true
; } $(MAKE_TRACE
)
477 rm -f
$(STAMP_DIR
)/.linux-compile
478 rm -f
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
)/.modules_done
479 rm -f
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
)/.drivers-unpacked
480 $(MAKE
) -C
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
) clean $(MAKE_TRACE
)
481 rm -f
$(LINUX_KERNEL
) $(LINUX_IMAGE
)
485 if
[ -f
$(LINUX_KERNEL
) ]; then \
486 $(MAKE
) clean $(MAKE_TRACE
); \
488 $(MAKE
) compile
$(MAKE_TRACE
)
491 rm -f
$(STAMP_DIR
)/.linux-compile
492 rm -rf
$(LINUX_BUILD_DIR
)