From patchwork Tue Jun 24 13:18:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waldemar Brodkorb X-Patchwork-Id: 363445 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id F10521400AC for ; Tue, 24 Jun 2014 23:18:34 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 3ACD627A5B; Tue, 24 Jun 2014 13:18:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B-RsoJJGRQK7; Tue, 24 Jun 2014 13:18:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 4E82431BB2; Tue, 24 Jun 2014 13:18:30 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 08EE81BF970 for ; Tue, 24 Jun 2014 13:18:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 05F238AFC7 for ; Tue, 24 Jun 2014 13:18:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WdB64ICtDa0C for ; Tue, 24 Jun 2014 13:18:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from helium.waldemar-brodkorb.de (helium.waldemar-brodkorb.de [89.238.66.15]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 59C898965C for ; Tue, 24 Jun 2014 13:18:28 +0000 (UTC) Received: by helium.waldemar-brodkorb.de (Postfix, from userid 1000) id 501C510263; Tue, 24 Jun 2014 15:18:25 +0200 (CEST) Date: Tue, 24 Jun 2014 15:18:25 +0200 From: Waldemar Brodkorb To: buildroot@buildroot.net Message-ID: <20140624131825.GA29718@waldemar-brodkorb.de> MIME-Version: 1.0 Content-Disposition: inline X-Operating-System: Linux 3.2.0-4-amd64 x86_64 User-Agent: Mutt/1.5.21 (2010-09-15) Subject: [Buildroot] [PATCH] linux target name might be not equal linux file name X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Waldemar Brodkorb List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net 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: Waldemar Brodkorb --- linux/Config.in | 6 ++++++ linux/linux.mk | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/linux/Config.in b/linux/Config.in index ece48a7..0f4337f 100644 --- a/linux/Config.in +++ b/linux/Config.in @@ -244,6 +244,12 @@ config BR2_LINUX_KERNEL_IMAGE_TARGET_NAME Specify the kernel make target to build the kernel that you need. +config BR2_LINUX_KERNEL_IMAGE_NAME + string "Kernel image name" + depends on BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM + help + Specify the kernel filename. + config BR2_LINUX_KERNEL_UIMAGE_LOADADDR string "load address (for 3.7+ multi-platform image)" depends on BR2_arm || BR2_armeb diff --git a/linux/linux.mk b/linux/linux.mk index bd3f2ac..1e7d2e2 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -80,8 +80,10 @@ 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 +LINUX_TARGET_NAME = $(LINUX_IMAGE_NAME) ifeq ($(BR2_LINUX_KERNEL_UIMAGE),y) LINUX_IMAGE_NAME = uImage else ifeq ($(BR2_LINUX_KERNEL_APPENDED_UIMAGE),y) @@ -259,7 +261,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 @@ -331,8 +333,8 @@ endif # been generated in $(BINARIES_DIR)/rootfs.cpio. $(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) + # Build the kernel. for custom kernels make target may be unequal to kernel file 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)