2005-11-13 Marco Gerards <mgerards@xs4all.nl>
* geninit.sh: New file. * geninitheader.sh: Likewise. * commands/boot.c (grub_boot_init, grub_boot_fini): Removed. * commands/cat.c (grub_cat_init, grub_cat_fini): Likewise. * commands/cmp.c (grub_cmp_init, grub_cmp_fini): Likewise. * commands/configfile.c (grub_configfile_init) (grub_configfile_fini): Likewise. * commands/default.c (grub_default_init, grub_default_fini): Likewise. * commands/help.c (grub_help_init, grub_help_fini): Likewise. * commands/ls.c (grub_ls_init, grub_ls_fini): Likewise. * commands/search.c (grub_search_init, grub_search_fini): Likewise. * commands/terminal.c (grub_terminal_init, grub_terminal_fini): Likewise. * commands/test.c (grub_test_init, grub_test_fini): Likewise. * commands/timeout.c (grub_timeout_init, grub_timeout_fini): Likewise. * commands/i386/pc/halt.c (grub_halt_init, grub_halt_fini): Likewise. * commands/iee1275/halt.c (grub_halt_init, grub_halt_fini): Likewise. * commands/i386/pc/reboot.c (grub_reboot_init, grub_reboot_fini): Likewise. * commands/iee1275/reboot.c (grub_reboot_init, grub_reboot_fini): Likewise. * disk/loopback.c (grub_loop_init, grub_loop_fini): Likewise. * fs/affs.c (grub_affs_init, grub_affs_fini): Likewise. * fs/ext2.c (grub_ext2_init, grub_ext2_fini): Likewise. * fs/fat.c (grub_fat_init, grub_fat_fini): Likewise. * fs/hfs.c (grub_hfs_init, grub_hfs_fini): Likewise. * fs/iso9660.c (grub_iso9660_init, grub_iso9660_fini): Likewise. * fs/jfs.c (grub_jfs_init, grub_jfs_fini): Likewise. * fs/minix.c (grub_minix_init, grub_minix_fini): Likewise. * fs/sfs.c (grub_sfs_init, grub_sfs_fini): Likewise. * fs/ufs.c (grub_ufs_init, grub_ufs_fini): Likewise. * fs/xfs.c (grub_xfs_init, grub_xfs_fini): Likewise. * normal/main.c (grub_normal_init, grub_normal_fini): Likewise. * partmap/amiga.c (grub_amiga_partition_map_init) (grub_amiga_partition_map_fini): Likewise. * partmap/apple.c (grub_apple_partition_map_init) (grub_apple_partition_map_fini): Likewise. * partmap/pc.c (grub_pc_partition_map_init) (grub_pc_partition_map_fini): Likewise. * partmap/sun.c (grub_sun_partition_map_init, grub_sun_partition_map_fini): Likewise. * term/terminfo.c (grub_terminal_init, grub_terminal_fini): Likewise. * util/grub-emu.c: Include <grub_modules_init.h>. (main): Don't initialize and de-initialize any modules directly, use `grub_init_all' and `grub_fini_all' instead. * term/i386/pc/vesafb.c (grub_vesafb_init): Renamed to `grub_vesafb_mod_init'. (grub_vesafb_fini): Renamed to `grub_vesafb_mod_fini'. Updated all users. * term/i386/pc/vga.c (grub_vga_init): Renamed to `grub_vga_mod_init'. Updated all users. (grub_vga_fini): Renamed to `grub_vga_mod_fini'. * conf/i386-pc.rmk (grub_emu_SOURCES): Add `grub_emu_init.c'. (grub_modules_init.lst, grub_modules_init.h, grub_emu_init.c): New rules. * include/grub/dl.h (GRUB_MOD_INIT): Add argument `name'. Generate a function to initialize the module in utilities. Updated all callers. (GRUB_MOD_FINI): Add argument `name'. Generate a function to initialize the module in utilities. Updated all callers.
This commit is contained in:
parent
9046bcf0e6
commit
6d099807fa
57 changed files with 414 additions and 663 deletions
|
@ -38,29 +38,14 @@ grub_cmd_boot (struct grub_arg_list *state __attribute__ ((unused)),
|
|||
|
||||
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void
|
||||
grub_boot_init (void)
|
||||
{
|
||||
grub_register_command ("boot", grub_cmd_boot, GRUB_COMMAND_FLAG_BOTH,
|
||||
"boot", "Boot an operating system.", 0);
|
||||
}
|
||||
|
||||
void
|
||||
grub_boot_fini (void)
|
||||
{
|
||||
grub_unregister_command ("boot");
|
||||
}
|
||||
#else /* ! GRUB_UTIL */
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(boot)
|
||||
{
|
||||
(void) mod; /* To stop warning. */
|
||||
grub_register_command ("boot", grub_cmd_boot, GRUB_COMMAND_FLAG_BOTH,
|
||||
"boot", "Boot an operating system.", 0);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(boot)
|
||||
{
|
||||
grub_unregister_command ("boot");
|
||||
}
|
||||
#endif /* ! GRUB_UTIL */
|
||||
|
|
|
@ -70,29 +70,14 @@ grub_cmd_cat (struct grub_arg_list *state __attribute__ ((unused)),
|
|||
}
|
||||
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void
|
||||
grub_cat_init (void)
|
||||
{
|
||||
grub_register_command ("cat", grub_cmd_cat, GRUB_COMMAND_FLAG_BOTH,
|
||||
"cat FILE", "Show the contents of a file.", 0);
|
||||
}
|
||||
|
||||
void
|
||||
grub_cat_fini (void)
|
||||
{
|
||||
grub_unregister_command ("cat");
|
||||
}
|
||||
#else /* ! GRUB_UTIL */
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(cat)
|
||||
{
|
||||
(void) mod; /* To stop warning. */
|
||||
grub_register_command ("cat", grub_cmd_cat, GRUB_COMMAND_FLAG_BOTH,
|
||||
"cat FILE", "Show the contents of a file.", 0);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(cat)
|
||||
{
|
||||
grub_unregister_command ("cat");
|
||||
}
|
||||
#endif /* ! GRUB_UTIL */
|
||||
|
|
|
@ -102,29 +102,14 @@ cleanup:
|
|||
}
|
||||
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void
|
||||
grub_cmp_init (void)
|
||||
{
|
||||
grub_register_command ("cmp", grub_cmd_cmp, GRUB_COMMAND_FLAG_BOTH,
|
||||
"cmp FILE1 FILE2", "Compare two files.", 0);
|
||||
}
|
||||
|
||||
void
|
||||
grub_cmp_fini (void)
|
||||
{
|
||||
grub_unregister_command ("cmp");
|
||||
}
|
||||
#else /* ! GRUB_UTIL */
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(cmp)
|
||||
{
|
||||
(void) mod; /* To stop warning. */
|
||||
grub_register_command ("cmp", grub_cmd_cmp, GRUB_COMMAND_FLAG_BOTH,
|
||||
"cmp FILE1 FILE2", "Compare two files.", 0);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(cmp)
|
||||
{
|
||||
grub_unregister_command ("cmp");
|
||||
}
|
||||
#endif /* ! GRUB_UTIL */
|
||||
|
|
|
@ -39,22 +39,7 @@ grub_cmd_configfile (struct grub_arg_list *state __attribute__ ((unused)),
|
|||
}
|
||||
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void
|
||||
grub_configfile_init (void)
|
||||
{
|
||||
grub_register_command ("configfile", grub_cmd_configfile,
|
||||
GRUB_COMMAND_FLAG_BOTH, "configfile FILE",
|
||||
"Load another config file.", 0);
|
||||
}
|
||||
|
||||
void
|
||||
grub_configfile_fini (void)
|
||||
{
|
||||
grub_unregister_command ("configfile");
|
||||
}
|
||||
#else /* ! GRUB_UTIL */
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(configfile)
|
||||
{
|
||||
(void) mod; /* To stop warning. */
|
||||
grub_register_command ("configfile", grub_cmd_configfile,
|
||||
|
@ -62,8 +47,7 @@ GRUB_MOD_INIT
|
|||
"Load another config file.", 0);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(configfile)
|
||||
{
|
||||
grub_unregister_command ("configfile");
|
||||
}
|
||||
#endif /* ! GRUB_UTIL */
|
||||
|
|
|
@ -44,29 +44,14 @@ grub_cmd_default (struct grub_arg_list *state __attribute__ ((unused)),
|
|||
|
||||
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void
|
||||
grub_default_init (void)
|
||||
{
|
||||
grub_register_command ("default", grub_cmd_default, GRUB_COMMAND_FLAG_MENU,
|
||||
"default ENTRY", "Set the default entry", 0);
|
||||
}
|
||||
|
||||
void
|
||||
grub_default_fini (void)
|
||||
{
|
||||
grub_unregister_command ("default");
|
||||
}
|
||||
#else /* ! GRUB_UTIL */
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(default)
|
||||
{
|
||||
(void)mod; /* To stop warning. */
|
||||
grub_register_command ("default", grub_cmd_default, GRUB_COMMAND_FLAG_MENU,
|
||||
"default ENTRY", "Set the default entry", 0);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(default)
|
||||
{
|
||||
grub_unregister_command ("default");
|
||||
}
|
||||
#endif /* ! GRUB_UTIL */
|
||||
|
|
|
@ -94,29 +94,14 @@ grub_cmd_help (struct grub_arg_list *state __attribute__ ((unused)), int argc,
|
|||
|
||||
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void
|
||||
grub_help_init (void)
|
||||
{
|
||||
grub_register_command ("help", grub_cmd_help, GRUB_COMMAND_FLAG_CMDLINE,
|
||||
"help [PATTERN ...]", "Show a help message.", 0);
|
||||
}
|
||||
|
||||
void
|
||||
grub_help_fini (void)
|
||||
{
|
||||
grub_unregister_command ("help");
|
||||
}
|
||||
#else /* ! GRUB_UTIL */
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(help)
|
||||
{
|
||||
(void)mod; /* To stop warning. */
|
||||
grub_register_command ("help", grub_cmd_help, GRUB_COMMAND_FLAG_CMDLINE,
|
||||
"help [PATTERN ...]", "Show a help message.", 0);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(help)
|
||||
{
|
||||
grub_unregister_command ("help");
|
||||
}
|
||||
#endif /* ! GRUB_UTIL */
|
||||
|
|
|
@ -44,22 +44,7 @@ grub_cmd_halt (struct grub_arg_list *state,
|
|||
|
||||
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void
|
||||
grub_halt_init (void)
|
||||
{
|
||||
grub_register_command ("halt", grub_cmd_halt, GRUB_COMMAND_FLAG_BOTH,
|
||||
"halt [OPTIONS...]",
|
||||
"Halt the system, if possible using APM", options);
|
||||
}
|
||||
|
||||
void
|
||||
grub_halt_fini (void)
|
||||
{
|
||||
grub_unregister_command ("halt");
|
||||
}
|
||||
#else /* ! GRUB_UTIL */
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(halt)
|
||||
{
|
||||
(void)mod; /* To stop warning. */
|
||||
grub_register_command ("halt", grub_cmd_halt, GRUB_COMMAND_FLAG_BOTH,
|
||||
|
@ -67,8 +52,7 @@ GRUB_MOD_INIT
|
|||
"Halt the system, if possible using APM", options);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(halt)
|
||||
{
|
||||
grub_unregister_command ("halt");
|
||||
}
|
||||
#endif /* ! GRUB_UTIL */
|
||||
|
|
|
@ -35,29 +35,14 @@ grub_cmd_reboot (struct grub_arg_list *state __attribute__ ((unused)),
|
|||
|
||||
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void
|
||||
grub_reboot_init (void)
|
||||
{
|
||||
grub_register_command ("reboot", grub_cmd_reboot, GRUB_COMMAND_FLAG_BOTH,
|
||||
"reboot", "Reboot the computer.", 0);
|
||||
}
|
||||
|
||||
void
|
||||
grub_reboot_fini (void)
|
||||
{
|
||||
grub_unregister_command ("reboot");
|
||||
}
|
||||
#else /* ! GRUB_UTIL */
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(reboot)
|
||||
{
|
||||
(void)mod; /* To stop warning. */
|
||||
grub_register_command ("reboot", grub_cmd_reboot, GRUB_COMMAND_FLAG_BOTH,
|
||||
"reboot", "Reboot the computer", 0);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(reboot)
|
||||
{
|
||||
grub_unregister_command ("reboot");
|
||||
}
|
||||
#endif /* ! GRUB_UTIL */
|
||||
|
|
|
@ -146,7 +146,7 @@ grub_cmd_vbeinfo (struct grub_arg_list *state __attribute__ ((unused)),
|
|||
return 0;
|
||||
}
|
||||
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(vbeinfo)
|
||||
{
|
||||
(void) mod; /* To stop warning. */
|
||||
grub_register_command ("vbeinfo",
|
||||
|
@ -157,7 +157,7 @@ GRUB_MOD_INIT
|
|||
0);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(vbeinfo)
|
||||
{
|
||||
grub_unregister_command ("vbeinfo");
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ grub_cmd_vbetest (struct grub_arg_list *state __attribute__ ((unused)),
|
|||
return grub_errno;
|
||||
}
|
||||
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(vbetest)
|
||||
{
|
||||
(void) mod; /* To stop warning. */
|
||||
grub_register_command ("vbetest",
|
||||
|
@ -174,7 +174,7 @@ GRUB_MOD_INIT
|
|||
0);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(vbetest)
|
||||
{
|
||||
grub_unregister_command ("vbetest");
|
||||
}
|
||||
|
|
|
@ -33,22 +33,7 @@ grub_cmd_halt (struct grub_arg_list *state __attribute__ ((unused)),
|
|||
}
|
||||
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void
|
||||
grub_halt_init (void)
|
||||
{
|
||||
grub_register_command ("halt", grub_cmd_halt, GRUB_COMMAND_FLAG_BOTH,
|
||||
"halt", "halts the computer. This command does not"
|
||||
" work on all firmware.", 0);
|
||||
}
|
||||
|
||||
void
|
||||
grub_halt_fini (void)
|
||||
{
|
||||
grub_unregister_command ("halt");
|
||||
}
|
||||
#else /* ! GRUB_UTIL */
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(ieee1275_halt)
|
||||
{
|
||||
(void)mod; /* To stop warning. */
|
||||
grub_register_command ("halt", grub_cmd_halt, GRUB_COMMAND_FLAG_BOTH,
|
||||
|
@ -56,8 +41,7 @@ GRUB_MOD_INIT
|
|||
" work on all firmware.", 0);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(ieee1275_halt)
|
||||
{
|
||||
grub_unregister_command ("halt");
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -33,29 +33,14 @@ grub_cmd_reboot (struct grub_arg_list *state __attribute__ ((unused)),
|
|||
}
|
||||
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void
|
||||
grub_reboot_init (void)
|
||||
{
|
||||
grub_register_command ("reboot", grub_cmd_reboot, GRUB_COMMAND_FLAG_BOTH,
|
||||
"reboot", "Reboot the computer", 0);
|
||||
}
|
||||
|
||||
void
|
||||
grub_reboot_fini (void)
|
||||
{
|
||||
grub_unregister_command ("reboot");
|
||||
}
|
||||
#else /* ! GRUB_UTIL */
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(ieee1275_reboot)
|
||||
{
|
||||
(void)mod; /* To stop warning. */
|
||||
grub_register_command ("reboot", grub_cmd_reboot, GRUB_COMMAND_FLAG_BOTH,
|
||||
"reboot", "Reboot the computer", 0);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(ieee1275_reboot)
|
||||
{
|
||||
grub_unregister_command ("reboot");
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -36,14 +36,14 @@ grub_cmd_suspend (struct grub_arg_list *state __attribute__ ((unused)),
|
|||
}
|
||||
|
||||
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(ieee1275_suspend)
|
||||
{
|
||||
(void)mod; /* To stop warning. */
|
||||
grub_register_command ("suspend", grub_cmd_suspend, GRUB_COMMAND_FLAG_BOTH,
|
||||
"suspend", "Return to Open Firmware prompt", 0);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(ieee1275_suspend)
|
||||
{
|
||||
grub_unregister_command ("suspend");
|
||||
}
|
||||
|
|
|
@ -228,22 +228,7 @@ grub_cmd_ls (struct grub_arg_list *state, int argc, char **args)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void
|
||||
grub_ls_init (void)
|
||||
{
|
||||
grub_register_command ("ls", grub_cmd_ls, GRUB_COMMAND_FLAG_BOTH,
|
||||
"ls [-l|-h|-a] [FILE]",
|
||||
"List devices and files.", options);
|
||||
}
|
||||
|
||||
void
|
||||
grub_ls_fini (void)
|
||||
{
|
||||
grub_unregister_command ("ls");
|
||||
}
|
||||
#else /* ! GRUB_UTIL */
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(ls)
|
||||
{
|
||||
(void)mod; /* To stop warning. */
|
||||
grub_register_command ("ls", grub_cmd_ls, GRUB_COMMAND_FLAG_BOTH,
|
||||
|
@ -251,8 +236,7 @@ GRUB_MOD_INIT
|
|||
"List devices and files.", options);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(ls)
|
||||
{
|
||||
grub_unregister_command ("ls");
|
||||
}
|
||||
#endif /* ! GRUB_UTIL */
|
||||
|
|
|
@ -148,26 +148,7 @@ grub_cmd_search (struct grub_arg_list *state, int argc, char **args)
|
|||
return grub_errno;
|
||||
}
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void
|
||||
grub_search_init (void)
|
||||
{
|
||||
grub_register_command ("search", grub_cmd_search, GRUB_COMMAND_FLAG_BOTH,
|
||||
"search [-f|-l|-s] NAME",
|
||||
"Search devices by a file or a filesystem label."
|
||||
" If --set is specified, the first device found is"
|
||||
" set to a variable. If no variable name is"
|
||||
" specified, \"root\" is used.",
|
||||
options);
|
||||
}
|
||||
|
||||
void
|
||||
grub_search_fini (void)
|
||||
{
|
||||
grub_unregister_command ("search");
|
||||
}
|
||||
#else /* ! GRUB_UTIL */
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(search)
|
||||
{
|
||||
(void) mod; /* To stop warning. */
|
||||
grub_register_command ("search", grub_cmd_search, GRUB_COMMAND_FLAG_BOTH,
|
||||
|
@ -179,8 +160,7 @@ GRUB_MOD_INIT
|
|||
options);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(search)
|
||||
{
|
||||
grub_unregister_command ("search");
|
||||
}
|
||||
#endif /* ! GRUB_UTIL */
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* terminal.c - command to show and select a terminal */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -71,29 +71,14 @@ grub_cmd_terminal (struct grub_arg_list *state __attribute__ ((unused)),
|
|||
}
|
||||
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void
|
||||
grub_terminal_init (void)
|
||||
{
|
||||
grub_register_command ("terminal", grub_cmd_terminal, GRUB_COMMAND_FLAG_BOTH,
|
||||
"terminal [TERM...]", "Select a terminal.", 0);
|
||||
}
|
||||
|
||||
void
|
||||
grub_terminal_fini (void)
|
||||
{
|
||||
grub_unregister_command ("terminal");
|
||||
}
|
||||
#else /* ! GRUB_UTIL */
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(terminal)
|
||||
{
|
||||
(void)mod; /* To stop warning. */
|
||||
grub_register_command ("terminal", grub_cmd_terminal, GRUB_COMMAND_FLAG_BOTH,
|
||||
"terminal [TERM...]", "Select a terminal.", 0);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(terminal)
|
||||
{
|
||||
grub_unregister_command ("terminal");
|
||||
}
|
||||
#endif /* ! GRUB_UTIL */
|
||||
|
|
|
@ -55,24 +55,7 @@ grub_cmd_test (struct grub_arg_list *state __attribute__ ((unused)), int argc,
|
|||
|
||||
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void
|
||||
grub_test_init (void)
|
||||
{
|
||||
grub_register_command ("[", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE,
|
||||
"[ EXPRESSION ]", "Evaluate an expression", 0);
|
||||
grub_register_command ("test", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE,
|
||||
"test EXPRESSION", "Evaluate an expression", 0);
|
||||
}
|
||||
|
||||
void
|
||||
grub_test_fini (void)
|
||||
{
|
||||
grub_unregister_command ("[");
|
||||
grub_unregister_command ("test");
|
||||
}
|
||||
#else /* ! GRUB_UTIL */
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(test)
|
||||
{
|
||||
(void)mod; /* To stop warning. */
|
||||
grub_register_command ("[", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE,
|
||||
|
@ -81,9 +64,8 @@ GRUB_MOD_INIT
|
|||
"test EXPRESSION", "Evaluate an expression", 0);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(test)
|
||||
{
|
||||
grub_unregister_command ("[");
|
||||
grub_unregister_command ("test");
|
||||
}
|
||||
#endif /* ! GRUB_UTIL */
|
||||
|
|
|
@ -42,29 +42,14 @@ grub_cmd_timeout (struct grub_arg_list *state __attribute__ ((unused)),
|
|||
|
||||
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
void
|
||||
grub_timeout_init (void)
|
||||
{
|
||||
grub_register_command ("timeout", grub_cmd_timeout, GRUB_COMMAND_FLAG_MENU,
|
||||
"timeout SECS", "Set the timeout", 0);
|
||||
}
|
||||
|
||||
void
|
||||
grub_timeout_fini (void)
|
||||
{
|
||||
grub_unregister_command ("timeout");
|
||||
}
|
||||
#else /* ! GRUB_UTIL */
|
||||
GRUB_MOD_INIT
|
||||
GRUB_MOD_INIT(timeout)
|
||||
{
|
||||
(void)mod; /* To stop warning. */
|
||||
grub_register_command ("timeout", grub_cmd_timeout, GRUB_COMMAND_FLAG_MENU,
|
||||
"timeout SECS", "Set the timeout", 0);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI
|
||||
GRUB_MOD_FINI(timeout)
|
||||
{
|
||||
grub_unregister_command ("timeout");
|
||||
}
|
||||
#endif /* ! GRUB_UTIL */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue