2 # Copyright (C) 2006-2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 # For target profile selection - the default set
9 DEFAULT_PACKAGES
:=base-files libgcc uclibc bridge busybox dnsmasq dropbear iptables mtd ppp ppp-mod-pppoe mtd kmod-ipt-nathelper
11 DEFAULT_PACKAGES
+=udevtrigger hotplug2
15 ifneq (,$(findstring x86
,$(BOARD
)))
18 ifneq (,$(findstring rdc
,$(BOARD
)))
21 ifneq (,$(findstring ppc
,$(BOARD
)))
24 ifneq (,$(findstring avr32
,$(BOARD
)))
28 KERNEL_MAKEOPTS
:= -C
$(LINUX_DIR
) \
29 CROSS_COMPILE
="$(KERNEL_CROSS)" \
30 ARCH
="$(LINUX_KARCH)" \
31 CONFIG_SHELL
="$(BASH)"
34 Kernel
/Patch
:=$(Kernel
/Patch
/Default
)
35 define Kernel
/Prepare
/Default
36 bzcat
$(DL_DIR
)/$(LINUX_SOURCE
) |
$(TAR
) -C
$(KERNEL_BUILD_DIR
) $(TAR_OPTIONS
)
40 define Kernel
/Configure
/2.4
41 $(SED
) "s,\-mcpu=,\-mtune=,g;" $(LINUX_DIR
)/arch
/mips
/Makefile
42 $(MAKE
) $(KERNEL_MAKEOPTS
) CC
="$(KERNEL_CC)" oldconfig
include/linux
/compile.h
include/linux
/version.h
43 $(MAKE
) $(KERNEL_MAKEOPTS
) dep
45 define Kernel
/Configure
/2.6
46 -$(MAKE
) $(KERNEL_MAKEOPTS
) CC
="$(KERNEL_CC)" oldconfig prepare scripts
48 define Kernel
/Configure
/Default
49 @if
[ -f
"./config/profile-$(PROFILE)" ]; then \
50 $(SCRIPT_DIR
)/config.pl
'+' $(GENERIC_LINUX_CONFIG
) '+' $(LINUX_CONFIG
) .
/config
/profile-
$(PROFILE
) > $(LINUX_DIR
)/.config
; \
52 $(SCRIPT_DIR
)/config.pl
'+' $(GENERIC_LINUX_CONFIG
) $(LINUX_CONFIG
) > $(LINUX_DIR
)/.config
; \
54 $(call Kernel
/Configure
/$(KERNEL
))
55 rm -rf
$(KERNEL_BUILD_DIR
)/modules
56 @
rm -f
$(BUILD_DIR
)/linux
57 ln
-sf
$(KERNEL_BUILD_DIR
)/linux-
$(LINUX_VERSION
) $(BUILD_DIR
)/linux
60 define Kernel
/CompileModules
/Default
61 rm -f
$(LINUX_DIR
)/vmlinux
$(LINUX_DIR
)/System.map
62 $(MAKE
) -j
$(CONFIG_JLEVEL
) $(KERNEL_MAKEOPTS
) CC
="$(KERNEL_CC)" modules
66 ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS
),y
)
67 define Kernel
/SetInitramfs
68 mv
$(LINUX_DIR
)/.config
$(LINUX_DIR
)/.config.old
69 grep
-v INITRAMFS
$(LINUX_DIR
)/.config.old
> $(LINUX_DIR
)/.config
70 echo
'CONFIG_INITRAMFS_SOURCE="../../root"' >> $(LINUX_DIR
)/.config
71 echo
'CONFIG_INITRAMFS_ROOT_UID=0' >> $(LINUX_DIR
)/.config
72 echo
'CONFIG_INITRAMFS_ROOT_GID=0' >> $(LINUX_DIR
)/.config
75 define Kernel
/SetInitramfs
76 mv
$(LINUX_DIR
)/.config
$(LINUX_DIR
)/.config.old
77 grep
-v INITRAMFS
$(LINUX_DIR
)/.config.old
> $(LINUX_DIR
)/.config
78 rm -f
$(BUILD_DIR
)/root
/init
79 echo
'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR
)/.config
83 define Kernel
/CompileImage
/Default
84 $(call Kernel
/SetInitramfs
)
85 $(MAKE
) -j
$(CONFIG_JLEVEL
) $(KERNEL_MAKEOPTS
) CC
="$(KERNEL_CC)" $(KERNELNAME
)
86 $(KERNEL_CROSS
)objcopy
-O binary
-R .reginfo
-R .note
-R .comment
-R .mdebug
-S
$(LINUX_DIR
)/vmlinux
$(LINUX_KERNEL
)
87 $(KERNEL_CROSS
)objcopy
-R .reginfo
-R .note
-R .comment
-R .mdebug
-S
$(LINUX_DIR
)/vmlinux
$(KERNEL_BUILD_DIR
)/vmlinux.elf
90 define Kernel
/Clean
/Default
91 rm -f
$(LINUX_DIR
)/.linux-compile
92 rm -f
$(KERNEL_BUILD_DIR
)/linux-
$(LINUX_VERSION
)/.configured
94 $(MAKE
) -C
$(KERNEL_BUILD_DIR
)/linux-
$(LINUX_VERSION
) clean