2 # Copyright (C) 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 define get_kernel_entry
11 0x
$(shell $(TARGET_CROSS
)nm
$(1) 2>/dev
/null | grep
" kernel_entry" | cut
-f1
-d
' ')
15 $(STAGING_DIR_HOST
)/bin
/lzma e
$(1) -lc1
-lp2
-pb2
$(2)
19 gzip
-9 -c
$(1) > $(2)
23 mkimage
-A mips
-O linux
-T kernel
-a
0x80100000 -C
$(1) $(2) \
24 -e
$(call get_kernel_entry
,$(LINUX_DIR
)/vmlinux
) -n
'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
28 define Image
/BuildKernel
29 cp
$(KDIR
)/vmlinux.elf
$(BIN_DIR
)/$(IMG_PREFIX
)-vmlinux.elf
30 $(call CompressLzma
,$(KDIR
)/vmlinux
,$(KDIR
)/vmlinux.bin.lzma
)
31 $(call MkuImage
,lzma
,,$(KDIR
)/vmlinux.bin.lzma
,$(BIN_DIR
)/$(IMG_PREFIX
)-uImage-lzma
)
32 $(call CompressGzip
,$(KDIR
)/vmlinux
,$(KDIR
)/vmlinux.bin.gz
)
33 $(call MkuImage
,gzip
,,$(KDIR
)/vmlinux.bin.gz
,$(BIN_DIR
)/$(IMG_PREFIX
)-uImage-gzip
)
36 define Image
/Build
/squashfs
37 $(call prepare_generic_squashfs
,$(KDIR
)/root.squashfs
)
41 $(call Image
/Build
/$(1))
42 dd if
=$(KDIR
)/root.
$(1) of
=$(BIN_DIR
)/$(IMG_PREFIX
)-root.
$(1) bs
=128k conv
=sync
45 $(eval
$(call BuildImage
))