Fixed boottool's grub support to fix the way it sets the default param
Author: Ryan Stutsman <stutsman@google.com>
Date: Thu Jun 21 12:11:25 2007 -0700
Fixed boottool's grub support to fix the way it sets the default param
Boottool was setting the default builtin in grub to some value plus
and "comment" at the end of the line. Grub does not support inline
comments; it only supports comments that start with a pound at the
beginning of the line. This was causing the default value to be
ignored when it was set to "saved" which is used for one-time booting.
git-svn-id: http://test.kernel.org/svn/autotest/trunk@539 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/tools/boottool b/client/tools/boottool
index 9382177..96d87dd 100755
--- a/client/tools/boottool
+++ b/client/tools/boottool
@@ -233,7 +233,7 @@
foreach my $index ( 0 .. $#config ) {
if ( $config[$index] =~ /(^\s*default\s*\=*\s*)\d+/i ) {
- $config[$index] = "$1$newdefault # set by $0\n";
+ $config[$index] = "# set by $0\n$1$newdefault\n";
last;
}
elsif ( $config[$index] =~ /^\s*default\s*\=*\s*saved/i ) {