2 # Linux 2.6 kernel target for the OpenWRT project
4 include $(TOPDIR
)/rules.mk
9 LINUX_KERNEL_MD5SUM
:=cdf95e00f5111e31f78e1d97304d9522
10 LINUX_SITE
=http
://www.fi.kernel.org
/pub
/linux
/kernel
/v2.6 \
11 http
://www.fr.kernel.org
/pub
/linux
/kernel
/v2.6 \
12 http
://www.kernel.org
/pub
/linux
/kernel
/v2.6 \
13 http
://www.de.kernel.org
/pub
/linux
/kernel
/v2.6
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 \
61 $(MODULES_DIR
)/kernel
/drivers
/atm
/atmtcp.ko \
64 $(eval
$(call KMOD_template
,GRE
,gre
,\
65 $(MODULES_DIR
)/kernel
/net
/ipv4
/ip_gre.ko \
68 $(eval
$(call KMOD_template
,IMQ
,imq
,\
69 $(MODULES_DIR
)/kernel
/net
/*/netfilter
/*IMQ
*.ko \
70 $(MODULES_DIR
)/kernel
/drivers
/net
/imq.ko \
73 $(eval
$(call KMOD_template
,IPV6
,ipv6
,\
74 $(MODULES_DIR
)/kernel
/net
/ipv6
/ipv6.ko \
75 ,CONFIG_IPV6
,,20,ipv6
))
77 $(eval
$(call KMOD_template
,PPP
,ppp
,\
78 $(MODULES_DIR
)/kernel
/drivers
/net
/ppp_async.ko \
79 $(MODULES_DIR
)/kernel
/drivers
/net
/ppp_generic.ko \
80 $(MODULES_DIR
)/kernel
/drivers
/net
/slhc.ko \
83 #$(eval $(call KMOD_template,MPPE,mppe,\
84 # $(MODULES_DIR)/kernel/drivers/net/ppp_mppe_mppc.ko \
85 #,CONFIG_PPP_MPPE_MPPC))
87 $(eval
$(call KMOD_template
,PPPOATM
,pppoatm
,\
88 $(MODULES_DIR
)/kernel
/net
/atm
/pppoatm.ko \
91 $(eval
$(call KMOD_template
,PPPOE
,pppoe
,\
92 $(MODULES_DIR
)/kernel
/drivers
/net
/pppoe.ko \
93 $(MODULES_DIR
)/kernel
/drivers
/net
/pppox.ko \
96 $(eval
$(call KMOD_template
,SCHED
,sched
,\
97 $(MODULES_DIR
)/kernel
/net
/sched
/*.ko \
100 $(eval
$(call KMOD_template
,TUN
,tun
,\
101 $(MODULES_DIR
)/kernel
/drivers
/net
/tun.ko \
102 ,CONFIG_TUN
,,20,tun
))
105 # Filtering / Firewalling
107 $(eval
$(call KMOD_template
,ARPTABLES
,arptables
,\
108 $(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/arp
*.ko \
109 ,CONFIG_IP_NF_ARPTABLES
))
111 $(eval
$(call KMOD_template
,EBTABLES
,ebtables
,\
112 $(MODULES_DIR
)/kernel
/net
/bridge
/netfilter
/*.ko \
113 ,CONFIG_BRIDGE_NF_EBTABLES
))
115 # metapackage for compatibility ...
116 $(eval
$(call KMOD_template
,IPTABLES_EXTRA
,iptables-extra
,\
117 ,,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
))
119 $(eval
$(call KMOD_template
,IPT_CONNTRACK
,ipt-conntrack
,\
120 $(foreach mod
,$(IPT_CONNTRACK-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
123 $(eval
$(call KMOD_template
,IPT_EXTRA
,ipt-extra
,\
124 $(foreach mod
,$(IPT_EXTRA-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
127 $(eval
$(call KMOD_template
,IPT_FILTER
,ipt-filter
,\
128 $(foreach mod
,$(IPT_FILTER-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
131 $(eval
$(call KMOD_template
,IPT_IPOPT
,ipt-ipopt
,\
132 $(foreach mod
,$(IPT_IPOPT-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
135 $(eval
$(call KMOD_template
,IPT_IPSEC
,ipt-ipsec
,\
136 $(foreach mod
,$(IPT_IPSEC-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
139 $(eval
$(call KMOD_template
,IPT_NAT
,ipt-nat
,\
140 $(foreach mod
,$(IPT_NAT-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
143 $(eval
$(call KMOD_template
,IPT_NAT_EXTRA
,ipt-nat-extra
,\
144 $(foreach mod
,$(IPT_NAT_EXTRA-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
145 ,,,40,$(IPT_NAT_EXTRA-m
)))
147 $(eval
$(call KMOD_template
,IPT_QUEUE
,ipt-queue
,\
148 $(foreach mod
,$(IPT_QUEUE-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
151 $(eval
$(call KMOD_template
,IPT_ULOG
,ipt-ulog
,\
152 $(foreach mod
,$(IPT_ULOG-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
155 $(eval
$(call KMOD_template
,IP6TABLES
,ip6tables
,\
156 $(MODULES_DIR
)/kernel
/net
/ipv6
/netfilter
/ip
*.ko \
157 ,CONFIG_IP6_NF_IPTABLES
,kmod-ipv6
))
162 $(eval
$(call KMOD_template
,IDE
,ide
,\
163 $(MODULES_DIR
)/kernel
/drivers
/ide
/*.ko \
164 $(MODULES_DIR
)/kernel
/drivers
/ide
/*/*.ko \
167 $(eval
$(call KMOD_template
,LOOP
,loop
,\
168 $(MODULES_DIR
)/kernel
/drivers
/block
/loop.ko \
169 ,CONFIG_BLK_DEV_LOOP
,,20,loop
))
171 $(eval
$(call KMOD_template
,NBD
,nbd
,\
172 $(MODULES_DIR
)/kernel
/drivers
/block
/nbd.ko \
173 ,CONFIG_BLK_DEV_NBD
,,20,nbd
))
178 $(eval
$(call KMOD_template
,CRYPTO
,crypto
,\
179 $(MODULES_DIR
)/kernel
/crypto
/*.ko \
185 $(eval
$(call KMOD_template
,FS_CIFS
,fs-cifs
,\
186 $(MODULES_DIR
)/kernel
/fs
/cifs
/cifs.ko \
187 ,CONFIG_CIFS
,kmod-nls-base
,30,cifs
))
189 $(eval
$(call KMOD_template
,FS_EXT2
,fs-ext2
,\
190 $(MODULES_DIR
)/kernel
/fs
/ext2
/ext2.ko \
191 ,CONFIG_EXT2_FS
,,30,ext2
))
193 $(eval
$(call KMOD_template
,FS_EXT3
,fs-ext3
,\
194 $(MODULES_DIR
)/kernel
/fs
/ext3
/ext3.ko \
195 $(MODULES_DIR
)/kernel
/fs
/jbd
/jbd.ko \
196 ,CONFIG_EXT3_FS
,,30,jbd ext3
))
198 $(eval
$(call KMOD_template
,FS_HFSPLUS
,fs-hfsplus
,\
199 $(MODULES_DIR
)/kernel
/fs
/hfsplus
/hfsplus.ko \
200 ,CONFIG_HFSPLUS_FS
,kmod-nls-base
,30,hfsplus
))
202 $(eval
$(call KMOD_template
,FS_NFS
,fs-nfs
,\
203 $(MODULES_DIR
)/kernel
/fs
/lockd
/lockd.ko \
204 $(MODULES_DIR
)/kernel
/fs
/nfs
/nfs.ko \
205 $(MODULES_DIR
)/kernel
/net
/sunrpc
/sunrpc.ko \
206 ,CONFIG_NFS_FS
,,30,sunrpc lockd nfs
))
208 $(eval
$(call KMOD_template
,FS_VFAT
,fs-vfat
,\
209 $(MODULES_DIR
)/kernel
/fs
/fat
/fat.ko \
210 $(MODULES_DIR
)/kernel
/fs
/vfat
/vfat.ko \
211 ,CONFIG_VFAT_FS
,kmod-nls-base
,30,fat vfat
))
213 $(eval
$(call KMOD_template
,FS_XFS
,fs-xfs
,\
214 $(MODULES_DIR
)/kernel
/fs
/xfs
/xfs.ko \
215 ,CONFIG_XFS_FS
,,30,xfs
))
220 $(eval
$(call KMOD_template
,PWC
,pwc
,\
221 $(MODULES_DIR
)/kernel
/drivers
/usb
/media
/pwc
/pwc.ko \
222 ,CONFIG_USB_PWC
,kmod-videodev
,63,pwc
))
224 $(eval
$(call KMOD_template
,SOUNDCORE
,soundcore
,\
225 $(MODULES_DIR
)/kernel
/sound
/soundcore.ko \
226 ,CONFIG_SOUND
,,30,soundcore
))
228 $(eval
$(call KMOD_template
,VIDEODEV
,videodev
,\
229 $(MODULES_DIR
)/kernel
/drivers
/media
/video
/v4l1-compat.ko \
230 $(MODULES_DIR
)/kernel
/drivers
/media
/video
/v4l2-common.ko \
231 $(MODULES_DIR
)/kernel
/drivers
/media
/video
/videodev.ko \
232 ,CONFIG_VIDEO_DEV
,,62,videodev
))
237 $(eval
$(call KMOD_template
,NLS_BASE
,nls-base
,\
238 $(MODULES_DIR
)/kernel
/fs
/nls
/nls_base.ko \
239 ,CONFIG_NLS
,,20,nls_base
))
241 $(eval
$(call KMOD_template
,NLS_CP437
,nls-cp437
,\
242 $(MODULES_DIR
)/kernel
/fs
/nls
/nls_cp437.ko \
243 ,CONFIG_NLS_CODEPAGE_437
,,20,nls_cp437
))
245 $(eval
$(call KMOD_template
,NLS_CP850
,nls-cp850
,\
246 $(MODULES_DIR
)/kernel
/fs
/nls
/nls_cp850.ko \
247 ,CONFIG_NLS_CODEPAGE_850
,,20,nls_cp850
))
249 $(eval
$(call KMOD_template
,NLS_ISO8859_1
,nls-iso8859-1
,\
250 $(MODULES_DIR
)/kernel
/fs
/nls
/nls_iso8859-1.ko \
251 ,CONFIG_NLS_ISO8859_1
,,20,nls_iso8859-1
))
253 $(eval
$(call KMOD_template
,NLS_ISO8859_15
,nls-iso8859-15
,\
254 $(MODULES_DIR
)/kernel
/fs
/nls
/nls_iso8859-15.ko \
255 ,CONFIG_NLS_ISO8859_15
,,20,nls_iso8859-15
))
257 $(eval
$(call KMOD_template
,NLS_UTF8
,nls-utf8
,\
258 $(MODULES_DIR
)/kernel
/fs
/nls
/nls_utf8.ko \
259 ,CONFIG_NLS_UTF8
,,20,nls_utf8
))
264 $(eval
$(call KMOD_template
,NET_3C59X
,net-3c59x
,\
265 $(MODULES_DIR
)/kernel
/drivers
/net
/3c59x.ko \
266 ,CONFIG_VORTEX
,,10,3c59x
))
268 $(eval
$(call KMOD_template
,NET_8139TOO
,net-8139too
,\
269 $(MODULES_DIR
)/kernel
/drivers
/net
/8139too.ko \
270 ,CONFIG_8139TOO
,,10,8139too
))
272 $(eval
$(call KMOD_template
,NET_AIRO
,net-airo
,\
273 $(MODULES_DIR
)/kernel
/drivers
/net
/wireless
/airo.ko \
274 ,CONFIG_AIRO
,,10,airo
))
276 $(eval
$(call KMOD_template
,NET_B44
,net-b44
,\
277 $(MODULES_DIR
)/kernel
/drivers
/net
/b44.ko \
278 ,CONFIG_B44
,,10,b44
))
280 $(eval
$(call KMOD_template
,NET_E100
,net-e100
,\
281 $(MODULES_DIR
)/kernel
/drivers
/net
/e100.ko \
282 ,CONFIG_E100
,,10,e100
))
284 $(eval
$(call KMOD_template
,NET_HERMES
,net-hermes
,\
285 $(MODULES_DIR
)/kernel
/drivers
/net
/wireless
/hermes.ko \
286 $(MODULES_DIR
)/kernel
/drivers
/net
/wireless
/orinoco.ko \
287 ,CONFIG_HERMES
,,10,hermes orinoco
))
289 $(eval
$(call KMOD_template
,NET_HERMES_PCI
,net-hermes-pci
,\
290 $(MODULES_DIR
)/kernel
/drivers
/net
/wireless
/orinoco_pci.ko \
291 ,CONFIG_PCI_HERMES
,kmod-net-hermes
,11,orinoco_pci
))
293 $(eval
$(call KMOD_template
,NET_HERMES_PCI
,net-hermes-plx
,\
294 $(MODULES_DIR
)/kernel
/drivers
/net
/wireless
/orinoco_plx.ko \
295 ,CONFIG_PLX_HERMES
,kmod-net-hermes
,11,orinoco_plx
))
297 $(eval
$(call KMOD_template
,NET_NATSEMI
,net-natsemi
,\
298 $(MODULES_DIR
)/kernel
/drivers
/net
/natsemi.ko \
299 ,CONFIG_NATSEMI
,,10,natsemi
))
301 $(eval
$(call KMOD_template
,NET_PRISM54
,net-prism54
,\
302 $(MODULES_DIR
)/kernel
/drivers
/net
/wireless
/prism54
/prism54.ko \
303 ,CONFIG_PRISM54
,,10,prism54
))
308 $(eval
$(call KMOD_template
,PCMCIA_CORE
,pcmcia-core
,\
309 $(MODULES_DIR
)/kernel
/drivers
/pcmcia
/pcmcia.ko \
310 $(MODULES_DIR
)/kernel
/drivers
/pcmcia
/pcmcia_core.ko \
311 $(MODULES_DIR
)/kernel
/drivers
/pcmcia
/yenta_socket.ko \
312 $(MODULES_DIR
)/kernel
/drivers
/pcmcia
/rsrc_nonstatic.ko \
313 ,CONFIG_PCMCIA
,,50,pcmcia_core pcmcia yenta_socket rsrc_nonstatic
))
315 $(eval
$(call KMOD_template
,PCMCIA_SERIAL
,pcmcia-serial
,\
316 $(MODULES_DIR
)/kernel
/drivers
/serial
/serial_cs.ko \
317 ,CONFIG_SERIAL_8250_CS
))
322 $(eval
$(call KMOD_template
,USB
,usb-core
,\
323 $(MODULES_DIR
)/kernel
/drivers
/usb
/core
/usbcore.ko \
324 ,CONFIG_USB
,,50,usbcore
))
326 $(eval
$(call KMOD_template
,USB_OHCI
,usb-ohci
,\
327 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/ohci-hcd.ko \
328 ,CONFIG_USB_OHCI_HCD
,kmod-usb-core
,60,ohci-hcd
))
330 $(eval
$(call KMOD_template
,USB_UHCI
,usb-uhci
,\
331 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/uhci.ko \
332 ,CONFIG_USB_UHCI_ALT
,kmod-usb-core
,60,uhci
))
334 $(eval
$(call KMOD_template
,USB2
,usb2
,\
335 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/ehci-hcd.ko \
336 ,CONFIG_USB_EHCI_HCD
,kmod-usb-core
,60,ehci-hcd
))
338 $(eval
$(call KMOD_template
,USB_ACM
,usb-acm
,\
339 $(MODULES_DIR
)/kernel
/drivers
/usb
/class
/cdc-acm.ko \
342 #$(eval $(call KMOD_template,USB_AUDIO,usb-audio,\
343 # $(MODULES_DIR)/kernel/drivers/usb/class/audio.ko \
344 #,CONFIG_USB_AUDIO,kmod-soundcore kmod-usb-core,61,audio))
346 $(eval
$(call KMOD_template
,USB_PRINTER
,usb-printer
,\
347 $(MODULES_DIR
)/kernel
/drivers
/usb
/class
/usblp.ko \
348 ,CONFIG_USB_PRINTER
,kmod-usb-core
,60,usblp
))
350 $(eval
$(call KMOD_template
,USB_SERIAL
,usb-serial
,\
351 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/usbserial.ko \
352 ,CONFIG_USB_SERIAL
,kmod-usb-core
,60,usbserial
))
354 $(eval
$(call KMOD_template
,USB_SERIAL_BELKIN
,usb-serial-belkin
,\
355 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/belkin_sa.ko \
356 ,CONFIG_USB_SERIAL_BELKIN
,kmod-usb-serial
,61,belkin_sa
))
358 $(eval
$(call KMOD_template
,USB_SERIAL_FTDI
,usb-serial-ftdi
,\
359 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/ftdi_sio.ko \
360 ,CONFIG_USB_SERIAL_FTDI_SIO
,kmod-usb-serial
,61,ftdi_sio
))
362 $(eval
$(call KMOD_template
,USB_SERIAL_MCT_U232
,usb-serial-mct-u232
,\
363 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/mct_u232.ko \
364 ,CONFIG_USB_SERIAL_MCT_U232
,kmod-usb-serial
,61,mct_u232
))
366 $(eval
$(call KMOD_template
,USB_SERIAL_PL2303
,usb-serial-pl2303
,\
367 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/pl2303.ko \
368 ,CONFIG_USB_SERIAL_PL2303
,kmod-usb-serial
,61,pl2303
))
370 $(eval
$(call KMOD_template
,USB_SERIAL_VISOR
,usb-serial-visor
,\
371 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/visor.ko \
372 ,CONFIG_USB_SERIAL_VISOR
,kmod-usb-serial
,61,visor
))
374 $(eval
$(call KMOD_template
,USB_STORAGE
,usb-storage
,\
375 $(MODULES_DIR
)/kernel
/drivers
/scsi
/scsi_mod.ko \
376 $(MODULES_DIR
)/kernel
/drivers
/scsi
/sd_mod.ko \
377 $(MODULES_DIR
)/kernel
/drivers
/usb
/storage
/usb-storage.ko \
378 ,CONFIG_USB_STORAGE
,kmod-usb-core
,60,scsi_mod sd_mod usb-storage
))
380 $(eval
$(call KMOD_template
,USB_ATM
,usb-atm
,\
381 $(MODULES_DIR
)/kernel
/drivers
/usb
/atm
/usbatm.ko \
382 ,CONFIG_USB_ATM
,kmod-usb-atm
,50,usb-atm
))
386 $(eval
$(call KMOD_template
,AX25
,ax25
,\
387 $(MODULES_DIR
)/kernel
/net
/ax25
/ax25.ko \
388 $(MODULES_DIR
)/kernel
/drivers
/net
/hamradio
/mkiss.ko \
389 ,CONFIG_AX25
,,90,ax25 mkiss
))
391 $(eval
$(call KMOD_template
,BLUETOOTH
,bluetooth
,\
392 $(MODULES_DIR
)/kernel
/net
/bluetooth
/bluetooth.ko \
393 $(MODULES_DIR
)/kernel
/net
/bluetooth
/l2cap.ko \
394 $(MODULES_DIR
)/kernel
/net
/bluetooth
/sco.ko \
395 $(MODULES_DIR
)/kernel
/net
/bluetooth
/rfcomm
/rfcomm.ko \
396 $(MODULES_DIR
)/kernel
/drivers
/bluetooth
/hci_uart.ko \
400 $(TARGETS
): $(PACKAGE_DIR
)
403 mkdir
-p
$(PACKAGE_DIR
)
405 $(DL_DIR
)/$(LINUX_SOURCE
):
407 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(LINUX_SOURCE
) $(LINUX_KERNEL_MD5SUM
) $(LINUX_SITE
) $(MAKE_TRACE
)
409 $(LINUX_DIR
)/.unpacked
: $(DL_DIR
)/$(LINUX_SOURCE
)
410 -mkdir
-p
$(LINUX_BUILD_DIR
)
411 bzcat
$(DL_DIR
)/$(LINUX_SOURCE
) |
tar -C
$(LINUX_BUILD_DIR
) $(TAR_OPTIONS
) -
413 ln
-s
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
) $(LINUX_DIR
)
414 touch
$(LINUX_DIR
)/.unpacked
416 $(LINUX_DIR
)/.patched
: $(LINUX_DIR
)/.unpacked
417 $(PATCH
) $(LINUX_DIR
) .
/patches
/generic
$(MAKE_TRACE
)
418 [ -d .
/patches
/$(BOARD
) ] && $(PATCH
) $(LINUX_DIR
) .
/patches
/$(BOARD
) $(MAKE_TRACE
)
419 touch
$(LINUX_DIR
)/.patched
421 $(LINUX_DIR
)/.configured
: $(LINUX_DIR
)/.patched
422 -cp
$(LINUX_KCONFIG
) $(LINUX_DIR
)/.config
423 $(MAKE
) -C
$(LINUX_DIR
) ARCH
=$(LINUX_KARCH
) oldconfig
$(MAKE_TRACE
)
424 touch
$(LINUX_DIR
)/.configured
426 $(LINUX_DIR
)/vmlinux
: $(LINUX_DIR
)/.configured
427 $(MAKE
) -C
$(LINUX_DIR
) CROSS_COMPILE
=$(TARGET_CROSS
) ARCH
=$(LINUX_KARCH
) PATH
=$(TARGET_PATH
) $(MAKE_TRACE
)
429 $(LINUX_KERNEL
): $(LINUX_DIR
)/vmlinux
430 $(TARGET_CROSS
)objcopy
-O binary
-R .reginfo
-R .note
-R .comment
-R .mdebug
-S
$< $@
$(MAKE_TRACE
)
431 touch
-c
$(LINUX_KERNEL
)
433 $(LINUX_DIR
)/.modules_done
: $(LINUX_KERNEL
) $(LINUX_IMAGE
)
434 rm -rf
$(LINUX_BUILD_DIR
)/modules
435 $(MAKE
) -C
$(LINUX_DIR
) CROSS_COMPILE
=$(TARGET_CROSS
) ARCH
=$(LINUX_KARCH
) PATH
=$(TARGET_PATH
) modules
$(MAKE_TRACE
)
436 $(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
)
437 touch
$(LINUX_DIR
)/.modules_done
439 $(STAGING_DIR
)/include/linux
/version.h
: $(LINUX_DIR
)/.configured
440 mkdir
-p
$(STAGING_DIR
)/include
441 tar -ch
-C
$(LINUX_DIR
)/include -f
- linux |
tar -xf
- -C
$(STAGING_DIR
)/include/
442 tar -ch
-C
$(LINUX_DIR
)/include -f
- asm |
tar -xf
- -C
$(STAGING_DIR
)/include/
444 $(STAMP_DIR
)/.linux-compile
: $(LINUX_DIR
)/.modules_done
445 @mkdir
-p
$(STAMP_DIR
)
447 ln
-sf
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
) $(LINUX_DIR
)
448 @
$(TRACE
) target
/linux
/package
449 $(MAKE
) -C
$(TOPDIR
)/target
/linux
/package \
454 $(TARGET_MODULES_DIR
):
455 -mkdir
-p
$(TARGET_MODULES_DIR
)
458 rm -rf
$(KERNEL_IDIR
)
459 mkdir
-p
$(KERNEL_IDIR
)/etc
460 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(KERNEL_IDIR
) ..
/control
/kernel.control
$(LINUX_VERSION
)-$(BOARD
)-$(PKG_RELEASE
) $(ARCH
)
461 if
[ -f .
/config
/$(BOARD
).modules
]; then \
462 cp .
/config
/$(BOARD
).modules
$(KERNEL_IDIR
)/etc
/modules
; \
464 $(IPKG_BUILD
) $(KERNEL_IDIR
) $(LINUX_BUILD_DIR
) $(MAKE_TRACE
)
466 source
: $(DL_DIR
)/$(LINUX_SOURCE
)
467 prepare
: $(LINUX_DIR
)/.configured
469 $(MAKE
) $(STAMP_DIR
)/.linux-compile
$(MAKE_TRACE
)
471 install: compile
$(TARGET_MODULES_DIR
) $(KERNEL_IPKG
)
472 rm -rf
$(LINUX_BUILD_DIR
)/root
*
473 cp
-fpR
$(BUILD_DIR
)/root
$(LINUX_BUILD_DIR
)/
474 echo
-e
'dest root /\noption offline_root $(LINUX_BUILD_DIR)/root' > $(LINUX_BUILD_DIR
)/ipkg.conf
475 $(MAKE
) -C
$(TOPDIR
)/target
/linux
/package \
478 @
{ [ "$(INSTALL_TARGETS)" != "" ] && $(IPKG_KERNEL
) install $(INSTALL_TARGETS
) || true
; } $(MAKE_TRACE
)
481 rm -f
$(STAMP_DIR
)/.linux-compile
482 rm -f
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
)/.modules_done
483 rm -f
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
)/.drivers-unpacked
484 $(MAKE
) -C
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
) clean $(MAKE_TRACE
)
485 rm -f
$(LINUX_KERNEL
) $(LINUX_IMAGE
)
489 if
[ -f
$(LINUX_KERNEL
) ]; then \
490 $(MAKE
) clean $(MAKE_TRACE
); \
492 $(MAKE
) compile
$(MAKE_TRACE
)
495 rm -f
$(STAMP_DIR
)/.linux-compile
496 rm -rf
$(LINUX_BUILD_DIR
)