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

« back to all changes in this revision

Viewing changes to commands/acpi.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:
36
36
 
37
37
static const struct grub_arg_option options[] = {
38
38
  {"exclude", 'x', 0,
39
 
   "Don't load host tables specified by comma-separated list",
 
39
   "Don't load host tables specified by comma-separated list.",
40
40
   0, ARG_TYPE_STRING},
41
41
  {"load-only", 'n', 0,
42
 
   "Load only tables specified by comma-separated list", 0, ARG_TYPE_STRING},
43
 
  {"v1", '1', 0, "Expose v1 tables", 0, ARG_TYPE_NONE},
44
 
  {"v2", '2', 0, "Expose v2 and v3 tables", 0, ARG_TYPE_NONE},
45
 
  {"oemid", 'o', 0, "Set OEMID of RSDP, XSDT and RSDT", 0, ARG_TYPE_STRING},
 
42
   "Load only tables specified by comma-separated list.", 0, ARG_TYPE_STRING},
 
43
  {"v1", '1', 0, "Expose v1 tables.", 0, ARG_TYPE_NONE},
 
44
  {"v2", '2', 0, "Expose v2 and v3 tables.", 0, ARG_TYPE_NONE},
 
45
  {"oemid", 'o', 0, "Set OEMID of RSDP, XSDT and RSDT.", 0, ARG_TYPE_STRING},
46
46
  {"oemtable", 't', 0,
47
 
   "Set OEMTABLE ID of RSDP, XSDT and RSDT", 0, ARG_TYPE_STRING},
 
47
   "Set OEMTABLE ID of RSDP, XSDT and RSDT.", 0, ARG_TYPE_STRING},
48
48
  {"oemtablerev", 'r', 0,
49
 
   "Set OEMTABLE revision of RSDP, XSDT and RSDT", 0, ARG_TYPE_INT},
 
49
   "Set OEMTABLE revision of RSDP, XSDT and RSDT.", 0, ARG_TYPE_INT},
50
50
  {"oemtablecreator", 'c', 0,
51
 
   "Set creator field of RSDP, XSDT and RSDT", 0, ARG_TYPE_STRING},
 
51
   "Set creator field of RSDP, XSDT and RSDT.", 0, ARG_TYPE_STRING},
52
52
  {"oemtablecreatorrev", 'd', 0,
53
 
   "Set creator revision of RSDP, XSDT and RSDT", 0, ARG_TYPE_INT},
54
 
  {"no-ebda", 'e', 0, "Don't update EBDA. May fix failures or hangs on some"
55
 
   " BIOSes but makes it ineffective with OS not receiving RSDP from GRUB",
 
53
   "Set creator revision of RSDP, XSDT and RSDT.", 0, ARG_TYPE_INT},
 
54
  {"no-ebda", 'e', 0, "Don't update EBDA. May fix failures or hangs on some."
 
55
   " BIOSes but makes it ineffective with OS not receiving RSDP from GRUB.",
56
56
   0, ARG_TYPE_NONE},
57
57
  {0, 0, 0, 0, 0, 0}
58
58
};
277
277
    {
278
278
      grub_mmap_unregister (mmapregion);
279
279
      return grub_error (GRUB_ERR_OUT_OF_MEMORY,
280
 
                         "Couldn't find suitable spot in EBDA");
 
280
                         "couldn't find suitable spot in EBDA");
281
281
    }
282
282
 
283
283
  /* Remove any other RSDT. */
551
551
                      grub_free (exclude);
552
552
                      grub_free (load_only);
553
553
                      return grub_error (GRUB_ERR_OUT_OF_MEMORY,
554
 
                                         "Couldn't allocate table");
 
554
                                         "couldn't allocate table");
555
555
                    }
556
556
                  grub_memcpy (table_dsdt, dsdt, dsdt->length);
557
557
                }
578
578
              grub_free (exclude);
579
579
              grub_free (load_only);
580
580
              return grub_error (GRUB_ERR_OUT_OF_MEMORY,
581
 
                                 "Couldn't allocate table structure");
 
581
                                 "couldn't allocate table structure");
582
582
            }
583
583
          table->size = curtable->length;
584
584
          table->addr = grub_malloc (table->size);
587
587
            {
588
588
              free_tables ();
589
589
              return grub_error (GRUB_ERR_OUT_OF_MEMORY,
590
 
                                 "Couldn't allocate table");
 
590
                                 "couldn't allocate table");
591
591
            }
592
592
          table->next = acpi_tables;
593
593
          acpi_tables = table;
674
674
            {
675
675
              free_tables ();
676
676
              return grub_error (GRUB_ERR_OUT_OF_MEMORY,
677
 
                                 "Couldn't allocate table structure");
 
677
                                 "couldn't allocate table structure");
678
678
            }
679
679
 
680
680
          table->size = size;
709
709
    {
710
710
      free_tables ();
711
711
      return grub_error (GRUB_ERR_OUT_OF_MEMORY,
712
 
                         "Couldn't allocate space for ACPI tables");
 
712
                         "couldn't allocate space for ACPI tables");
713
713
    }
714
714
 
715
715
  setup_common_tables ();
759
759
{
760
760
  cmd = grub_register_extcmd ("acpi", grub_cmd_acpi,
761
761
                              GRUB_COMMAND_FLAG_BOTH,
762
 
                              "acpi [-1|-2] [--exclude=table1,table2|"
 
762
                              "[-1|-2] [--exclude=table1,table2|"
763
763
                              "--load-only=table1,table2] filename1 "
764
764
                              " [filename2] [...]",
765
765
                              "Load host acpi tables and tables "
766
 
                              "specified by arguments",
 
766
                              "specified by arguments.",
767
767
                              options);
768
768
}
769
769