build: make MkuImage more generic
Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 38516
This commit is contained in:
parent
86aff32701
commit
7938d16451
2 changed files with 15 additions and 11 deletions
|
@ -67,6 +67,10 @@ define add_jffs2_mark
|
||||||
echo -ne '\xde\xad\xc0\xde' >> $(1)
|
echo -ne '\xde\xad\xc0\xde' >> $(1)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define toupper
|
||||||
|
$(shell echo $(1) | tr '[:lower:]' '[:upper:]')
|
||||||
|
endef
|
||||||
|
|
||||||
# pad to 4k, 8k, 64k, 128k 256k and add jffs2 end-of-filesystem mark
|
# pad to 4k, 8k, 64k, 128k 256k and add jffs2 end-of-filesystem mark
|
||||||
define prepare_generic_squashfs
|
define prepare_generic_squashfs
|
||||||
$(STAGING_DIR_HOST)/bin/padjffs2 $(1) 4 8 64 128 256
|
$(STAGING_DIR_HOST)/bin/padjffs2 $(1) 4 8 64 128 256
|
||||||
|
@ -82,9 +86,9 @@ else
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
define Image/BuildKernel/MkuImageARM
|
define Image/BuildKernel/MkuImage
|
||||||
mkimage -A arm -O linux -T kernel -a $(1) -C none -e $(1) \
|
mkimage -A $(ARCH) -O linux -T kernel -C $(1) -a $(2) -e $(3) \
|
||||||
-n 'ARM OpenWrt Linux-$(LINUX_VERSION)' -d $(2) $(3)
|
-n '$(call toupper,$(ARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d $(4) $(5)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Image/BuildKernel/MkFIT
|
define Image/BuildKernel/MkFIT
|
||||||
|
|
|
@ -13,8 +13,8 @@ define Image/BuildKernel/Template
|
||||||
|
|
||||||
$(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage
|
$(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage
|
||||||
echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage
|
echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage
|
||||||
$(call Image/BuildKernel/MkuImageARM, \
|
$(call Image/BuildKernel/MkuImage, \
|
||||||
0x00008000, \
|
none, 0x00008000, 0x00008000, \
|
||||||
$(BIN_DIR)/$(IMG_PREFIX)-zImage, \
|
$(BIN_DIR)/$(IMG_PREFIX)-zImage, \
|
||||||
$(BIN_DIR)/$(IMG_PREFIX)-uImage \
|
$(BIN_DIR)/$(IMG_PREFIX)-uImage \
|
||||||
)
|
)
|
||||||
|
@ -22,8 +22,8 @@ define Image/BuildKernel/Template
|
||||||
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
||||||
$(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
|
$(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
|
||||||
echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
|
echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
|
||||||
$(call Image/BuildKernel/MkuImageARM, \
|
$(call Image/BuildKernel/MkuImage, \
|
||||||
0x00008000, \
|
none, 0x00008000, 0x00008000, \
|
||||||
$(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs, \
|
$(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs, \
|
||||||
$(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
|
$(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
|
||||||
)
|
)
|
||||||
|
@ -34,8 +34,8 @@ define Image/BuildKernel/Template
|
||||||
|
|
||||||
$(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage
|
$(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage
|
||||||
cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage
|
cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage
|
||||||
$(call Image/BuildKernel/MkuImageARM, \
|
$(call Image/BuildKernel/MkuImage, \
|
||||||
0x00008000, \
|
none, 0x00008000, 0x00008000, \
|
||||||
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage, \
|
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage, \
|
||||||
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-uImage \
|
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-uImage \
|
||||||
)
|
)
|
||||||
|
@ -43,8 +43,8 @@ define Image/BuildKernel/Template
|
||||||
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
||||||
$(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-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
|
cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs
|
||||||
$(call Image/BuildKernel/MkuImageARM, \
|
$(call Image/BuildKernel/MkuImage, \
|
||||||
0x00008000, \
|
none, 0x00008000, 0x00008000,
|
||||||
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs, \
|
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs, \
|
||||||
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-uImage-initramfs \
|
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-uImage-initramfs \
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue