aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/image
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2013-06-27 19:58:31 +0000
committerFlorian Fainelli <florian@openwrt.org>2013-06-27 19:58:31 +0000
commit704e2ed39d4e157d0c24d4dc3a3078cbacc6505c (patch)
treeffba1790b89941519ddb5acc2bf8f55df6b65529 /target/linux/ar71xx/image
parent5431c1983b51e4f69db63f5d5c94b2ed157e5374 (diff)
downloadupstream-704e2ed39d4e157d0c24d4dc3a3078cbacc6505c.tar.gz
upstream-704e2ed39d4e157d0c24d4dc3a3078cbacc6505c.tar.bz2
upstream-704e2ed39d4e157d0c24d4dc3a3078cbacc6505c.zip
targets: prepare for supporting normal and initramfs images
In order to support both normal images and initramfs, ensure that each target sets KERNELNAME properly so that the generic kernel building code can copy the corresponding files over $(KDIR) with the appropriate extension. Update the various paths to the kernel and wrapper images from $(LINUX_DIR)/arch/$(ARCH)/boot/$(foo) to $(KDIR)/$(foo). Signed-off-by: Florian Fainelli <florian@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37049 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/image')
-rw-r--r--target/linux/ar71xx/image/Makefile22
1 files changed, 13 insertions, 9 deletions
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 24c0a00ffc..84a378382d 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -58,15 +58,6 @@ fs_64k:=64k
fs_64kraw:=64kraw
fs_128k:=128k
fs_256k:=256k
-ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
- fs_squash:=initramfs
- fs_64k:=initramfs
- fs_64kraw:=initramfs
- fs_128k:=initramfs
- fs_256k:=initramfs
- VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs
- UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs
-endif
define CompressLzma
$(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(3) $(2)
@@ -200,6 +191,15 @@ define Image/BuildKernel
$(call MkuImage,gzip,,$(KDIR)/vmlinux.bin.gz,$(UIMAGE)-gzip.bin)
$(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(UIMAGE)-lzma.bin)
cp $(KDIR)/loader-generic.elf $(VMLINUX)-lzma.elf
+ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+ cp $(KDIR)/vmlinux-initramfs.elf $(VMLINUX)-initramfs.elf
+ cp $(KDIR)/vmlinux-initramfs $(VMLINUX)-initramfs.bin
+ dd if=$(KDIR)/vmlinux-initramfs.bin.lzma of=$(VMLINUX)-initramfs.lzma bs=65536 conv=sync
+ dd if=$(KDIR)/vmlinux-initramfs.bin.gz of=$(VMLINUX)-initramfs.gz bs=65536 conv=sync
+ $(call MkuImage,gzip,,$(KDIR)/vmlinux-initramfs.bin.gz,$(UIMAGE)-initramfs-gzip.bin)
+ $(call MkuImage,lzma,,$(KDIR)/vmlinux-initramfs.bin.lzma,$(UIMAGE)-initramfs-lzma.bin)
+ cp $(KDIR)/loader-generic.elf $(VMLINUX)-initramfs-lzma.elf
+endif
-mkdir -p $(KDIR_TMP)
$(call Image/Build/Initramfs)
endef
@@ -1030,6 +1030,10 @@ endef
define Image/Prepare
gzip -9 -c $(KDIR)/vmlinux > $(KDIR)/vmlinux.bin.gz
$(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma)
+ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+ gzip -9 -c $(KDIR)/vmlinux-initramfs > $(KDIR)/vmlinux-initramfs.bin.gz
+ $(call CompressLzma,$(KDIR)/vmlinux-initramfs,$(KDIR)/vmlinux-initramfs.bin.lzma)
+endif
$(call Image/BuildLoader,generic,elf)
$(call Image/Build/Profile/$(if $(CONFIG_IB),Default,$(PROFILE)),loader)
endef