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
22FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
23FILE_SECBOOT ( PERMITTED );
24
25#include <config/general.h>
26#include <config/console.h>
27#include <config/sideband.h>
28#include <config/settings.h>
29
30/** @file
31 *
32 * Configuration options
33 *
34 * This file contains macros that pull various objects into the link
35 * based on definitions in configuration header files. Ideally it
36 * should be the only place in iPXE where one might need to use #ifdef
37 * for compile-time options.
38 *
39 * In the fairly common case where an object should only be considered
40 * for inclusion if the subsystem it depends on is present, its
41 * configuration macros should be placed in a file named
42 * <tt>config_<i>subsystem</i>.c</tt>, where @e subsystem is the
43 * object basename of the main source file for that subsystem. The
44 * build system will pull in that file if @c subsystem.c is included
45 * in the final iPXE executable built.
46 */
47
49
50/*
51 * Drag in all requested console types
52 *
53 */
54
55#ifdef CONSOLE_SERIAL
57#endif
58#ifdef CONSOLE_DIRECT_VGA
59REQUIRE_OBJECT ( video_subr );
60#endif
61#ifdef CONSOLE_PC_KBD
62REQUIRE_OBJECT ( pc_kbd );
63#endif
64#ifdef CONSOLE_SYSLOG
66#endif
67#ifdef CONSOLE_SYSLOGS
69#endif
70#ifdef CONSOLE_EFI
72#endif
73#ifdef CONSOLE_LINUX
74REQUIRE_OBJECT ( linux_console );
75#endif
76#ifdef CONSOLE_VMWARE
77REQUIRE_OBJECT ( vmconsole );
78#endif
79#ifdef CONSOLE_DEBUGCON
80REQUIRE_OBJECT ( debugcon );
81#endif
82#ifdef CONSOLE_SBI
83REQUIRE_OBJECT ( sbi_console );
84#endif
85
86/*
87 * Drag in all requested network protocols
88 *
89 */
90#ifdef NET_PROTO_IPV4
91REQUIRE_OBJECT ( ipv4 );
92#endif
93#ifdef NET_PROTO_IPV6
94REQUIRE_OBJECT ( ipv6 );
95#endif
96
97/*
98 * Drag in all requested PXE support
99 *
100 */
101#ifdef PXE_MENU
102REQUIRE_OBJECT ( pxemenu );
103#endif
104#ifdef PXE_STACK
105REQUIRE_OBJECT ( pxe_call );
106#endif
107
108/*
109 * Drag in all requested download protocols
110 *
111 */
112#ifdef DOWNLOAD_PROTO_TFTP
113REQUIRE_OBJECT ( tftp );
114#endif
115#ifdef DOWNLOAD_PROTO_HTTP
116REQUIRE_OBJECT ( http );
117#endif
118#ifdef DOWNLOAD_PROTO_HTTPS
119REQUIRE_OBJECT ( https );
120#endif
121#ifdef DOWNLOAD_PROTO_FTP
122REQUIRE_OBJECT ( ftp );
123#endif
124#ifdef DOWNLOAD_PROTO_NFS
126#endif
127#ifdef DOWNLOAD_PROTO_SLAM
128REQUIRE_OBJECT ( slam );
129#endif
130
131/*
132 * Drag in all requested SAN boot protocols
133 *
134 */
135#ifdef SANBOOT_PROTO_ISCSI
136REQUIRE_OBJECT ( iscsi );
137#endif
138#ifdef SANBOOT_PROTO_HTTP
139REQUIRE_OBJECT ( httpblock );
140#endif
141
142/*
143 * Drag in all requested resolvers
144 *
145 */
146#ifdef DNS_RESOLVER
147REQUIRE_OBJECT ( dns );
148#endif
149
150/*
151 * Drag in all requested image formats
152 *
153 */
154#ifdef IMAGE_NBI
155REQUIRE_OBJECT ( nbi );
156#endif
157#ifdef IMAGE_ELF
158REQUIRE_OBJECT ( elfboot );
159#endif
160#ifdef IMAGE_MULTIBOOT
161REQUIRE_OBJECT ( multiboot );
162#endif
163#ifdef IMAGE_PXE
164REQUIRE_OBJECT ( pxe_image );
165#endif
166#ifdef IMAGE_SCRIPT
167REQUIRE_OBJECT ( script );
168#endif
169#ifdef IMAGE_BZIMAGE
170REQUIRE_OBJECT ( bzimage );
171#endif
172#ifdef IMAGE_ELTORITO
173REQUIRE_OBJECT ( eltorito );
174#endif
175#ifdef IMAGE_COMBOOT
176REQUIRE_OBJECT ( comboot );
177REQUIRE_OBJECT ( com32 );
178REQUIRE_OBJECT ( comboot_call );
179REQUIRE_OBJECT ( com32_call );
180REQUIRE_OBJECT ( com32_wrapper );
182#endif
183#ifdef IMAGE_EFI
184REQUIRE_OBJECT ( efi_image );
185#endif
186#ifdef IMAGE_SDI
187REQUIRE_OBJECT ( sdi );
188#endif
189#ifdef IMAGE_ZLIB
190REQUIRE_OBJECT ( zlib );
191#endif
192#ifdef IMAGE_GZIP
193REQUIRE_OBJECT ( gzip );
194#endif
195#ifdef IMAGE_UCODE
196REQUIRE_OBJECT ( ucode );
197#endif
198
199/*
200 * Drag in all requested commands
201 *
202 */
203#ifdef AUTOBOOT_CMD
205#endif
206#ifdef NVO_CMD
207REQUIRE_OBJECT ( nvo_cmd );
208#endif
209#ifdef CONFIG_CMD
211#endif
212#ifdef IFMGMT_CMD
213REQUIRE_OBJECT ( ifmgmt_cmd );
214#endif
215/* IWMGMT_CMD is brought in by net80211.c if requested */
216#ifdef ROUTE_CMD
218#endif
219#ifdef IMAGE_CMD
220REQUIRE_OBJECT ( image_cmd );
221#endif
222#ifdef IMAGE_TRUST_CMD
223REQUIRE_OBJECT ( image_trust_cmd );
224#endif
225#ifdef DHCP_CMD
226REQUIRE_OBJECT ( dhcp_cmd );
227#endif
228#ifdef SANBOOT_CMD
230#endif
231#ifdef MENU_CMD
233#endif
234#ifdef FORM_CMD
236#endif
237#ifdef LOGIN_CMD
239#endif
240#ifdef TIME_CMD
242#endif
243#ifdef DIGEST_CMD
245#endif
246#ifdef PXE_CMD
247REQUIRE_OBJECT ( pxe_cmd );
248#endif
249#ifdef LOTEST_CMD
251#endif
252#ifdef VLAN_CMD
253REQUIRE_OBJECT ( vlan_cmd );
254#endif
255#ifdef POWEROFF_CMD
257#endif
258#ifdef REBOOT_CMD
260#endif
261#ifdef CPUID_CMD
263#endif
264#ifdef SYNC_CMD
266#endif
267#ifdef SHELL_CMD
269#endif
270#ifdef NSLOOKUP_CMD
272#endif
273#ifdef PARAM_CMD
275#endif
276#ifdef NEIGHBOUR_CMD
277REQUIRE_OBJECT ( neighbour_cmd );
278#endif
279#ifdef PING_CMD
281#endif
282#ifdef CONSOLE_CMD
284#endif
285#ifdef IPSTAT_CMD
287#endif
288#ifdef PROFSTAT_CMD
290#endif
291#ifdef NTP_CMD
293#endif
294#ifdef CERT_CMD
295REQUIRE_OBJECT ( cert_cmd );
296#endif
297#ifdef IMAGE_MEM_CMD
298REQUIRE_OBJECT ( image_mem_cmd );
299#endif
300#ifdef SHIM_CMD
302#endif
303#ifdef IMAGE_CRYPT_CMD
304REQUIRE_OBJECT ( image_crypt_cmd );
305#endif
306#ifdef FDT_CMD
308#endif
309
310/*
311 * Drag in miscellaneous objects
312 *
313 */
314#ifdef NULL_TRAP
315REQUIRE_OBJECT ( nulltrap );
316#endif
317#ifdef GDBSERIAL
318REQUIRE_OBJECT ( gdbidt );
319REQUIRE_OBJECT ( gdbserial );
321#endif
322#ifdef GDBUDP
323REQUIRE_OBJECT ( gdbidt );
324REQUIRE_OBJECT ( gdbudp );
326#endif
327
328/*
329 * Drag in objects that are always required, but not dragged in via
330 * symbol dependencies.
331 *
332 */
334REQUIRE_OBJECT ( embedded );
335
336/* linux drivers aren't picked up by the parserom utility so drag them in here */
337#ifdef DRIVERS_LINUX
338REQUIRE_OBJECT ( tap );
339#endif
340
341/*
342 * Drag in relevant sideband entry points
343 */
344#ifdef CONFIG_BOFM
345#ifdef BOFM_EFI
346REQUIRE_OBJECT ( efi_bofm );
347#endif /* BOFM_EFI */
348#endif /* CONFIG_BOFM */
349
350/*
351 * Drag in relevant settings sources
352 */
353#ifdef VMWARE_SETTINGS
354REQUIRE_OBJECT ( guestinfo );
355#endif
356#ifdef CPUID_SETTINGS
358#endif
359#ifdef MEMMAP_SETTINGS
361#endif
362#ifdef VRAM_SETTINGS
363REQUIRE_OBJECT ( vram_settings );
364#endif
365#ifdef ACPI_SETTINGS
367#endif
368#ifdef EFI_SETTINGS
369REQUIRE_OBJECT ( efi_settings );
370#endif
371
372/*
373 * Drag in selected keyboard map
374 */
375#define REQUIRE_KEYMAP_OBJECT( _map ) REQUIRE_OBJECT ( keymap_ ## _map )
376#define REQUIRE_KEYMAP( _map ) REQUIRE_KEYMAP_OBJECT ( _map )
static struct settings acpi_settings
ACPI settings.
static struct ifcommon_command_descriptor autoboot_cmd
"autoboot" command descriptor
int comboot_resolv(const char *name, struct in_addr *address)
Console configuration.
#define KEYBOARD_MAP
Definition console.h:83
Configuration settings sources.
#define REQUIRE_KEYMAP(_map)
Definition config.c:376
PROVIDE_REQUIRING_SYMBOL()
static struct command_descriptor config_cmd
"config" command descriptor
Definition config_cmd.c:49
static struct command_descriptor console_cmd
"console" command descriptor
Definition console_cmd.c:77
static struct command_descriptor cpuid_cmd
"cpuid" command descriptor
Definition cpuid_cmd.c:61
static struct settings cpuid_settings
CPUID settings.
static struct command_descriptor digest_cmd
"digest" command descriptor
Definition digest_cmd.c:56
static struct command_descriptor dynui_cmd
"dynui" command descriptor
Definition dynui_cmd.c:63
uint64_t serial
Serial number.
Definition edd.h:1
struct console_driver efi_console
Definition efi_fbcon.c:53
static struct command_descriptor fdt_cmd
"fdt" command descriptor
Definition fdt_cmd.c:52
static struct command_descriptor gdbstub_cmd
"gdbstub" command descriptor
Definition gdbstub_cmd.c:72
General configuration.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define REQUIRE_OBJECT(object)
Require an object.
Definition compiler.h:202
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
static struct command_descriptor ipstat_cmd
"ipstat" command descriptor
Definition ipstat_cmd.c:46
static struct command_descriptor login_cmd
"login" command descriptor
Definition login_cmd.c:46
static struct command_descriptor lotest_cmd
"lotest" command descriptor
Definition lotest_cmd.c:59
static struct settings memmap_settings
Memory map settings.
static int nfs_open(struct interface *xfer, struct uri *uri)
Initiate a NFS connection.
Definition nfs_open.c:632
static struct command_descriptor nslookup_cmd
"nslookup" command descriptor
static struct command_descriptor ntp_cmd
"ntp" command descriptor
Definition ntp_cmd.c:47
static struct command_descriptor param_cmd
"param" command descriptor
Definition param_cmd.c:107
static struct command_descriptor ping_cmd
"ping" command descriptor
Definition ping_cmd.c:75
static struct command_descriptor poweroff_cmd
"poweroff" command descriptor
static struct command_descriptor profstat_cmd
"profstat" command descriptor
static struct command_descriptor reboot_cmd
"reboot" command descriptor
Definition reboot_cmd.c:55
static struct command_descriptor route_cmd
"route" command descriptor
Definition route_cmd.c:46
static struct command_descriptor sanboot_cmd
"sanboot" command descriptor
Definition sanboot_cmd.c:94
int shell(void)
Start command shell.
Definition shell.c:82
static struct command_descriptor shim_cmd
"shim" command descriptor
Definition shim_cmd.c:72
Sideband access by platform firmware.
A hardware device.
Definition device.h:77
static struct command_descriptor sync_cmd
"sync" command descriptor
Definition sync_cmd.c:53
#define syslog(priority, fmt,...)
Write message to system log.
Definition syslog.h:94
static struct interface syslogs
The encrypted syslog TLS interface.
Definition syslogs.c:103
static struct command_descriptor time_cmd
"time" command descriptor
Definition time_cmd.c:47