Config-build.in 14 KB

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