Skip to content

Commit

Permalink
ktest: Evaluate $KERNEL_VERSION in both install and post install
Browse files Browse the repository at this point in the history
The install process may also need to know what the kernel version
is, to add it to the name. Evaluate it for both install and
post install.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Dec 23, 2011
1 parent 165708b commit 2b29b2f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tools/testing/ktest/ktest.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1434,12 +1434,19 @@ sub monitor {
return 1;
}

sub eval_kernel_version {
my ($option) = @_;

$option =~ s/\$KERNEL_VERSION/$version/g;

return $option;
}

sub do_post_install {

return if (!defined($post_install));

my $cp_post_install = $post_install;
$cp_post_install =~ s/\$KERNEL_VERSION/$version/g;
my $cp_post_install = eval_kernel_version $post_install;
run_command "$cp_post_install" or
dodie "Failed to run post install";
}
Expand All @@ -1448,7 +1455,9 @@ sub install {

return if ($no_install);

run_scp "$outputdir/$build_target", "$target_image" or
my $cp_target = eval_kernel_version $target_image;

run_scp "$outputdir/$build_target", "$cp_target" or
dodie "failed to copy image";

my $install_mods = 0;
Expand Down

0 comments on commit 2b29b2f

Please sign in to comment.