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 JFFS2_BLOCKSIZE
= 128k
16 FLASH_KERNEL
:= 0xBFD00000
17 FLASH_FS
:= 0xBE000000
21 LOADADDR
=$(LOADADDR
) \
22 KERNEL_ENTRY
=$(KERNEL_ENTRY
) \
26 $(MAKE
) -C
$(GENERIC_PLATFORM_DIR
)/image
/lzma-loader
$(LOADER_MAKEOPTS
) clean
29 DROP_SECTIONS
:= .reginfo .mdebug .comment .note .pdr .options .MIPS.options
30 OBJCOPY_SREC
:= $(TARGET_CROSS
)objcopy
-S
-O srec
$(addprefix --remove-section
=,$(DROP_SECTIONS
))
31 OBJCOPY_BIN
:= $(TARGET_CROSS
)objcopy
-S
-O binary
$(addprefix --remove-section
=,$(DROP_SECTIONS
))
34 cat
$(KDIR
)/vmlinux |
$(STAGING_DIR_HOST
)/bin
/lzma e
-si
-so
-eos
-lc1
-lp2
-pb2
> $(KDIR
)/vmlinux.lzma
37 $(MAKE
) -C
$(GENERIC_PLATFORM_DIR
)/image
/lzma-loader \
40 $(OBJCOPY_SREC
) $(KDIR
)/loader.elf
$(KDIR
)/kernel.ram.srec
43 $(MAKE
) -C
$(GENERIC_PLATFORM_DIR
)/image
/lzma-loader \
46 LOADER_ENTRY
=$(FLASH_KERNEL
) \
49 $(OBJCOPY_SREC
) $(KDIR
)/loader_flash.elf
$(KDIR
)/kernel.flash.srec
50 $(OBJCOPY_BIN
) $(KDIR
)/loader_flash.elf
$(KDIR
)/kernel.flash.bin
53 define Image
/Build
/Initramfs
54 $(OBJCOPY_SREC
) $(BIN_DIR
)/openwrt-
$(BOARD
)-vmlinux.elf
$(BIN_DIR
)/openwrt-
$(BOARD
)-vmlinux.srec
58 $(TARGET_CROSS
)objcopy
-O srec
-I binary
--adjust-vma
$(FLASH_FS
) $(KDIR
)/root.
$(1) $(KDIR
)/root.
$(1).srec
59 grep
-v S7
$(KDIR
)/root.
$(1).srec
> $(BIN_DIR
)/openwrt-
$(BOARD
)-$(1).srec
60 grep
-v S0
$(KDIR
)/kernel.flash.srec
>> $(BIN_DIR
)/openwrt-
$(BOARD
)-$(1).srec
61 $(INSTALL_BIN
) $(KDIR
)/kernel.flash.bin
$(BIN_DIR
)/openwrt-
$(BOARD
)-vmlinux.bin
62 $(CP
) $(KDIR
)/root.
$(1) $(BIN_DIR
)/openwrt-
$(BOARD
)-$(1).fs
63 $(CP
) $(KDIR
)/kernel.flash.srec
$(BIN_DIR
)/openwrt-
$(BOARD
)-vmlinux-flash.srec
64 $(CP
) $(KDIR
)/kernel.ram.srec
$(BIN_DIR
)/openwrt-
$(BOARD
)-vmlinux-ram.srec
65 ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS
),y
)
66 $(call Image
/Build
/Initramfs
)
70 $(eval
$(call BuildImage
))