2 # Copyright (C) 2006-2010 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 DROP_SECTIONS
:=.reginfo .mdebug .comment .note .pdr .options .MIPS.options
11 OBJCOPY_SREC
:=$(TARGET_CROSS
)objcopy
-S
-O srec
$(addprefix --remove-section
=,$(DROP_SECTIONS
))
14 KERNEL_ENTRY
:=0x94100000
18 EVA_LOADADDR
:= 0x94100000
22 LOADADDR
=$(LOADADDR
) \
23 KERNEL_ENTRY
=$(KERNEL_ENTRY
) \
24 RAMSTART
=$(RAMSTART
) \
27 CFLAGS
:= -D__KERNEL__
-Wall
-Wstrict-prototypes
-Wno-trigraphs
-Os \
28 -fno-strict-aliasing
-fno-common
-fomit-frame-pointer
-G
0 -mno-abicalls
-fno-pic \
29 -pipe
-mlong-calls
-fno-common \
30 -mabi
=32 -march
=mips32
-Wa
,-32 -Wa
,-march
=mips32
-Wa
,-mips32
-Wa
,--trap \
31 -DLOADADDR
=$(LOADADDR
)
34 $(MAKE
) -C
$(GENERIC_PLATFORM_DIR
)/image
/lzma-loader
$(LOADER_MAKEOPTS
) clean
38 cat
$(KDIR
)/vmlinux |
$(STAGING_DIR_HOST
)/bin
/lzma e
-si
-so
-eos
-lc1
-lp2
-pb2
> $(KDIR
)/vmlinux.lzma
40 $(MAKE
) -C
$(GENERIC_PLATFORM_DIR
)/image
/lzma-loader \
43 $(OBJCOPY_SREC
) $(KDIR
)/loader.elf
$(KDIR
)/loader.srec
44 $(OBJCOPY_SREC
) $(KDIR
)/vmlinux.elf
$(KDIR
)/vmlinux.srec
45 srec2bin
$(KDIR
)/loader.srec
$(KDIR
)/loader.bin
46 srec2bin
$(KDIR
)/vmlinux.srec
$(KDIR
)/vmlinux.bin
49 define align
/jffs2-64k
53 define align
/jffs2-128k
60 define Image
/Build
/CyberTAN
61 (dd if
=/dev
/zero bs
=16 count
=1; cat
$(BIN_DIR
)/$(IMG_PREFIX
)-$(1).bin
) | \
62 $(STAGING_DIR_HOST
)/bin
/addpattern
-p
$(3) -o
$(BIN_DIR
)/openwrt-
$(2)-$(4)-code.bin
65 define Image
/Build
/Titan
66 $(STAGING_DIR_HOST
)/bin
/mktitanimg
-o
$(BIN_DIR
)/openwrt-
$(2)-$(4)-code.bin
-i
$(KDIR
)/loader.bin
$(KDIR
)/root.
$(1) -a
0x10000 0x10000 -h
2 -p
0x4C575943 -s
0x0b010000
67 $(STAGING_DIR_HOST
)/bin
/mktitanimg
-o
$(BIN_DIR
)/openwrt-
$(2)-na-
$(4)-code.bin
-i
$(KDIR
)/loader.bin
$(KDIR
)/root.
$(1) -a
0x10000 0x10000 -h
2 -p
0x4D575943 -s
0x0b010000
70 define Image
/Build
/AudioCodes
71 ( dd if
=$(KDIR
)/vmlinux.elf bs
=64k conv
=sync
; dd if
=$(KDIR
)/root.
$(1) ) > $(BIN_DIR
)/openwrt-
$(2)-$(1).bin
74 #define Image/Build/sErCoMm
75 # cat sercomm/adam2.bin "$(BIN_DIR)/$(IMG_PREFIX)-$(1).bin" > "$(KDIR)/dgfw.tmp"
76 # dd if=sercomm/$(2) of="$(KDIR)/dgfw.tmp" bs=$$$$((0x3e0000 - 80)) seek=1 conv=notrunc
77 # $(STAGING_DIR_HOST)/bin/dgfirmware -f -w "$(BIN_DIR)/openwrt-$(2)-$(3).img" "$(KDIR)/dgfw.tmp"
78 # rm -f "$(KDIR)/dgfw.tmp"
81 define Image
/Build
/EVA
82 $(STAGING_DIR_HOST
)/bin
/lzma2eva
$(EVA_LOADADDR
) 0x
$${shell $(TARGET_CROSS
)nm
$(KDIR
)/linux-
*/vmlinux | grep
-w kernel_entry | cut
-d
' ' -f1
} $(KDIR
)/vmlinux.lzma
$(KDIR
)/loader.eva
83 dd if
=$(KDIR
)/loader.eva
$(call align
/$(1)) > $(BIN_DIR
)/openwrt-
$(2)-$(KERNEL
)-$(1).bin
84 cat
$(KDIR
)/root.
$(1) >> $(BIN_DIR
)/openwrt-
$(2)-$(KERNEL
)-$(1).bin
85 $(call prepare_generic_squashfs
,$(BIN_DIR
)/openwrt-
$(2)-$(KERNEL
)-$(1).bin
)
88 define Image
/Build
/Initramfs
89 $(CP
) $(KDIR
)/vmlinux.bin
$(BIN_DIR
)/$(IMG_PREFIX
)-initramfs.bin
92 ifeq ($(CONFIG_AR7_TI
),y
)
94 dd if
=$(KDIR
)/loader.bin
$(call align
/$(1)) > $(BIN_DIR
)/$(IMG_PREFIX
)-$(1).bin
95 cat
$(KDIR
)/root.
$(1) >> $(BIN_DIR
)/$(IMG_PREFIX
)-$(1).bin
96 $(call prepare_generic_squashfs
,$(BIN_DIR
)/$(IMG_PREFIX
)-$(1).bin
)
97 $(call Image
/Build
/CyberTAN
,$(1),AG1B
,AG1B
,$(1))
98 $(call Image
/Build
/CyberTAN
,$(1),AG1A
,AG1A
,$(1))
99 $(call Image
/Build
/CyberTAN
,$(1),WA21
,WA21
,$(1))
100 $(call Image
/Build
/CyberTAN
,$(1),WA22
,WA22
,$(1))
101 $(call Image
/Build
/CyberTAN
,$(1),WAG2
,WAG2
,$(1))
102 $(call Image
/Build
/CyberTAN
,$(1),AG310
,AV2A
-b
-r
1.0,$(1))
103 $(call Image
/Build
/CyberTAN
,$(1),AG241v2
,AG3A
-b
-r
2.0,$(1))
104 $(call Image
/Build
/CyberTAN
,$(1),AG241v2b
,AG3B
-b
-r
2.0,$(1))
105 $(call Image
/Build
/CyberTAN
,$(1),AG241v1
,AG3A
-b
,$(1))
106 $(call Image
/Build
/CyberTAN
,$(1),WAG54GP2v1
,ATWL
-b
,$(1))
107 $(call Image
/Build
/CyberTAN
,$(1),WAG54GP2v2
,CTWL
-b
,$(1))
108 $(call Image
/Build
/CyberTAN
,$(1),WA31
,WA31
-b
,$(1))
109 $(call Image
/Build
/CyberTAN
,$(1),WA32
,WA32
-b
,$(1))
110 $(call Image
/Build
/CyberTAN
,$(1),WA7A
,WA7A
-b
,$(1))
111 $(call Image
/Build
/CyberTAN
,$(1),WA7B
,WA7B
-b
,$(1))
112 # $(call Image/Build/sErCoMm,$(1),dg834,$(1))
113 # $(call Image/Build/sErCoMm,$(1),jdr454wb,$(1))
114 $(call Image
/Build
/EVA
,$(1),EVA
)
115 $(call Image
/Build
/Titan
,$(1),Titan
,Titan
,$(1))
116 ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS
),y
)
117 $(call Image
/Build
/Initramfs
)
122 ifeq ($(CONFIG_AR7_AC49X
),y
)
124 # $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(1).bin)
125 $(call Image
/Build
/AudioCodes
,$(1),mp202
,$(1))
126 ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS
),y
)
127 $(call Image
/Build
/Initramfs
)
132 $(eval
$(call BuildImage
))