Skip to content

Commit

Permalink
build: make MkuImage more generic
Browse files Browse the repository at this point in the history
Signed-off-by: Luka Perkov <[email protected]>

SVN-Revision: 38516
  • Loading branch information
lperkov committed Oct 23, 2013
1 parent 86aff32 commit 7938d16
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
10 changes: 7 additions & 3 deletions include/image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ define add_jffs2_mark
echo -ne '\xde\xad\xc0\xde' >> $(1)
endef

define toupper
$(shell echo $(1) | tr '[:lower:]' '[:upper:]')
endef

# pad to 4k, 8k, 64k, 128k 256k and add jffs2 end-of-filesystem mark
define prepare_generic_squashfs
$(STAGING_DIR_HOST)/bin/padjffs2 $(1) 4 8 64 128 256
Expand All @@ -82,9 +86,9 @@ else
endef
endif

define Image/BuildKernel/MkuImageARM
mkimage -A arm -O linux -T kernel -a $(1) -C none -e $(1) \
-n 'ARM OpenWrt Linux-$(LINUX_VERSION)' -d $(2) $(3)
define Image/BuildKernel/MkuImage
mkimage -A $(ARCH) -O linux -T kernel -C $(1) -a $(2) -e $(3) \
-n '$(call toupper,$(ARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d $(4) $(5)
endef

define Image/BuildKernel/MkFIT
Expand Down
16 changes: 8 additions & 8 deletions target/linux/kirkwood/image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ define Image/BuildKernel/Template

$(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage
echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage
$(call Image/BuildKernel/MkuImageARM, \
0x00008000, \
$(call Image/BuildKernel/MkuImage, \
none, 0x00008000, 0x00008000, \
$(BIN_DIR)/$(IMG_PREFIX)-zImage, \
$(BIN_DIR)/$(IMG_PREFIX)-uImage \
)

ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
$(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
$(call Image/BuildKernel/MkuImageARM, \
0x00008000, \
$(call Image/BuildKernel/MkuImage, \
none, 0x00008000, 0x00008000, \
$(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs, \
$(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
)
Expand All @@ -34,17 +34,17 @@ define Image/BuildKernel/Template

$(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage
cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage
$(call Image/BuildKernel/MkuImageARM, \
0x00008000, \
$(call Image/BuildKernel/MkuImage, \
none, 0x00008000, 0x00008000, \
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage, \
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-uImage \
)

ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
$(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs
cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs
$(call Image/BuildKernel/MkuImageARM, \
0x00008000, \
$(call Image/BuildKernel/MkuImage, \
none, 0x00008000, 0x00008000,
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs, \
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-uImage-initramfs \
)
Expand Down

0 comments on commit 7938d16

Please sign in to comment.