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.8KB

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_PC_KBD
  66. REQUIRE_OBJECT ( pc_kbd );
  67. #endif
  68. #ifdef CONSOLE_SYSLOG
  69. REQUIRE_OBJECT ( syslog );
  70. #endif
  71. #ifdef CONSOLE_SYSLOGS
  72. REQUIRE_OBJECT ( syslogs );
  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_SLAM
  117. REQUIRE_OBJECT ( slam );
  118. #endif
  119. /*
  120. * Drag in all requested SAN boot protocols
  121. *
  122. */
  123. #ifdef SANBOOT_PROTO_ISCSI
  124. REQUIRE_OBJECT ( iscsi );
  125. #endif
  126. /*
  127. * Drag in all requested resolvers
  128. *
  129. */
  130. #ifdef DNS_RESOLVER
  131. REQUIRE_OBJECT ( dns );
  132. #endif
  133. /*
  134. * Drag in all requested image formats
  135. *
  136. */
  137. #ifdef IMAGE_NBI
  138. REQUIRE_OBJECT ( nbi );
  139. #endif
  140. #ifdef IMAGE_ELF
  141. REQUIRE_OBJECT ( elfboot );
  142. #endif
  143. #ifdef IMAGE_MULTIBOOT
  144. REQUIRE_OBJECT ( multiboot );
  145. #endif
  146. #ifdef IMAGE_PXE
  147. REQUIRE_OBJECT ( pxe_image );
  148. #endif
  149. #ifdef IMAGE_SCRIPT
  150. REQUIRE_OBJECT ( script );
  151. #endif
  152. #ifdef IMAGE_BZIMAGE
  153. REQUIRE_OBJECT ( bzimage );
  154. #endif
  155. #ifdef IMAGE_ELTORITO
  156. REQUIRE_OBJECT ( eltorito );
  157. #endif
  158. #ifdef IMAGE_COMBOOT
  159. REQUIRE_OBJECT ( comboot );
  160. REQUIRE_OBJECT ( com32 );
  161. REQUIRE_OBJECT ( comboot_call );
  162. REQUIRE_OBJECT ( com32_call );
  163. REQUIRE_OBJECT ( com32_wrapper );
  164. REQUIRE_OBJECT ( comboot_resolv );
  165. #endif
  166. #ifdef IMAGE_EFI
  167. REQUIRE_OBJECT ( efi_image );
  168. #endif
  169. /*
  170. * Drag in all requested commands
  171. *
  172. */
  173. #ifdef AUTOBOOT_CMD
  174. REQUIRE_OBJECT ( autoboot_cmd );
  175. #endif
  176. #ifdef NVO_CMD
  177. REQUIRE_OBJECT ( nvo_cmd );
  178. #endif
  179. #ifdef CONFIG_CMD
  180. REQUIRE_OBJECT ( config_cmd );
  181. #endif
  182. #ifdef IFMGMT_CMD
  183. REQUIRE_OBJECT ( ifmgmt_cmd );
  184. #endif
  185. /* IWMGMT_CMD is brought in by net80211.c if requested */
  186. #ifdef ROUTE_CMD
  187. REQUIRE_OBJECT ( route_cmd );
  188. #endif
  189. #ifdef IMAGE_CMD
  190. REQUIRE_OBJECT ( image_cmd );
  191. #endif
  192. #ifdef IMAGE_TRUST_CMD
  193. REQUIRE_OBJECT ( image_trust_cmd );
  194. #endif
  195. #ifdef DHCP_CMD
  196. REQUIRE_OBJECT ( dhcp_cmd );
  197. #endif
  198. #ifdef SANBOOT_CMD
  199. REQUIRE_OBJECT ( sanboot_cmd );
  200. #endif
  201. #ifdef MENU_CMD
  202. REQUIRE_OBJECT ( menu_cmd );
  203. #endif
  204. #ifdef LOGIN_CMD
  205. REQUIRE_OBJECT ( login_cmd );
  206. #endif
  207. #ifdef TIME_CMD
  208. REQUIRE_OBJECT ( time_cmd );
  209. #endif
  210. #ifdef DIGEST_CMD
  211. REQUIRE_OBJECT ( digest_cmd );
  212. #endif
  213. #ifdef PXE_CMD
  214. REQUIRE_OBJECT ( pxe_cmd );
  215. #endif
  216. #ifdef LOTEST_CMD
  217. REQUIRE_OBJECT ( lotest_cmd );
  218. #endif
  219. #ifdef VLAN_CMD
  220. REQUIRE_OBJECT ( vlan_cmd );
  221. #endif
  222. #ifdef REBOOT_CMD
  223. REQUIRE_OBJECT ( reboot_cmd );
  224. #endif
  225. #ifdef CPUID_CMD
  226. REQUIRE_OBJECT ( cpuid_cmd );
  227. #endif
  228. #ifdef SYNC_CMD
  229. REQUIRE_OBJECT ( sync_cmd );
  230. #endif
  231. /*
  232. * Drag in miscellaneous objects
  233. *
  234. */
  235. #ifdef NULL_TRAP
  236. REQUIRE_OBJECT ( nulltrap );
  237. #endif
  238. #ifdef GDBSERIAL
  239. REQUIRE_OBJECT ( gdbidt );
  240. REQUIRE_OBJECT ( gdbserial );
  241. REQUIRE_OBJECT ( gdbstub_cmd );
  242. #endif
  243. #ifdef GDBUDP
  244. REQUIRE_OBJECT ( gdbidt );
  245. REQUIRE_OBJECT ( gdbudp );
  246. REQUIRE_OBJECT ( gdbstub_cmd );
  247. #endif
  248. /*
  249. * Drag in objects that are always required, but not dragged in via
  250. * symbol dependencies.
  251. *
  252. */
  253. REQUIRE_OBJECT ( device );
  254. REQUIRE_OBJECT ( embedded );
  255. /* linux drivers aren't picked up by the parserom utility so drag them in here */
  256. #ifdef DRIVERS_LINUX
  257. REQUIRE_OBJECT ( tap );
  258. #endif
  259. /*
  260. * Drag in relevant sideband entry points
  261. */
  262. #ifdef CONFIG_BOFM
  263. #ifdef BOFM_EFI
  264. REQUIRE_OBJECT ( efi_bofm );
  265. #endif /* BOFM_EFI */
  266. #endif /* CONFIG_BOFM */
  267. #ifdef VMWARE_SETTINGS
  268. REQUIRE_OBJECT ( guestinfo );
  269. #endif /* VMWARE_SETTINGS */
  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 );