1
Index: b/util/grub-set-default.in
2
===================================================================
3
--- a/util/grub-set-default.in
4
+++ b/util/grub-set-default.in
11
+ echo -n "Searching for GRUB installation directory ... " >&2
13
+ for d in $grub_dirs ; do
14
+ if [ -d "$d" ] ; then
20
+ if [ -z "$grub_dir" ] ; then
21
+ abort "No GRUB directory found.\n###"
23
+ echo "found: $grub_dir" >&2
29
+grub_dirs="/boot/grub /boot/boot/grub"
31
# Determine the GRUB directory. This is different among OSes.
32
-grubdir=${rootdir}/boot/grub
33
-if test -d ${grubdir}; then
34
+# if rootdir has been informed use it or find grubdir otherwise
35
+if [ -n "${rootdir}" ]; then
36
+ grubdir=${rootdir}/boot/grub
37
+ if test -d ${grubdir}; then
41
grubdir=${rootdir}/grub
42
if test -d ${grubdir}; then
46
- echo "No GRUB directory found under ${rootdir}/" 1>&2
48
+ echo "No GRUB directory found under ${rootdir}/" 1>&2
53
+ grubdir=$(find_grub_dir)
56
file=${grubdir}/default