diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-12-22 17:25:46 +0100 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-12-23 03:59:33 +0100 |
commit | 2b29b2f8f869847d437b525d4cf027c09dc38286 (patch) | |
tree | fcc33fecf4d709cb5b02e26ebf74b0ea12a3bac7 /tools | |
parent | ktest: Only ask options needed for install (diff) | |
download | linux-2b29b2f8f869847d437b525d4cf027c09dc38286.tar.xz linux-2b29b2f8f869847d437b525d4cf027c09dc38286.zip |
ktest: Evaluate $KERNEL_VERSION in both install and post install
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>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/testing/ktest/ktest.pl | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 5d82c275e9e6..59738aa6ca73 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -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"; } @@ -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; |