Merge branch 'master' of /pub/scm/gpxe
[gpxe.git] / src / core / config.c
bloba65d0a9a153076b674b500396e2178148e1fd2fe
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, or (at
5 * your option) any later version.
6 */
8 #include "etherboot.h"
9 #include "dev.h"
10 #include "console.h"
12 #include "config/general.h"
15 * Build ID string calculations
18 #undef XSTR
19 #undef STR
20 #define XSTR(s) STR(s)
21 #define STR(s) #s
23 #ifdef BUILD_SERIAL
24 #include "config/.buildserial.h"
25 #define BUILD_SERIAL_STR " #" XSTR(BUILD_SERIAL_NUM)
26 #else
27 #define BUILD_SERIAL_STR ""
28 #endif
30 #ifdef BUILD_ID
31 #define BUILD_ID_STR " " BUILD_ID
32 #else
33 #define BUILD_ID_STR ""
34 #endif
36 #if defined(BUILD_ID) || defined(BUILD_SERIAL)
37 #define BUILD_STRING " [build" BUILD_ID_STR BUILD_SERIAL_STR "]"
38 #else
39 #define BUILD_STRING ""
40 #endif
43 * Drag in all requested console types
45 * CONSOLE_DUAL sets both CONSOLE_FIRMWARE and CONSOLE_SERIAL for
46 * legacy compatibility.
50 #ifdef CONSOLE_DUAL
51 #undef CONSOLE_FIRMWARE
52 #define CONSOLE_FIRMWARE 1
53 #undef CONSOLE_SERIAL
54 #define CONSOLE_SERIAL 1
55 #endif
57 #ifdef CONSOLE_FIRMWARE
58 REQUIRE_OBJECT ( bios_console );
59 #endif
61 #ifdef CONSOLE_SERIAL
62 REQUIRE_OBJECT ( serial );
63 #endif
65 #ifdef CONSOLE_DIRECT_VGA
66 REQUIRE_OBJECT ( video_subr );
67 #endif
69 #ifdef CONSOLE_BTEXT
70 REQUIRE_OBJECT ( btext );
71 #endif
73 #ifdef CONSOLE_PC_KBD
74 REQUIRE_OBJECT ( pc_kbd );
75 #endif
77 #ifdef CONSOLE_SYSLOG
78 REQUIRE_OBJECT ( syslog );
79 #endif
82 * Drag in all requested protocols
85 #ifdef DOWNLOAD_PROTO_TFTP
86 REQUIRE_OBJECT ( tftp );
87 #endif
88 #ifdef DOWNLOAD_PROTO_NFS
89 REQUIRE_OBJECT ( nfs );
90 #endif
91 #ifdef DOWNLOAD_PROTO_HTTP
92 REQUIRE_OBJECT ( http );
93 #endif
94 #ifdef DOWNLOAD_PROTO_FTP
95 REQUIRE_OBJECT ( ftp );
96 #endif
97 #ifdef DOWNLOAD_PROTO_TFTM
98 REQUIRE_OBJECT ( tftm );
99 #endif
100 #ifdef DOWNLOAD_PROTO_SLAM
101 REQUIRE_OBJECT ( slam );
102 #endif
105 * Drag in any required resolvers
108 #ifdef DNS_RESOLVER
109 REQUIRE_OBJECT ( dns );
110 #endif
112 #ifdef NMB_RESOLVER
113 REQUIRE_OBJECT ( nmb );
114 #endif
117 * Drag in all requested image formats
120 #ifdef IMAGE_NBI
121 REQUIRE_OBJECT ( nbi );
122 #endif
123 #ifdef IMAGE_ELF64
124 REQUIRE_OBJECT ( elf64 );
125 #endif
126 #ifdef IMAGE_ELF
127 REQUIRE_OBJECT ( elf );
128 #endif
129 #ifdef IMAGE_ELF
130 REQUIRE_OBJECT ( coff );
131 #endif
132 #ifdef IMAGE_FREEBSD
133 REQUIRE_OBJECT ( freebsd );
134 #endif
135 #ifdef IMAGE_MULTIBOOT
136 REQUIRE_OBJECT ( multiboot );
137 #endif
138 #ifdef IMAGE_AOUT
139 REQUIRE_OBJECT ( aout );
140 #endif
141 #ifdef IMAGE_WINCE
142 REQUIRE_OBJECT ( wince );
143 #endif
144 #ifdef IMAGE_PXE
145 REQUIRE_OBJECT ( pxe_image );
146 #endif
147 #ifdef IMAGE_SCRIPT
148 REQUIRE_OBJECT ( script );
149 #endif
150 #ifdef IMAGE_BZIMAGE
151 REQUIRE_OBJECT ( bzimage );
152 #endif
153 #ifdef IMAGE_ELTORITO
154 REQUIRE_OBJECT ( eltorito );
155 #endif
158 * Drag in all requested commands
161 #ifdef AUTOBOOT_CMD
162 REQUIRE_OBJECT ( autoboot_cmd );
163 #endif
164 #ifdef NVO_CMD
165 REQUIRE_OBJECT ( nvo_cmd );
166 #endif
167 #ifdef CONFIG_CMD
168 REQUIRE_OBJECT ( config_cmd );
169 #endif
170 #ifdef IFMGMT_CMD
171 REQUIRE_OBJECT ( ifmgmt_cmd );
172 #endif
173 #ifdef ROUTE_CMD
174 REQUIRE_OBJECT ( route_cmd );
175 #endif
176 #ifdef IMAGE_CMD
177 REQUIRE_OBJECT ( image_cmd );
178 #endif
179 #ifdef DHCP_CMD
180 REQUIRE_OBJECT ( dhcp_cmd );
181 #endif
184 * Drag in miscellaneous objects
187 #ifdef NULL_TRAP
188 REQUIRE_OBJECT ( nulltrap );
189 #endif
190 #ifdef DUMP_GDBSYM
191 REQUIRE_OBJECT ( gdbsym );
192 #endif