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 #ifdef CONSOLE_SBI
82 REQUIRE_OBJECT ( sbi_console );
83 #endif
84 
85 /*
86  * Drag in all requested network protocols
87  *
88  */
89 #ifdef NET_PROTO_IPV4
90 REQUIRE_OBJECT ( ipv4 );
91 #endif
92 #ifdef NET_PROTO_IPV6
93 REQUIRE_OBJECT ( ipv6 );
94 #endif
95 
96 /*
97  * Drag in all requested PXE support
98  *
99  */
100 #ifdef PXE_MENU
101 REQUIRE_OBJECT ( pxemenu );
102 #endif
103 #ifdef PXE_STACK
104 REQUIRE_OBJECT ( pxe_call );
105 #endif
106 
107 /*
108  * Drag in all requested download protocols
109  *
110  */
111 #ifdef DOWNLOAD_PROTO_TFTP
112 REQUIRE_OBJECT ( tftp );
113 #endif
114 #ifdef DOWNLOAD_PROTO_HTTP
115 REQUIRE_OBJECT ( http );
116 #endif
117 #ifdef DOWNLOAD_PROTO_HTTPS
118 REQUIRE_OBJECT ( https );
119 #endif
120 #ifdef DOWNLOAD_PROTO_FTP
121 REQUIRE_OBJECT ( ftp );
122 #endif
123 #ifdef DOWNLOAD_PROTO_NFS
125 #endif
126 #ifdef DOWNLOAD_PROTO_SLAM
127 REQUIRE_OBJECT ( slam );
128 #endif
129 
130 /*
131  * Drag in all requested SAN boot protocols
132  *
133  */
134 #ifdef SANBOOT_PROTO_ISCSI
135 REQUIRE_OBJECT ( iscsi );
136 #endif
137 #ifdef SANBOOT_PROTO_HTTP
138 REQUIRE_OBJECT ( httpblock );
139 #endif
140 
141 /*
142  * Drag in all requested resolvers
143  *
144  */
145 #ifdef DNS_RESOLVER
146 REQUIRE_OBJECT ( dns );
147 #endif
148 
149 /*
150  * Drag in all requested image formats
151  *
152  */
153 #ifdef IMAGE_NBI
154 REQUIRE_OBJECT ( nbi );
155 #endif
156 #ifdef IMAGE_ELF
157 REQUIRE_OBJECT ( elfboot );
158 #endif
159 #ifdef IMAGE_MULTIBOOT
160 REQUIRE_OBJECT ( multiboot );
161 #endif
162 #ifdef IMAGE_PXE
163 REQUIRE_OBJECT ( pxe_image );
164 #endif
165 #ifdef IMAGE_SCRIPT
166 REQUIRE_OBJECT ( script );
167 #endif
168 #ifdef IMAGE_BZIMAGE
169 REQUIRE_OBJECT ( bzimage );
170 #endif
171 #ifdef IMAGE_ELTORITO
172 REQUIRE_OBJECT ( eltorito );
173 #endif
174 #ifdef IMAGE_COMBOOT
175 REQUIRE_OBJECT ( comboot );
176 REQUIRE_OBJECT ( com32 );
177 REQUIRE_OBJECT ( comboot_call );
178 REQUIRE_OBJECT ( com32_call );
179 REQUIRE_OBJECT ( com32_wrapper );
181 #endif
182 #ifdef IMAGE_EFI
183 REQUIRE_OBJECT ( efi_image );
184 #endif
185 #ifdef IMAGE_SDI
186 REQUIRE_OBJECT ( sdi );
187 #endif
188 #ifdef IMAGE_ZLIB
189 REQUIRE_OBJECT ( zlib );
190 #endif
191 #ifdef IMAGE_GZIP
192 REQUIRE_OBJECT ( gzip );
193 #endif
194 #ifdef IMAGE_UCODE
195 REQUIRE_OBJECT ( ucode );
196 #endif
197 
198 /*
199  * Drag in all requested commands
200  *
201  */
202 #ifdef AUTOBOOT_CMD
204 #endif
205 #ifdef NVO_CMD
206 REQUIRE_OBJECT ( nvo_cmd );
207 #endif
208 #ifdef CONFIG_CMD
210 #endif
211 #ifdef IFMGMT_CMD
212 REQUIRE_OBJECT ( ifmgmt_cmd );
213 #endif
214 /* IWMGMT_CMD is brought in by net80211.c if requested */
215 #ifdef ROUTE_CMD
217 #endif
218 #ifdef IMAGE_CMD
219 REQUIRE_OBJECT ( image_cmd );
220 #endif
221 #ifdef IMAGE_TRUST_CMD
222 REQUIRE_OBJECT ( image_trust_cmd );
223 #endif
224 #ifdef DHCP_CMD
225 REQUIRE_OBJECT ( dhcp_cmd );
226 #endif
227 #ifdef SANBOOT_CMD
229 #endif
230 #ifdef MENU_CMD
232 #endif
233 #ifdef FORM_CMD
235 #endif
236 #ifdef LOGIN_CMD
238 #endif
239 #ifdef TIME_CMD
241 #endif
242 #ifdef DIGEST_CMD
244 #endif
245 #ifdef PXE_CMD
246 REQUIRE_OBJECT ( pxe_cmd );
247 #endif
248 #ifdef LOTEST_CMD
250 #endif
251 #ifdef VLAN_CMD
252 REQUIRE_OBJECT ( vlan_cmd );
253 #endif
254 #ifdef POWEROFF_CMD
256 #endif
257 #ifdef REBOOT_CMD
259 #endif
260 #ifdef CPUID_CMD
262 #endif
263 #ifdef SYNC_CMD
265 #endif
266 #ifdef SHELL_CMD
268 #endif
269 #ifdef NSLOOKUP_CMD
271 #endif
272 #ifdef PCI_CMD
273 REQUIRE_OBJECT ( pci_cmd );
274 #endif
275 #ifdef PARAM_CMD
277 #endif
278 #ifdef NEIGHBOUR_CMD
279 REQUIRE_OBJECT ( neighbour_cmd );
280 #endif
281 #ifdef PING_CMD
283 #endif
284 #ifdef CONSOLE_CMD
286 #endif
287 #ifdef IPSTAT_CMD
289 #endif
290 #ifdef PROFSTAT_CMD
292 #endif
293 #ifdef NTP_CMD
295 #endif
296 #ifdef CERT_CMD
297 REQUIRE_OBJECT ( cert_cmd );
298 #endif
299 #ifdef IMAGE_MEM_CMD
300 REQUIRE_OBJECT ( image_mem_cmd );
301 #endif
302 #ifdef SHIM_CMD
304 #endif
305 #ifdef IMAGE_CRYPT_CMD
306 REQUIRE_OBJECT ( image_crypt_cmd );
307 #endif
308 #ifdef USB_CMD
309 REQUIRE_OBJECT ( usb_cmd );
310 #endif
311 
312 /*
313  * Drag in miscellaneous objects
314  *
315  */
316 #ifdef NULL_TRAP
317 REQUIRE_OBJECT ( nulltrap );
318 #endif
319 #ifdef GDBSERIAL
320 REQUIRE_OBJECT ( gdbidt );
321 REQUIRE_OBJECT ( gdbserial );
323 #endif
324 #ifdef GDBUDP
325 REQUIRE_OBJECT ( gdbidt );
326 REQUIRE_OBJECT ( gdbudp );
328 #endif
329 
330 /*
331  * Drag in objects that are always required, but not dragged in via
332  * symbol dependencies.
333  *
334  */
336 REQUIRE_OBJECT ( embedded );
337 
338 /* linux drivers aren't picked up by the parserom utility so drag them in here */
339 #ifdef DRIVERS_LINUX
340 REQUIRE_OBJECT ( tap );
341 #endif
342 
343 /*
344  * Drag in relevant sideband entry points
345  */
346 #ifdef CONFIG_BOFM
347 #ifdef BOFM_EFI
348 REQUIRE_OBJECT ( efi_bofm );
349 #endif /* BOFM_EFI */
350 #endif /* CONFIG_BOFM */
351 
352 /*
353  * Drag in relevant settings sources
354  */
355 #ifdef PCI_SETTINGS
357 #endif
358 #ifdef VMWARE_SETTINGS
359 REQUIRE_OBJECT ( guestinfo );
360 #endif
361 #ifdef CPUID_SETTINGS
363 #endif
364 #ifdef MEMMAP_SETTINGS
366 #endif
367 #ifdef VRAM_SETTINGS
368 REQUIRE_OBJECT ( vram_settings );
369 #endif
370 #ifdef ACPI_SETTINGS
372 #endif
373 #ifdef EFI_SETTINGS
374 REQUIRE_OBJECT ( efi_settings );
375 #endif
376 
377 /*
378  * Drag in selected keyboard map
379  */
380 #define REQUIRE_KEYMAP_OBJECT( _map ) REQUIRE_OBJECT ( keymap_ ## _map )
381 #define REQUIRE_KEYMAP( _map ) REQUIRE_KEYMAP_OBJECT ( _map )
static struct command_descriptor dynui_cmd
"dynui" command descriptor
Definition: dynui_cmd.c:62
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:57
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:381
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.