/* minicmd.c - commands for the rescue mode */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003,2005,2006,2007,2009 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/>.
*/
GRUB_MOD_LICENSE ("GPLv3+");
/* cat FILE */
static grub_err_t
{
if (argc < 1)
if (! file)
return grub_errno;
{
int i;
for (i = 0; i < size; i++)
{
unsigned char c = buf[i];
grub_printf ("%c", c);
else
{
grub_printf ("<%x>", (int) c);
}
}
}
grub_xputs ("\n");
grub_refresh ();
return 0;
}
/* help */
static grub_err_t
{
for (p = grub_command_list; p; p = p->next)
p->prio & GRUB_PRIO_LIST_PRIO_MASK,
p->description);
return 0;
}
/* dump ADDRESS [SIZE] */
static grub_err_t
{
if (argc == 0)
if (grub_errno)
return grub_errno;
if (argc > 1)
while (size--)
{
addr++;
}
return 0;
}
/* rmmod MODULE */
static grub_err_t
{
if (argc == 0)
if (! mod)
if (grub_dl_unref (mod) <= 0)
return 0;
}
/* lsmod */
static grub_err_t
{
{
{
grub_xputs (",");
}
grub_xputs ("\n");
}
return 0;
}
/* exit */
{
/* Clean up after GRUB before returning control to firmware */
grub_exit ();
/* Not reached. */
}
{
cmd_cat =
cmd_help =
0, N_("Show this message."));
cmd_dump =
0, N_("Show loaded modules."));
cmd_exit =
0, N_("Exit from GRUB."));
}
{
}