merge mainline into install
This commit is contained in:
commit
6ed71f4831
135 changed files with 7695 additions and 1076 deletions
|
@ -28,7 +28,6 @@
|
|||
#include <grub/elfload.h>
|
||||
#include <grub/env.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/gzio.h>
|
||||
#include <grub/aout.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/extcmd.h>
|
||||
|
@ -746,6 +745,7 @@ grub_freebsd_boot (void)
|
|||
grub_memcpy (&stack[9], &bi, sizeof (bi));
|
||||
state.eip = entry;
|
||||
state.esp = stack_target;
|
||||
state.ebp = stack_target;
|
||||
stack[0] = entry; /* "Return" address. */
|
||||
stack[1] = bootflags | FREEBSD_RB_BOOTINFO;
|
||||
stack[2] = bootdev;
|
||||
|
@ -830,7 +830,8 @@ grub_openbsd_boot (void)
|
|||
#endif
|
||||
|
||||
state.eip = entry;
|
||||
state.esp = ((grub_uint8_t *) stack - (grub_uint8_t *) buf0) + buf_target;
|
||||
state.ebp = state.esp
|
||||
= ((grub_uint8_t *) stack - (grub_uint8_t *) buf0) + buf_target;
|
||||
stack[0] = entry;
|
||||
stack[1] = bootflags;
|
||||
stack[2] = openbsd_root;
|
||||
|
@ -1045,6 +1046,7 @@ grub_netbsd_boot (void)
|
|||
|
||||
state.eip = entry;
|
||||
state.esp = stack_target;
|
||||
state.ebp = stack_target;
|
||||
stack[0] = entry;
|
||||
stack[1] = bootflags;
|
||||
stack[2] = 0;
|
||||
|
@ -1323,7 +1325,7 @@ grub_bsd_load (int argc, char *argv[])
|
|||
goto fail;
|
||||
}
|
||||
|
||||
file = grub_gzfile_open (argv[0], 1);
|
||||
file = grub_file_open (argv[0]);
|
||||
if (!file)
|
||||
goto fail;
|
||||
|
||||
|
@ -1369,10 +1371,10 @@ grub_bsd_parse_flags (const struct grub_arg_list *state,
|
|||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_freebsd (grub_extcmd_t cmd, int argc, char *argv[])
|
||||
grub_cmd_freebsd (grub_extcmd_context_t ctxt, int argc, char *argv[])
|
||||
{
|
||||
kernel_type = KERNEL_TYPE_FREEBSD;
|
||||
bootflags = grub_bsd_parse_flags (cmd->state, freebsd_flags);
|
||||
bootflags = grub_bsd_parse_flags (ctxt->state, freebsd_flags);
|
||||
|
||||
if (grub_bsd_load (argc, argv) == GRUB_ERR_NONE)
|
||||
{
|
||||
|
@ -1393,7 +1395,7 @@ grub_cmd_freebsd (grub_extcmd_t cmd, int argc, char *argv[])
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
file = grub_gzfile_open (argv[0], 1);
|
||||
file = grub_file_open (argv[0]);
|
||||
if (! file)
|
||||
return grub_errno;
|
||||
|
||||
|
@ -1426,16 +1428,16 @@ grub_cmd_freebsd (grub_extcmd_t cmd, int argc, char *argv[])
|
|||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_openbsd (grub_extcmd_t cmd, int argc, char *argv[])
|
||||
grub_cmd_openbsd (grub_extcmd_context_t ctxt, int argc, char *argv[])
|
||||
{
|
||||
grub_uint32_t bootdev;
|
||||
|
||||
kernel_type = KERNEL_TYPE_OPENBSD;
|
||||
bootflags = grub_bsd_parse_flags (cmd->state, openbsd_flags);
|
||||
bootflags = grub_bsd_parse_flags (ctxt->state, openbsd_flags);
|
||||
|
||||
if (cmd->state[OPENBSD_ROOT_ARG].set)
|
||||
if (ctxt->state[OPENBSD_ROOT_ARG].set)
|
||||
{
|
||||
const char *arg = cmd->state[OPENBSD_ROOT_ARG].arg;
|
||||
const char *arg = ctxt->state[OPENBSD_ROOT_ARG].arg;
|
||||
int unit, part;
|
||||
if (*(arg++) != 'w' || *(arg++) != 'd')
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
|
@ -1456,7 +1458,7 @@ grub_cmd_openbsd (grub_extcmd_t cmd, int argc, char *argv[])
|
|||
else
|
||||
bootdev = 0;
|
||||
|
||||
if (cmd->state[OPENBSD_SERIAL_ARG].set)
|
||||
if (ctxt->state[OPENBSD_SERIAL_ARG].set)
|
||||
{
|
||||
struct grub_openbsd_bootarg_console serial;
|
||||
char *ptr;
|
||||
|
@ -1465,9 +1467,9 @@ grub_cmd_openbsd (grub_extcmd_t cmd, int argc, char *argv[])
|
|||
|
||||
grub_memset (&serial, 0, sizeof (serial));
|
||||
|
||||
if (cmd->state[OPENBSD_SERIAL_ARG].arg)
|
||||
if (ctxt->state[OPENBSD_SERIAL_ARG].arg)
|
||||
{
|
||||
ptr = cmd->state[OPENBSD_SERIAL_ARG].arg;
|
||||
ptr = ctxt->state[OPENBSD_SERIAL_ARG].arg;
|
||||
if (grub_memcmp (ptr, "com", sizeof ("com") - 1) != 0)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"only com0-com3 are supported");
|
||||
|
@ -1511,11 +1513,11 @@ grub_cmd_openbsd (grub_extcmd_t cmd, int argc, char *argv[])
|
|||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_netbsd (grub_extcmd_t cmd, int argc, char *argv[])
|
||||
grub_cmd_netbsd (grub_extcmd_context_t ctxt, int argc, char *argv[])
|
||||
{
|
||||
grub_err_t err;
|
||||
kernel_type = KERNEL_TYPE_NETBSD;
|
||||
bootflags = grub_bsd_parse_flags (cmd->state, netbsd_flags);
|
||||
bootflags = grub_bsd_parse_flags (ctxt->state, netbsd_flags);
|
||||
|
||||
if (grub_bsd_load (argc, argv) == GRUB_ERR_NONE)
|
||||
{
|
||||
|
@ -1523,7 +1525,7 @@ grub_cmd_netbsd (grub_extcmd_t cmd, int argc, char *argv[])
|
|||
{
|
||||
grub_file_t file;
|
||||
|
||||
file = grub_gzfile_open (argv[0], 1);
|
||||
file = grub_file_open (argv[0]);
|
||||
if (! file)
|
||||
return grub_errno;
|
||||
|
||||
|
@ -1548,15 +1550,15 @@ grub_cmd_netbsd (grub_extcmd_t cmd, int argc, char *argv[])
|
|||
grub_bsd_add_meta (NETBSD_BTINFO_BOOTPATH, bootpath, sizeof (bootpath));
|
||||
}
|
||||
|
||||
if (cmd->state[NETBSD_ROOT_ARG].set)
|
||||
if (ctxt->state[NETBSD_ROOT_ARG].set)
|
||||
{
|
||||
char root[GRUB_NETBSD_MAX_ROOTDEVICE_LEN];
|
||||
grub_memset (root, 0, sizeof (root));
|
||||
grub_strncpy (root, cmd->state[NETBSD_ROOT_ARG].arg,
|
||||
grub_strncpy (root, ctxt->state[NETBSD_ROOT_ARG].arg,
|
||||
sizeof (root) - 1);
|
||||
grub_bsd_add_meta (NETBSD_BTINFO_ROOTDEVICE, root, sizeof (root));
|
||||
}
|
||||
if (cmd->state[NETBSD_SERIAL_ARG].set)
|
||||
if (ctxt->state[NETBSD_SERIAL_ARG].set)
|
||||
{
|
||||
struct grub_netbsd_btinfo_serial serial;
|
||||
char *ptr;
|
||||
|
@ -1564,9 +1566,9 @@ grub_cmd_netbsd (grub_extcmd_t cmd, int argc, char *argv[])
|
|||
grub_memset (&serial, 0, sizeof (serial));
|
||||
grub_strcpy (serial.devname, "com");
|
||||
|
||||
if (cmd->state[NETBSD_SERIAL_ARG].arg)
|
||||
if (ctxt->state[NETBSD_SERIAL_ARG].arg)
|
||||
{
|
||||
ptr = cmd->state[NETBSD_SERIAL_ARG].arg;
|
||||
ptr = ctxt->state[NETBSD_SERIAL_ARG].arg;
|
||||
if (grub_memcmp (ptr, "com", sizeof ("com") - 1) == 0)
|
||||
{
|
||||
ptr += sizeof ("com") - 1;
|
||||
|
@ -1627,7 +1629,7 @@ grub_cmd_freebsd_loadenv (grub_command_t cmd __attribute__ ((unused)),
|
|||
goto fail;
|
||||
}
|
||||
|
||||
file = grub_gzfile_open (argv[0], 1);
|
||||
file = grub_file_open (argv[0]);
|
||||
if ((!file) || (!file->size))
|
||||
goto fail;
|
||||
|
||||
|
@ -1728,7 +1730,7 @@ grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)),
|
|||
return 0;
|
||||
}
|
||||
|
||||
file = grub_gzfile_open (argv[0], 1);
|
||||
file = grub_file_open (argv[0]);
|
||||
if ((!file) || (!file->size))
|
||||
goto fail;
|
||||
|
||||
|
@ -1779,7 +1781,7 @@ grub_netbsd_module_load (char *filename, grub_uint32_t type)
|
|||
void *src;
|
||||
grub_err_t err;
|
||||
|
||||
file = grub_gzfile_open (filename, 1);
|
||||
file = grub_file_open (filename);
|
||||
if ((!file) || (!file->size))
|
||||
goto fail;
|
||||
|
||||
|
@ -1865,7 +1867,7 @@ grub_cmd_freebsd_module_elf (grub_command_t cmd __attribute__ ((unused)),
|
|||
return 0;
|
||||
}
|
||||
|
||||
file = grub_gzfile_open (argv[0], 1);
|
||||
file = grub_file_open (argv[0]);
|
||||
if (!file)
|
||||
return grub_errno;
|
||||
if (!file->size)
|
||||
|
@ -1901,7 +1903,7 @@ grub_cmd_openbsd_ramdisk (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (!openbsd_ramdisk.max_size)
|
||||
return grub_error (GRUB_ERR_BAD_OS, "your kOpenBSD doesn't support ramdisk");
|
||||
|
||||
file = grub_gzfile_open (args[0], 1);
|
||||
file = grub_file_open (args[0]);
|
||||
if (! file)
|
||||
return grub_error (GRUB_ERR_FILE_NOT_FOUND,
|
||||
"couldn't load ramdisk");
|
||||
|
@ -1937,6 +1939,9 @@ static grub_command_t cmd_netbsd_module_elf, cmd_openbsd_ramdisk;
|
|||
|
||||
GRUB_MOD_INIT (bsd)
|
||||
{
|
||||
/* Net and OpenBSD kernels are often compressed. */
|
||||
grub_dl_load ("gzio");
|
||||
|
||||
cmd_freebsd = grub_register_extcmd ("kfreebsd", grub_cmd_freebsd,
|
||||
GRUB_COMMAND_FLAG_BOTH,
|
||||
N_("FILE"), N_("Load kernel of FreeBSD."),
|
||||
|
|
|
@ -716,7 +716,7 @@ grub_linux_boot (void)
|
|||
|
||||
/* FIXME. */
|
||||
/* asm volatile ("lidt %0" : : "m" (idt_desc)); */
|
||||
state.ebx = 0;
|
||||
state.ebp = state.edi = state.ebx = 0;
|
||||
state.esi = real_mode_target;
|
||||
state.esp = real_mode_target;
|
||||
state.eip = params->code32_start;
|
||||
|
@ -1069,6 +1069,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
goto fail;
|
||||
}
|
||||
|
||||
grub_file_filter_disable_compression ();
|
||||
file = grub_file_open (argv[0]);
|
||||
if (! file)
|
||||
goto fail;
|
||||
|
|
|
@ -69,6 +69,7 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags)
|
|||
|
||||
grub_dl_ref (my_mod);
|
||||
|
||||
grub_file_filter_disable_compression ();
|
||||
file = grub_file_open (filename);
|
||||
if (! file)
|
||||
goto fail;
|
||||
|
|
|
@ -401,6 +401,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
addr_min = GRUB_LINUX_BZIMAGE_ADDR + grub_linux16_prot_size;
|
||||
|
||||
grub_file_filter_disable_compression ();
|
||||
file = grub_file_open (argv[0]);
|
||||
if (!file)
|
||||
goto fail;
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include <grub/charset.h>
|
||||
#include <grub/term.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/gzio.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/bitmap_scale.h>
|
||||
|
||||
|
@ -535,7 +534,7 @@ grub_cmd_devprop_load (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (argc != 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
|
||||
|
||||
file = grub_gzfile_open (args[0], 1);
|
||||
file = grub_file_open (args[0]);
|
||||
if (! file)
|
||||
return grub_error (GRUB_ERR_FILE_NOT_FOUND,
|
||||
"couldn't load device-propertie dump");
|
||||
|
@ -836,6 +835,7 @@ grub_xnu_boot_resume (void)
|
|||
struct grub_relocator32_state state;
|
||||
|
||||
state.esp = grub_xnu_stack;
|
||||
state.ebp = grub_xnu_stack;
|
||||
state.eip = grub_xnu_entry_point;
|
||||
state.eax = grub_xnu_arg1;
|
||||
|
||||
|
@ -1114,6 +1114,7 @@ grub_xnu_boot (void)
|
|||
state.eip = grub_xnu_entry_point;
|
||||
state.eax = grub_xnu_arg1;
|
||||
state.esp = grub_xnu_stack;
|
||||
state.ebp = grub_xnu_stack;
|
||||
return grub_relocator32_boot (grub_xnu_relocator, state);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include <grub/cpu/macho.h>
|
||||
#include <grub/machoload.h>
|
||||
#include <grub/file.h>
|
||||
#include <grub/gzio.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/mm.h>
|
||||
|
||||
|
@ -149,7 +148,7 @@ grub_macho_open (const char *name)
|
|||
grub_file_t file;
|
||||
grub_macho_t macho;
|
||||
|
||||
file = grub_gzfile_open (name, 1);
|
||||
file = grub_file_open (name);
|
||||
if (! file)
|
||||
return 0;
|
||||
|
||||
|
|
|
@ -344,6 +344,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (initrd_loaded)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "only one initrd can be loaded.");
|
||||
|
||||
grub_file_filter_disable_compression ();
|
||||
file = grub_file_open (argv[0]);
|
||||
if (! file)
|
||||
return grub_errno;
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include <grub/dl.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/gzio.h>
|
||||
#include <grub/env.h>
|
||||
#include <grub/cpu/relocator.h>
|
||||
#include <grub/video.h>
|
||||
|
@ -225,7 +224,7 @@ grub_cmd_multiboot (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (argc == 0)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified");
|
||||
|
||||
file = grub_gzfile_open (argv[0], 1);
|
||||
file = grub_file_open (argv[0]);
|
||||
if (! file)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "couldn't open file");
|
||||
|
||||
|
@ -291,9 +290,9 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)),
|
|||
"you need to load the multiboot kernel first");
|
||||
|
||||
if (nounzip)
|
||||
file = grub_file_open (argv[0]);
|
||||
else
|
||||
file = grub_gzfile_open (argv[0], 1);
|
||||
grub_file_filter_disable_compression ();
|
||||
|
||||
file = grub_file_open (argv[0]);
|
||||
if (! file)
|
||||
return grub_errno;
|
||||
|
||||
|
|
|
@ -301,6 +301,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
goto fail;
|
||||
}
|
||||
|
||||
grub_file_filter_disable_compression ();
|
||||
file = grub_file_open (argv[0]);
|
||||
if (! file)
|
||||
goto fail;
|
||||
|
|
|
@ -305,7 +305,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
goto out;
|
||||
}
|
||||
|
||||
file = grub_gzfile_open (argv[0], 1);
|
||||
file = grub_file_open (argv[0]);
|
||||
if (!file)
|
||||
goto out;
|
||||
|
||||
|
@ -393,6 +393,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
goto fail;
|
||||
}
|
||||
|
||||
grub_file_filter_disable_compression ();
|
||||
file = grub_file_open (argv[0]);
|
||||
if (! file)
|
||||
goto fail;
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include <grub/machoload.h>
|
||||
#include <grub/macho.h>
|
||||
#include <grub/cpu/macho.h>
|
||||
#include <grub/gzio.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/extcmd.h>
|
||||
|
@ -661,7 +660,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile)
|
|||
macho = 0;
|
||||
|
||||
if (infoplistname)
|
||||
infoplist = grub_gzfile_open (infoplistname, 1);
|
||||
infoplist = grub_file_open (infoplistname);
|
||||
else
|
||||
infoplist = 0;
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
|
@ -756,7 +755,7 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (! grub_xnu_heap_size)
|
||||
return grub_error (GRUB_ERR_BAD_OS, "no xnu kernel loaded");
|
||||
|
||||
file = grub_gzfile_open (args[0], 1);
|
||||
file = grub_file_open (args[0]);
|
||||
if (! file)
|
||||
return grub_error (GRUB_ERR_FILE_NOT_FOUND,
|
||||
"couldn't load driver package");
|
||||
|
@ -869,7 +868,7 @@ grub_cmd_xnu_ramdisk (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (! grub_xnu_heap_size)
|
||||
return grub_error (GRUB_ERR_BAD_OS, "no xnu kernel loaded");
|
||||
|
||||
file = grub_gzfile_open (args[0], 1);
|
||||
file = grub_file_open (args[0]);
|
||||
if (! file)
|
||||
return grub_error (GRUB_ERR_FILE_NOT_FOUND,
|
||||
"couldn't load ramdisk");
|
||||
|
@ -909,7 +908,7 @@ grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq,
|
|||
if (binname)
|
||||
*binname = 0;
|
||||
|
||||
file = grub_gzfile_open (plistname, 1);
|
||||
file = grub_file_open (plistname);
|
||||
if (! file)
|
||||
{
|
||||
grub_file_close (file);
|
||||
|
@ -1166,7 +1165,7 @@ grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired,
|
|||
grub_strcpy (binname + grub_strlen (binname), "/");
|
||||
grub_strcpy (binname + grub_strlen (binname), binsuffix);
|
||||
grub_dprintf ("xnu", "%s:%s\n", plistname, binname);
|
||||
binfile = grub_gzfile_open (binname, 1);
|
||||
binfile = grub_file_open (binname);
|
||||
if (! binfile)
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
|
||||
|
@ -1204,7 +1203,7 @@ grub_cmd_xnu_kext (grub_command_t cmd __attribute__ ((unused)),
|
|||
/* User explicitly specified plist and binary. */
|
||||
if (grub_strcmp (args[1], "-") != 0)
|
||||
{
|
||||
binfile = grub_gzfile_open (args[1], 1);
|
||||
binfile = grub_file_open (args[1]);
|
||||
if (! binfile)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_OS, "can't open file");
|
||||
|
@ -1364,15 +1363,15 @@ static const struct grub_arg_option xnu_splash_cmd_options[] =
|
|||
};
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_xnu_splash (grub_extcmd_t cmd,
|
||||
grub_cmd_xnu_splash (grub_extcmd_context_t ctxt,
|
||||
int argc, char *args[])
|
||||
{
|
||||
grub_err_t err;
|
||||
if (argc != 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
|
||||
|
||||
if (cmd->state[XNU_SPLASH_CMD_ARGINDEX_MODE].set &&
|
||||
grub_strcmp (cmd->state[XNU_SPLASH_CMD_ARGINDEX_MODE].arg,
|
||||
if (ctxt->state[XNU_SPLASH_CMD_ARGINDEX_MODE].set &&
|
||||
grub_strcmp (ctxt->state[XNU_SPLASH_CMD_ARGINDEX_MODE].arg,
|
||||
"stretch") == 0)
|
||||
grub_xnu_bitmap_mode = GRUB_XNU_BITMAP_STRETCH;
|
||||
else
|
||||
|
|
|
@ -52,6 +52,7 @@ grub_xnu_resume (char *imagename)
|
|||
grub_addr_t target_image;
|
||||
grub_err_t err;
|
||||
|
||||
grub_file_filter_disable_compression ();
|
||||
file = grub_file_open (imagename);
|
||||
if (! file)
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue