* util/grub.d/30_os-prober.in: Fix occurence of grub-probe instead of

grub_probe.
	Reported by: adamwill
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-01-13 13:54:24 +01:00
parent 7e532280bd
commit 3c76ea0c2c
8 changed files with 187 additions and 77 deletions

View file

@ -317,10 +317,13 @@ static grub_err_t
grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
int argc, char *argv[])
{
grub_file_t file = 0;
grub_ssize_t size;
grub_file_t *files = 0;
grub_size_t size = 0;
grub_addr_t first_addr;
grub_addr_t addr;
int i;
int nfiles = 0;
grub_uint8_t *ptr;
if (argc == 0)
{
@ -334,13 +337,21 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
goto fail;
}
grub_file_filter_disable_compression ();
file = grub_file_open (argv[0]);
if (! file)
files = grub_zalloc (argc * sizeof (files[0]));
if (!files)
goto fail;
for (i = 0; i < argc; i++)
{
grub_file_filter_disable_compression ();
files[i] = grub_file_open (argv[i]);
if (! files[i])
goto fail;
nfiles++;
size += grub_file_size (files[i]);
}
first_addr = linux_addr + linux_size;
size = grub_file_size (file);
/* Attempt to claim at a series of addresses until successful in
the same way that grub_rescue_cmd_linux does. */
@ -350,13 +361,19 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
grub_dprintf ("loader", "Loading initrd at 0x%x, size 0x%x\n", addr, size);
if (grub_file_read (file, (void *) addr, size) != size)
ptr = (void *) addr;
for (i = 0; i < nfiles; i++)
{
grub_ieee1275_release (addr, size);
if (!grub_errno)
grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"),
argv[0]);
goto fail;
grub_ssize_t cursize = grub_file_size (files[i]);
if (grub_file_read (files[i], ptr, cursize) != cursize)
{
grub_ieee1275_release (addr, size);
if (!grub_errno)
grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"),
argv[i]);
goto fail;
}
ptr += cursize;
}
initrd_addr = addr;