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

« back to all changes in this revision

Viewing changes to loader/powerpc/ieee1275/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:
75
75
  linux_args = 0;
76
76
 
77
77
  if (linux_addr && grub_ieee1275_release (linux_addr, linux_size))
78
 
    return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Can not release memory");
 
78
    return grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot release memory");
79
79
 
80
80
  if (initrd_addr && grub_ieee1275_release (initrd_addr, initrd_size))
81
 
    return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Can not release memory");
 
81
    return grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot release memory");
82
82
 
83
83
  linux_addr = 0;
84
84
  initrd_addr = 0;
128
128
        break;
129
129
    }
130
130
  if (found_addr == -1)
131
 
    return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Could not claim memory.");
 
131
    return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't claim memory");
132
132
 
133
133
  /* Now load the segments into the area we claimed.  */
134
134
  auto grub_err_t offset_phdr (Elf32_Phdr *phdr, grub_addr_t *addr, int *do_load);
178
178
        break;
179
179
    }
180
180
  if (found_addr == -1)
181
 
    return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Could not claim memory.");
 
181
    return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't claim memory");
182
182
 
183
183
  /* Now load the segments into the area we claimed.  */
184
184
  auto grub_err_t offset_phdr (Elf64_Phdr *phdr, grub_addr_t *addr, int *do_load);
222
222
  if (elf->ehdr.ehdr32.e_type != ET_EXEC)
223
223
    {
224
224
      grub_error (GRUB_ERR_UNKNOWN_OS,
225
 
                  "This ELF file is not of the right type\n");
 
225
                  "this ELF file is not of the right type");
226
226
      goto out;
227
227
    }
228
228
 
236
236
    grub_linux_load64 (elf);
237
237
  else
238
238
    {
239
 
      grub_error (GRUB_ERR_BAD_FILE_TYPE, "Unknown ELF class");
 
239
      grub_error (GRUB_ERR_BAD_FILE_TYPE, "unknown ELF class");
240
240
      goto out;
241
241
    }
242
242
 
297
297
 
298
298
  if (!loaded)
299
299
    {
300
 
      grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first.");
 
300
      grub_error (GRUB_ERR_BAD_ARGUMENT, "you need to load the kernel first");
301
301
      goto fail;
302
302
    }
303
303
 
321
321
 
322
322
  if (found_addr == -1)
323
323
    {
324
 
      grub_error (GRUB_ERR_OUT_OF_MEMORY, "Can not claim memory");
 
324
      grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot claim memory");
325
325
      goto fail;
326
326
    }
327
327
 
330
330
  if (grub_file_read (file, (void *) addr, size) != size)
331
331
    {
332
332
      grub_ieee1275_release (addr, size);
333
 
      grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
 
333
      grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
334
334
      goto fail;
335
335
    }
336
336
 
349
349
GRUB_MOD_INIT(linux)
350
350
{
351
351
  cmd_linux = grub_register_command ("linux", grub_cmd_linux,
352
 
                                     0, "load a linux kernel");
 
352
                                     0, "Load Linux.");
353
353
  cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd,
354
 
                                      0, "load an initrd");
 
354
                                      0, "Load initrd.");
355
355
  my_mod = mod;
356
356
}
357
357