2 * Copyright (C) 2001-2003 Hewlett-Packard Co.
3 * Contributed by Stephane Eranian <eranian@hpl.hp.com>
5 * This file is part of the ELILO, the EFI Linux boot loader.
7 * ELILO is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * ELILO is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with ELILO; see the file COPYING. If not, write to the Free
19 * Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 * Please check out the elilo.txt for complete documentation on how
23 * to use this program.
31 #ifdef CONFIG_CHOOSER_SIMPLE
32 #include "choosers/simple.h"
35 #ifdef CONFIG_CHOOSER_TEXTMENU
36 #include "choosers/textmenu.h"
39 static chooser_t *choosers_tab[]={
40 #ifdef CONFIG_CHOOSER_SIMPLE
43 #ifdef CONFIG_CHOOSER_TEXTMENU
49 * The intent of this module is to provide a mechanism by which alternate
50 * choosers can be installed. Developers can write new choosers and
51 * add them to the list. They will be probe and the best match
52 * will be started first. It should be possible to switch to another
53 * chooser using a key combination. There is a default simple text-based
54 * chooser that must always be present.
56 * Currently you can specify a chooser via "-c name" when you invoke elilo,
57 * or via "chooser=name" in the config file. If the specified chooser
58 * probes ok it will be selected, otherwise the first one that probes ok
61 * XXX: at this time, not all chooser functionalities are implemented.
64 chooser_func_t *kernel_chooser;
67 init_chooser(EFI_HANDLE dev)
70 CHAR16 *chooser_name = L"none";
72 kernel_chooser = NULL;
74 for (p=choosers_tab; *p; p++) {
76 VERB_PRT(4, Print(L"trying chooser %s\n", (*p)->chooser_name));
78 if ((*p)->chooser_probe(dev) == 0) {
80 * if that's the one we asked for, then go for it
82 if (!StrCmp(elilo_opt.chooser, (*p)->chooser_name)) {
83 kernel_chooser = (*p)->chooser_func;
84 chooser_name = (*p)->chooser_name;
88 if (kernel_chooser == NULL) {
89 kernel_chooser = (*p)->chooser_func;
90 chooser_name = (*p)->chooser_name;
96 VERB_PRT(2, Print(L"selected chooser %s\n", chooser_name));
100 ERR_PRT((L"No chooser selected. Impossible to proceed"));
105 exist_chooser(CHAR16 *name)
109 for (p=choosers_tab; *p; p++) {
110 if (!StrCmp(name, (*p)->chooser_name)) return 0;