-$(LINUX_KCONFIG):
- @if [ ! -f "$(LINUX_KCONFIG)" ] ; then \
- echo ""; \
- echo "You should create a .config for your kernel"; \
- echo "and install it as $(LINUX_KCONFIG)"; \
- echo ""; \
- sleep 5; \
- fi;
-
-$(LINUX_DIR)/.configured: $(LINUX_DIR)/.unpacked $(LINUX_KCONFIG)
- $(SED) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" $(LINUX_DIR)/Makefile
- $(SED) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" $(LINUX_DIR)/arch/mips/Makefile
+$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
+ $(PATCH) $(LINUX_DIR) $(LINUX_PATCHES)
+ # copy kernel source which is maintained in openwrt via cvs
+ cp -a $(LINUX_KERNEL_SOURCE)/* $(LINUX_DIR)
+ # copy binary drivers
+ cp -a $(BUILD_DIR)/wl/*.o $(LINUX_DIR)/drivers/net/wl
+ cp -a $(BUILD_DIR)/et/*.o $(LINUX_DIR)/drivers/net/et
+ $(SED) 's/@expr length/@-expr length/' $(LINUX_DIR)/Makefile
+ touch $(LINUX_DIR)/.patched
+
+$(LINUX_DIR)/.configured: $(LINUX_DIR)/.patched
+ -cp $(LINUX_KCONFIG) $(LINUX_DIR)/.config
+ $(SED) "s,^CROSS_COMPILE.*,CROSS_COMPILE=$(KERNEL_CROSS),g;" \
+ $(LINUX_DIR)/Makefile \
+ $(LINUX_DIR)/arch/mips/Makefile