All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: linux-kbuild@vger.kernel.org
Cc: Josh Boyer <jwboyer@redhat.com>,
	Darren Hart <dvhart@linux.intel.com>,
	john stultz <johnstul@us.ibm.com>, Michal Marek <mmarek@suse.cz>,
	Josh Triplett <josh@joshtriplett.org>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	linux-kernel@vger.kernel.org,
	"Yann E. MORIN" <yann.morin.1998@free.fr>
Subject: [PATCH 2/6] kbuild: mergeconfig: move an error check to merge_config.sh
Date: Fri, 13 Mar 2015 15:21:39 +0900	[thread overview]
Message-ID: <1426227703-31815-3-git-send-email-yamada.masahiro@socionext.com> (raw)
In-Reply-To: <1426227703-31815-1-git-send-email-yamada.masahiro@socionext.com>

Currently, "make tinyconfig" does not work with "-j" option.

  $ make mrproper
  $ make -j8 tinyconfig
    HOSTCC  scripts/basic/fixdep
    HOSTCC  scripts/kconfig/conf.o
    SHIPPED scripts/kconfig/zconf.tab.c
    SHIPPED scripts/kconfig/zconf.lex.c
    SHIPPED scripts/kconfig/zconf.hash.c
    HOSTCC  scripts/kconfig/zconf.tab.o
    HOSTLD  scripts/kconfig/conf
  scripts/kconfig/conf --allnoconfig Kconfig
  #
  # configuration written to .config
  #
  scripts/kconfig/Makefile:122: *** You need an existing .config
  for this target.  Stop.
  make: *** [tinyconfig] Error 2

As shown above, "allnoconfig" has created the .config file before
mergeconfig is called, but Make still raises a false alarm because
of some sort of race condition.

We can fix this issue by moving the error check to the shell script.

Anyway, scripts/kconfig/merge_config.sh always requires an existing
.config as a base file.  It is reasonable to check its existence in
the shell script.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 scripts/kconfig/Makefile        | 1 -
 scripts/kconfig/merge_config.sh | 5 +++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index fc34f46..be0fad4 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -107,7 +107,6 @@ endif
 configfiles=$(wildcard $(srctree)/kernel/configs/$(1).config $(srctree)/arch/$(SRCARCH)/configs/$(1).config)
 
 define mergeconfig
-$(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
 $(if $(call configfiles,$(1)),, $(error No configuration exists for this target on this architecture))
 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(call configfiles,$(1))
 +$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index 2118af8..88d89b2 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -85,6 +85,11 @@ fi
 INITFILE=$1
 shift;
 
+if [ ! -r "$INITFILE" ]; then
+	echo "The base file '$INITFILE' does not exist.  Exit." >&2
+	exit 1
+fi
+
 MERGE_LIST=$*
 SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
 TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
-- 
1.9.1


  parent reply	other threads:[~2015-03-13  6:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13  6:21 [PATCH 0/6] kbuild: mergeconfig: fix bugs, improve readability, and add generic entry point Masahiro Yamada
2015-03-13  6:21 ` [PATCH 1/6] kbuild: mergeconfig: fix "jobserver unavailable" warning Masahiro Yamada
2015-03-13  6:21 ` Masahiro Yamada [this message]
2015-03-13  6:21 ` [PATCH 3/6] kbuild: mergeconfig: remove redundant $(objtree) Masahiro Yamada
2015-03-13  6:21 ` [PATCH 4/6] merge_config.sh: improve indentation Masahiro Yamada
2015-03-13  6:21 ` [PATCH 5/6] merge_config.sh: rename MAKE to RUNMAKE Masahiro Yamada
2015-03-13  6:21 ` [RFC PATCH 6/6] kbuild: add generic mergeconfig target, %.config Masahiro Yamada
2015-03-13  8:27 ` [PATCH 0/6] kbuild: mergeconfig: fix bugs, improve readability, and add generic entry point Josh Triplett
2015-03-13 21:29   ` Darren Hart
2015-03-13 21:29     ` Darren Hart
2015-03-24 15:55     ` Michal Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426227703-31815-3-git-send-email-yamada.masahiro@socionext.com \
    --to=yamada.masahiro@socionext.com \
    --cc=dvhart@linux.intel.com \
    --cc=johnstul@us.ibm.com \
    --cc=josh@joshtriplett.org \
    --cc=jwboyer@redhat.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=yann.morin.1998@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.