From 3d057de4db395102e1589d2ae5df295a3cee00f8 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Sat, 12 Jan 2013 12:29:52 +0000 Subject: [PATCH] malta: build lzma and gzip compressed uImages Signed-off-by: Gabor Juhos SVN-Revision: 35117 --- target/linux/malta/image/Makefile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/target/linux/malta/image/Makefile b/target/linux/malta/image/Makefile index b09bfa34982c..c0e520fbeee1 100644 --- a/target/linux/malta/image/Makefile +++ b/target/linux/malta/image/Makefile @@ -7,8 +7,30 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk +define get_kernel_entry +0x$(shell $(TARGET_CROSS)nm $(1) 2>/dev/null | grep " kernel_entry" | cut -f1 -d ' ') +endef + +define CompressLzma + $(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(2) +endef + +define CompressGzip + gzip -9 -c $(1) > $(2) +endef + +define MkuImage + mkimage -A mips -O linux -T kernel -a 0x80100000 -C $(1) $(2) \ + -e $(call get_kernel_entry,$(LINUX_DIR)/vmlinux) -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \ + -d $(3) $(4) +endef + define Image/BuildKernel cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf + $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma) + $(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(BIN_DIR)/$(IMG_PREFIX)-uImage-lzma) + $(call CompressGzip,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.gz) + $(call MkuImage,gzip,,$(KDIR)/vmlinux.bin.gz,$(BIN_DIR)/$(IMG_PREFIX)-uImage-gzip) endef define Image/Build/squashfs -- 2.30.2