Hi Jürgen

Could you try the attached patch? I think this is a better aproach and avoids 
future problems.

Thanks

--
Dorileo

On Sunday 25 February 2007 14:29, jlueters wrote:
> Package: grub
> Version: 0.97-23
> Severity: important
>
> If grub is under /boot/boot/grub update grub fails because it does
> call "grub-set-default" without parameter ""--root-directory".
> grub-set-default fails because it has been provided with the wrong root
> directory.
>
> Possible fix:
>
> line 400
> replace
>       grub-set-default  0
>
> with
>       if [ $grub_dir = /boot/boot/grub ]
>               then grub-set-default --root-directory=/boot 0
>               else grub-set-default --root-directory=/     0
>       fi
>
>
> Jürgen
>
> -- System Information:
> Debian Release: 4.0
>   APT prefers testing-proposed-updates
>   APT policy: (500, 'testing-proposed-updates'), (500, 'testing')
> Architecture: i386 (i686)
> Shell:  /bin/sh linked to /bin/bash
> Kernel: Linux 2.6.18
> Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
>
> Versions of packages grub depends on:
> ii  libc6                       2.3.6.ds1-11 GNU C Library: Shared
> libraries ii  libncurses5                 5.5-5        Shared libraries for
> terminal hand
>
> grub recommends no packages.
>
> -- no debconf information
>
>
> _______________________________________________
> Pkg-grub-devel mailing list
> [EMAIL PROTECTED]
> http://lists.alioth.debian.org/mailman/listinfo/pkg-grub-devel
--- grub-set-default	2007-02-13 16:50:53.000000000 +0000
+++ grub-set-default.changed	2007-02-27 15:18:07.000000000 +0000
@@ -74,18 +74,45 @@
     exit 1
 fi
 
+find_grub_dir ()
+{
+        echo  -n "Searching for GRUB installation directory ... " >&2
+
+        for d in $grub_dirs ; do
+                if [ -d "$d" ] ; then
+                        grub_dir="$d"
+                        break
+                fi
+        done
+
+        if [ -z "$grub_dir" ] ; then
+                abort "No GRUB directory found.\n###"
+        else
+                echo "found: $grub_dir" >&2
+        fi
+
+        echo $grub_dir
+}
+
+grub_dirs="/boot/grub /boot/boot/grub"
+
 # Determine the GRUB directory. This is different among OSes.
-grubdir=${rootdir}/boot/grub
-if test -d ${grubdir}; then
+# if rootdir has been informed use it or find grubdir otherwise
+if [ -n ${rootdir} ]; then
+  grubdir=${rootdir}/boot/grub
+  if test -d ${grubdir}; then
     :
-else
+  else
     grubdir=${rootdir}/grub
     if test -d ${grubdir}; then
-	:
+        :
     else
-	echo "No GRUB directory found under ${rootdir}/" 1>&2
-	exit 1
+        echo "No GRUB directory found under ${rootdir}/" 1>&2
+        exit 1
     fi
+  fi
+else
+  grubdir=$(find_grub_dir)
 fi
 
 file=${grubdir}/default

Reply via email to