From patchwork Fri Mar 25 10:17:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Izard X-Patchwork-Id: 601961 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 3qWfPd5x6Jz9s2G for ; Fri, 25 Mar 2016 21:17:41 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=fcAz6aUg; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 018F889385; Fri, 25 Mar 2016 10:17:41 +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 RbV-KZ4QNYS3; Fri, 25 Mar 2016 10:17:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 53ED88AFD0; Fri, 25 Mar 2016 10:17:40 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 4B14E1C0EAF for ; Fri, 25 Mar 2016 10:17:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 451FE2F939 for ; Fri, 25 Mar 2016 10:17:39 +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 LWVoBoBOZ26u for ; Fri, 25 Mar 2016 10:17:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by silver.osuosl.org (Postfix) with ESMTPS id 31F862EE8B for ; Fri, 25 Mar 2016 10:17:38 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id l68so3221659wml.3 for ; Fri, 25 Mar 2016 03:17:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=TFoihFrchEhXl++zagcY2SufDp1qBQa0iKdcF7vv3PA=; b=fcAz6aUgJi65XgELttvcYC6tiLv6Cw/ZMGAUzGhh5OtQYrTD94TOM9kudNOkZOF9h6 /DniNgc1TUdYrgQAeUivhX6F6TA4IvM4fwIB+AnguvFNexh0FKAjq4gey9ZyxQXHqnrF ylxortBGky2BhFFunsgrZT2/av0+poS75xJ/D7Uh3qhhTu6XubrnFBKylWa6iG1j2CLb ka2Y16gkCwjnae0+Ke9FPZjJL8pfzGKfXumloboUpBVYguaQhJ0jYTCvf8i5e0eJtOIv xpj2XlNkCrQn4/022BDR0ExSjjiyV8v24/nKOLFEjhh0OI+dxVDgiBaXKsYtokDJ5qym Lqxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TFoihFrchEhXl++zagcY2SufDp1qBQa0iKdcF7vv3PA=; b=N6e+GI0r/VmZXkaEf4GZezDutzYdHyj/OnJYk1EwcsvJ+8fFcuWCIMVhaI+d+EAV+z pZ3tNRYrTqtDQg1Vvf93pgvEdHoDMz0sXHijQzrpJpwvgvfxFkw1LKDZduWhpsaJ+DfT BcrpywTgsWzpPbf0zBWMkIfW56yQatM8gHn7X9bPzAVscHq3LY1v1DMK1Gisc7L5DFxB F+tUqsA2k38zHuKXHONxEssgAqJadlEhBogYm00fwwho3x+aqCMqg6RH7Ot4vupsazKE Rk6QpDKLdwFRQHkCgZEi2Ro5iYjoxk7DOXHKa4BBtUG6W7Xdf0GD71Arr1UziSd73O8R 8BCA== X-Gm-Message-State: AD7BkJK9OLHRurih3i6WAi5Cj89APkgcBDnUWzEOUurYnXdAar4F0C3YO00Ky262ki1NMw== X-Received: by 10.194.157.65 with SMTP id wk1mr15072472wjb.83.1458901056806; Fri, 25 Mar 2016 03:17:36 -0700 (PDT) Received: from localhost.localdomain (ram94-11-88-187-113-157.fbx.proxad.net. [88.187.113.157]) by smtp.gmail.com with ESMTPSA id t8sm11263122wjy.41.2016.03.25.03.17.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Mar 2016 03:17:36 -0700 (PDT) From: Romain Izard To: buildroot@buildroot.org Date: Fri, 25 Mar 2016 11:17:28 +0100 Message-Id: <1458901049-3693-1-git-send-email-romain.izard.pro@gmail.com> X-Mailer: git-send-email 2.5.0 Cc: Romain Izard Subject: [Buildroot] [PATCH 1/2] core/pkg-kconfig: add an option to use olddefconfig X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 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" Using 'yes "" | make oldconfig' to regenerate a .config file from an existing defconfig does not work reliably in all cases. Specifically, it does not work well with tristate choice entries. The correct way to do it is to use 'make olddefconfig', but this target is not supported in projects that use an old version of kconfig. As most projects do not use tristate entries, there is no need for them to upgrade. As a result, add support in the pkg-kconfig infrastructure for both cases, with a configuration entry to select which mode to use. Signed-off-by: Romain Izard --- docs/manual/adding-packages-kconfig.txt | 5 +++++ package/pkg-kconfig.mk | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/manual/adding-packages-kconfig.txt b/docs/manual/adding-packages-kconfig.txt index 3290024..50c4ecb 100644 --- a/docs/manual/adding-packages-kconfig.txt +++ b/docs/manual/adding-packages-kconfig.txt @@ -53,6 +53,11 @@ It is mandatory to provide either, but not both: * +FOO_KCONFIG_FILE+ specifies the path to a defconfig or full-config file to be used to configure the package. +* +FOO_KCONFIG_OLDDEFCONFIG+ when set specifies that the 'make' rule to + call with defconfig files is 'olddefconfig'. Only some projects support + it, but the default rule called 'oldconfig' can misbehave when the + config file changes tristate 'choice' entries. + * +FOO_KCONFIG_DEFCONFIG+ specifies the defconfig 'make' rule to call to configure the package. diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk index 90f3f9f..71c6865 100644 --- a/package/pkg-kconfig.mk +++ b/package/pkg-kconfig.mk @@ -60,8 +60,7 @@ $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES): | $(1)-patch # The specified source configuration file and any additional configuration file # fragments are merged together to .config, after the package has been patched. # Since the file could be a defconfig file it needs to be expanded to a -# full .config first. We use 'make oldconfig' because this can be safely -# done even when the package does not support defconfigs. +# full .config first. $$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES) $$(if $$($(2)_KCONFIG_DEFCONFIG), \ $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ @@ -69,8 +68,11 @@ $$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES) cp $$($(2)_KCONFIG_FILE) $$(@)) support/kconfig/merge_config.sh -m -O $$(@D) \ $$(@) $$($(2)_KCONFIG_FRAGMENT_FILES) - $$(Q)yes "" | $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ - $$($(2)_KCONFIG_OPTS) oldconfig + $$(if $$($(2)_KCONFIG_OLDDEFCONFIG), \ + $$($2_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ + $$($(2)_KCONFIG_OPTS) olddefconfig, \ + $$(Q)yes "" | $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ + $$($(2)_KCONFIG_OPTS) oldconfig) # If _KCONFIG_FILE or _KCONFIG_FRAGMENT_FILES exists, this dependency is # already implied, but if we only have a _KCONFIG_DEFCONFIG we have to add