iPXE
config.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License as
4  * published by the Free Software Foundation; either version 2 of the
5  * License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful, but
8  * WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10  * General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  *
17  * You can also choose to distribute this program under the terms of
18  * the Unmodified Binary Distribution Licence (as given in the file
19  * COPYING.UBDL), provided that you have satisfied its requirements.
20  */
21 
22 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
23 
24 #include <config/general.h>
25 #include <config/console.h>
26 #include <config/sideband.h>
27 #include <config/settings.h>
28 
29 /** @file
30  *
31  * Configuration options
32  *
33  * This file contains macros that pull various objects into the link
34  * based on definitions in configuration header files. Ideally it
35  * should be the only place in iPXE where one might need to use #ifdef
36  * for compile-time options.
37  *
38  * In the fairly common case where an object should only be considered
39  * for inclusion if the subsystem it depends on is present, its
40  * configuration macros should be placed in a file named
41  * <tt>config_<i>subsystem</i>.c</tt>, where @e subsystem is the
42  * object basename of the main source file for that subsystem. The
43  * build system will pull in that file if @c subsystem.c is included
44  * in the final iPXE executable built.
45  */
46 
48 
49 /*
50  * Drag in all requested console types
51  *
52  */
53 
54 #ifdef CONSOLE_SERIAL
56 #endif
57 #ifdef CONSOLE_DIRECT_VGA
58 REQUIRE_OBJECT ( video_subr );
59 #endif
60 #ifdef CONSOLE_PC_KBD
61 REQUIRE_OBJECT ( pc_kbd );
62 #endif
63 #ifdef CONSOLE_SYSLOG
65 #endif
66 #ifdef CONSOLE_SYSLOGS
68 #endif
69 #ifdef CONSOLE_EFI
71 #endif
72 #ifdef CONSOLE_LINUX
73 REQUIRE_OBJECT ( linux_console );
74 #endif
75 #ifdef CONSOLE_VMWARE
76 REQUIRE_OBJECT ( vmconsole );
77 #endif
78 #ifdef CONSOLE_DEBUGCON
79 REQUIRE_OBJECT ( debugcon );
80 #endif
81 
82 /*
83  * Drag in all requested network protocols
84  *
85  */
86 #ifdef NET_PROTO_IPV4
87 REQUIRE_OBJECT ( ipv4 );
88 #endif
89 #ifdef NET_PROTO_IPV6
90 REQUIRE_OBJECT ( ipv6 );
91 #endif
92 
93 /*
94  * Drag in all requested PXE support
95  *
96  */
97 #ifdef PXE_MENU
98 REQUIRE_OBJECT ( pxemenu );
99 #endif
100 #ifdef PXE_STACK
101 REQUIRE_OBJECT ( pxe_call );
102 #endif
103 
104 /*
105  * Drag in all requested download protocols
106  *
107  */
108 #ifdef DOWNLOAD_PROTO_TFTP
109 REQUIRE_OBJECT ( tftp );
110 #endif
111 #ifdef DOWNLOAD_PROTO_HTTP
112 REQUIRE_OBJECT ( http );
113 #endif
114 #ifdef DOWNLOAD_PROTO_HTTPS
115 REQUIRE_OBJECT ( https );
116 #endif
117 #ifdef DOWNLOAD_PROTO_FTP
118 REQUIRE_OBJECT ( ftp );
119 #endif
120 #ifdef DOWNLOAD_PROTO_NFS
122 #endif
123 #ifdef DOWNLOAD_PROTO_SLAM
124 REQUIRE_OBJECT ( slam );
125 #endif
126 
127 /*
128  * Drag in all requested SAN boot protocols
129  *
130  */
131 #ifdef SANBOOT_PROTO_ISCSI
132 REQUIRE_OBJECT ( iscsi );
133 #endif
134 #ifdef SANBOOT_PROTO_HTTP
135 REQUIRE_OBJECT ( httpblock );
136 #endif
137 
138 /*
139  * Drag in all requested resolvers
140  *
141  */
142 #ifdef DNS_RESOLVER
143 REQUIRE_OBJECT ( dns );
144 #endif
145 
146 /*
147  * Drag in all requested image formats
148  *
149  */
150 #ifdef IMAGE_NBI
151 REQUIRE_OBJECT ( nbi );
152 #endif
153 #ifdef IMAGE_ELF
154 REQUIRE_OBJECT ( elfboot );
155 #endif
156 #ifdef IMAGE_MULTIBOOT
157 REQUIRE_OBJECT ( multiboot );
158 #endif
159 #ifdef IMAGE_PXE
160 REQUIRE_OBJECT ( pxe_image );
161 #endif
162 #ifdef IMAGE_SCRIPT
163 REQUIRE_OBJECT ( script );
164 #endif
165 #ifdef IMAGE_BZIMAGE
166 REQUIRE_OBJECT ( bzimage );
167 #endif
168 #ifdef IMAGE_ELTORITO
169 REQUIRE_OBJECT ( eltorito );
170 #endif
171 #ifdef IMAGE_COMBOOT
172 REQUIRE_OBJECT ( comboot );
173 REQUIRE_OBJECT ( com32 );
174 REQUIRE_OBJECT ( comboot_call );
175 REQUIRE_OBJECT ( com32_call );
176 REQUIRE_OBJECT ( com32_wrapper );
178 #endif
179 #ifdef IMAGE_EFI
180 REQUIRE_OBJECT ( efi_image );
181 #endif
182 #ifdef IMAGE_SDI
183 REQUIRE_OBJECT ( sdi );
184 #endif
185 
186 /*
187  * Drag in all requested commands
188  *
189  */
190 #ifdef AUTOBOOT_CMD
192 #endif
193 #ifdef NVO_CMD
194 REQUIRE_OBJECT ( nvo_cmd );
195 #endif
196 #ifdef CONFIG_CMD
198 #endif
199 #ifdef IFMGMT_CMD
200 REQUIRE_OBJECT ( ifmgmt_cmd );
201 #endif
202 /* IWMGMT_CMD is brought in by net80211.c if requested */
203 #ifdef ROUTE_CMD
205 #endif
206 #ifdef IMAGE_CMD
207 REQUIRE_OBJECT ( image_cmd );
208 #endif
209 #ifdef IMAGE_TRUST_CMD
210 REQUIRE_OBJECT ( image_trust_cmd );
211 #endif
212 #ifdef DHCP_CMD
213 REQUIRE_OBJECT ( dhcp_cmd );
214 #endif
215 #ifdef SANBOOT_CMD
217 #endif
218 #ifdef MENU_CMD
220 #endif
221 #ifdef LOGIN_CMD
223 #endif
224 #ifdef TIME_CMD
226 #endif
227 #ifdef DIGEST_CMD
229 #endif
230 #ifdef PXE_CMD
231 REQUIRE_OBJECT ( pxe_cmd );
232 #endif
233 #ifdef LOTEST_CMD
235 #endif
236 #ifdef VLAN_CMD
237 REQUIRE_OBJECT ( vlan_cmd );
238 #endif
239 #ifdef POWEROFF_CMD
241 #endif
242 #ifdef REBOOT_CMD
244 #endif
245 #ifdef CPUID_CMD
247 #endif
248 #ifdef SYNC_CMD
250 #endif
251 #ifdef SHELL_CMD
253 #endif
254 #ifdef NSLOOKUP_CMD
256 #endif
257 #ifdef PCI_CMD
258 REQUIRE_OBJECT ( pci_cmd );
259 #endif
260 #ifdef PARAM_CMD
262 #endif
263 #ifdef NEIGHBOUR_CMD
264 REQUIRE_OBJECT ( neighbour_cmd );
265 #endif
266 #ifdef PING_CMD
268 #endif
269 #ifdef CONSOLE_CMD
271 #endif
272 #ifdef IPSTAT_CMD
274 #endif
275 #ifdef PROFSTAT_CMD
277 #endif
278 #ifdef NTP_CMD
280 #endif
281 #ifdef CERT_CMD
282 REQUIRE_OBJECT ( cert_cmd );
283 #endif
284 
285 /*
286  * Drag in miscellaneous objects
287  *
288  */
289 #ifdef NULL_TRAP
290 REQUIRE_OBJECT ( nulltrap );
291 #endif
292 #ifdef GDBSERIAL
293 REQUIRE_OBJECT ( gdbidt );
294 REQUIRE_OBJECT ( gdbserial );
296 #endif
297 #ifdef GDBUDP
298 REQUIRE_OBJECT ( gdbidt );
299 REQUIRE_OBJECT ( gdbudp );
301 #endif
302 
303 /*
304  * Drag in objects that are always required, but not dragged in via
305  * symbol dependencies.
306  *
307  */
309 REQUIRE_OBJECT ( embedded );
310 
311 /* linux drivers aren't picked up by the parserom utility so drag them in here */
312 #ifdef DRIVERS_LINUX
313 REQUIRE_OBJECT ( tap );
314 #endif
315 
316 /*
317  * Drag in relevant sideband entry points
318  */
319 #ifdef CONFIG_BOFM
320 #ifdef BOFM_EFI
321 REQUIRE_OBJECT ( efi_bofm );
322 #endif /* BOFM_EFI */
323 #endif /* CONFIG_BOFM */
324 
325 /*
326  * Drag in relevant settings sources
327  */
328 #ifdef PCI_SETTINGS
330 #endif
331 #ifdef VMWARE_SETTINGS
332 REQUIRE_OBJECT ( guestinfo );
333 #endif
334 #ifdef CPUID_SETTINGS
336 #endif
337 #ifdef MEMMAP_SETTINGS
339 #endif
340 #ifdef VRAM_SETTINGS
341 REQUIRE_OBJECT ( vram_settings );
342 #endif
343 #ifdef ACPI_SETTINGS
345 #endif
346 
347 /*
348  * Drag in selected keyboard map
349  */
350 #define REQUIRE_KEYMAP_OBJECT( _map ) REQUIRE_OBJECT ( keymap_ ## _map )
351 #define REQUIRE_KEYMAP( _map ) REQUIRE_KEYMAP_OBJECT ( _map )
PROVIDE_REQUIRING_SYMBOL()
static struct command_descriptor sanboot_cmd
"sanboot" command descriptor
Definition: sanboot_cmd.c:82
static struct command_descriptor time_cmd
"time" command descriptor
Definition: time_cmd.c:46
static struct ifcommon_command_descriptor autoboot_cmd
"autoboot" command descriptor
Definition: autoboot_cmd.c:59
static struct command_descriptor reboot_cmd
"reboot" command descriptor
Definition: reboot_cmd.c:50
int shell(void)
Start command shell.
Definition: shell.c:84
static struct command_descriptor digest_cmd
"digest" command descriptor
Definition: digest_cmd.c:47
static struct command_descriptor config_cmd
"config" command descriptor
Definition: config_cmd.c:48
A hardware device.
Definition: device.h:73
static struct command_descriptor ipstat_cmd
"ipstat" command descriptor
Definition: ipstat_cmd.c:45
static struct command_descriptor sync_cmd
"sync" command descriptor
Definition: sync_cmd.c:52
static int nfs_open(struct interface *xfer, struct uri *uri)
Initiate a NFS connection.
Definition: nfs_open.c:630
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static struct command_descriptor console_cmd
"console" command descriptor
Definition: console_cmd.c:76
static struct command_descriptor ntp_cmd
"ntp" command descriptor
Definition: ntp_cmd.c:46
struct console_driver efi_console
Definition: efi_fbcon.c:51
REQUIRE_OBJECT(device)
static struct command_descriptor route_cmd
"route" command descriptor
Definition: route_cmd.c:45
uint64_t serial
Serial number.
Definition: edd.h:30
static struct settings pci_settings
PCI device settings.
Definition: pci_settings.c:106
Configuration settings sources.
Console configuration.
static struct command_descriptor login_cmd
"login" command descriptor
Definition: login_cmd.c:45
#define KEYBOARD_MAP
Definition: console.h:56
static struct command_descriptor param_cmd
"param" command descriptor
Definition: param_cmd.c:102
static struct command_descriptor poweroff_cmd
"poweroff" command descriptor
Definition: poweroff_cmd.c:46
static struct settings memmap_settings
Memory map settings.
int comboot_resolv(const char *name, struct in_addr *address)
General configuration.
static struct command_descriptor ping_cmd
"ping" command descriptor
Definition: ping_cmd.c:74
static struct command_descriptor profstat_cmd
"profstat" command descriptor
Definition: profstat_cmd.c:45
#define syslog(priority, fmt,...)
Write message to system log.
Definition: syslog.h:93
static struct command_descriptor gdbstub_cmd
"gdbstub" command descriptor
Definition: gdbstub_cmd.c:71
#define REQUIRE_KEYMAP(_map)
Definition: config.c:351
Sideband access by platform firmware.
static struct command_descriptor lotest_cmd
"lotest" command descriptor
Definition: lotest_cmd.c:59
static struct command_descriptor cpuid_cmd
"cpuid" command descriptor
Definition: cpuid_cmd.c:60
static struct settings cpuid_settings
CPUID settings.
static struct interface syslogs
The encrypted syslog TLS interface.
Definition: syslogs.c:101
static struct command_descriptor nslookup_cmd
"nslookup" command descriptor
Definition: nslookup_cmd.c:41
static struct settings acpi_settings
ACPI settings.