From patchwork Sun Sep 2 15:05:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 181185 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id EE3A52C008A for ; Mon, 3 Sep 2012 01:06:13 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7FE28A0202; Sun, 2 Sep 2012 15:06:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hf6HsZb997mI; Sun, 2 Sep 2012 15:06:08 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 285D2A013F; Sun, 2 Sep 2012 15:06:08 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id E45598F75B for ; Sun, 2 Sep 2012 15:06:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 15D5F8B2BF for ; Sun, 2 Sep 2012 15:06:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2-u4DcSv+7Az for ; Sun, 2 Sep 2012 15:06:03 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from viper.mind.be (132.79-246-81.adsl-static.isp.belgacom.be [81.246.79.132]) by whitealder.osuosl.org (Postfix) with ESMTPS id 51A5F8A330 for ; Sun, 2 Sep 2012 15:06:02 +0000 (UTC) Received: from [172.16.2.6] (helo=vandecaa-laptop) by viper.mind.be with esmtp (Exim 4.69) (envelope-from ) id 1T8BkH-0007WX-D8; Sun, 02 Sep 2012 17:05:58 +0200 Received: from arnout by vandecaa-laptop with local (Exim 4.80) (envelope-from ) id 1T8BkG-0005L0-P6; Sun, 02 Sep 2012 17:05:52 +0200 From: "Arnout Vandecappelle (Essensium/Mind)" To: buildroot@busybox.net Date: Sun, 2 Sep 2012 17:05:41 +0200 Message-Id: <1346598341-20434-1-git-send-email-arnout@mind.be> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <50435801.7050406@mind.be> Subject: [Buildroot] [PATCH] linux: add default defconfig X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Buildroot currently requires a defconfig to be supplied for the kernel: either a custom supplied one, or one from the kernel tree. However, the kernel can (usually) also select a default defconfig, based on the architecture. So make this option available to buildroot. We also make this the default, so the user can compile a kernel with minimal effort. Microblaze currently (linux-3.5) doesn't have a default defconfig. Older versions also lack it for some architectures (e.g. mips was introduced in 2.6.35) but that's nearly impossible to check for at buildroot level. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) Reviewed-by: "Yann E. MORIN" --- linux/Config.in | 8 +++++++- linux/linux.mk | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/linux/Config.in b/linux/Config.in index 9c63215..1165bc9 100644 --- a/linux/Config.in +++ b/linux/Config.in @@ -101,7 +101,13 @@ config BR2_LINUX_KERNEL_PATCH choice prompt "Kernel configuration" - default BR2_LINUX_KERNEL_USE_DEFCONFIG + # microblaze doesn't have an in-kernel defconfig (as of 3.5) + default BR2_LINUX_KERNEL_USE_DEFCONFIG if BR2_microblazeel || BR2_microblazebe + default BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG + +config BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG + bool "Using the default supplied by the kernel" + depends on !(BR2_microblazeel || BR2_microblazebe) config BR2_LINUX_KERNEL_USE_DEFCONFIG bool "Using a defconfig" diff --git a/linux/linux.mk b/linux/linux.mk index c4bdf90..a248ae4 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -146,6 +146,13 @@ endef LINUX_POST_PATCH_HOOKS += LINUX_APPLY_PATCHES +ifeq ($(BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG),y) + +define LINUX_BASE_CONFIGURE_CMDS + $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) defconfig +endef + +else # BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y) KERNEL_SOURCE_CONFIG = $(KERNEL_ARCH_PATH)/configs/$(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig @@ -153,10 +160,16 @@ else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y) KERNEL_SOURCE_CONFIG = $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE) endif -define LINUX_CONFIGURE_CMDS +define LINUX_BASE_CONFIGURE_CMDS cp $(KERNEL_SOURCE_CONFIG) $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) buildroot_defconfig rm $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig +endef + +endif # BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG + +define LINUX_CONFIGURE_CMDS + $(LINUX_BASE_CONFIGURE_CMDS) $(if $(BR2_ARM_EABI), $(call KCONFIG_ENABLE_OPT,CONFIG_AEABI,$(@D)/.config), $(call KCONFIG_DISABLE_OPT,CONFIG_AEABI,$(@D)/.config))