~darkmuggle-deactivatedaccount/ubuntu/quantal/grub2/fix-872244

« back to all changes in this revision

Viewing changes to font/font.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2010-01-11 11:12:55 UTC
  • mfrom: (17.3.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100111111255-lr8ebkqw5x41gq6j
Tags: 1.98~20100101-1ubuntu1
* Resynchronise with Debian. Remaining changes:
  - Adjust for default Ubuntu boot options ("quiet splash").
  - Default to hiding the menu; holding down Shift at boot will show it.
  - Set a monochromatic theme for Ubuntu.
  - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title,
    recovery mode, quiet option, tweak how memtest86+ is displayed, and
    use UUIDs where appropriate.
  - Conflict with grub (<< 0.97-54) as well as grub-legacy.
  - Fix backslash-escaping in merge_debconf_into_conf.
  - Remove "GNU/Linux" from default distributor string.
  - Add crashkernel= options if kdump and makedumpfile are available.
  - If other operating systems are installed, then automatically unhide
    the menu. Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus
    if available to check whether Shift is pressed. If it is, show the
    menu, otherwise boot immediately. If keystatus is not available, then
    fall back to a short delay interruptible with Escape.
  - Allow Shift to interrupt 'sleep --interruptible'.
  - Don't display introductory message about line editing unless we're
    actually offering a shell prompt. Don't clear the screen just before
    booting if we never drew the menu in the first place.
  - Remove some verbose messages printed before reading the configuration
    file.
  - If the environment variable "quiet" is set to something other than 0,
    suppress progress messages as the kernel and initrd load. Set this for
    non-recovery kernel menu entries.
  - Add GRUB_DEFAULT=saved, as well as grub-set-default and grub-reboot
    utilities. Provides functionality essentially equivalent to GRUB
    Legacy's savedefault.
  - Keep the loopback file open so that subsequent changes to the "root"
    environment variable don't affect it.
  - Change prepare_grub_to_access_device to handle filesystems
    loop-mounted on file images.
  - Ignore devices loop-mounted from files in 10_linux.
  - Show the boot menu if the previous boot failed, that is if it failed
    to get to the end of one of the normal runlevels.
  - Handle RAID devices containing virtio components.
* Update savedefault patch from current Bazaar branch, fixing grub-reboot
  to have distinct behaviour from grub-set-default (LP: #497326).
* Fix grub-mkisofs compilation error with FORTIFY_SOURCE.
* Convert recordfail boilerplate in each menu entry to use a function.

Show diffs side-by-side

added added

removed removed

Lines of Context:
210
210
  else if (retval < 0)
211
211
    {
212
212
      grub_error (GRUB_ERR_BAD_FONT,
213
 
                  "Font format error: can't read section name");
 
213
                  "font format error: can't read section name");
214
214
      return 1;
215
215
    }
216
216
 
225
225
  else if (retval < 0)
226
226
    {
227
227
      grub_error (GRUB_ERR_BAD_FONT,
228
 
                  "Font format error: can't read section length");
 
228
                  "font format error: can't read section length");
229
229
      return 1;
230
230
    }
231
231
 
259
259
  if ((sect_length % FONT_CHAR_INDEX_ENTRY_SIZE) != 0)
260
260
    {
261
261
      grub_error (GRUB_ERR_BAD_FONT,
262
 
                  "Font file format error: character index length %d "
 
262
                  "font file format error: character index length %d "
263
263
                  "is not a multiple of the entry size %d",
264
264
                  sect_length, FONT_CHAR_INDEX_ENTRY_SIZE);
265
265
      return 1;
294
294
      if (i != 0 && entry->code <= last_code)
295
295
        {
296
296
          grub_error (GRUB_ERR_BAD_FONT,
297
 
                      "Font characters not in ascending order: %u <= %u",
 
297
                      "font characters not in ascending order: %u <= %u",
298
298
                      entry->code, last_code);
299
299
          return 1;
300
300
        }
357
357
  if (section->length != 2)
358
358
    {
359
359
      grub_error (GRUB_ERR_BAD_FONT,
360
 
                  "Font file format error: section %c%c%c%c length "
 
360
                  "font file format error: section %c%c%c%c length "
361
361
                  "is %d but should be 2",
362
362
                  section->name[0], section->name[1],
363
363
                  section->name[2], section->name[3],
403
403
  if (grub_memcmp (section.name, section_names_file, 4) != 0)
404
404
    {
405
405
      grub_error (GRUB_ERR_BAD_FONT,
406
 
                  "Font file format error: 1st section must be FILE");
 
406
                  "font file format error: 1st section must be FILE");
407
407
      goto fail;
408
408
    }
409
409
 
413
413
  if (section.length != 4)
414
414
    {
415
415
      grub_error (GRUB_ERR_BAD_FONT,
416
 
                  "Font file format error (file type ID length is %d "
 
416
                  "font file format error (file type ID length is %d "
417
417
                  "but should be 4)", section.length);
418
418
      goto fail;
419
419
    }
431
431
 
432
432
  if (grub_memcmp (magic, pff2_magic, 4) != 0)
433
433
    {
434
 
      grub_error (GRUB_ERR_BAD_FONT, "Invalid font magic %x %x %x %x",
 
434
      grub_error (GRUB_ERR_BAD_FONT, "invalid font magic %x %x %x %x",
435
435
                  magic[0], magic[1], magic[2], magic[3]);
436
436
      goto fail;
437
437
    }
558
558
      || font->descent == 0)
559
559
    {
560
560
      grub_error (GRUB_ERR_BAD_FONT,
561
 
                  "Invalid font file: missing some required data.");
 
561
                  "invalid font file: missing some required data");
562
562
      goto fail;
563
563
    }
564
564