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 #ifdef IMAGE_ZLIB
186 REQUIRE_OBJECT ( zlib );
187 #endif
188 #ifdef IMAGE_GZIP
189 REQUIRE_OBJECT ( gzip );
190 #endif
191 #ifdef IMAGE_UCODE
192 REQUIRE_OBJECT ( ucode );
193 #endif
194 
195 /*
196  * Drag in all requested commands
197  *
198  */
199 #ifdef AUTOBOOT_CMD
201 #endif
202 #ifdef NVO_CMD
203 REQUIRE_OBJECT ( nvo_cmd );
204 #endif
205 #ifdef CONFIG_CMD
207 #endif
208 #ifdef IFMGMT_CMD
209 REQUIRE_OBJECT ( ifmgmt_cmd );
210 #endif
211 /* IWMGMT_CMD is brought in by net80211.c if requested */
212 #ifdef ROUTE_CMD
214 #endif
215 #ifdef IMAGE_CMD
216 REQUIRE_OBJECT ( image_cmd );
217 #endif
218 #ifdef IMAGE_TRUST_CMD
219 REQUIRE_OBJECT ( image_trust_cmd );
220 #endif
221 #ifdef DHCP_CMD
222 REQUIRE_OBJECT ( dhcp_cmd );
223 #endif
224 #ifdef SANBOOT_CMD
226 #endif
227 #ifdef MENU_CMD
229 #endif
230 #ifdef LOGIN_CMD
232 #endif
233 #ifdef TIME_CMD
235 #endif
236 #ifdef DIGEST_CMD
238 #endif
239 #ifdef PXE_CMD
240 REQUIRE_OBJECT ( pxe_cmd );
241 #endif
242 #ifdef LOTEST_CMD
244 #endif
245 #ifdef VLAN_CMD
246 REQUIRE_OBJECT ( vlan_cmd );
247 #endif
248 #ifdef POWEROFF_CMD
250 #endif
251 #ifdef REBOOT_CMD
253 #endif
254 #ifdef CPUID_CMD
256 #endif
257 #ifdef SYNC_CMD
259 #endif
260 #ifdef SHELL_CMD
262 #endif
263 #ifdef NSLOOKUP_CMD
265 #endif
266 #ifdef PCI_CMD
267 REQUIRE_OBJECT ( pci_cmd );
268 #endif
269 #ifdef PARAM_CMD
271 #endif
272 #ifdef NEIGHBOUR_CMD
273 REQUIRE_OBJECT ( neighbour_cmd );
274 #endif
275 #ifdef PING_CMD
277 #endif
278 #ifdef CONSOLE_CMD
280 #endif
281 #ifdef IPSTAT_CMD
283 #endif
284 #ifdef PROFSTAT_CMD
286 #endif
287 #ifdef NTP_CMD
289 #endif
290 #ifdef CERT_CMD
291 REQUIRE_OBJECT ( cert_cmd );
292 #endif
293 #ifdef IMAGE_MEM_CMD
294 REQUIRE_OBJECT ( image_mem_cmd );
295 #endif
296 #ifdef SHIM_CMD
298 #endif
299 
300 /*
301  * Drag in miscellaneous objects
302  *
303  */
304 #ifdef NULL_TRAP
305 REQUIRE_OBJECT ( nulltrap );
306 #endif
307 #ifdef GDBSERIAL
308 REQUIRE_OBJECT ( gdbidt );
309 REQUIRE_OBJECT ( gdbserial );
311 #endif
312 #ifdef GDBUDP
313 REQUIRE_OBJECT ( gdbidt );
314 REQUIRE_OBJECT ( gdbudp );
316 #endif
317 
318 /*
319  * Drag in objects that are always required, but not dragged in via
320  * symbol dependencies.
321  *
322  */
324 REQUIRE_OBJECT ( embedded );
325 
326 /* linux drivers aren't picked up by the parserom utility so drag them in here */
327 #ifdef DRIVERS_LINUX
328 REQUIRE_OBJECT ( tap );
329 #endif
330 
331 /*
332  * Drag in relevant sideband entry points
333  */
334 #ifdef CONFIG_BOFM
335 #ifdef BOFM_EFI
336 REQUIRE_OBJECT ( efi_bofm );
337 #endif /* BOFM_EFI */
338 #endif /* CONFIG_BOFM */
339 
340 /*
341  * Drag in relevant settings sources
342  */
343 #ifdef PCI_SETTINGS
345 #endif
346 #ifdef VMWARE_SETTINGS
347 REQUIRE_OBJECT ( guestinfo );
348 #endif
349 #ifdef CPUID_SETTINGS
351 #endif
352 #ifdef MEMMAP_SETTINGS
354 #endif
355 #ifdef VRAM_SETTINGS
356 REQUIRE_OBJECT ( vram_settings );
357 #endif
358 #ifdef ACPI_SETTINGS
360 #endif
361 #ifdef EFI_SETTINGS
362 REQUIRE_OBJECT ( efi_settings );
363 #endif
364 
365 /*
366  * Drag in selected keyboard map
367  */
368 #define REQUIRE_KEYMAP_OBJECT( _map ) REQUIRE_OBJECT ( keymap_ ## _map )
369 #define REQUIRE_KEYMAP( _map ) REQUIRE_KEYMAP_OBJECT ( _map )
PROVIDE_REQUIRING_SYMBOL()
static struct command_descriptor sanboot_cmd
"sanboot" command descriptor
Definition: sanboot_cmd.c:93
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
static struct command_descriptor shim_cmd
"shim" command descriptor
Definition: shim_cmd.c:71
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:106
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:369
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:102
static struct command_descriptor nslookup_cmd
"nslookup" command descriptor
Definition: nslookup_cmd.c:41
static struct settings acpi_settings
ACPI settings.