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

« back to all changes in this revision

Viewing changes to loader/i386/efi/linux.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:
469
469
{
470
470
  int found = 0;
471
471
 
472
 
  auto int NESTED_FUNC_ATTR find_card (int bus, int dev, int func,
 
472
  auto int NESTED_FUNC_ATTR find_card (grub_pci_device_t dev,
473
473
                                       grub_pci_id_t pciid);
474
474
 
475
 
  int NESTED_FUNC_ATTR find_card (int bus, int dev, int func,
 
475
  int NESTED_FUNC_ATTR find_card (grub_pci_device_t dev,
476
476
                                  grub_pci_id_t pciid)
477
477
    {
478
478
      grub_pci_address_t addr;
479
479
 
480
 
      addr = grub_pci_make_address (bus, dev, func, 2);
 
480
      addr = grub_pci_make_address (dev, 2);
481
481
      if (grub_pci_read (addr) >> 24 == 0x3)
482
482
        {
483
483
          int i;
484
484
 
485
485
          grub_printf ("Display controller: %d:%d.%d\nDevice id: %x\n",
486
 
                       bus, dev, func, pciid);
 
486
                       grub_pci_get_bus (dev), grub_pci_get_device (dev),
 
487
                       grub_pci_get_function (dev), pciid);
487
488
          addr += 8;
488
489
          for (i = 0; i < 6; i++, addr += 4)
489
490
            {
670
671
  len = 0x400 - sizeof (lh);
671
672
  if (grub_file_read (file, (char *) real_mode_mem + sizeof (lh), len) != len)
672
673
    {
673
 
      grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
 
674
      grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
674
675
      goto fail;
675
676
    }
676
677
 
852
853
 
853
854
  len = prot_size;
854
855
  if (grub_file_read (file, (void *) GRUB_LINUX_BZIMAGE_ADDR, len) != len)
855
 
    grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
 
856
    grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
856
857
 
857
858
  if (grub_errno == GRUB_ERR_NONE)
858
859
    {
889
890
 
890
891
  if (argc == 0)
891
892
    {
892
 
      grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified");
 
893
      grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified");
893
894
      goto fail;
894
895
    }
895
896
 
896
897
  if (! loaded)
897
898
    {
898
 
      grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first.");
 
899
      grub_error (GRUB_ERR_BAD_ARGUMENT, "you need to load the kernel first");
899
900
      goto fail;
900
901
    }
901
902
 
965
966
 
966
967
  if (grub_file_read (file, initrd_mem, size) != size)
967
968
    {
968
 
      grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
 
969
      grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
969
970
      goto fail;
970
971
    }
971
972
 
988
989
GRUB_MOD_INIT(linux)
989
990
{
990
991
  cmd_linux = grub_register_command ("linux", grub_cmd_linux,
991
 
                                     0, "load linux");
 
992
                                     0, "Load Linux.");
992
993
  cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd,
993
 
                                      0, "load initrd");
 
994
                                      0, "Load initrd.");
994
995
  my_mod = mod;
995
996
}
996
997