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 
47 PROVIDE_REQUIRING_SYMBOL();
48 
49 /*
50  * Drag in all requested console types
51  *
52  */
53 
54 #ifdef CONSOLE_SERIAL
55 REQUIRE_OBJECT ( 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
64 REQUIRE_OBJECT ( syslog );
65 #endif
66 #ifdef CONSOLE_SYSLOGS
67 REQUIRE_OBJECT ( syslogs );
68 #endif
69 #ifdef CONSOLE_EFI
70 REQUIRE_OBJECT ( efi_console );
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
121 REQUIRE_OBJECT ( nfs_open );
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 );
177 REQUIRE_OBJECT ( comboot_resolv );
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
191 REQUIRE_OBJECT ( autoboot_cmd );
192 #endif
193 #ifdef NVO_CMD
194 REQUIRE_OBJECT ( nvo_cmd );
195 #endif
196 #ifdef CONFIG_CMD
197 REQUIRE_OBJECT ( 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
204 REQUIRE_OBJECT ( 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
216 REQUIRE_OBJECT ( sanboot_cmd );
217 #endif
218 #ifdef MENU_CMD
219 REQUIRE_OBJECT ( menu_cmd );
220 #endif
221 #ifdef LOGIN_CMD
222 REQUIRE_OBJECT ( login_cmd );
223 #endif
224 #ifdef TIME_CMD
225 REQUIRE_OBJECT ( time_cmd );
226 #endif
227 #ifdef DIGEST_CMD
228 REQUIRE_OBJECT ( digest_cmd );
229 #endif
230 #ifdef PXE_CMD
231 REQUIRE_OBJECT ( pxe_cmd );
232 #endif
233 #ifdef LOTEST_CMD
234 REQUIRE_OBJECT ( lotest_cmd );
235 #endif
236 #ifdef VLAN_CMD
237 REQUIRE_OBJECT ( vlan_cmd );
238 #endif
239 #ifdef POWEROFF_CMD
240 REQUIRE_OBJECT ( poweroff_cmd );
241 #endif
242 #ifdef REBOOT_CMD
243 REQUIRE_OBJECT ( reboot_cmd );
244 #endif
245 #ifdef CPUID_CMD
246 REQUIRE_OBJECT ( cpuid_cmd );
247 #endif
248 #ifdef SYNC_CMD
249 REQUIRE_OBJECT ( sync_cmd );
250 #endif
251 #ifdef SHELL_CMD
252 REQUIRE_OBJECT ( shell );
253 #endif
254 #ifdef NSLOOKUP_CMD
255 REQUIRE_OBJECT ( nslookup_cmd );
256 #endif
257 #ifdef PCI_CMD
258 REQUIRE_OBJECT ( pci_cmd );
259 #endif
260 #ifdef PARAM_CMD
261 REQUIRE_OBJECT ( param_cmd );
262 #endif
263 #ifdef NEIGHBOUR_CMD
264 REQUIRE_OBJECT ( neighbour_cmd );
265 #endif
266 #ifdef PING_CMD
267 REQUIRE_OBJECT ( ping_cmd );
268 #endif
269 #ifdef CONSOLE_CMD
270 REQUIRE_OBJECT ( console_cmd );
271 #endif
272 #ifdef IPSTAT_CMD
273 REQUIRE_OBJECT ( ipstat_cmd );
274 #endif
275 #ifdef PROFSTAT_CMD
276 REQUIRE_OBJECT ( profstat_cmd );
277 #endif
278 #ifdef NTP_CMD
279 REQUIRE_OBJECT ( 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 );
295 REQUIRE_OBJECT ( gdbstub_cmd );
296 #endif
297 #ifdef GDBUDP
298 REQUIRE_OBJECT ( gdbidt );
299 REQUIRE_OBJECT ( gdbudp );
300 REQUIRE_OBJECT ( gdbstub_cmd );
301 #endif
302 
303 /*
304  * Drag in objects that are always required, but not dragged in via
305  * symbol dependencies.
306  *
307  */
308 REQUIRE_OBJECT ( device );
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
329 REQUIRE_OBJECT ( pci_settings );
330 #endif
331 #ifdef VMWARE_SETTINGS
332 REQUIRE_OBJECT ( guestinfo );
333 #endif
334 #ifdef CPUID_SETTINGS
335 REQUIRE_OBJECT ( cpuid_settings );
336 #endif
337 #ifdef MEMMAP_SETTINGS
338 REQUIRE_OBJECT ( memmap_settings );
339 #endif
340 #ifdef VRAM_SETTINGS
341 REQUIRE_OBJECT ( vram_settings );
342 #endif
343 #ifdef ACPI_SETTINGS
344 REQUIRE_OBJECT ( 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 )
352 REQUIRE_KEYMAP ( KEYBOARD_MAP );
353