LINUX_BUILD_DIR:=$(BUILD_DIR)/linux-2.4-$(BOARD)
LINUX_TARGET_DIR:=$(LINUX_BUILD_DIR)/root
LINUX_KERNEL:=$(LINUX_BUILD_DIR)/vmlinux
-LINUX_IMAGE:=$(LINUX_BUILD_DIR)/kernel-image
-LINUX_FORMAT=zImage
LINUX_KARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \
-e 's/mipsel/mips/' \
-e 's/powerpc/ppc/' \
-e 's/sh[234]/sh/' \
)
-LINUX_BINARY_DRIVER_SITE := http://openwrt.org/downloads/
+LINUX_BINARY_DRIVER_SITE := http://openwrt.org/downloads/sources/
LINUX_SOURCE := linux-$(LINUX_VERSION).tar.bz2
-LINUX_BINLOC := arch/$(LINUX_KARCH)/bcm947xx/compressed/piggy
LINUX_SOURCE_DIR := $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION)
MODULES_DIR := $(LINUX_BUILD_DIR)/modules/$(MODULES_SUBDIR)
TARGET_MODULES_DIR := $(TARGET_DIR)/lib/modules/$(LINUX_VERSION)
KERNEL_IDIR:=$(LINUX_BUILD_DIR)/kernel-ipkg
include $(LINUX_KCONFIG)
+
+INSTALL_TARGETS := $(KERNEL_IPKG)
+TARGETS :=
+
ifeq ($(BOARD),brcm)
include ./broadcom.mk
endif
-TARGETS :=
-INSTALL_TARGETS := $(KERNEL_IPKG)
-
-$(eval $(call KMOD_template,DIAG,diag,\
- $(MODULES_DIR)/kernel/drivers/net/diag/diag.o \
-))
-$(eval $(call KMOD_template,BRCM_WL,brcm-wl,\
- $(MODULES_DIR)/kernel/drivers/net/wl/wl.o \
-,CONFIG_WL))
$(eval $(call KMOD_template,B44,b44,\
$(MODULES_DIR)/kernel/drivers/net/b44.o \
,CONFIG_B44))
-$(eval $(call KMOD_template,BRCM_ET,brcm-et,\
- $(MODULES_DIR)/kernel/drivers/net/et/et.o \
-,CONFIG_ET))
$(eval $(call KMOD_template,ARPT,arptables,\
$(MODULES_DIR)/kernel/net/ipv4/netfilter/arp*.o \
,CONFIG_IP_NF_ARPTABLES))
$(eval $(call KMOD_template,USB_PRINTER,usb-printer,\
$(MODULES_DIR)/kernel/drivers/usb/printer.o \
,CONFIG_USB_PRINTER))
-$(eval $(call KMOD_template,LP,lp,\
- $(MODULES_DIR)/kernel/drivers/parport/parport.o \
- $(MODULES_DIR)/kernel/drivers/parport/parport_splink.o \
- $(MODULES_DIR)/kernel/drivers/char/lp.o \
-,CONFIG_PARPORT))
$(eval $(call KMOD_template,IDE,ide,\
$(MODULES_DIR)/kernel/drivers/ide/*.o \
$(MODULES_DIR)/kernel/drivers/ide/*/*.o \
touch $(LINUX_DIR)/.unpacked
$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
- [ -d ./patches/$(BOARD) ] && $(PATCH) $(LINUX_DIR) ./patches/$(BOARD)
$(PATCH) $(LINUX_DIR) ./patches/generic
+ [ -d ./patches/$(BOARD) ] && $(PATCH) $(LINUX_DIR) ./patches/$(BOARD)
touch $(LINUX_DIR)/.patched
$(LINUX_DIR)/.configured: $(LINUX_DIR)/.patched
$(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_KARCH) dep
touch $(LINUX_DIR)/.depend_done
-$(LINUX_DIR)/$(LINUX_BINLOC): $(LINUX_DIR)/.depend_done
- $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH) $(LINUX_FORMAT)
+$(LINUX_DIR)/vmlinux: $(LINUX_DIR)/.depend_done
+ $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH)
-$(LINUX_KERNEL): $(LINUX_DIR)/$(LINUX_BINLOC)
- cp -fa $< $@
+$(LINUX_KERNEL): $(LINUX_DIR)/vmlinux
+ $(TARGET_CROSS)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S $< $@
touch -c $(LINUX_KERNEL)
-$(LINUX_IMAGE): $(LINUX_KERNEL)
- cat $^ | $(BUILD_DIR)/lzma/lzma e -si -so -eos -lc1 -lp2 -pb2 > $@ || (rm -f $@ && false)
-
$(LINUX_DIR)/.modules_done: $(LINUX_KERNEL) $(LINUX_IMAGE)
rm -rf $(LINUX_BUILD_DIR)/modules
$(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH) modules