make the linux-ppc packags be in synch with other platforms
[tangerine.git] / arch / common / boot / grub2 / loader / i386 / pc / chainloader_normal.c
blob106cd56300ecb04b0e9b1a930036ec17c182aa94
1 /* chainloader_normal.c - boot another boot loader */
2 /*
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>
21 #include <grub/err.h>
22 #include <grub/normal.h>
23 #include <grub/dl.h>
25 static const struct grub_arg_option options[] =
27 {"force", 'f', 0, "skip bootsector magic number test", 0, 0},
28 {0, 0, 0, 0, 0, 0}
31 static grub_err_t
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;
37 if (argc == 0)
38 grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified");
39 else
40 grub_chainloader_cmd (args[0], flags);
41 return grub_errno;
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");