mirror of
git://git.openwrt.org/openwrt/openwrt.git
synced 2024-12-26 16:42:47 +00:00
kirkwood: image: Refactor sanitize_profile_name using PROFILE_SANITIZED var
Signed-off-by: Petr Štetiar <ynezz@true.cz> SVN-Revision: 47309
This commit is contained in:
parent
e09d32dd96
commit
8a237d1f03
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user