Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

config.c 7.3KB

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