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 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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. */
  7. FILE_LICENCE ( GPL2_OR_LATER );
  8. #include <config/general.h>
  9. #include <config/console.h>
  10. #include <config/sideband.h>
  11. /** @file
  12. *
  13. * Configuration options
  14. *
  15. * This file contains macros that pull various objects into the link
  16. * based on definitions in configuration header files. Ideally it
  17. * should be the only place in iPXE where one might need to use #ifdef
  18. * for compile-time options.
  19. *
  20. * In the fairly common case where an object should only be considered
  21. * for inclusion if the subsystem it depends on is present, its
  22. * configuration macros should be placed in a file named
  23. * <tt>config_<i>subsystem</i>.c</tt>, where @e subsystem is the
  24. * object basename of the main source file for that subsystem. The
  25. * build system will pull in that file if @c subsystem.c is included
  26. * in the final iPXE executable built.
  27. */
  28. /*
  29. * Build ID string calculations
  30. *
  31. */
  32. #undef XSTR
  33. #undef STR
  34. #define XSTR(s) STR(s)
  35. #define STR(s) #s
  36. #ifdef BUILD_SERIAL
  37. #include "config/.buildserial.h"
  38. #define BUILD_SERIAL_STR " #" XSTR(BUILD_SERIAL_NUM)
  39. #else
  40. #define BUILD_SERIAL_STR ""
  41. #endif
  42. #ifdef BUILD_ID
  43. #define BUILD_ID_STR " " BUILD_ID
  44. #else
  45. #define BUILD_ID_STR ""
  46. #endif
  47. #if defined(BUILD_ID) || defined(BUILD_SERIAL)
  48. #define BUILD_STRING " [build" BUILD_ID_STR BUILD_SERIAL_STR "]"
  49. #else
  50. #define BUILD_STRING ""
  51. #endif
  52. /*
  53. * Drag in all requested console types
  54. *
  55. */
  56. #ifdef CONSOLE_PCBIOS
  57. REQUIRE_OBJECT ( bios_console );
  58. #endif
  59. #ifdef CONSOLE_SERIAL
  60. REQUIRE_OBJECT ( serial_console );
  61. #endif
  62. #ifdef CONSOLE_DIRECT_VGA
  63. REQUIRE_OBJECT ( video_subr );
  64. #endif
  65. #ifdef CONSOLE_BTEXT
  66. REQUIRE_OBJECT ( btext );
  67. #endif
  68. #ifdef CONSOLE_PC_KBD
  69. REQUIRE_OBJECT ( pc_kbd );
  70. #endif
  71. #ifdef CONSOLE_SYSLOG
  72. REQUIRE_OBJECT ( syslog );
  73. #endif
  74. #ifdef CONSOLE_EFI
  75. REQUIRE_OBJECT ( efi_console );
  76. #endif
  77. #ifdef CONSOLE_LINUX
  78. REQUIRE_OBJECT ( linux_console );
  79. #endif
  80. #ifdef CONSOLE_VMWARE
  81. REQUIRE_OBJECT ( vmconsole );
  82. #endif
  83. /*
  84. * Drag in all requested network protocols
  85. *
  86. */
  87. #ifdef NET_PROTO_IPV4
  88. REQUIRE_OBJECT ( ipv4 );
  89. #endif
  90. /*
  91. * Drag in all requested PXE support
  92. *
  93. */
  94. #ifdef PXE_MENU
  95. REQUIRE_OBJECT ( pxemenu );
  96. #endif
  97. #ifdef PXE_STACK
  98. REQUIRE_OBJECT ( pxe_call );
  99. #endif
  100. /*
  101. * Drag in all requested download protocols
  102. *
  103. */
  104. #ifdef DOWNLOAD_PROTO_TFTP
  105. REQUIRE_OBJECT ( tftp );
  106. #endif
  107. #ifdef DOWNLOAD_PROTO_HTTP
  108. REQUIRE_OBJECT ( http );
  109. #endif
  110. #ifdef DOWNLOAD_PROTO_HTTPS
  111. REQUIRE_OBJECT ( https );
  112. #endif
  113. #ifdef DOWNLOAD_PROTO_FTP
  114. REQUIRE_OBJECT ( ftp );
  115. #endif
  116. #ifdef DOWNLOAD_PROTO_TFTM
  117. REQUIRE_OBJECT ( tftm );
  118. #endif
  119. #ifdef DOWNLOAD_PROTO_SLAM
  120. REQUIRE_OBJECT ( slam );
  121. #endif
  122. /*
  123. * Drag in all requested SAN boot protocols
  124. *
  125. */
  126. #ifdef SANBOOT_PROTO_ISCSI
  127. REQUIRE_OBJECT ( iscsi );
  128. #endif
  129. /*
  130. * Drag in all requested resolvers
  131. *
  132. */
  133. #ifdef DNS_RESOLVER
  134. REQUIRE_OBJECT ( dns );
  135. #endif
  136. /*
  137. * Drag in all requested image formats
  138. *
  139. */
  140. #ifdef IMAGE_NBI
  141. REQUIRE_OBJECT ( nbi );
  142. #endif
  143. #ifdef IMAGE_ELF
  144. REQUIRE_OBJECT ( elfboot );
  145. #endif
  146. #ifdef IMAGE_FREEBSD
  147. REQUIRE_OBJECT ( freebsd );
  148. #endif
  149. #ifdef IMAGE_MULTIBOOT
  150. REQUIRE_OBJECT ( multiboot );
  151. #endif
  152. #ifdef IMAGE_AOUT
  153. REQUIRE_OBJECT ( aout );
  154. #endif
  155. #ifdef IMAGE_WINCE
  156. REQUIRE_OBJECT ( wince );
  157. #endif
  158. #ifdef IMAGE_PXE
  159. REQUIRE_OBJECT ( pxe_image );
  160. #endif
  161. #ifdef IMAGE_SCRIPT
  162. REQUIRE_OBJECT ( script );
  163. #endif
  164. #ifdef IMAGE_BZIMAGE
  165. REQUIRE_OBJECT ( bzimage );
  166. #endif
  167. #ifdef IMAGE_ELTORITO
  168. REQUIRE_OBJECT ( eltorito );
  169. #endif
  170. #ifdef IMAGE_COMBOOT
  171. REQUIRE_OBJECT ( comboot );
  172. REQUIRE_OBJECT ( com32 );
  173. REQUIRE_OBJECT ( comboot_call );
  174. REQUIRE_OBJECT ( com32_call );
  175. REQUIRE_OBJECT ( com32_wrapper );
  176. REQUIRE_OBJECT ( comboot_resolv );
  177. #endif
  178. #ifdef IMAGE_EFI
  179. REQUIRE_OBJECT ( efi_image );
  180. #endif
  181. /*
  182. * Drag in all requested commands
  183. *
  184. */
  185. #ifdef AUTOBOOT_CMD
  186. REQUIRE_OBJECT ( autoboot_cmd );
  187. #endif
  188. #ifdef NVO_CMD
  189. REQUIRE_OBJECT ( nvo_cmd );
  190. #endif
  191. #ifdef CONFIG_CMD
  192. REQUIRE_OBJECT ( config_cmd );
  193. #endif
  194. #ifdef IFMGMT_CMD
  195. REQUIRE_OBJECT ( ifmgmt_cmd );
  196. #endif
  197. /* IWMGMT_CMD is brought in by net80211.c if requested */
  198. #ifdef ROUTE_CMD
  199. REQUIRE_OBJECT ( route_cmd );
  200. #endif
  201. #ifdef IMAGE_CMD
  202. REQUIRE_OBJECT ( image_cmd );
  203. #endif
  204. #ifdef IMAGE_TRUST_CMD
  205. REQUIRE_OBJECT ( image_trust_cmd );
  206. #endif
  207. #ifdef DHCP_CMD
  208. REQUIRE_OBJECT ( dhcp_cmd );
  209. #endif
  210. #ifdef SANBOOT_CMD
  211. REQUIRE_OBJECT ( sanboot_cmd );
  212. #endif
  213. #ifdef LOGIN_CMD
  214. REQUIRE_OBJECT ( login_cmd );
  215. #endif
  216. #ifdef TIME_CMD
  217. REQUIRE_OBJECT ( time_cmd );
  218. #endif
  219. #ifdef DIGEST_CMD
  220. REQUIRE_OBJECT ( digest_cmd );
  221. #endif
  222. #ifdef PXE_CMD
  223. REQUIRE_OBJECT ( pxe_cmd );
  224. #endif
  225. #ifdef LOTEST_CMD
  226. REQUIRE_OBJECT ( lotest_cmd );
  227. #endif
  228. #ifdef VLAN_CMD
  229. REQUIRE_OBJECT ( vlan_cmd );
  230. #endif
  231. #ifdef REBOOT_CMD
  232. REQUIRE_OBJECT ( reboot_cmd );
  233. #endif
  234. /*
  235. * Drag in miscellaneous objects
  236. *
  237. */
  238. #ifdef NULL_TRAP
  239. REQUIRE_OBJECT ( nulltrap );
  240. #endif
  241. #ifdef GDBSERIAL
  242. REQUIRE_OBJECT ( gdbidt );
  243. REQUIRE_OBJECT ( gdbserial );
  244. REQUIRE_OBJECT ( gdbstub_cmd );
  245. #endif
  246. #ifdef GDBUDP
  247. REQUIRE_OBJECT ( gdbidt );
  248. REQUIRE_OBJECT ( gdbudp );
  249. REQUIRE_OBJECT ( gdbstub_cmd );
  250. #endif
  251. /*
  252. * Drag in objects that are always required, but not dragged in via
  253. * symbol dependencies.
  254. *
  255. */
  256. REQUIRE_OBJECT ( device );
  257. REQUIRE_OBJECT ( embedded );
  258. /* linux drivers aren't picked up by the parserom utility so drag them in here */
  259. #ifdef DRIVERS_LINUX
  260. REQUIRE_OBJECT ( tap );
  261. #endif
  262. /*
  263. * Drag in relevant BOFM entry points
  264. */
  265. #ifdef CONFIG_BOFM
  266. #ifdef BOFM_EFI
  267. REQUIRE_OBJECT ( efi_bofm );
  268. #endif /* BOFM_EFI */
  269. #endif /* CONFIG_BOFM */
  270. /*
  271. * Drag in selected keyboard map
  272. */
  273. #define REQUIRE_KEYMAP_OBJECT( _map ) REQUIRE_OBJECT ( keymap_ ## _map )
  274. #define REQUIRE_KEYMAP( _map ) REQUIRE_KEYMAP_OBJECT ( _map )
  275. REQUIRE_KEYMAP ( KEYBOARD_MAP );