Config-build.in 12 KB

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