merge bootcheck and mainline into newreloc
This commit is contained in:
commit
3c83bc50db
165 changed files with 4132 additions and 665 deletions
|
@ -33,7 +33,7 @@
|
|||
#include <grub/command.h>
|
||||
#include <grub/extcmd.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/i386/pc/serial.h>
|
||||
#include <grub/serial.h>
|
||||
|
||||
#include <grub/video.h>
|
||||
#ifdef GRUB_MACHINE_PCBIOS
|
||||
|
@ -849,11 +849,9 @@ grub_netbsd_setup_video (void)
|
|||
if (modevar && *modevar != 0)
|
||||
{
|
||||
char *tmp;
|
||||
tmp = grub_malloc (grub_strlen (modevar)
|
||||
+ sizeof (";" NETBSD_DEFAULT_VIDEO_MODE));
|
||||
tmp = grub_xasprintf ("%s;" NETBSD_DEFAULT_VIDEO_MODE, modevar);
|
||||
if (! tmp)
|
||||
return grub_errno;
|
||||
grub_sprintf (tmp, "%s;" NETBSD_DEFAULT_VIDEO_MODE, modevar);
|
||||
err = grub_video_set_mode (tmp, 0, 0);
|
||||
grub_free (tmp);
|
||||
}
|
||||
|
@ -1634,14 +1632,20 @@ grub_cmd_freebsd_loadenv (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (*curr)
|
||||
{
|
||||
char name[grub_strlen (curr) + sizeof("kFreeBSD.")];
|
||||
char *name;
|
||||
|
||||
if (*p == '"')
|
||||
p++;
|
||||
|
||||
grub_sprintf (name, "kFreeBSD.%s", curr);
|
||||
if (grub_env_set (name, p))
|
||||
name = grub_xasprintf ("kFreeBSD.%s", curr);
|
||||
if (!name)
|
||||
goto fail;
|
||||
if (grub_env_set (name, p))
|
||||
{
|
||||
grub_free (name);
|
||||
goto fail;
|
||||
}
|
||||
grub_free (name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -612,11 +612,9 @@ grub_linux_boot (void)
|
|||
May change in future if we have modes without framebuffer. */
|
||||
if (modevar && *modevar != 0)
|
||||
{
|
||||
tmp = grub_malloc (grub_strlen (modevar)
|
||||
+ sizeof (";" DEFAULT_VIDEO_MODE));
|
||||
tmp = grub_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar);
|
||||
if (! tmp)
|
||||
return grub_errno;
|
||||
grub_sprintf (tmp, "%s;" DEFAULT_VIDEO_MODE, modevar);
|
||||
err = grub_video_set_mode (tmp, 0, 0);
|
||||
grub_free (tmp);
|
||||
}
|
||||
|
@ -941,19 +939,18 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
break;
|
||||
}
|
||||
|
||||
buf = grub_malloc (sizeof ("WWWWxHHHHxDD;WWWWxHHHH"));
|
||||
if (! buf)
|
||||
goto fail;
|
||||
|
||||
linux_mode
|
||||
= &linux_vesafb_modes[vid_mode - GRUB_LINUX_VID_MODE_VESA_START];
|
||||
|
||||
grub_sprintf (buf, "%ux%ux%u,%ux%u",
|
||||
linux_vesafb_res[linux_mode->res_index].width,
|
||||
linux_vesafb_res[linux_mode->res_index].height,
|
||||
linux_mode->depth,
|
||||
linux_vesafb_res[linux_mode->res_index].width,
|
||||
linux_vesafb_res[linux_mode->res_index].height);
|
||||
buf = grub_xasprintf ("%ux%ux%u,%ux%u",
|
||||
linux_vesafb_res[linux_mode->res_index].width,
|
||||
linux_vesafb_res[linux_mode->res_index].height,
|
||||
linux_mode->depth,
|
||||
linux_vesafb_res[linux_mode->res_index].width,
|
||||
linux_vesafb_res[linux_mode->res_index].height);
|
||||
if (! buf)
|
||||
goto fail;
|
||||
|
||||
grub_printf ("%s is deprecated. "
|
||||
"Use set gfxpayload=%s before "
|
||||
"linux command instead.\n",
|
||||
|
|
|
@ -231,17 +231,20 @@ grub_multiboot (int argc, char *argv[])
|
|||
|
||||
case 0:
|
||||
{
|
||||
char buf[sizeof ("XXXXXXXXXXxXXXXXXXXXXxXXXXXXXXXX,XXXXXXXXXXxXXXXXXXXXX,auto")];
|
||||
char *buf;
|
||||
if (header->depth && header->width && header->height)
|
||||
grub_sprintf (buf, "%dx%dx%d,%dx%d,auto", header->width,
|
||||
header->height, header->depth, header->width,
|
||||
header->height);
|
||||
buf = grub_xasprintf ("%dx%dx%d,%dx%d,auto", header->width,
|
||||
header->height, header->depth, header->width,
|
||||
header->height);
|
||||
else if (header->width && header->height)
|
||||
grub_sprintf (buf, "%dx%d,auto", header->width, header->height);
|
||||
buf = grub_xasprintf ("%dx%d,auto", header->width, header->height);
|
||||
else
|
||||
grub_sprintf (buf, "auto");
|
||||
buf = grub_strdup ("auto");
|
||||
|
||||
if (!buf)
|
||||
goto fail;
|
||||
grub_env_set ("gfxpayload", buf);
|
||||
grub_free (buf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,6 +114,18 @@ grub_fill_multiboot_mmap (struct multiboot_mmap_entry *first_entry)
|
|||
case GRUB_MACHINE_MEMORY_AVAILABLE:
|
||||
mmap_entry->type = MULTIBOOT_MEMORY_AVAILABLE;
|
||||
break;
|
||||
|
||||
#ifdef GRUB_MACHINE_MEMORY_ACPI_RECLAIMABLE
|
||||
case GRUB_MACHINE_MEMORY_ACPI_RECLAIMABLE:
|
||||
mmap_entry->type = MULTIBOOT_MEMORY_ACPI_RECLAIMABLE;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef GRUB_MACHINE_MEMORY_NVS
|
||||
case GRUB_MACHINE_MEMORY_NVS:
|
||||
mmap_entry->type = MULTIBOOT_MEMORY_NVS;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
mmap_entry->type = MULTIBOOT_MEMORY_RESERVED;
|
||||
|
@ -142,11 +154,9 @@ set_video_mode (void)
|
|||
else
|
||||
{
|
||||
char *tmp;
|
||||
tmp = grub_malloc (grub_strlen (modevar)
|
||||
+ sizeof (DEFAULT_VIDEO_MODE) + 1);
|
||||
tmp = grub_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar);
|
||||
if (! tmp)
|
||||
return grub_errno;
|
||||
grub_sprintf (tmp, "%s;" DEFAULT_VIDEO_MODE, modevar);
|
||||
err = grub_video_set_mode (tmp, 0, 0);
|
||||
grub_free (tmp);
|
||||
}
|
||||
|
|
|
@ -753,11 +753,13 @@ grub_cpu_xnu_fill_devicetree (void)
|
|||
#endif
|
||||
|
||||
/* The name of key for new table. */
|
||||
grub_sprintf (guidbuf, "%08x-%04x-%04x-%02x%02x-",
|
||||
guid.data1, guid.data2, guid.data3, guid.data4[0],
|
||||
guid.data4[1]);
|
||||
grub_snprintf (guidbuf, sizeof (guidbuf), "%08x-%04x-%04x-%02x%02x-",
|
||||
guid.data1, guid.data2, guid.data3, guid.data4[0],
|
||||
guid.data4[1]);
|
||||
for (j = 2; j < 8; j++)
|
||||
grub_sprintf (guidbuf + grub_strlen (guidbuf), "%02x", guid.data4[j]);
|
||||
grub_snprintf (guidbuf + grub_strlen (guidbuf),
|
||||
sizeof (guidbuf) - grub_strlen (guidbuf),
|
||||
"%02x", guid.data4[j]);
|
||||
/* For some reason GUID has to be in uppercase. */
|
||||
for (j = 0; guidbuf[j] ; j++)
|
||||
if (guidbuf[j] >= 'a' && guidbuf[j] <= 'f')
|
||||
|
@ -858,12 +860,10 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params)
|
|||
32 << GRUB_VIDEO_MODE_TYPE_DEPTH_POS);
|
||||
else
|
||||
{
|
||||
tmp = grub_malloc (grub_strlen (modevar)
|
||||
+ sizeof (DEFAULT_VIDEO_MODE) + 1);
|
||||
tmp = grub_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar);
|
||||
if (! tmp)
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
|
||||
"couldn't allocate temporary storag");
|
||||
grub_sprintf (tmp, "%s;" DEFAULT_VIDEO_MODE, modevar);
|
||||
err = grub_video_set_mode (tmp,
|
||||
GRUB_VIDEO_MODE_TYPE_PURE_TEXT
|
||||
| GRUB_VIDEO_MODE_TYPE_DEPTH_MASK,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue