/* corecmd.c - critical commands which are registered in kernel */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 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/>.
*/
/* set ENVVAR=VALUE */
static grub_err_t
{
char *var;
char *val;
{
return 0;
}
if (argc < 1)
{
return 0;
}
if (! val)
val[0] = 0;
val[0] = '=';
return 0;
}
static grub_err_t
{
if (argc < 1)
return grub_error (GRUB_ERR_BAD_ARGUMENT,
"no environment variable specified");
grub_env_unset (argv[0]);
return 0;
}
/* insmod MODULE */
static grub_err_t
{
char *p;
if (argc == 0)
if (! p)
else
if (mod)
grub_dl_ref (mod);
return 0;
}
static int
{
return 0;
}
static int
const struct grub_dirhook_info *info)
{
return 0;
}
/* ls [ARG] */
static grub_err_t
{
if (argc < 1)
{
grub_xputs ("\n");
grub_refresh ();
}
else
{
char *device_name;
char *path;
if (! dev)
goto fail;
if (! path)
else
path++;
if (! path && ! device_name)
{
goto fail;
}
if (! path)
{
if (grub_errno == GRUB_ERR_UNKNOWN_FS)
grub_printf ("(%s): Filesystem is %s.\n",
}
else if (fs)
{
grub_xputs ("\n");
grub_refresh ();
}
fail:
if (dev)
}
return grub_errno;
}
void
grub_register_core_commands (void)
{
N_("[ENVVAR=VALUE]"),
N_("Set an environment variable."));
if (cmd)
N_("ENVVAR"),
N_("Remove an environment variable."));
}