Config-build.in 13 KB

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