Config-build.in 12 KB

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