Preserve fw_arg0-3 to allow runtime bootloader detection (Gabor Juhos)
[openwrt.git] / target / linux / adm5120-2.6 / image / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
9
10 define Build/Compile
11 rm -f $(KDIR)/loader.gz
12 $(MAKE) -C lzma-loader \
13 BUILD_DIR="$(KDIR)" \
14 TARGET="$(KDIR)" \
15 install
16 echo -ne "\\x00" >> $(KDIR)/loader.gz
17 endef
18
19 define Build/Clean
20 $(MAKE) -C lzma-loader clean
21 endef
22
23 define Image/Prepare
24 cat $(KDIR)/vmlinux | $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
25 endef
26
27 define trxalign/jffs2-128k
28 -a 0x20000
29 endef
30 define trxalign/jffs2-64k
31 -a 0x10000
32 endef
33 define trxalign/squashfs
34 -a 1024
35 endef
36
37 define Image/Build/Compex
38 $(CP) $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).trx $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(3)-$(2).trx
39 endef
40
41 define Image/Build/Edimax
42 $(STAGING_DIR)/bin/mksyshdr csys $(KDIR)/vmlinux
43 cat csys $(KDIR)/vmlinux $(KDIR)/root.$(1) > $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(3)-$(2).img
44 endef
45
46 define Image/Build/MyLoader
47 $(CP) $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1)-noloader.trx $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(3)-$(2).trx
48 $(STAGING_DIR)/bin/mkmylofw -B $(4) \
49 -p0x20000:0x10000:ahp:0x80001000 \
50 -p0x30000:0 \
51 -b0x20000:0x10000:h:$(KDIR)/loader.gz \
52 -b0x30000:0::$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(3)-$(2).trx \
53 $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(3)-$(2).bin
54 endef
55
56 define Image/Build
57 $(STAGING_DIR)/bin/trx -o $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1).trx -f $(KDIR)/loader.gz -f $(KDIR)/vmlinux.lzma $(call trxalign/$(1)) -f $(KDIR)/root.$(1)
58 $(STAGING_DIR)/bin/trx -o $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(1)-noloader.trx -f $(KDIR)/vmlinux.lzma $(call trxalign/$(1)) -f $(KDIR)/root.$(1)
59 ifneq ($(1),jffs2-128K)
60 $(call Image/Build/Compex,$(1),wp54g-wrt,$(patsubst jffs2-%,jffs2,$(1)))
61 $(call Image/Build/Edimax,$(1),br6104,$(patsubst jffs2-%,jffs2,$(1)))
62 $(call Image/Build/MyLoader,$(1),np27g,$(patsubst jffs2-%,jffs2,$(1)),NP27G)
63 $(call Image/Build/MyLoader,$(1),np28g,$(patsubst jffs2-%,jffs2,$(1)),NP28G)
64 $(call Image/Build/MyLoader,$(1),np28ghs,$(patsubst jffs2-%,jffs2,$(1)),NP28GHS)
65 $(call Image/Build/MyLoader,$(1),wp54g,$(patsubst jffs2-%,jffs2,$(1)),WP54G)
66 $(call Image/Build/MyLoader,$(1),wp54ag,$(patsubst jffs2-%,jffs2,$(1)),WP54AG)
67 $(call Image/Build/MyLoader,$(1),wpp54g,$(patsubst jffs2-%,jffs2,$(1)),WPP54G)
68 $(call Image/Build/MyLoader,$(1),wpp54ag,$(patsubst jffs2-%,jffs2,$(1)),WPP54AG)
69 endif
70 endef
71
72 $(eval $(call BuildImage))
This page took 0.043417 seconds and 5 git commands to generate.