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

« back to all changes in this revision

Viewing changes to loader/i386/pc/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:
234
234
  len = real_size + GRUB_DISK_SECTOR_SIZE - sizeof (lh);
235
235
  if (grub_file_read (file, grub_linux_tmp_addr + sizeof (lh), len) != len)
236
236
    {
237
 
      grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
 
237
      grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
238
238
      goto fail;
239
239
    }
240
240
 
265
265
 
266
266
  len = prot_size;
267
267
  if (grub_file_read (file, (void *) GRUB_LINUX_BZIMAGE_ADDR, len) != len)
268
 
    grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
 
268
    grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
269
269
 
270
270
  if (grub_errno == GRUB_ERR_NONE)
271
271
    {
299
299
 
300
300
  if (argc == 0)
301
301
    {
302
 
      grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified");
 
302
      grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified");
303
303
      goto fail;
304
304
    }
305
305
 
306
306
  if (!loaded)
307
307
    {
308
 
      grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first.");
 
308
      grub_error (GRUB_ERR_BAD_ARGUMENT, "you need to load the kernel first");
309
309
      goto fail;
310
310
    }
311
311
 
314
314
  if (!(lh->header == grub_cpu_to_le32 (GRUB_LINUX_MAGIC_SIGNATURE)
315
315
        && grub_le_to_cpu16 (lh->version) >= 0x0200))
316
316
    {
317
 
      grub_error (GRUB_ERR_BAD_OS, "The kernel is too old for initrd.");
 
317
      grub_error (GRUB_ERR_BAD_OS, "the kernel is too old for initrd");
318
318
      goto fail;
319
319
    }
320
320
 
357
357
 
358
358
  if (addr < addr_min)
359
359
    {
360
 
      grub_error (GRUB_ERR_OUT_OF_RANGE, "The initrd is too big");
 
360
      grub_error (GRUB_ERR_OUT_OF_RANGE, "the initrd is too big");
361
361
      goto fail;
362
362
    }
363
363
 
364
364
  if (grub_file_read (file, (void *) addr, size) != size)
365
365
    {
366
 
      grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
 
366
      grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
367
367
      goto fail;
368
368
    }
369
369
 
383
383
{
384
384
  cmd_linux =
385
385
    grub_register_command ("linux16", grub_cmd_linux,
386
 
                           0, "load linux");
 
386
                           0, "Load Linux.");
387
387
  cmd_initrd =
388
388
    grub_register_command ("initrd16", grub_cmd_initrd,
389
 
                           0, "load initrd");
 
389
                           0, "Load initrd.");
390
390
  my_mod = mod;
391
391
}
392
392