aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-01-12 12:29:52 +0000
committerGabor Juhos <juhosg@openwrt.org>2013-01-12 12:29:52 +0000
commit9da421f8dbadc9948b0ff664847f920c8d1750bc (patch)
treef26537d5886babffafa05d5f2165fc12a21db841
parent1b117657bfdca72e2e19bc60178c5bfcce01afcb (diff)
downloadupstream-9da421f8dbadc9948b0ff664847f920c8d1750bc.tar.gz
upstream-9da421f8dbadc9948b0ff664847f920c8d1750bc.tar.bz2
upstream-9da421f8dbadc9948b0ff664847f920c8d1750bc.zip
malta: build lzma and gzip compressed uImages
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35117 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/malta/image/Makefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/target/linux/malta/image/Makefile b/target/linux/malta/image/Makefile
index b09bfa3498..c0e520fbee 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