Bug#560417: wheezy update-grub error

Colin Watson cjwatson at debian.org
Tue Jan 29 16:13:14 UTC 2013


On Tue, Jan 29, 2013 at 11:50:29AM +0400, Oleg wrote:
> ~# update-grub 
> Searching for GRUB installation directory ... found: /boot/grub
> Searching for default file ... Generating /boot/grub/default file and setting the default boot entry to 0
> entry not specified.
> Usage: grub-set-default [OPTION] entry
> Set the default boot entry for GRUB.
> 
>   -h, --help              print this message and exit
>   -v, --version           print the version information and exit
>   --root-directory=DIR    Use the directory DIR instead of the root directory
> 
> ENTRY is a number or the special keyword `default\'.
> 
> Report bugs to <bug-grub at gnu.org>.
> 
>   Is this a bug? Or i do anything wrong?

Thanks for your report.  This is bug #560417, and was broken in 0.97-59.
It's IMO clear from the diff that it was unintentional to use $1 here
rather than 0:

=== modified file 'debian/changelog'
--- debian/changelog	2009-09-04 13:20:44 +0000
+++ debian/changelog	2009-09-04 14:41:35 +0000
@@ -1,3 +1,10 @@
+grub (0.97-59) unstable; urgency=low
+
+  * Use /usr/lib/grub-legacy/grub-set-default if it exists in update-
+    grub, in preparation for grub2's grub-set-default.
+
+ -- Felix Zielcke <fzielcke at z-51.de>  Fri, 04 Sep 2009 16:41:22 +0200
+
 grub (0.97-58) unstable; urgency=low
 
   * Upgrade path is now GRUB 2.

=== modified file 'debian/update-grub'
--- debian/update-grub	2009-08-12 22:07:07 +0000
+++ debian/update-grub	2009-09-04 14:41:35 +0000
@@ -327,7 +327,11 @@ if [ -f "$default_file" ] ; then
   echo "found: $default_file" >&2
 else
   echo "Generating $default_file file and setting the default boot entry to 0" >&2
-  grub-set-default 0
+  if [ -f /usr/lib/grub-legacy/grub-set-default ] ; then
+    /usr/lib/grub-legacy/grub-set-default $1
+  else
+    grub-set-default $1
+  fi
 fi
 
 # Make sure we use the standard sorting order
@@ -1022,7 +1026,11 @@ fi
 # Function to update the default value
 set_default_value() {
     if [ "$use_grub_set_default" = "true" ] ; then
-	grub-set-default $1
+	if [ -f /usr/lib/grub-legacy/grub-set-default ] ; then
+	    /usr/lib/grub-legacy/grub-set-default $1
+	else
+	    grub-set-default $1
+	fi
     else
 	value="$1"
 	newmenu=$(tempfile)

I'll fix this.

-- 
Colin Watson                                       [cjwatson at debian.org]



More information about the Pkg-grub-devel mailing list