~ubuntu-branches/debian/jessie/grub/jessie

« back to all changes in this revision

Viewing changes to debian/patches/find-grub-dir.patch

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2011-03-17 13:34:14 UTC
  • Revision ID: james.westby@ubuntu.com-20110317133414-cawa48d482iuqqb9
Tags: 0.97-65
* Fix grub/migrate_from_legacy title to not end with a full stop.
* Fix update-grub(8) groff typo (".bar" instead of ".br").
* Adjust doc-base file to account for renaming of grub.info to
  grub-legacy.info.
* Compare -trunk kernels earlier than numeric ABIs (thanks, Aaron M. Ucko
  and Andreas Beckmann; closes: #570318).
* Convert from home-grown patch system to quilt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: b/util/grub-set-default.in
 
2
===================================================================
 
3
--- a/util/grub-set-default.in
 
4
+++ b/util/grub-set-default.in
 
5
@@ -74,18 +74,45 @@
 
6
     exit 1
 
7
 fi
 
8
 
 
9
+find_grub_dir ()
 
10
+{
 
11
+        echo  -n "Searching for GRUB installation directory ... " >&2
 
12
+
 
13
+        for d in $grub_dirs ; do
 
14
+                if [ -d "$d" ] ; then
 
15
+                        grub_dir="$d"
 
16
+                        break
 
17
+                fi
 
18
+        done
 
19
+
 
20
+        if [ -z "$grub_dir" ] ; then
 
21
+                abort "No GRUB directory found.\n###"
 
22
+        else
 
23
+                echo "found: $grub_dir" >&2
 
24
+        fi
 
25
+
 
26
+        echo $grub_dir
 
27
+}
 
28
+
 
29
+grub_dirs="/boot/grub /boot/boot/grub"
 
30
+
 
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
 
38
     :
 
39
-else
 
40
+  else
 
41
     grubdir=${rootdir}/grub
 
42
     if test -d ${grubdir}; then
 
43
-       :
 
44
+        :
 
45
     else
 
46
-       echo "No GRUB directory found under ${rootdir}/" 1>&2
 
47
-       exit 1
 
48
+        echo "No GRUB directory found under ${rootdir}/" 1>&2
 
49
+        exit 1
 
50
     fi
 
51
+  fi
 
52
+else
 
53
+  grubdir=$(find_grub_dir)
 
54
 fi
 
55
 
 
56
 file=${grubdir}/default