You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

config.c 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  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. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  22. #include <config/general.h>
  23. #include <config/console.h>
  24. #include <config/sideband.h>
  25. #include <config/settings.h>
  26. /** @file
  27. *
  28. * Configuration options
  29. *
  30. * This file contains macros that pull various objects into the link
  31. * based on definitions in configuration header files. Ideally it
  32. * should be the only place in iPXE where one might need to use #ifdef
  33. * for compile-time options.
  34. *
  35. * In the fairly common case where an object should only be considered
  36. * for inclusion if the subsystem it depends on is present, its
  37. * configuration macros should be placed in a file named
  38. * <tt>config_<i>subsystem</i>.c</tt>, where @e subsystem is the
  39. * object basename of the main source file for that subsystem. The
  40. * build system will pull in that file if @c subsystem.c is included
  41. * in the final iPXE executable built.
  42. */
  43. /*
  44. * Build ID string calculations
  45. *
  46. */
  47. #undef XSTR
  48. #undef STR
  49. #define XSTR(s) STR(s)
  50. #define STR(s) #s
  51. #ifdef BUILD_SERIAL
  52. #include "config/.buildserial.h"
  53. #define BUILD_SERIAL_STR " #" XSTR(BUILD_SERIAL_NUM)
  54. #else
  55. #define BUILD_SERIAL_STR ""
  56. #endif
  57. #ifdef BUILD_ID
  58. #define BUILD_ID_STR " " BUILD_ID
  59. #else
  60. #define BUILD_ID_STR ""
  61. #endif
  62. #if defined(BUILD_ID) || defined(BUILD_SERIAL)
  63. #define BUILD_STRING " [build" BUILD_ID_STR BUILD_SERIAL_STR "]"
  64. #else
  65. #define BUILD_STRING ""
  66. #endif
  67. /*
  68. * Drag in all requested console types
  69. *
  70. */
  71. #ifdef CONSOLE_PCBIOS
  72. REQUIRE_OBJECT ( bios_console );
  73. #endif
  74. #ifdef CONSOLE_SERIAL
  75. REQUIRE_OBJECT ( serial_console );
  76. #endif
  77. #ifdef CONSOLE_DIRECT_VGA
  78. REQUIRE_OBJECT ( video_subr );
  79. #endif
  80. #ifdef CONSOLE_PC_KBD
  81. REQUIRE_OBJECT ( pc_kbd );
  82. #endif
  83. #ifdef CONSOLE_SYSLOG
  84. REQUIRE_OBJECT ( syslog );
  85. #endif
  86. #ifdef CONSOLE_SYSLOGS
  87. REQUIRE_OBJECT ( syslogs );
  88. #endif
  89. #ifdef CONSOLE_EFI
  90. REQUIRE_OBJECT ( efi_console );
  91. #endif
  92. #ifdef CONSOLE_LINUX
  93. REQUIRE_OBJECT ( linux_console );
  94. #endif
  95. #ifdef CONSOLE_VMWARE
  96. REQUIRE_OBJECT ( vmconsole );
  97. #endif
  98. #ifdef CONSOLE_DEBUGCON
  99. REQUIRE_OBJECT ( debugcon );
  100. #endif
  101. #ifdef CONSOLE_VESAFB
  102. REQUIRE_OBJECT ( vesafb );
  103. #endif
  104. /*
  105. * Drag in all requested network protocols
  106. *
  107. */
  108. #ifdef NET_PROTO_IPV4
  109. REQUIRE_OBJECT ( ipv4 );
  110. #endif
  111. #ifdef NET_PROTO_IPV6
  112. REQUIRE_OBJECT ( ipv6 );
  113. #endif
  114. /*
  115. * Drag in all requested PXE support
  116. *
  117. */
  118. #ifdef PXE_MENU
  119. REQUIRE_OBJECT ( pxemenu );
  120. #endif
  121. #ifdef PXE_STACK
  122. REQUIRE_OBJECT ( pxe_call );
  123. #endif
  124. /*
  125. * Drag in all requested download protocols
  126. *
  127. */
  128. #ifdef DOWNLOAD_PROTO_TFTP
  129. REQUIRE_OBJECT ( tftp );
  130. #endif
  131. #ifdef DOWNLOAD_PROTO_HTTP
  132. REQUIRE_OBJECT ( http );
  133. #endif
  134. #ifdef DOWNLOAD_PROTO_HTTPS
  135. REQUIRE_OBJECT ( https );
  136. #endif
  137. #ifdef DOWNLOAD_PROTO_FTP
  138. REQUIRE_OBJECT ( ftp );
  139. #endif
  140. #ifdef DOWNLOAD_PROTO_NFS
  141. REQUIRE_OBJECT ( nfs_open );
  142. #endif
  143. #ifdef DOWNLOAD_PROTO_SLAM
  144. REQUIRE_OBJECT ( slam );
  145. #endif
  146. /*
  147. * Drag in all requested SAN boot protocols
  148. *
  149. */
  150. #ifdef SANBOOT_PROTO_ISCSI
  151. REQUIRE_OBJECT ( iscsi );
  152. #endif
  153. /*
  154. * Drag in all requested resolvers
  155. *
  156. */
  157. #ifdef DNS_RESOLVER
  158. REQUIRE_OBJECT ( dns );
  159. #endif
  160. /*
  161. * Drag in all requested image formats
  162. *
  163. */
  164. #ifdef IMAGE_NBI
  165. REQUIRE_OBJECT ( nbi );
  166. #endif
  167. #ifdef IMAGE_ELF
  168. REQUIRE_OBJECT ( elfboot );
  169. #endif
  170. #ifdef IMAGE_MULTIBOOT
  171. REQUIRE_OBJECT ( multiboot );
  172. #endif
  173. #ifdef IMAGE_PXE
  174. REQUIRE_OBJECT ( pxe_image );
  175. #endif
  176. #ifdef IMAGE_SCRIPT
  177. REQUIRE_OBJECT ( script );
  178. #endif
  179. #ifdef IMAGE_BZIMAGE
  180. REQUIRE_OBJECT ( bzimage );
  181. #endif
  182. #ifdef IMAGE_ELTORITO
  183. REQUIRE_OBJECT ( eltorito );
  184. #endif
  185. #ifdef IMAGE_COMBOOT
  186. REQUIRE_OBJECT ( comboot );
  187. REQUIRE_OBJECT ( com32 );
  188. REQUIRE_OBJECT ( comboot_call );
  189. REQUIRE_OBJECT ( com32_call );
  190. REQUIRE_OBJECT ( com32_wrapper );
  191. REQUIRE_OBJECT ( comboot_resolv );
  192. #endif
  193. #ifdef IMAGE_EFI
  194. REQUIRE_OBJECT ( efi_image );
  195. #endif
  196. #ifdef IMAGE_SDI
  197. REQUIRE_OBJECT ( sdi );
  198. #endif
  199. #ifdef IMAGE_PNM
  200. REQUIRE_OBJECT ( pnm );
  201. #endif
  202. #ifdef IMAGE_PNG
  203. REQUIRE_OBJECT ( png );
  204. #endif
  205. /*
  206. * Drag in all requested commands
  207. *
  208. */
  209. #ifdef AUTOBOOT_CMD
  210. REQUIRE_OBJECT ( autoboot_cmd );
  211. #endif
  212. #ifdef NVO_CMD
  213. REQUIRE_OBJECT ( nvo_cmd );
  214. #endif
  215. #ifdef CONFIG_CMD
  216. REQUIRE_OBJECT ( config_cmd );
  217. #endif
  218. #ifdef IFMGMT_CMD
  219. REQUIRE_OBJECT ( ifmgmt_cmd );
  220. #endif
  221. /* IWMGMT_CMD is brought in by net80211.c if requested */
  222. #ifdef ROUTE_CMD
  223. REQUIRE_OBJECT ( route_cmd );
  224. #endif
  225. #ifdef IMAGE_CMD
  226. REQUIRE_OBJECT ( image_cmd );
  227. #endif
  228. #ifdef IMAGE_TRUST_CMD
  229. REQUIRE_OBJECT ( image_trust_cmd );
  230. #endif
  231. #ifdef DHCP_CMD
  232. REQUIRE_OBJECT ( dhcp_cmd );
  233. #endif
  234. #ifdef SANBOOT_CMD
  235. REQUIRE_OBJECT ( sanboot_cmd );
  236. #endif
  237. #ifdef MENU_CMD
  238. REQUIRE_OBJECT ( menu_cmd );
  239. #endif
  240. #ifdef LOGIN_CMD
  241. REQUIRE_OBJECT ( login_cmd );
  242. #endif
  243. #ifdef TIME_CMD
  244. REQUIRE_OBJECT ( time_cmd );
  245. #endif
  246. #ifdef DIGEST_CMD
  247. REQUIRE_OBJECT ( digest_cmd );
  248. #endif
  249. #ifdef PXE_CMD
  250. REQUIRE_OBJECT ( pxe_cmd );
  251. #endif
  252. #ifdef LOTEST_CMD
  253. REQUIRE_OBJECT ( lotest_cmd );
  254. #endif
  255. #ifdef VLAN_CMD
  256. REQUIRE_OBJECT ( vlan_cmd );
  257. #endif
  258. #ifdef POWEROFF_CMD
  259. REQUIRE_OBJECT ( poweroff_cmd );
  260. #endif
  261. #ifdef REBOOT_CMD
  262. REQUIRE_OBJECT ( reboot_cmd );
  263. #endif
  264. #ifdef CPUID_CMD
  265. REQUIRE_OBJECT ( cpuid_cmd );
  266. #endif
  267. #ifdef SYNC_CMD
  268. REQUIRE_OBJECT ( sync_cmd );
  269. #endif
  270. #ifdef NSLOOKUP_CMD
  271. REQUIRE_OBJECT ( nslookup_cmd );
  272. #endif
  273. #ifdef PCI_CMD
  274. REQUIRE_OBJECT ( pci_cmd );
  275. #endif
  276. #ifdef PARAM_CMD
  277. REQUIRE_OBJECT ( param_cmd );
  278. #endif
  279. #ifdef NEIGHBOUR_CMD
  280. REQUIRE_OBJECT ( neighbour_cmd );
  281. #endif
  282. #ifdef PING_CMD
  283. REQUIRE_OBJECT ( ping_cmd );
  284. #endif
  285. #ifdef CONSOLE_CMD
  286. REQUIRE_OBJECT ( console_cmd );
  287. #endif
  288. #ifdef IPSTAT_CMD
  289. REQUIRE_OBJECT ( ipstat_cmd );
  290. #endif
  291. #ifdef PROFSTAT_CMD
  292. REQUIRE_OBJECT ( profstat_cmd );
  293. #endif
  294. /*
  295. * Drag in miscellaneous objects
  296. *
  297. */
  298. #ifdef NULL_TRAP
  299. REQUIRE_OBJECT ( nulltrap );
  300. #endif
  301. #ifdef GDBSERIAL
  302. REQUIRE_OBJECT ( gdbidt );
  303. REQUIRE_OBJECT ( gdbserial );
  304. REQUIRE_OBJECT ( gdbstub_cmd );
  305. #endif
  306. #ifdef GDBUDP
  307. REQUIRE_OBJECT ( gdbidt );
  308. REQUIRE_OBJECT ( gdbudp );
  309. REQUIRE_OBJECT ( gdbstub_cmd );
  310. #endif
  311. /*
  312. * Drag in objects that are always required, but not dragged in via
  313. * symbol dependencies.
  314. *
  315. */
  316. REQUIRE_OBJECT ( device );
  317. REQUIRE_OBJECT ( embedded );
  318. /* linux drivers aren't picked up by the parserom utility so drag them in here */
  319. #ifdef DRIVERS_LINUX
  320. REQUIRE_OBJECT ( tap );
  321. #endif
  322. /*
  323. * Drag in relevant sideband entry points
  324. */
  325. #ifdef CONFIG_BOFM
  326. #ifdef BOFM_EFI
  327. REQUIRE_OBJECT ( efi_bofm );
  328. #endif /* BOFM_EFI */
  329. #endif /* CONFIG_BOFM */
  330. /*
  331. * Drag in relevant settings sources
  332. */
  333. #ifdef PCI_SETTINGS
  334. REQUIRE_OBJECT ( pci_settings );
  335. #endif
  336. #ifdef VMWARE_SETTINGS
  337. REQUIRE_OBJECT ( guestinfo );
  338. #endif
  339. #ifdef CPUID_SETTINGS
  340. REQUIRE_OBJECT ( cpuid_settings );
  341. #endif
  342. #ifdef MEMMAP_SETTINGS
  343. REQUIRE_OBJECT ( memmap_settings );
  344. #endif
  345. /*
  346. * Drag in selected keyboard map
  347. */
  348. #define REQUIRE_KEYMAP_OBJECT( _map ) REQUIRE_OBJECT ( keymap_ ## _map )
  349. #define REQUIRE_KEYMAP( _map ) REQUIRE_KEYMAP_OBJECT ( _map )
  350. REQUIRE_KEYMAP ( KEYBOARD_MAP );