~ubuntu-branches/ubuntu/jaunty/grub2/jaunty-proposed

« back to all changes in this revision

Viewing changes to util/update-grub_lib.in

  • Committer: Bazaar Package Importer
  • Author(s): Robert Millan
  • Date: 2008-01-28 00:01:11 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20080128000111-qolpe0u4qkf0xccc
Tags: 1.95+20080128-1
* New CVS snapshot.
  - Fixes bogus CLAIM problems on Apple firmware.  (Closes: #449135, #422729)
  - grub-probe performs sanity checks to make sure our filesystem drivers
    are usable.  (Closes: #462449)
  - patches/disable_ata.diff: Remove.  ATA module isn't auto-loaded in
    rescue floppies now.
  - patches/disable_xfs.diff: Remove.  See above (about grub-probe).
* Bring back grub-emu; it can help a lot with debugging feedback.
  - control
  - rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Helper library for update-grub
2
 
# Copyright (C) 2007  Free Software Foundation, Inc.
 
2
# Copyright (C) 2007,2008  Free Software Foundation, Inc.
3
3
#
4
4
# GRUB is free software: you can redistribute it and/or modify
5
5
# it under the terms of the GNU General Public License as published by
18
18
 
19
19
prefix=@prefix@
20
20
exec_prefix=@exec_prefix@
 
21
datadir=@datadir@
21
22
sbindir=@sbindir@
 
23
pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`
22
24
 
23
25
grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
24
26
 
91
93
 
92
94
font_path ()
93
95
{
94
 
  if [ "x${GRUB_FONT_PATH}" = "x" ] ; then : ; else
95
 
    echo "${GRUB_FONT_PATH}"
96
 
    return 0
97
 
  fi
98
 
 
99
96
  # Prefer system path for space reasons (/boot/grub might be a very small
100
97
  # partition in case of OpenFirmware, etc).
101
 
  for i in /usr/share/grub/unifont.pff /boot/grub/unifont.pff ; do
102
 
    if path=`convert_system_path_to_grub_path $i` ; then
103
 
      GRUB_FONT_PATH="${path}"
104
 
      echo "${GRUB_FONT_PATH}"
105
 
      return 0
106
 
    fi
 
98
  for dir in ${pkgdatadir} /usr/share/grub /boot/grub ; do
 
99
    # Prefer complete fonts over incomplete ones.
 
100
    for basename in unicode unifont ascii ; do
 
101
      path="${dir}/${basename}.pff"
 
102
      if convert_system_path_to_grub_path ${path} > /dev/null ; then
 
103
        echo "${path}"
 
104
        return 0
 
105
      fi
 
106
    done
107
107
  done
108
108
 
109
109
  return 1
110
110
}
 
111
 
 
112
grub_file_is_not_garbage ()
 
113
{
 
114
  if test -f "$1" ; then
 
115
    case "$1" in
 
116
      *.dpkg-dist|*.dpkg-old|*.dpkg-tmp) return 1 ;; # debian dpkg
 
117
    esac
 
118
  else
 
119
    return 1
 
120
  fi
 
121
  return 0
 
122
}