1 /* chainloader_normal.c - boot another boot loader */
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2004,2007 Free Software Foundation, Inc.
6 * GRUB is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * GRUB is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
20 #include <grub/machine/chainloader.h>
22 #include <grub/normal.h>
25 static const struct grub_arg_option options
[] =
27 {"force", 'f', 0, "skip bootsector magic number test", 0, 0},
32 chainloader_command (struct grub_arg_list
*state
,
33 int argc
, char **args
)
35 grub_chainloader_flags_t flags
= state
[0].set
? GRUB_CHAINLOADER_FORCE
: 0;
38 grub_error (GRUB_ERR_BAD_ARGUMENT
, "no file specified");
40 grub_chainloader_cmd (args
[0], flags
);
44 GRUB_MOD_INIT(chainloader_normal
)
46 (void) mod
; /* To stop warning. */
47 grub_register_command ("chainloader", chainloader_command
,
48 GRUB_COMMAND_FLAG_BOTH
,
49 "chainloader [-f] FILE",
50 "Prepare to boot another boot loader.", options
);
53 GRUB_MOD_FINI(chainloader_normal
)
55 grub_unregister_command ("chainloader");