Hi Andreas
On Friday 16 February 2007 09:12, Andreas John wrote:
> Package: grub
> Version: sid
> Severity: medium
>
> Hi,
> after dist-upgrading my sid, update-grub did not run successfully.
> The reason for that was that it called indirectly 'grub-set-default',
> which looked for a grub dir on / ! (not /boot or in my case /boot/boot
> ,as I run traditionally an own partition for /boot).
update-grub as far as I can see has actually a problem when calling
grub-set-default, it does not inform the root-directory parameter, please
take a look at bug #412334 for an example. It means that update-grub does not
try to find the root-directory and surely inform it, the script tries to find
the grub-root-directory not the root-directory so update-grub cant inform it
of course. My change is to make grub-set-default find the grub-root-directory
in another way if root-directory is not informed.
I attached a patch to the quoted bug and will attach it here again for tests,
could you apply the patch and see how it works?
Thanks
--
Dorileo
--- 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