* grub-core/loader/xnu.c (grub_cmd_xnu_kext): Abort if no kernel

is loaded
	(grub_cmd_xnu_kextdir): Likewise.
	(grub_cmd_xnu_splash): Likewise.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-12-27 07:18:24 +01:00
parent c76386454e
commit 693db2df56
2 changed files with 17 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2010-12-27 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/loader/xnu.c (grub_cmd_xnu_kext): Abort if no kernel
is loaded
(grub_cmd_xnu_kextdir): Likewise.
(grub_cmd_xnu_splash): Likewise.
2010-12-27 Vladimir Serbinenko <phcoder@gmail.com>
Avoid using Reed-Solomon with 0 redundancy.

View file

@ -1198,6 +1198,10 @@ grub_cmd_xnu_kext (grub_command_t cmd __attribute__ ((unused)),
int argc, char *args[])
{
grub_file_t binfile = 0;
if (! grub_xnu_heap_size)
return grub_error (GRUB_ERR_BAD_OS, "no xnu kernel loaded");
if (argc == 2)
{
/* User explicitly specified plist and binary. */
@ -1229,6 +1233,9 @@ grub_cmd_xnu_kextdir (grub_command_t cmd __attribute__ ((unused)),
if (argc != 1 && argc != 2)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "directory name required");
if (! grub_xnu_heap_size)
return grub_error (GRUB_ERR_BAD_OS, "no xnu kernel loaded");
if (argc == 1)
return grub_xnu_scan_dir_for_kexts (args[0],
"console,root,local-root,network-root",
@ -1370,6 +1377,9 @@ grub_cmd_xnu_splash (grub_extcmd_context_t ctxt,
if (argc != 1)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
if (! grub_xnu_heap_size)
return grub_error (GRUB_ERR_BAD_OS, "no xnu kernel loaded");
if (ctxt->state[XNU_SPLASH_CMD_ARGINDEX_MODE].set &&
grub_strcmp (ctxt->state[XNU_SPLASH_CMD_ARGINDEX_MODE].arg,
"stretch") == 0)