Config-build.in 13 KB

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