* util/grub.d/30_os-prober.in: Fix occurence of grub-probe instead of
grub_probe. Reported by: adamwill
This commit is contained in:
parent
7e532280bd
commit
3c76ea0c2c
8 changed files with 187 additions and 77 deletions
|
@ -371,11 +371,14 @@ 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 paddr;
|
||||
grub_addr_t addr;
|
||||
int ret;
|
||||
int i;
|
||||
int nfiles = 0;
|
||||
grub_uint8_t *ptr;
|
||||
|
||||
if (argc == 0)
|
||||
{
|
||||
|
@ -389,13 +392,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]);
|
||||
}
|
||||
|
||||
addr = 0x60000000;
|
||||
size = grub_file_size (file);
|
||||
|
||||
paddr = alloc_phys (size);
|
||||
if (paddr == (grub_addr_t) -1)
|
||||
|
@ -415,12 +426,18 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
grub_dprintf ("loader", "Loading initrd at vaddr 0x%lx, paddr 0x%lx, size 0x%lx\n",
|
||||
addr, paddr, size);
|
||||
|
||||
if (grub_file_read (file, (void *) addr, size) != size)
|
||||
ptr = (void *) addr;
|
||||
for (i = 0; i < nfiles; i++)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue