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.
11 # Default packages - the really basic set
12 DEFAULT_PACKAGES
:=base-files libgcc uclibc busybox dropbear mtd mtd
14 DEFAULT_PACKAGES.router
:=dnsmasq iptables ppp ppp-mod-pppoe iptables kmod-ipt-nathelper bridge
16 # Additional packages for Linux 2.6
18 DEFAULT_PACKAGES
+= udevtrigger hotplug2
21 # Add device specific packages
22 DEFAULT_PACKAGES
+= $(DEFAULT_PACKAGES.
$(DEVICE_TYPE
))
25 ifneq (,$(findstring x86
,$(BOARD
)))
28 ifneq (,$(findstring rdc
,$(BOARD
)))
31 ifneq (,$(findstring ppc
,$(BOARD
)))
34 ifneq (,$(findstring avr32
,$(BOARD
)))
38 KERNEL_MAKEOPTS
:= -C
$(LINUX_DIR
) \
39 CROSS_COMPILE
="$(KERNEL_CROSS)" \
40 ARCH
="$(LINUX_KARCH)" \
41 CONFIG_SHELL
="$(BASH)"
43 INITRAMFS_EXTRA_FILES ?
= $(GENERIC_PLATFORM_DIR
)/image
/initramfs-base-files.txt
46 KERNEL_MAKEOPTS
+= CC
="$(KERNEL_CC)"
50 Kernel
/Patch
:=$(Kernel
/Patch
/Default
)
51 define Kernel
/Prepare
/Default
52 bzcat
$(DL_DIR
)/$(LINUX_SOURCE
) |
$(TAR
) -C
$(KERNEL_BUILD_DIR
) $(TAR_OPTIONS
)
54 $(if
$(QUILT
),touch
$(LINUX_DIR
)/.quilt_used
)
57 define Kernel
/Configure
/2.4
58 $(SED
) "s,\-mcpu=,\-mtune=,g;" $(LINUX_DIR
)/arch
/mips
/Makefile
59 $(MAKE
) $(KERNEL_MAKEOPTS
) oldconfig
include/linux
/compile.h
include/linux
/version.h
60 $(MAKE
) $(KERNEL_MAKEOPTS
) dep
62 define Kernel
/Configure
/2.6
63 -$(MAKE
) $(KERNEL_MAKEOPTS
) oldconfig prepare scripts
65 define Kernel
/Configure
/Default
66 $(LINUX_CONFCMD
) > $(LINUX_DIR
)/.config.target
67 $(SCRIPT_DIR
)/metadata.pl kconfig
$(TMP_DIR
)/.packageinfo
$(TOPDIR
)/.config
> $(LINUX_DIR
)/.config.
override
68 $(SCRIPT_DIR
)/kconfig.pl
'm+' $(LINUX_DIR
)/.config.target
$(LINUX_DIR
)/.config.
override > $(LINUX_DIR
)/.config
69 $(call Kernel
/Configure
/$(KERNEL
))
70 rm -rf
$(KERNEL_BUILD_DIR
)/modules
73 define Kernel
/CompileModules
/Default
74 rm -f
$(LINUX_DIR
)/vmlinux
$(LINUX_DIR
)/System.map
75 $(MAKE
) $(KERNEL_MAKEOPTS
) modules
79 ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS
),y
)
80 define Kernel
/SetInitramfs
81 mv
$(LINUX_DIR
)/.config
$(LINUX_DIR
)/.config.old
82 grep
-v INITRAMFS
$(LINUX_DIR
)/.config.old
> $(LINUX_DIR
)/.config
83 echo
'CONFIG_INITRAMFS_SOURCE="$(strip $(TARGET_DIR) $(INITRAMFS_EXTRA_FILES))"' >> $(LINUX_DIR
)/.config
84 echo
'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> $(LINUX_DIR
)/.config
85 echo
'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> $(LINUX_DIR
)/.config
88 define Kernel
/SetInitramfs
89 mv
$(LINUX_DIR
)/.config
$(LINUX_DIR
)/.config.old
90 grep
-v INITRAMFS
$(LINUX_DIR
)/.config.old
> $(LINUX_DIR
)/.config
91 rm -f
$(TARGET_DIR
)/init
92 echo
'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR
)/.config
96 define Kernel
/CompileImage
/Default
97 $(call Kernel
/SetInitramfs
)
98 $(MAKE
) $(KERNEL_MAKEOPTS
) $(KERNELNAME
)
99 $(KERNEL_CROSS
)objcopy
-O binary
-R .reginfo
-R .note
-R .comment
-R .mdebug
-S
$(LINUX_DIR
)/vmlinux
$(LINUX_KERNEL
)
100 $(KERNEL_CROSS
)objcopy
-R .reginfo
-R .note
-R .comment
-R .mdebug
-S
$(LINUX_DIR
)/vmlinux
$(KERNEL_BUILD_DIR
)/vmlinux.elf
103 define Kernel
/Clean
/Default
104 rm -f
$(KERNEL_BUILD_DIR
)/linux-
$(LINUX_VERSION
)/.configured
105 rm -f
$(LINUX_KERNEL
)
106 $(MAKE
) -C
$(KERNEL_BUILD_DIR
)/linux-
$(LINUX_VERSION
) clean