-define sanitize_profile_name
-$(shell echo $(PROFILE) | tr '[:upper:]' '[:lower:]' | sed 's/_/-/g')
-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, 0x40008000, 0x40008000, \
- $(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/MkuImage, \
- none, 0x40008000, 0x40008000, \
- $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs, \
- $(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
- )
- endif
-
- ifneq ($(1),)
- $(CP) $(LINUX_DIR)/arch/arm/boot/dts/$(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
- $(call Image/BuildKernel/MkuImage, \
- none, 0x40008000, 0x40008000, \
- $(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)-$(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, 0x40008000, 0x40008000, \
- $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage-initramfs, \
- $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-uImage-initramfs \
- )
- endif
- endif
-endef
-
-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