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

« back to all changes in this revision

Viewing changes to efiemu/main.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:
39
39
static struct grub_efiemu_prepare_hook *efiemu_prepare_hooks = 0;
40
40
/* Linked list of configuration tables */
41
41
static struct grub_efiemu_configuration_table *efiemu_config_tables = 0;
 
42
static int prepared = 0;
42
43
 
43
44
/* Free all allocated space */
44
45
grub_err_t
70
71
    }
71
72
  efiemu_prepare_hooks = 0;
72
73
 
 
74
  prepared = 0;
 
75
 
73
76
  return GRUB_ERR_NONE;
74
77
}
75
78
 
211
214
    {
212
215
      grub_file_close (file);
213
216
      grub_efiemu_unload ();
214
 
      return grub_error (grub_errno, "Couldn't init memory management");
 
217
      return grub_error (grub_errno, "couldn't init memory management");
215
218
    }
216
219
 
217
220
  grub_dprintf ("efiemu", "mm initialized\n");
277
280
{
278
281
  grub_err_t err;
279
282
 
 
283
  if (prepared)
 
284
    return GRUB_ERR_NONE;
 
285
 
280
286
  grub_dprintf ("efiemu", "Preparing %d-bit efiemu\n",
281
287
                8 * grub_efiemu_sizeof_uintn_t ());
282
288
 
283
289
  err = grub_efiemu_autocore ();
284
290
 
285
 
  /* Create NVRAM if not yet done. */
 
291
  /* Create NVRAM. */
286
292
  grub_efiemu_pnvram ();
287
293
 
 
294
  prepared = 1;
 
295
 
288
296
  if (grub_efiemu_sizeof_uintn_t () == 4)
289
297
    return grub_efiemu_prepare32 (efiemu_prepare_hooks, efiemu_config_tables);
290
298
  else
316
324
 
317
325
static grub_command_t cmd_loadcore, cmd_prepare, cmd_unload;
318
326
 
319
 
void
320
 
grub_efiemu_pnvram_cmd_register (void);
321
 
 
322
327
GRUB_MOD_INIT(efiemu)
323
328
{
324
329
  cmd_loadcore = grub_register_command ("efiemu_loadcore",
325
330
                                        grub_cmd_efiemu_load,
326
 
                                       "efiemu_loadcore FILE",
327
 
                                       "Load and initialize EFI emulator");
 
331
                                       "FILE",
 
332
                                       "Load and initialize EFI emulator.");
328
333
  cmd_prepare = grub_register_command ("efiemu_prepare",
329
334
                                       grub_cmd_efiemu_prepare,
330
 
                                       "efiemu_prepare",
331
 
                                       "Finalize loading of EFI emulator");
 
335
                                       0,
 
336
                                       "Finalize loading of EFI emulator.");
332
337
  cmd_unload = grub_register_command ("efiemu_unload", grub_cmd_efiemu_unload,
333
 
                                      "efiemu_unload",
334
 
                                      "Unload  EFI emulator");
335
 
  grub_efiemu_pnvram_cmd_register ();
 
338
                                      0,
 
339
                                      "Unload  EFI emulator.");
336
340
}
337
341
 
338
342
GRUB_MOD_FINI(efiemu)
340
344
  grub_unregister_command (cmd_loadcore);
341
345
  grub_unregister_command (cmd_prepare);
342
346
  grub_unregister_command (cmd_unload);
343
 
  grub_efiemu_pnvram_cmd_unregister ();
344
347
}