diff options
author | Luka Perkov <luka@openwrt.org> | 2013-10-31 11:44:28 +0000 |
---|---|---|
committer | Luka Perkov <luka@openwrt.org> | 2013-10-31 11:44:28 +0000 |
commit | 6f26ef8b5dfbffc6c8090e6f10c493e2c90fb45a (patch) | |
tree | 081094e3151a5e6d27a88ae11680464bfa0ce8b5 /target/linux/kirkwood | |
parent | 59d58990fbf96d8048edbd5686adda94614ef95e (diff) | |
download | mtk-20170518-6f26ef8b5dfbffc6c8090e6f10c493e2c90fb45a.zip mtk-20170518-6f26ef8b5dfbffc6c8090e6f10c493e2c90fb45a.tar.gz mtk-20170518-6f26ef8b5dfbffc6c8090e6f10c493e2c90fb45a.tar.bz2 |
kirkwood: extend image/Makefile
* use lower case letters in generated images
* extend support for boot/ directory
* fix some typos
Signed-off-by: Luka Perkov <luka@openwrt.org>
Signed-off-by: Felix Kaechele <heffer@fedoraproject.org>
SVN-Revision: 38629
Diffstat (limited to 'target/linux/kirkwood')
-rw-r--r-- | target/linux/kirkwood/image/Makefile | 51 |
1 files changed, 34 insertions, 17 deletions
diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index 94e7bb9..397a465 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -9,12 +9,16 @@ include $(INCLUDE_DIR)/image.mk NAND_BLOCKSIZE := 2048:128k +define sanitize_profile_name +$(shell echo $(PROFILE) | tr '[:upper:]' '[:lower:]') +endef + 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/MkuImage, \ - none, 0x00008000, 0x00008000, \ + none, 0x8000, 0x8000, \ $(BIN_DIR)/$(IMG_PREFIX)-zImage, \ $(BIN_DIR)/$(IMG_PREFIX)-uImage \ ) @@ -23,7 +27,7 @@ define Image/BuildKernel/Template $(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/MkuImage, \ - none, 0x00008000, 0x00008000, \ + none, 0x8000, 0x8000, \ $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs, \ $(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \ ) @@ -32,21 +36,21 @@ define Image/BuildKernel/Template ifneq ($(1),) $(CP) $(LINUX_DIR)/arch/arm/boot/dts/kirkwood-$(1).dtb $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb - $(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage - cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage + $(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage + cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage $(call Image/BuildKernel/MkuImage, \ - none, 0x00008000, 0x00008000, \ - $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage, \ - $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-uImage \ + none, 0x8000, 0x8000, \ + $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage, \ + $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-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 + $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage-initramfs + cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage-initramfs $(call Image/BuildKernel/MkuImage, \ - none, 0x00008000, 0x00008000, - $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs, \ - $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-uImage-initramfs \ + none, 0x8000, 0x8000, \ + $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage-initramfs, \ + $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-uImage-initramfs \ ) endif endif @@ -56,19 +60,27 @@ define Image/InstallKernel/Template ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_KERNEL),) $(INSTALL_DIR) $(TARGET_DIR)/boot + ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_UIMAGE),) + $(CP) $(BIN_DIR)/$(IMG_PREFIX)-uImage $(TARGET_DIR)/boot/ + ln -sf $(IMG_PREFIX)-uImage $(TARGET_DIR)/boot/uImage + endif + ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_ZIMAGE),) $(CP) $(BIN_DIR)/$(IMG_PREFIX)-zImage $(TARGET_DIR)/boot/ + ln -sf $(IMG_PREFIX)-zImage $(TARGET_DIR)/boot/zImage + endif endif ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_DTB),) $(INSTALL_DIR) $(TARGET_DIR)/boot ifneq ($(1),) $(CP) $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb $(TARGET_DIR)/boot/ + ln -sf $(IMG_PREFIX)-$(1).dtb $(TARGET_DIR)/boot/$(1).dtb endif endif endef define Image/Build/jffs2-nand-2048-128k - dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-$(1).img \ + dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-$(1).img \ bs=2048 conv=sync endef @@ -77,20 +89,25 @@ define Image/Build/squashfs ( \ dd if=$(KDIR)/zImage bs=4096k conv=sync; \ dd if=$(KDIR)/root.$(1) bs=128k conv=sync; \ - ) > $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-$(1).img + ) > $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-$(1).img +endef + +define Image/mkfs/targz + + $(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-rootfs.tar.gz --numeric-owner --owner=0 --group=0 -C $(TARGET_DIR)/ . endef define Image/Build/ubifs ifneq ($($(PROFILE)_UBIFS_OPTS),) - $(CP) $(KDIR)/root.ubifs $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-ubifs.img + $(CP) $(KDIR)/root.ubifs $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-rootfs.ubifs endif endef define Image/Build/ubi ifneq ($($(PROFILE)_UBI_OPTS),) - $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-ubi.img + $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-rootfs.ubi endif endef @@ -111,7 +128,7 @@ endef define Image/Build $(if $(Image/Build/$(1)), \ $(call Image/Build/$(1),$(1)), \ - $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-$(1).img \ + $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-$(1).img \ ) endef |