aboutsummaryrefslogtreecommitdiff
path: root/linux/linux.mk
diff options
context:
space:
mode:
authorGravatar Waldemar Brodkorb <wbx@openadk.org>2014-07-11 14:49:22 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-07-15 22:18:45 +0200
commitc78d57637cd57a383e44713eb27e654b3071340e (patch)
tree2fdc835f83a3b8e17b757f4fabee5b534fb29a5c /linux/linux.mk
parent58b748dc480f79f49a341ba81defc7fe7425adc9 (diff)
downloadbuildroot-c78d57637cd57a383e44713eb27e654b3071340e.tar.gz
buildroot-c78d57637cd57a383e44713eb27e654b3071340e.tar.bz2
linux: add option to explicitly specify the kernel image name
For example the upcoming qemu-xtensa patch is using this feature, where the target is called "zImage", but the resulting kernel name is "Image.elf". Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'linux/linux.mk')
-rw-r--r--linux/linux.mk10
1 files changed, 7 insertions, 3 deletions
diff --git a/linux/linux.mk b/linux/linux.mk
index bcd9dc168f..928d93dfcf 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -80,7 +80,8 @@ endif
KERNEL_DTBS = $(addsuffix .dtb,$(KERNEL_DTS_NAME))
ifeq ($(BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM),y)
-LINUX_IMAGE_NAME = $(call qstrip,$(BR2_LINUX_KERNEL_IMAGE_TARGET_NAME))
+LINUX_IMAGE_NAME = $(call qstrip,$(BR2_LINUX_KERNEL_IMAGE_NAME))
+LINUX_TARGET_NAME = $(call qstrip,$(BR2_LINUX_KERNEL_IMAGE_TARGET_NAME))
else
ifeq ($(BR2_LINUX_KERNEL_UIMAGE),y)
LINUX_IMAGE_NAME = uImage
@@ -106,6 +107,9 @@ else ifeq ($(BR2_LINUX_KERNEL_VMLINUZ),y)
LINUX_IMAGE_NAME = vmlinuz
endif
endif
+ifeq ($(LINUX_IMAGE_NAME),)
+LINUX_IMAGE_NAME = $(LINUX_TARGET_NAME)
+endif
LINUX_KERNEL_UIMAGE_LOADADDR=$(call qstrip,$(BR2_LINUX_KERNEL_UIMAGE_LOADADDR))
ifneq ($(LINUX_KERNEL_UIMAGE_LOADADDR),)
@@ -259,7 +263,7 @@ endif
define LINUX_BUILD_CMDS
$(if $(BR2_LINUX_KERNEL_USE_CUSTOM_DTS),
cp $(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH) $(KERNEL_ARCH_PATH)/boot/dts/)
- $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_IMAGE_NAME)
+ $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
@if grep -q "CONFIG_MODULES=y" $(@D)/.config; then \
$(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) modules ; \
fi
@@ -332,7 +336,7 @@ endif
$(LINUX_DIR)/.stamp_initramfs_rebuilt: $(LINUX_DIR)/.stamp_target_installed $(LINUX_DIR)/.stamp_images_installed $(BINARIES_DIR)/rootfs.cpio
@$(call MESSAGE,"Rebuilding kernel with initramfs")
# Build the kernel.
- $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_IMAGE_NAME)
+ $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
$(LINUX_APPEND_DTB)
# Copy the kernel image to its final destination
cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR)