Config-build.in 11 KB

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