Skip to content

Commit

Permalink
ktest: Fix ktest confusion with CONFIG_MODULES_USE_ELF_RELA
Browse files Browse the repository at this point in the history
In order to decide if ktest should bother installing modules on the
target box, it checks if the config file has CONFIG_MODULES=y. But it
also checks if the '=y' part exists. It only will install modules if the
config exists and is set with '=y'. But as the regex that was used
tests:

  /^CONFIG_MODULES(=y)?/

this will also match:

  CONFIG_MODULES_USE_ELF_RELA

as the '=y' part was optional and it did not test the rest of the line.
When this happens, ktest will stop checking the rest of the configs but
it will also think that no modules are needed to be installed. What it
should do is only jump out of the loop if it actually found a
CONFIG_MODULES that is set to true.

Otherwise, ktest wont install the necessary modules needed for proper
booting of the test target.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Oct 26, 2012
1 parent 6f0c058 commit 8bc5e4e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/testing/ktest/ktest.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1740,8 +1740,10 @@ sub install {
open(IN, "$output_config") or dodie("Can't read config file");
while (<IN>) {
if (/CONFIG_MODULES(=y)?/) {
$install_mods = 1 if (defined($1));
last;
if (defined($1)) {
$install_mods = 1;
last;
}
}
}
close(IN);
Expand Down

0 comments on commit 8bc5e4e

Please sign in to comment.