public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 3/9] ktest: Handle kernels before make oldnoconfig
Date: Tue, 08 Mar 2011 10:22:01 -0500	[thread overview]
Message-ID: <20110308152528.036486067@goodmis.org> (raw)
In-Reply-To: 20110308152158.799699072@goodmis.org

[-- Attachment #1: 0003-ktest-Handle-kernels-before-make-oldnoconfig.patch --]
[-- Type: text/plain, Size: 2180 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

When bisecting, one may come across a kernel that does not have
make oldnoconfig. In this case, we need to run the command "yes"
into a make oldconfig. This will select defaults instead of 'n'
into each command, but it works as a work around.

Note, "yes n" will not work because a config may have a value that
"n" is not acceptable for.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 tools/testing/ktest/ktest.pl |   27 ++++++++++++++++++++-------
 1 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 6620fe4..c95209b 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -930,6 +930,18 @@ sub check_buildlog {
     return 1;
 }
 
+sub make_oldconfig {
+    my ($defconfig) = @_;
+
+    if (!run_command "$defconfig $make oldnoconfig") {
+	# Perhaps oldnoconfig doesn't exist in this version of the kernel
+	# try a yes '' | oldconfig
+	doprint "oldnoconfig failed, trying yes '' | make oldconfig\n";
+	run_command "yes '' | $defconfig $make oldconfig" or
+	    dodie "failed make config oldconfig";
+    }
+}
+
 sub build {
     my ($type) = @_;
     my $defconfig = "";
@@ -975,8 +987,12 @@ sub build {
 	$defconfig = "KCONFIG_ALLCONFIG=$minconfig";
     }
 
-    run_command "$defconfig $make $type" or
-	dodie "failed make config";
+    if ($type eq "oldnoconfig") {
+	make_oldconfig $defconfig;
+    } else {
+	run_command "$defconfig $make $type" or
+	    dodie "failed make config";
+    }
 
     $redirect = "$buildlog";
     if (!run_command "$make $build_options") {
@@ -1395,9 +1411,7 @@ sub create_config {
     close(OUT);
 
 #    exit;
-    run_command "$make oldnoconfig" or
-	dodie "failed make config oldconfig";
-
+    make_oldconfig "";
 }
 
 sub compare_configs {
@@ -1599,8 +1613,7 @@ sub config_bisect {
     close(IN);
 
     # Now run oldconfig with the minconfig (and addconfigs)
-    run_command "$defconfig $make oldnoconfig" or
-	dodie "failed make config oldconfig";
+    make_oldconfig $defconfig;
 
     # check to see what we lost (or gained)
     open (IN, $output_config)
-- 
1.7.2.3



  parent reply	other threads:[~2011-03-08 15:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-08 15:21 [PATCH 0/9] ktest: queue for 2.6.39 Steven Rostedt
2011-03-08 15:21 ` [PATCH 1/9] ktest: Print logfile name on failure Steven Rostedt
2011-03-08 15:22 ` [PATCH 2/9] ktest: Start failure timeout on panic too Steven Rostedt
2011-03-08 15:22 ` Steven Rostedt [this message]
2011-03-08 15:22 ` [PATCH 4/9] ktest: Add manual bisect Steven Rostedt
2011-03-08 15:22 ` [PATCH 5/9] ktest: Add BISECT_SKIP Steven Rostedt
2011-03-08 15:22 ` [PATCH 6/9] ktest: Add BISECT_FILES to run git bisect on paths Steven Rostedt
2011-03-08 15:22 ` [PATCH 7/9] ktest: Fix bug where the test would not end after failure Steven Rostedt
2011-03-08 15:22 ` [PATCH 8/9] ktest: Monitor kernel while running of user tests Steven Rostedt
2011-03-08 15:22 ` [PATCH 9/9] ktest: Add STOP_TEST_AFTER to stop the test after a period of time Steven Rostedt

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=20110308152528.036486067@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --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