2 # Linux 2.6 kernel target for the OpenWRT project
4 include $(TOPDIR
)/rules.mk
8 LINUX_VERSION
:=2.6.12.5
9 LINUX_KERNEL_MD5SUM
:=076f0dc714112c764c790fbaef19e228
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 \
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
,$(IPKG_KMOD_IPT_CONNTRACK-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
122 $(eval
$(call KMOD_template
,IPT_EXTRA
,ipt-extra
,\
123 $(foreach mod
,$(IPKG_KMOD_IPT_EXTRA-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
126 $(eval
$(call KMOD_template
,IPT_FILTER
,ipt-filter
,\
127 $(foreach mod
,$(IPKG_KMOD_IPT_FILTER-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
130 $(eval
$(call KMOD_template
,IPT_IPOPT
,ipt-ipopt
,\
131 $(foreach mod
,$(IPKG_KMOD_IPT_IPOPT-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
134 $(eval
$(call KMOD_template
,IPT_IPSEC
,ipt-ipsec
,\
135 $(foreach mod
,$(IPKG_KMOD_IPT_IPSEC-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
138 $(eval
$(call KMOD_template
,IPT_NAT
,ipt-nat
,\
139 $(foreach mod
,$(IPKG_KMOD_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
,$(IPKG_KMOD_IPT_NAT_EXTRA-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
144 ,,,40,$(IPKG_KMOD_IPT_NAT_EXTRA-m
)))
146 $(eval
$(call KMOD_template
,IPT_QUEUE
,ipt-queue
,\
147 $(foreach mod
,$(IPKG_KMOD_IPT_QUEUE-m
),$(MODULES_DIR
)/kernel
/net
/ipv4
/netfilter
/$(mod
).ko
) \
150 $(eval
$(call KMOD_template
,IPT_ULOG
,ipt-ulog
,\
151 $(foreach mod
,$(IPKG_KMOD_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_core.ko \
309 $(MODULES_DIR
)/kernel
/drivers
/pcmcia
/yenta_socket.ko \
310 ,CONFIG_PCMCIA
,,50,pcmcia_core
))
315 $(eval
$(call KMOD_template
,USB
,usb-core
,\
316 $(MODULES_DIR
)/kernel
/drivers
/usb
/core
/usbcore.ko \
317 ,CONFIG_USB
,,50,usbcore
))
319 $(eval
$(call KMOD_template
,USB_OHCI
,usb-ohci
,\
320 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/ohci-hcd.ko \
321 ,CONFIG_USB_OHCI_HCD
,kmod-usb-core
,60,ohci-hcd
))
323 $(eval
$(call KMOD_template
,USB_UHCI
,usb-uhci
,\
324 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/uhci.ko \
325 ,CONFIG_USB_UHCI_ALT
,kmod-usb-core
,60,uhci
))
327 $(eval
$(call KMOD_template
,USB2
,usb2
,\
328 $(MODULES_DIR
)/kernel
/drivers
/usb
/host
/ehci-hcd.ko \
329 ,CONFIG_USB_EHCI_HCD
,kmod-usb-core
,60,ehci-hcd
))
331 $(eval
$(call KMOD_template
,USB_ACM
,usb-acm
,\
332 $(MODULES_DIR
)/kernel
/drivers
/usb
/class
/cdc-acm.ko \
335 $(eval
$(call KMOD_template
,USB_AUDIO
,usb-audio
,\
336 $(MODULES_DIR
)/kernel
/drivers
/usb
/class
/audio.ko \
337 ,CONFIG_USB_AUDIO
,kmod-soundcore kmod-usb-core
,61,audio
))
339 $(eval
$(call KMOD_template
,USB_PRINTER
,usb-printer
,\
340 $(MODULES_DIR
)/kernel
/drivers
/usb
/class
/usblp.ko \
341 ,CONFIG_USB_PRINTER
,kmod-usb-core
,60,usblp
))
343 $(eval
$(call KMOD_template
,USB_SERIAL
,usb-serial
,\
344 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/usbserial.ko \
345 ,CONFIG_USB_SERIAL
,kmod-usb-core
,60,usbserial
))
347 $(eval
$(call KMOD_template
,USB_SERIAL_BELKIN
,usb-serial-belkin
,\
348 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/belkin_sa.ko \
349 ,CONFIG_USB_SERIAL_BELKIN
,kmod-usb-serial
,61,belkin_sa
))
351 $(eval
$(call KMOD_template
,USB_SERIAL_FTDI
,usb-serial-ftdi
,\
352 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/ftdi_sio.ko \
353 ,CONFIG_USB_SERIAL_FTDI_SIO
,kmod-usb-serial
,61,ftdi_sio
))
355 $(eval
$(call KMOD_template
,USB_SERIAL_MCT_U232
,usb-serial-mct-u232
,\
356 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/mct_u232.ko \
357 ,CONFIG_USB_SERIAL_MCT_U232
,kmod-usb-serial
,61,mct_u232
))
359 $(eval
$(call KMOD_template
,USB_SERIAL_PL2303
,usb-serial-pl2303
,\
360 $(MODULES_DIR
)/kernel
/drivers
/usb
/serial
/pl2303.ko \
361 ,CONFIG_USB_SERIAL_PL2303
,kmod-usb-serial
,61,pl2303
))
363 $(eval
$(call KMOD_template
,USB_STORAGE
,usb-storage
,\
364 $(MODULES_DIR
)/kernel
/drivers
/scsi
/scsi_mod.ko \
365 $(MODULES_DIR
)/kernel
/drivers
/scsi
/sd_mod.ko \
366 $(MODULES_DIR
)/kernel
/drivers
/usb
/storage
/usb-storage.ko \
367 ,CONFIG_USB_STORAGE
,kmod-usb-core
,60,scsi_mod sd_mod usb-storage
))
372 $(eval
$(call KMOD_template
,AX25
,ax25
,\
373 $(MODULES_DIR
)/kernel
/net
/ax25
/ax25.ko \
374 $(MODULES_DIR
)/kernel
/drivers
/net
/hamradio
/mkiss.ko \
375 ,CONFIG_AX25
,,90,ax25 mkiss
))
377 $(eval
$(call KMOD_template
,BLUETOOTH
,bluetooth
,\
378 $(MODULES_DIR
)/kernel
/net
/bluetooth
/bluetooth.ko \
379 $(MODULES_DIR
)/kernel
/net
/bluetooth
/l2cap.ko \
380 $(MODULES_DIR
)/kernel
/net
/bluetooth
/sco.ko \
381 $(MODULES_DIR
)/kernel
/net
/bluetooth
/rfcomm
/rfcomm.ko \
382 $(MODULES_DIR
)/kernel
/drivers
/bluetooth
/hci_uart.ko \
386 $(TARGETS
): $(PACKAGE_DIR
)
389 mkdir
-p
$(PACKAGE_DIR
)
391 $(DL_DIR
)/$(LINUX_SOURCE
):
393 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(LINUX_SOURCE
) $(LINUX_KERNEL_MD5SUM
) $(LINUX_SITE
) $(MAKE_TRACE
)
395 $(LINUX_DIR
)/.unpacked
: $(DL_DIR
)/$(LINUX_SOURCE
)
396 -mkdir
-p
$(LINUX_BUILD_DIR
)
397 bzcat
$(DL_DIR
)/$(LINUX_SOURCE
) |
tar -C
$(LINUX_BUILD_DIR
) $(TAR_OPTIONS
) -
399 ln
-s
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
) $(LINUX_DIR
)
400 touch
$(LINUX_DIR
)/.unpacked
402 $(LINUX_DIR
)/.patched
: $(LINUX_DIR
)/.unpacked
403 $(PATCH
) $(LINUX_DIR
) .
/patches
/generic
$(MAKE_TRACE
)
404 [ -d .
/patches
/$(BOARD
) ] && $(PATCH
) $(LINUX_DIR
) .
/patches
/$(BOARD
) $(MAKE_TRACE
)
405 touch
$(LINUX_DIR
)/.patched
407 $(LINUX_DIR
)/.configured
: $(LINUX_DIR
)/.patched
408 -cp
$(LINUX_KCONFIG
) $(LINUX_DIR
)/.config
409 $(MAKE
) -C
$(LINUX_DIR
) ARCH
=$(LINUX_KARCH
) oldconfig
$(MAKE_TRACE
)
410 touch
$(LINUX_DIR
)/.configured
412 $(LINUX_DIR
)/vmlinux
: $(LINUX_DIR
)/.configured
413 $(MAKE
) -C
$(LINUX_DIR
) CROSS_COMPILE
=$(TARGET_CROSS
) ARCH
=$(LINUX_KARCH
) PATH
=$(TARGET_PATH
) $(MAKE_TRACE
)
415 $(LINUX_KERNEL
): $(LINUX_DIR
)/vmlinux
416 $(TARGET_CROSS
)objcopy
-O binary
-R .reginfo
-R .note
-R .comment
-R .mdebug
-S
$< $@
$(MAKE_TRACE
)
417 touch
-c
$(LINUX_KERNEL
)
419 $(LINUX_DIR
)/.modules_done
: $(LINUX_KERNEL
) $(LINUX_IMAGE
)
420 rm -rf
$(LINUX_BUILD_DIR
)/modules
421 $(MAKE
) -C
$(LINUX_DIR
) CROSS_COMPILE
=$(TARGET_CROSS
) ARCH
=$(LINUX_KARCH
) PATH
=$(TARGET_PATH
) modules
$(MAKE_TRACE
)
422 $(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
)
423 touch
$(LINUX_DIR
)/.modules_done
425 $(STAGING_DIR
)/include/linux
/version.h
: $(LINUX_DIR
)/.configured
426 mkdir
-p
$(STAGING_DIR
)/include
427 tar -ch
-C
$(LINUX_DIR
)/include -f
- linux |
tar -xf
- -C
$(STAGING_DIR
)/include/
428 tar -ch
-C
$(LINUX_DIR
)/include -f
- asm |
tar -xf
- -C
$(STAGING_DIR
)/include/
430 $(STAMP_DIR
)/.linux-compile
: $(LINUX_DIR
)/.modules_done
431 @mkdir
-p
$(STAMP_DIR
)
433 ln
-sf
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
) $(LINUX_DIR
)
434 @
$(TRACE
) target
/linux
/package
435 $(MAKE
) -C
$(TOPDIR
)/target
/linux
/package \
440 $(TARGET_MODULES_DIR
):
441 -mkdir
-p
$(TARGET_MODULES_DIR
)
444 rm -rf
$(KERNEL_IDIR
)
445 mkdir
-p
$(KERNEL_IDIR
)/etc
446 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(KERNEL_IDIR
) ..
/control
/kernel.control
$(LINUX_VERSION
)-$(BOARD
)-$(PKG_RELEASE
) $(ARCH
)
447 if
[ -f .
/config
/$(BOARD
).modules
]; then \
448 cp .
/config
/$(BOARD
).modules
$(KERNEL_IDIR
)/etc
/modules
; \
450 $(IPKG_BUILD
) $(KERNEL_IDIR
) $(LINUX_BUILD_DIR
) $(MAKE_TRACE
)
452 source
: $(DL_DIR
)/$(LINUX_SOURCE
)
453 prepare
: $(LINUX_DIR
)/.configured
455 $(MAKE
) $(STAMP_DIR
)/.linux-compile
$(MAKE_TRACE
)
457 install: compile
$(TARGET_MODULES_DIR
) $(KERNEL_IPKG
)
458 rm -rf
$(LINUX_BUILD_DIR
)/root
*
459 cp
-fpR
$(BUILD_DIR
)/root
$(LINUX_BUILD_DIR
)/
460 echo
-e
'dest root /\noption offline_root $(LINUX_BUILD_DIR)/root' > $(LINUX_BUILD_DIR
)/ipkg.conf
461 $(MAKE
) -C
$(TOPDIR
)/target
/linux
/package \
464 @
{ [ "$(INSTALL_TARGETS)" != "" ] && $(IPKG_KERNEL
) install $(INSTALL_TARGETS
) || true
; } $(MAKE_TRACE
)
467 rm -f
$(STAMP_DIR
)/.linux-compile
468 rm -f
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
)/.modules_done
469 rm -f
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
)/.drivers-unpacked
470 $(MAKE
) -C
$(LINUX_BUILD_DIR
)/linux-
$(LINUX_VERSION
) clean $(MAKE_TRACE
)
471 rm -f
$(LINUX_KERNEL
) $(LINUX_IMAGE
)
475 if
[ -f
$(LINUX_KERNEL
) ]; then \
476 $(MAKE
) clean $(MAKE_TRACE
); \
478 $(MAKE
) compile
$(MAKE_TRACE
)
481 rm -f
$(STAMP_DIR
)/.linux-compile
482 rm -rf
$(LINUX_BUILD_DIR
)