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 IMGNAME = $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)
11 LOADER_MAKE = $(MAKE) -C lzma-loader KDIR=$(KDIR)
13 define Image/Build/Loader
14 $(LOADER_MAKE) LOADER=loader-$(1).$(2) LOADER_DATA="" \
15 LZMA_TEXT_START=$(3) LZMA_STARTUP_ORG=$(4) \
16 CONFIG_PASS_KARGS=$(5) CONFIG_BOARD=$(6) \
25 cat $(KDIR)/vmlinux | $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
28 define trxalign/jffs2-128k
31 define trxalign/jffs2-64k
34 define trxalign/squashfs
38 define Image/Build/TRX
39 $(STAGING_DIR)/bin/trx -o $(1) -f $(3) -f $(KDIR)/vmlinux.lzma \
40 $(call trxalign/$(2)) -f $(KDIR)/root.$(2)
43 define Image/Build/TRXNoloader
44 $(STAGING_DIR)/bin/trx -o $(1) -f $(KDIR)/vmlinux.lzma \
45 $(call trxalign/$(2)) -f $(KDIR)/root.$(2)
48 define Image/Build/ZyXEL
49 $(call Image/Build/Loader,loader-$(2),gz,0x80500000,0)
50 $(call Image/Build/TRXNoloader,$(IMGNAME)-$(3)-$(2).trx,$(1))
51 #TODO: firmware generation tool needed
55 #FIXME: No firmware images yet
58 define Image/Build/LZMAKernel
59 $(LOADER_MAKE) TARGET_DIR=$(BIN_DIR) \
60 LOADER=openwrt-$(BOARD)-$(KERNEL)-ramfs-lzma-$(1).$(2) \
61 LOADER_DATA=$(KDIR)/vmlinux.lzma \
62 LZMA_TEXT_START=$(3) LZMA_STARTUP_ORG=$(4) \
63 CONFIG_PASS_KARGS=$(5) CONFIG_BOARD=$(6) \
67 define Image/Build/LZMAKernel/ZyXEL
68 $(call Image/Build/LZMAKernel,$(1),$(2),0x80500000,0,y,$(1))
71 define Image/Build/Initramfs
72 $(call Image/Build/LZMAKernel/ZyXEL,p-334wt,bin)
73 $(call Image/Build/LZMAKernel/ZyXEL,p-335,bin)
76 $(eval $(call BuildImage))