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#ifdef CONSOLE_DMESG
87#endif
88
89/*
90 * Drag in all requested network protocols
91 *
92 */
93#ifdef NET_PROTO_IPV4
94REQUIRE_OBJECT ( ipv4 );
95#endif
96#ifdef NET_PROTO_IPV6
97REQUIRE_OBJECT ( ipv6 );
98#endif
99
100/*
101 * Drag in all requested PXE support
102 *
103 */
104#ifdef PXE_MENU
105REQUIRE_OBJECT ( pxemenu );
106#endif
107#ifdef PXE_STACK
108REQUIRE_OBJECT ( pxe_call );
109#endif
110
111/*
112 * Drag in all requested download protocols
113 *
114 */
115#ifdef DOWNLOAD_PROTO_TFTP
116REQUIRE_OBJECT ( tftp );
117#endif
118#ifdef DOWNLOAD_PROTO_HTTP
119REQUIRE_OBJECT ( http );
120#endif
121#ifdef DOWNLOAD_PROTO_HTTPS
122REQUIRE_OBJECT ( https );
123#endif
124#ifdef DOWNLOAD_PROTO_FTP
125REQUIRE_OBJECT ( ftp );
126#endif
127#ifdef DOWNLOAD_PROTO_NFS
129#endif
130#ifdef DOWNLOAD_PROTO_SLAM
131REQUIRE_OBJECT ( slam );
132#endif
133#ifdef DOWNLOAD_PROTO_DATA
134REQUIRE_OBJECT ( datauri );
135#endif
136
137/*
138 * Drag in all requested SAN boot protocols
139 *
140 */
141#ifdef SANBOOT_PROTO_ISCSI
142REQUIRE_OBJECT ( iscsi );
143#endif
144#ifdef SANBOOT_PROTO_HTTP
145REQUIRE_OBJECT ( httpblock );
146#endif
147
148/*
149 * Drag in all requested resolvers
150 *
151 */
152#ifdef DNS_RESOLVER
153REQUIRE_OBJECT ( dns );
154#endif
155
156/*
157 * Drag in all requested image formats
158 *
159 */
160#ifdef IMAGE_NBI
161REQUIRE_OBJECT ( nbi );
162#endif
163#ifdef IMAGE_ELF
164REQUIRE_OBJECT ( elfboot );
165#endif
166#ifdef IMAGE_MULTIBOOT
167REQUIRE_OBJECT ( multiboot );
168#endif
169#ifdef IMAGE_PXE
170REQUIRE_OBJECT ( pxe_image );
171#endif
172#ifdef IMAGE_SCRIPT
173REQUIRE_OBJECT ( script );
174#endif
175#ifdef IMAGE_BZIMAGE
176REQUIRE_OBJECT ( bzimage );
177#endif
178#ifdef IMAGE_ELTORITO
179REQUIRE_OBJECT ( eltorito );
180#endif
181#ifdef IMAGE_COMBOOT
182REQUIRE_OBJECT ( comboot );
183REQUIRE_OBJECT ( com32 );
184REQUIRE_OBJECT ( comboot_call );
185REQUIRE_OBJECT ( com32_call );
186REQUIRE_OBJECT ( com32_wrapper );
188#endif
189#ifdef IMAGE_EFI
190REQUIRE_OBJECT ( efi_image );
191#endif
192#ifdef IMAGE_SDI
193REQUIRE_OBJECT ( sdi );
194#endif
195#ifdef IMAGE_ZLIB
196REQUIRE_OBJECT ( zlib );
197#endif
198#ifdef IMAGE_GZIP
199REQUIRE_OBJECT ( gzip );
200#endif
201#ifdef IMAGE_UCODE
202REQUIRE_OBJECT ( ucode );
203#endif
204#ifdef IMAGE_MIME
205REQUIRE_OBJECT ( mime );
206#endif
207
208/*
209 * Drag in all requested commands
210 *
211 */
212#ifdef AUTOBOOT_CMD
214#endif
215#ifdef NVO_CMD
216REQUIRE_OBJECT ( nvo_cmd );
217#endif
218#ifdef CONFIG_CMD
220#endif
221#ifdef IFMGMT_CMD
222REQUIRE_OBJECT ( ifmgmt_cmd );
223#endif
224/* IWMGMT_CMD is brought in by net80211.c if requested */
225#ifdef ROUTE_CMD
227#endif
228#ifdef IMAGE_CMD
229REQUIRE_OBJECT ( image_cmd );
230#endif
231#ifdef IMAGE_TRUST_CMD
232REQUIRE_OBJECT ( image_trust_cmd );
233#endif
234#ifdef DHCP_CMD
235REQUIRE_OBJECT ( dhcp_cmd );
236#endif
237#ifdef SANBOOT_CMD
239#endif
240#ifdef MENU_CMD
242#endif
243#ifdef FORM_CMD
245#endif
246#ifdef LOGIN_CMD
248#endif
249#ifdef TIME_CMD
251#endif
252#ifdef DIGEST_CMD
254#endif
255#ifdef PXE_CMD
256REQUIRE_OBJECT ( pxe_cmd );
257#endif
258#ifdef LOTEST_CMD
260#endif
261#ifdef VLAN_CMD
262REQUIRE_OBJECT ( vlan_cmd );
263#endif
264#ifdef POWEROFF_CMD
266#endif
267#ifdef REBOOT_CMD
269#endif
270#ifdef CPUID_CMD
272#endif
273#ifdef SYNC_CMD
275#endif
276#ifdef SHELL_CMD
278#endif
279#ifdef NSLOOKUP_CMD
281#endif
282#ifdef PARAM_CMD
284#endif
285#ifdef NEIGHBOUR_CMD
286REQUIRE_OBJECT ( neighbour_cmd );
287#endif
288#ifdef PING_CMD
290#endif
291#ifdef CONSOLE_CMD
293#endif
294#ifdef IPSTAT_CMD
296#endif
297#ifdef PROFSTAT_CMD
299#endif
300#ifdef NTP_CMD
302#endif
303#ifdef CERT_CMD
304REQUIRE_OBJECT ( cert_cmd );
305#endif
306#ifdef IMAGE_MEM_CMD
307REQUIRE_OBJECT ( image_mem_cmd );
308#endif
309#ifdef SHIM_CMD
311#endif
312#ifdef IMAGE_CRYPT_CMD
313REQUIRE_OBJECT ( image_crypt_cmd );
314#endif
315#ifdef FDT_CMD
317#endif
318#ifdef IMAGE_SET_CMD
319REQUIRE_OBJECT ( image_set_cmd );
320#endif
321
322/*
323 * Drag in miscellaneous objects
324 *
325 */
326#ifdef NULL_TRAP
327REQUIRE_OBJECT ( nulltrap );
328#endif
329#ifdef GDBSERIAL
330REQUIRE_OBJECT ( gdbidt );
331REQUIRE_OBJECT ( gdbserial );
333#endif
334#ifdef GDBUDP
335REQUIRE_OBJECT ( gdbidt );
336REQUIRE_OBJECT ( gdbudp );
338#endif
339
340/*
341 * Drag in objects that are always required, but not dragged in via
342 * symbol dependencies.
343 *
344 */
346REQUIRE_OBJECT ( embedded );
347
348/* linux drivers aren't picked up by the parserom utility so drag them in here */
349#ifdef DRIVERS_LINUX
350REQUIRE_OBJECT ( tap );
351#endif
352
353/*
354 * Drag in relevant sideband entry points
355 */
356#ifdef CONFIG_BOFM
357#ifdef BOFM_EFI
358REQUIRE_OBJECT ( efi_bofm );
359#endif /* BOFM_EFI */
360#endif /* CONFIG_BOFM */
361
362/*
363 * Drag in relevant settings sources
364 */
365#ifdef VMWARE_SETTINGS
366REQUIRE_OBJECT ( guestinfo );
367#endif
368#ifdef CPUID_SETTINGS
370#endif
371#ifdef MEMMAP_SETTINGS
373#endif
374#ifdef VRAM_SETTINGS
375REQUIRE_OBJECT ( vram_settings );
376#endif
377#ifdef ACPI_SETTINGS
379#endif
380#ifdef EFI_SETTINGS
381REQUIRE_OBJECT ( efi_settings );
382#endif
383
384/*
385 * Drag in selected keyboard map
386 */
387#define REQUIRE_KEYMAP_OBJECT( _map ) REQUIRE_OBJECT ( keymap_ ## _map )
388#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:84
Configuration settings sources.
#define REQUIRE_KEYMAP(_map)
Definition config.c:388
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 char dmesg[DMESG_LEN]
Ring buffer.
Definition dmesg.c:48
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:56
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:921
#define REQUIRE_OBJECT(object)
Require an object.
Definition compiler.h:227
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:951
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:111
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:76
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