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 LOADER_MAKE
:= $(NO_TRACE_MAKE
) -C lzma-loader KDIR
=$(KDIR
)
11 JFFS2BLOCK
:= $(KDIR
)/jffs2.block
12 JFFS2MARK
:= $(KDIR
)/jffs2.mark
15 $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(patsubst jffs2-
%,jffs2
,$(1))
18 VMLINUX
:=$(BIN_DIR
)/$(IMG_PREFIX
)-vmlinux
19 fs_squash
:=squashfs-only
24 ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS
),y
)
30 VMLINUX
:=$(BIN_DIR
)/$(IMG_PREFIX
)-vmlinux-initramfs
38 cat
$(KDIR
)/vmlinux |
$(STAGING_DIR_HOST
)/bin
/lzma e
-si
-so
-eos
-lc1
-lp2
-pb2
> $(KDIR
)/vmlinux.lzma
41 $(call prepare_generic_squashfs
,$(JFFS2BLOCK
))
44 $(call add_jffs2_mark
,$(JFFS2MARK
))
47 define Image
/Build
/Loader
48 $(LOADER_MAKE
) LOADER
=loader-
$(1).
$(2) LOADER_DATA
="" \
49 LZMA_TEXT_START
=$(3) LZMA_STARTUP_ORG
=$(4) \
50 CONFIG_PASS_KARGS
=$(5) CONFIG_BOARD
=$(6) \
54 define Image
/Build
/LZMAKernel
55 $(LOADER_MAKE
) TARGET_DIR
=$(BIN_DIR
) \
56 LOADER
=$(BIN_DIR
)/$(IMG_PREFIX
)-$(1)-ramfs.
$(2) \
57 LOADER_DATA
=$(KDIR
)/vmlinux.lzma \
58 LZMA_TEXT_START
=$(3) LZMA_STARTUP_ORG
=$(4) \
59 CONFIG_PASS_KARGS
=$(5) CONFIG_BOARD
=$(6) \
63 define Image
/Build
/LZMAKernel
/Generic
64 $(call Image
/Build
/LZMAKernel
,$(1),$(2),0x80500000,0)
67 define Image
/Build
/LZMAKernel
/Admboot
68 $(call Image
/Build
/LZMAKernel
,$(1),$(2),0x80500000,0x6D8,y
,$(1))
71 define Image
/Build
/LZMAKernel
/Cellvision
72 $(call Image
/Build
/LZMAKernel
,$(1),$(3),0x80500000,0x6D8,y
,$(2))
75 define Image
/Build
/LZMAKernel
/KArgs
76 $(call Image
/Build
/LZMAKernel
,$(1),$(2),0x80500000,0,y
,$(1))
79 define trxalign
/jffs2-128k
80 -a
0x20000 -f
$(KDIR
)/root.jffs2-128k
83 define trxalign
/jffs2-64k
84 -a
0x10000 -f
$(KDIR
)/root.jffs2-64k
87 define trxalign
/squashfs
88 -a
1024 -f
$(KDIR
)/root.squashfs
-a
0x10000 -A
$(JFFS2BLOCK
)
91 define Image
/Build
/TRX
92 $(STAGING_DIR_HOST
)/bin
/trx
-o
$(1) -f
$(3) -f
$(KDIR
)/vmlinux.lzma \
96 define Image
/Build
/TRXNoloader
97 $(STAGING_DIR_HOST
)/bin
/trx
-o
$(1) -f
$(KDIR
)/vmlinux.lzma \
101 include $(SUBTARGET
).mk
104 $(call Image
/Build
/Profile
/$(PROFILE
),$(1))
107 define Image
/Build
/Initramfs
108 $(call Image
/Build
/Profile
/$(PROFILE
),Initramfs
)
111 define Image
/BuildKernel
112 cp
$(KDIR
)/vmlinux.elf
$(VMLINUX
).elf
113 cp
$(KDIR
)/vmlinux
$(VMLINUX
).bin
116 $(eval
$(call BuildImage
))