summaryrefslogtreecommitdiff
path: root/target/linux/kirkwood
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-10-31 09:27:56 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-10-31 09:27:56 +0000
commit8a237d1f03a2c6bd43181a6aef2aff67c72a954b (patch)
tree91e6a4efa557d509c8c5c6617c0073f1ddf8a552 /target/linux/kirkwood
parente09d32dd96faa754153d7a9703e178ac1ac5b488 (diff)
downloadmtk-20170518-8a237d1f03a2c6bd43181a6aef2aff67c72a954b.zip
mtk-20170518-8a237d1f03a2c6bd43181a6aef2aff67c72a954b.tar.gz
mtk-20170518-8a237d1f03a2c6bd43181a6aef2aff67c72a954b.tar.bz2
kirkwood: image: Refactor sanitize_profile_name using PROFILE_SANITIZED var
Signed-off-by: Petr Štetiar <ynezz@true.cz> SVN-Revision: 47309
Diffstat (limited to 'target/linux/kirkwood')
-rw-r--r--target/linux/kirkwood/image/Makefile32
1 files changed, 14 insertions, 18 deletions
diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile
index 019806c..5dcad98 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -10,10 +10,6 @@ NAND_BLOCKSIZE := 2048-128k
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
-define sanitize_profile_name
-$(shell echo $(PROFILE) | tr '[:upper:]' '[:lower:]')
-endef
-
define Image/BuildKernel/Template
$(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage
@@ -37,21 +33,21 @@ define Image/BuildKernel/Template
ifneq ($(1),)
$(CP) $(DTS_DIR)/kirkwood-$(1).dtb $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb
- $(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
+ $(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-zImage
+ cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-zImage
$(call Image/BuildKernel/MkuImage, \
none, 0x8000, 0x8000, \
- $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage, \
- $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-uImage \
+ $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-zImage, \
+ $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-uImage \
)
ifneq ($(CONFIG_TARGET_ROOTFS_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
+ $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-zImage-initramfs
+ cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-zImage-initramfs
$(call Image/BuildKernel/MkuImage, \
none, 0x8000, 0x8000, \
- $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage-initramfs, \
- $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-uImage-initramfs \
+ $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-zImage-initramfs, \
+ $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-uImage-initramfs \
)
endif
endif
@@ -81,7 +77,7 @@ define Image/InstallKernel/Template
endef
define Image/Build/jffs2-nand-2048-128k
- dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-$(1).img \
+ dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-$(1).img \
bs=2048 conv=sync
endef
@@ -90,25 +86,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)-$(call sanitize_profile_name)-$(1).img
+ ) > $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-$(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)/ .
+ $(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-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)-$(call sanitize_profile_name)-rootfs.ubifs
+ $(CP) $(KDIR)/root.ubifs $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-rootfs.ubifs
endif
endef
define Image/Build/ubi
ifneq ($($(PROFILE)_UBI_OPTS),)
- $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-rootfs.ubi
+ $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-rootfs.ubi
endif
endef
@@ -165,7 +161,7 @@ endef
define Image/Build
$(if $(Image/Build/$(1)), \
$(call Image/Build/$(1),$(1)), \
- $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-$(1).img \
+ $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-$(1).img \
)
endef