2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
10 LOADADDR = 0x81000000 # RAM start + 16M
11 KERNEL_ENTRY = 0x80100000
12 RAMSIZE = 0x00100000 # 1MB
14 FLASH_KERNEL := 0xBFD00000
15 FLASH_FS := 0xBE000000
19 LOADADDR=$(LOADADDR) \
20 KERNEL_ENTRY=$(KERNEL_ENTRY) \
24 $(MAKE) -C ../../generic-2.6/image/lzma-loader $(LOADER_MAKEOPTS) clean
27 DROP_SECTIONS := .reginfo .mdebug .comment .note .pdr .options .MIPS.options
28 OBJCOPY_KERNEL := $(TARGET_CROSS)objcopy -S -O srec $(addprefix --remove-section=,$(DROP_SECTIONS))
31 cat $(KDIR)/vmlinux | $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
34 $(MAKE) -C ../../generic-2.6/image/lzma-loader \
37 $(OBJCOPY_KERNEL) $(KDIR)/loader.elf $(KDIR)/kernel.ram.srec
40 $(MAKE) -C ../../generic-2.6/image/lzma-loader \
43 LOADER_ENTRY=$(FLASH_KERNEL) \
46 $(OBJCOPY_KERNEL) $(KDIR)/loader_flash.elf $(KDIR)/kernel.flash.srec
50 $(TARGET_CROSS)objcopy -O srec -I binary --adjust-vma $(FLASH_FS) $(KDIR)/root.$(1) $(KDIR)/root.$(1).srec
51 grep -v S7 $(KDIR)/root.$(1).srec > $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).img
52 grep -v S0 $(KDIR)/kernel.flash.srec >> $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).img
55 $(eval $(call BuildImage))