linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Werner Almesberger <Werner.Almesberger@epfl.ch>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] make updateconfig (for recent 2.4.0-test* kernels)
Date: Tue, 31 Oct 2000 11:55:24 +0100	[thread overview]
Message-ID: <20001031115524.B8753@almesberger.net> (raw)

Here's a little patch I've been using for a while, and which some
people may find useful. It's mainly good for helping with that feeling
that you might miss something when you simply make oldconfig. Any
self-respecting control freak will understand why this is
important ;-)

What this patch does:
 - adds -D option to scripts/Configure.
 - adds  make updateconfig  and synonymous  make updconfig  targets to
   invoke scripts/Configure with -D

Configure -D works like -d (i.e. like  make oldconfig ) but prints all
options referenced in the old .config, but missing in the new .config.
So you'll know if something that used to be configurable at build time
now is configured at run time, auto-configures, or such, or if a whole
set of options has disappeared, e.g. because of an added dependency or
a new option where you gave the wrong answer.

Known problems: also reports certain options which were written to the
old .config by mistake (or, rather, by a configurator using different
visibility rules), e.g. xconfig adds CONFIG_JFFS_FS_VERBOSE even if
CONFIG_JFFS_FS is not set.

Q: Why don't you just use  diff .config.old .config  ?
A: This would work if the previous .config file was obtained from
   Configure, but menuconfig already leaves some clutter, and a diff
   for a .config obtained from xconfig wouldn't be useful without
   serious post-processing. Also, a diff repeats new options, which
   were already handled by Configure.

- Werner

---------------------------------- cut here -----------------------------------

--- linux/Makefile.orig	Thu Aug 31 18:09:34 2000
+++ linux/Makefile	Thu Aug 31 18:09:51 2000
@@ -220,6 +220,9 @@
 oldconfig: symlinks
 	$(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in
 
+updconfig updateconfig: symlinks
+	$(CONFIG_SHELL) scripts/Configure -D arch/$(ARCH)/config.in
+
 xconfig: symlinks
 	$(MAKE) -C scripts kconfig.tk
 	wish -f scripts/kconfig.tk
--- linux/scripts/Configure.orig	Thu Aug 31 17:55:44 2000
+++ linux/scripts/Configure	Thu Aug 31 18:09:10 2000
@@ -115,7 +115,7 @@
 #	readln prompt default oldval
 #
 function readln () {
-	if [ "$DEFAULT" = "-d" -a -n "$3" ]; then
+	if [ ! -z "$DEFAULT" -a -n "$3" ]; then
 		echo "$1"
 		ans=$2
 	else
@@ -526,8 +526,8 @@
 echo "#define AUTOCONF_INCLUDED" >> $CONFIG_H
 
 DEFAULT=""
-if [ "$1" = "-d" ] ; then
-	DEFAULT="-d"
+if [ "$1" = "-d" -o "$1" = "-D" ] ; then
+	DEFAULT=$1
 	shift
 fi
 
@@ -557,10 +557,24 @@
 
 . $CONFIG_IN
 
+if [ "$DEFAULT" = -D -a -f $DEFAULTS ]; then
+    sed 's/^# CONFIG_/CONFIG_/;p' <.tmpconfig | cat $DEFAULTS - |
+      sed 's/[#=].*//' | sort | uniq -u >.tmpmissing
+    if [ -s .tmpmissing ]; then
+	echo
+	echo "#"
+	echo "# Unused variables (found in $DEFAULTS)"
+	echo "#"
+	cat .tmpmissing
+    fi
+    rm -f .tmpmissing
+fi
+
 rm -f .config.old
 if [ -f .config ]; then
 	mv .config .config.old
 fi
+
 mv .tmpconfig .config
 mv .tmpconfig.h include/linux/autoconf.h
 

-- 
  _________________________________________________________________________
 / Werner Almesberger, ICA, EPFL, CH           Werner.Almesberger@epfl.ch /
/_IN_N_032__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

                 reply	other threads:[~2000-10-31 10:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20001031115524.B8753@almesberger.net \
    --to=werner.almesberger@epfl.ch \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).