/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
#include <string.h>
#include <signal.h>
#include <unistd.h>
#include <grub/partition.h>
#include "progname.h"
#define ENABLE_RELOCATABLE 0
/* Used for going back to the main function. */
/* Store the prefix specified by an argument. */
int grub_no_autoload;
void
grub_reboot (void)
{
}
void
grub_machine_init (void)
{
}
void
{
}
void
grub_machine_fini (void)
{
}
{
{ 0, 0, 0, 0 }
};
static int
{
if (status)
_("Try `%s --help' for more information.\n"), program_name);
else
printf (
_("Usage: %s [OPTION]...\n"
"\n"
"GRUB emulator.\n"
"\n"
" -r, --root-device=DEV use DEV as the root device [default=host]\n"
" -m, --device-map=FILE use FILE as the device map [default=%s]\n"
" -d, --directory=DIR use GRUB files in the directory DIR [default=%s]\n"
" -v, --verbose print verbose messages\n"
" -H, --hold[=SECONDS] wait until a debugger will attach\n"
" -h, --help display this message and exit\n"
" -V, --version print version information and exit\n"
"\n"
return status;
}
void grub_hostfs_init (void);
void grub_hostfs_fini (void);
void grub_host_init (void);
void grub_host_fini (void);
void grub_emu_init (void);
int
{
volatile int hold = 0;
int opt;
set_program_name (argv[0]);
switch (opt)
{
case 'r':
break;
case 'd':
break;
case 'm':
break;
case 'v':
verbosity++;
break;
case 'H':
break;
case 'h':
return usage (0);
case 'V':
return 0;
default:
return usage (1);
}
{
return usage (1);
}
/* Wait until the ARGS.HOLD variable is cleared by an attached debugger. */
printf (_("Run \"gdb %s %d\", and set ARGS.HOLD to zero.\n"),
program_name, (int) getpid ());
while (hold)
{
if (hold > 0)
hold--;
sleep (1);
}
grub_emu_init ();
grub_host_init ();
/* XXX: This is a bit unportable. */
grub_init_all ();
grub_hostfs_init ();
/* Make sure that there is a root device. */
if (! root_dev)
/* Start GRUB! */
grub_main ();
grub_fini_all ();
grub_hostfs_fini ();
grub_host_fini ();
return 0;
}
#ifdef __MINGW32__
void
{
}
#else
void
{
}
#endif