Config-build.in 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. # Copyright (C) 2006-2013 OpenWrt.org
  2. # Copyright (C) 2016 LEDE Project
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. menu "Global build settings"
  8. config JSON_OVERVIEW_IMAGE_INFO
  9. bool "Create JSON info file overview per target"
  10. default BUILDBOT
  11. help
  12. Create a JSON info file called profiles.json in the target
  13. directory containing machine readable list of built profiles
  14. and resulting images.
  15. config ALL_NONSHARED
  16. bool "Select all target specific packages by default"
  17. select ALL_KMODS
  18. default BUILDBOT
  19. config ALL_KMODS
  20. bool "Select all kernel module packages by default"
  21. config ALL
  22. bool "Select all userspace packages by default"
  23. select ALL_KMODS
  24. select ALL_NONSHARED
  25. config BUILDBOT
  26. bool "Set build defaults for automatic builds (e.g. via buildbot)"
  27. default n
  28. help
  29. This option changes several defaults to be more suitable for
  30. automatic builds. This includes the following changes:
  31. - Deleting build directories after compiling (to save space)
  32. - Enabling per-device rootfs support
  33. ...
  34. config SIGNED_PACKAGES
  35. bool "Cryptographically signed package lists"
  36. default y
  37. config SIGNATURE_CHECK
  38. bool "Enable signature checking in opkg"
  39. default SIGNED_PACKAGES
  40. comment "General build options"
  41. config TESTING_KERNEL
  42. bool "Use the testing kernel version"
  43. depends on HAS_TESTING_KERNEL
  44. default n
  45. help
  46. If the target supports a newer kernel version than the default,
  47. you can use this config option to enable it
  48. config DISPLAY_SUPPORT
  49. bool "Show packages that require graphics support (local or remote)"
  50. default n
  51. config BUILD_PATENTED
  52. default n
  53. bool "Compile with support for patented functionality"
  54. help
  55. When this option is disabled, software which provides patented functionality
  56. will not be built. In case software provides optional support for patented
  57. functionality, this optional support will get disabled for this package.
  58. config BUILD_NLS
  59. default n
  60. bool "Compile with full language support"
  61. help
  62. When this option is enabled, packages are built with the full versions of
  63. iconv and GNU gettext instead of the default OpenWrt stubs. If uClibc is
  64. used, it is also built with locale support.
  65. config SHADOW_PASSWORDS
  66. bool
  67. default y
  68. config CLEAN_IPKG
  69. bool
  70. prompt "Remove ipkg/opkg status data files in final images"
  71. default n
  72. help
  73. This removes all ipkg/opkg status data files from the target directory
  74. before building the root filesystem.
  75. config IPK_FILES_CHECKSUMS
  76. bool
  77. prompt "Record files checksums in package metadata"
  78. default n
  79. help
  80. This makes file checksums part of package metadata. It increases size
  81. but provides you with pkg_check command to check for flash coruptions.
  82. config INCLUDE_CONFIG
  83. bool "Include build configuration in firmware" if DEVEL
  84. default n
  85. help
  86. If enabled, buildinfo files will be stored in /etc/build.* of firmware.
  87. config REPRODUCIBLE_DEBUG_INFO
  88. bool "Make debug information reproducible"
  89. default BUILDBOT
  90. help
  91. This strips the local build path out of debug information. This has the
  92. advantage of making it reproducible, but the disadvantage of making local
  93. debugging using ./scripts/remote-gdb harder, since the debug data will
  94. no longer point to the full path on the build host.
  95. config COLLECT_KERNEL_DEBUG
  96. bool
  97. prompt "Collect kernel debug information"
  98. select KERNEL_DEBUG_INFO
  99. default BUILDBOT
  100. help
  101. This collects debugging symbols from the kernel and all compiled modules.
  102. Useful for release builds, so that kernel issues can be debugged offline
  103. later.
  104. menu "Kernel build options"
  105. source "config/Config-kernel.in"
  106. endmenu
  107. comment "Package build options"
  108. config DEBUG
  109. bool
  110. prompt "Compile packages with debugging info"
  111. default n
  112. help
  113. Adds -g3 to the CFLAGS.
  114. config IPV6
  115. bool
  116. prompt "Enable IPv6 support in packages"
  117. default y
  118. help
  119. Enables IPv6 support in kernel (builtin) and packages.
  120. comment "Stripping options"
  121. choice
  122. prompt "Binary stripping method"
  123. default USE_STRIP if EXTERNAL_TOOLCHAIN
  124. default USE_STRIP if USE_GLIBC
  125. default USE_SSTRIP
  126. help
  127. Select the binary stripping method you wish to use.
  128. config NO_STRIP
  129. bool "none"
  130. help
  131. This will install unstripped binaries (useful for native
  132. compiling/debugging).
  133. config USE_STRIP
  134. bool "strip"
  135. help
  136. This will install binaries stripped using strip from binutils.
  137. config USE_SSTRIP
  138. bool "sstrip"
  139. depends on !USE_GLIBC
  140. help
  141. This will install binaries stripped using sstrip.
  142. endchoice
  143. config STRIP_ARGS
  144. string
  145. prompt "Strip arguments"
  146. depends on USE_STRIP
  147. default "--strip-unneeded --remove-section=.comment --remove-section=.note" if DEBUG
  148. default "--strip-all"
  149. help
  150. Specifies arguments passed to the strip command when stripping binaries.
  151. config STRIP_KERNEL_EXPORTS
  152. bool "Strip unnecessary exports from the kernel image"
  153. help
  154. Reduces kernel size by stripping unused kernel exports from the kernel
  155. image. Note that this might make the kernel incompatible with any kernel
  156. modules that were not selected at the time the kernel image was created.
  157. config USE_MKLIBS
  158. bool "Strip unnecessary functions from libraries"
  159. help
  160. Reduces libraries to only those functions that are necessary for using all
  161. selected packages (including those selected as <M>). Note that this will
  162. make the system libraries incompatible with most of the packages that are
  163. not selected during the build process.
  164. choice
  165. prompt "Preferred standard C++ library"
  166. default USE_LIBSTDCXX if USE_GLIBC
  167. default USE_UCLIBCXX
  168. help
  169. Select the preferred standard C++ library for all packages that support this.
  170. config USE_UCLIBCXX
  171. bool "uClibc++"
  172. config USE_LIBCXX
  173. bool "libc++"
  174. depends on !USE_UCLIBC
  175. config USE_LIBSTDCXX
  176. bool "libstdc++"
  177. endchoice
  178. comment "Hardening build options"
  179. config PKG_CHECK_FORMAT_SECURITY
  180. bool
  181. prompt "Enable gcc format-security"
  182. default y
  183. help
  184. Add -Wformat -Werror=format-security to the CFLAGS. You can disable
  185. this per package by adding PKG_CHECK_FORMAT_SECURITY:=0 in the package
  186. Makefile.
  187. choice
  188. prompt "User space ASLR PIE compilation"
  189. default PKG_ASLR_PIE_NONE if ((SMALL_FLASH || LOW_MEMORY_FOOTPRINT) && !SDK)
  190. default PKG_ASLR_PIE_REGULAR
  191. help
  192. Add -fPIC to CFLAGS and -specs=hardened-build-ld to LDFLAGS.
  193. This enables package build as Position Independent Executables (PIE)
  194. to protect against "return-to-text" attacks. This belongs to the
  195. feature of Address Space Layout Randomisation (ASLR), which is
  196. implemented by the kernel and the ELF loader by randomising the
  197. location of memory allocations. This makes memory addresses harder
  198. to predict when an attacker is attempting a memory-corruption exploit.
  199. You can disable this per package by adding PKG_ASLR_PIE:=0 in the package
  200. Makefile.
  201. Be ware that ASLR increases the binary size.
  202. config PKG_ASLR_PIE_NONE
  203. bool "None"
  204. help
  205. PIE is deactivated for all applications
  206. config PKG_ASLR_PIE_REGULAR
  207. bool "Regular"
  208. help
  209. PIE is activated for some binaries, mostly network exposed applications
  210. config PKG_ASLR_PIE_ALL
  211. bool "All"
  212. select BUSYBOX_DEFAULT_PIE
  213. help
  214. PIE is activated for all applications
  215. endchoice
  216. choice
  217. prompt "User space Stack-Smashing Protection"
  218. default PKG_CC_STACKPROTECTOR_REGULAR
  219. help
  220. Enable GCC Stack Smashing Protection (SSP) for userspace applications
  221. config PKG_CC_STACKPROTECTOR_NONE
  222. bool "None"
  223. config PKG_CC_STACKPROTECTOR_REGULAR
  224. bool "Regular"
  225. config PKG_CC_STACKPROTECTOR_STRONG
  226. bool "Strong"
  227. endchoice
  228. choice
  229. prompt "Kernel space Stack-Smashing Protection"
  230. default KERNEL_CC_STACKPROTECTOR_REGULAR
  231. help
  232. Enable GCC Stack-Smashing Protection (SSP) for the kernel
  233. config KERNEL_CC_STACKPROTECTOR_NONE
  234. bool "None"
  235. config KERNEL_CC_STACKPROTECTOR_REGULAR
  236. bool "Regular"
  237. config KERNEL_CC_STACKPROTECTOR_STRONG
  238. bool "Strong"
  239. endchoice
  240. config KERNEL_STACKPROTECTOR
  241. bool
  242. default KERNEL_CC_STACKPROTECTOR_REGULAR || KERNEL_CC_STACKPROTECTOR_STRONG
  243. config KERNEL_STACKPROTECTOR_STRONG
  244. bool
  245. default KERNEL_CC_STACKPROTECTOR_STRONG
  246. choice
  247. prompt "Enable buffer-overflows detection (FORTIFY_SOURCE)"
  248. default PKG_FORTIFY_SOURCE_1
  249. help
  250. Enable the _FORTIFY_SOURCE macro which introduces additional
  251. checks to detect buffer-overflows in the following standard library
  252. functions: memcpy, mempcpy, memmove, memset, strcpy, stpcpy,
  253. strncpy, strcat, strncat, sprintf, vsprintf, snprintf, vsnprintf,
  254. gets. "Conservative" (_FORTIFY_SOURCE set to 1) only introduces
  255. checks that shouldn't change the behavior of conforming programs,
  256. while "aggressive" (_FORTIFY_SOURCES set to 2) some more checking is
  257. added, but some conforming programs might fail.
  258. config PKG_FORTIFY_SOURCE_NONE
  259. bool "None"
  260. config PKG_FORTIFY_SOURCE_1
  261. bool "Conservative"
  262. config PKG_FORTIFY_SOURCE_2
  263. bool "Aggressive"
  264. endchoice
  265. choice
  266. prompt "Enable RELRO protection"
  267. default PKG_RELRO_FULL
  268. help
  269. Enable a link-time protection known as RELRO (Relocation Read Only)
  270. which helps to protect from certain type of exploitation techniques
  271. altering the content of some ELF sections. "Partial" RELRO makes the
  272. .dynamic section not writeable after initialization, introducing
  273. almost no performance penalty, while "full" RELRO also marks the GOT
  274. as read-only at the cost of initializing all of it at startup.
  275. config PKG_RELRO_NONE
  276. bool "None"
  277. config PKG_RELRO_PARTIAL
  278. bool "Partial"
  279. config PKG_RELRO_FULL
  280. bool "Full"
  281. endchoice
  282. config TARGET_ROOTFS_SECURITY_LABELS
  283. bool
  284. select KERNEL_SQUASHFS_XATTR
  285. select KERNEL_EXT4_FS_SECURITY
  286. select KERNEL_F2FS_FS_SECURITY
  287. select KERNEL_UBIFS_FS_SECURITY
  288. select KERNEL_JFFS2_FS_SECURITY
  289. config SELINUX
  290. bool "Enable SELinux"
  291. select KERNEL_SECURITY_SELINUX
  292. select TARGET_ROOTFS_SECURITY_LABELS
  293. select PACKAGE_procd-selinux
  294. select PACKAGE_busybox-selinux
  295. help
  296. This option enables SELinux kernel features, applies security labels
  297. in squashfs rootfs and selects the selinux-variants of busybox and procd.
  298. Selecting this option results in about 0.5MiB of additional flash space
  299. usage accounting for increased kernel and rootfs size.
  300. choice
  301. prompt "default SELinux type"
  302. depends on TARGET_ROOTFS_SECURITY_LABELS
  303. default SELINUXTYPE_dssp
  304. help
  305. Select SELinux policy to be installed and used for applying rootfs labels.
  306. config SELINUXTYPE_targeted
  307. bool "targeted"
  308. select PACKAGE_refpolicy
  309. help
  310. SELinux Reference Policy (refpolicy)
  311. config SELINUXTYPE_targeted-modular
  312. bool "targeted-modular"
  313. select PACKAGE_refpolicy-modular
  314. help
  315. Modular SELinux Reference Policy (refpolicy-modular)
  316. config SELINUXTYPE_dssp
  317. bool "dssp"
  318. select PACKAGE_selinux-policy
  319. help
  320. Defensec SELinux Security Policy -- OpenWrt edition
  321. endchoice
  322. endmenu