b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | # |
| 3 | # Copyright (C) 2006-2013 OpenWrt.org |
| 4 | # Copyright (C) 2016 LEDE Project |
| 5 | |
| 6 | config EXPERIMENTAL |
| 7 | bool "Enable experimental features by default" |
| 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 | |
| 17 | If you plan to use this build in production, say NO! |
| 18 | |
| 19 | menu "Global build settings" |
| 20 | |
| 21 | config MPIPE_SHARE_NETWORK |
| 22 | bool "Config support internal access to the internet in pipe mode" |
| 23 | help |
| 24 | Not support large packets, i.e. fragment packet, need to control the packet |
| 25 | length to be less than MTU(default 1500). |
| 26 | default n |
| 27 | |
| 28 | config IPV6_POLICY_ROUTING |
| 29 | bool "Support configure IPv6 policy routes in dnsmasq" |
| 30 | help |
| 31 | Only works in MIFI mode and supports multiple PDN. |
| 32 | default n |
| 33 | |
| 34 | config SPI_LCD |
| 35 | bool "Config SPI interface driver for LCD" |
| 36 | default n |
| 37 | select KERNEL_FB |
| 38 | select KERNEL_FB_SPI_LCD |
| 39 | |
| 40 | config LCDC_SPI |
| 41 | bool "Config LCDC SPI interface driver for ASR 190x/1806" |
| 42 | depends on TARGET_mmp_asr1901 || TARGET_mmp_asr1903 || TARGET_mmp_asr1906 || TARGET_mmp_asr1806 |
| 43 | default n |
| 44 | select KERNEL_FB |
| 45 | select KERNEL_FB_ASR |
| 46 | select KERNEL_FB_ASR_SPI |
| 47 | |
| 48 | config LCDC_MCU |
| 49 | bool "Config LCDC MCU interface driver for ASR 190x/1806" |
| 50 | depends on TARGET_mmp_asr1901 || TARGET_mmp_asr1903 || TARGET_mmp_asr1906 || TARGET_mmp_asr1806 |
| 51 | default n |
| 52 | select KERNEL_FB |
| 53 | select KERNEL_FB_ASR |
| 54 | select KERNEL_FB_ASR_MCU |
| 55 | |
| 56 | config LCDC_MIPI |
| 57 | bool "Config LCDC MIPI interface driver for ASR 1806/1903" |
| 58 | depends on TARGET_mmp_asr1806 || TARGET_mmp_asr1903 |
| 59 | default n |
| 60 | select KERNEL_FB |
| 61 | select KERNEL_FB_ASR |
| 62 | select KERNEL_FB_ASR_MIPI |
| 63 | |
| 64 | config POSE |
| 65 | bool "Config support for POS-E" |
| 66 | depends on TARGET_mmp_asr1806_FACT301 |
| 67 | default n |
| 68 | select PACKAGE_camera |
| 69 | select PACKAGE_evtest |
| 70 | select PACKAGE_tslib |
| 71 | select KERNEL_POSE |
| 72 | select LCDC_MIPI |
| 73 | select KERNEL_PWM |
| 74 | select KERNEL_PWM_PXA |
| 75 | select KERNEL_PWM_SYSFS |
| 76 | select KERNEL_BACKLIGHT_CLASS_DEVICE |
| 77 | select KERNEL_BACKLIGHT_PWM |
| 78 | select KERNEL_INPUT_TOUCHSCREEN |
| 79 | select KERNEL_TOUCHSCREEN_PROPERTIES |
| 80 | select KERNEL_TOUCHSCREEN_EDT_FT5X06 |
| 81 | select CAMERA |
| 82 | help |
| 83 | This includes LCD and CAMERA functions, in addition to wifi and eth are |
| 84 | also support. |
| 85 | |
| 86 | config POSL |
| 87 | bool "Config support for POS-L" |
| 88 | depends on TARGET_mmp_asr1806_FACT301 |
| 89 | default n |
| 90 | select PACKAGE_camera |
| 91 | select PACKAGE_evtest |
| 92 | select PACKAGE_tslib |
| 93 | select KERNEL_POSL |
| 94 | select LCDC_SPI |
| 95 | select KERNEL_PWM |
| 96 | select KERNEL_PWM_PXA |
| 97 | select KERNEL_PWM_SYSFS |
| 98 | select KERNEL_BACKLIGHT_CLASS_DEVICE |
| 99 | select KERNEL_BACKLIGHT_PWM |
| 100 | select KERNEL_INPUT_TOUCHSCREEN |
| 101 | select KERNEL_TOUCHSCREEN_PROPERTIES |
| 102 | select KERNEL_TOUCHSCREEN_ASR_TSC |
| 103 | select CAMERA |
| 104 | help |
| 105 | This includes LCD and camera functions, in addition to wifi support. |
| 106 | |
| 107 | config AB_SYSTEM |
| 108 | bool "Config support for A/B system" |
| 109 | default n |
| 110 | select KERNEL_AB_SYSTEM |
| 111 | |
| 112 | config ASR_SDTIM |
| 113 | bool "Config support for Single DTIM" |
| 114 | default n |
| 115 | select KERNEL_ASR_SDTIM |
| 116 | |
| 117 | config SEC |
| 118 | bool "All-in-one config support for security features" |
| 119 | default n |
| 120 | select TEE_OS |
| 121 | select SELINUX |
| 122 | select SECURE_DM |
| 123 | |
| 124 | config TEE_OS |
| 125 | bool "Config support for TEE OS" |
| 126 | default n |
| 127 | select KERNEL_TEE |
| 128 | select KERNEL_OPTEE |
| 129 | select KERNEL_ASR_OPTEE_VIRTUAL_UART |
| 130 | select KERNEL_ASR_OPTEE_LOG_LEVEL |
| 131 | select PACKAGE_optee_client |
| 132 | select PACKAGE_optee_app |
| 133 | select HWRANDOM |
| 134 | select CIPHER_TEST |
| 135 | select SECURE_STORAGE |
| 136 | select ACIPHER_TEST |
| 137 | select KEY_TEST |
| 138 | |
| 139 | config LIB_ATPS |
| 140 | bool "Config support libatps(asr trust platform services lib)" |
| 141 | default n |
| 142 | select KERNEL_CRYPTO |
| 143 | select KERNEL_CRYPTO_USER_API |
| 144 | select KERNEL_CRYPTO_USER_API_SKCIPHER |
| 145 | select KERNEL_CRYPTO_USER_API_HASH |
| 146 | select KERNEL_CONFIG_CRYPTO_RSA |
| 147 | select HARDWARE_AES_ENGINE |
| 148 | |
| 149 | config HARDWARE_AES_ENGINE |
| 150 | bool "Config support hardware AES engine" |
| 151 | default n |
| 152 | |
| 153 | config SECURE_DM |
| 154 | bool "Config support for dm device and select dm-verity by default" |
| 155 | select KERNEL_MD |
| 156 | select KERNEL_BLK_DEV_DM |
| 157 | select KERNEL_DM_VERITY |
| 158 | select KERNEL_DM_INIT |
| 159 | select KERNEL_DM_USER |
| 160 | depends on TARGET_ROOTFS_SQUASHFS |
| 161 | |
| 162 | config SECURE_DM_CRYPT |
| 163 | bool "Config support for dm-crypt" |
| 164 | depends on SECURE_DM |
| 165 | default n |
| 166 | select KERNEL_DM_CRYPT |
| 167 | |
| 168 | config SECURE_IMA |
| 169 | bool "Config support for IMA enable" |
| 170 | default n |
| 171 | select KERNEL_SECURITY |
| 172 | select KERNEL_UBIFS_FS_SECURITY |
| 173 | select KERNEL_INTEGRITY |
| 174 | select KERNEL_IMA |
| 175 | select KERNEL_IMA_APPRAISE |
| 176 | select KERNEL_IMA_APPRAISE_BOOTPARAM |
| 177 | select TARGET_ROOTFS_INITRAMFS |
| 178 | select KERNEL_SIGNATURE |
| 179 | select KERNEL_INTEGRITY_SIGNATURE |
| 180 | select PACKAGE_libkeyutils |
| 181 | select PACKAGE_keyctl |
| 182 | select PACKAGE_libopenssl |
| 183 | select PACKAGE_ima-evm-utils |
| 184 | select KERNEL_EVM |
| 185 | select KERNEL_INTEGRITY_ASYMMETRIC_KEYS |
| 186 | select KERNEL_EVM_LOAD_X509 |
| 187 | select KERNEL_CRYPTO_RNG |
| 188 | select KERNEL_ENCRYPTED_KEYS |
| 189 | select KERNEL_TRUSTED_KEYS |
| 190 | select PACKAGE_attr |
| 191 | select KERNEL_AUDIT |
| 192 | select KERNEL_INTEGRITY_AUDIT |
| 193 | select KERNEL_STRICT_KERNEL_RWX |
| 194 | |
| 195 | config QSPINAND_64M |
| 196 | bool |
| 197 | prompt "Enable QSPI NAND 64M support" |
| 198 | default n |
| 199 | select KERNEL_QSPINAND_64M |
| 200 | help |
| 201 | Enable QSPI NAND 64M support. |
| 202 | |
| 203 | config MODULE_BUILDIN |
| 204 | bool |
| 205 | prompt "Enable Kernel modules buildin" |
| 206 | default n |
| 207 | help |
| 208 | Enable Enable Kernel modules buildin. |
| 209 | |
| 210 | config CAMERA |
| 211 | bool "Config Camera interface driver for ASR platform" |
| 212 | depends on TARGET_mmp_asr1806 || TARGET_mmp_asr1903 |
| 213 | default n |
| 214 | select KERNEL_ASR_CAMERA |
| 215 | select KERNEL_MEDIA_CAMERA_SUPPORT |
| 216 | |
| 217 | config UART_921600 |
| 218 | bool "Config support uart baudrate 921600" |
| 219 | default n |
| 220 | |
| 221 | config DAILY |
| 222 | bool "Enable experimental features for automatic daily builds" |
| 223 | default n |
| 224 | |
| 225 | config DSDS |
| 226 | bool "Config support for Dual SIM Dual Standby" |
| 227 | default n |
| 228 | select KERNEL_ASR_DSDS |
| 229 | |
| 230 | config JSON_OVERVIEW_IMAGE_INFO |
| 231 | bool "Create JSON info file overview per target" |
| 232 | default y |
| 233 | help |
| 234 | Create a JSON info file called profiles.json in the target |
| 235 | directory containing machine readable list of built profiles |
| 236 | and resulting images. |
| 237 | |
| 238 | config JSON_CYCLONEDX_SBOM |
| 239 | bool "Create CycloneDX SBOM JSON" |
| 240 | default BUILDBOT |
| 241 | help |
| 242 | Create a JSON files *.bom.cdx.json in the build |
| 243 | directory containing Software Bill Of Materials in CycloneDX |
| 244 | format. |
| 245 | |
| 246 | config ALL_NONSHARED |
| 247 | bool "Select all target specific packages by default" |
| 248 | select ALL_KMODS |
| 249 | default BUILDBOT |
| 250 | |
| 251 | config ALL_KMODS |
| 252 | bool "Select all kernel module packages by default" |
| 253 | |
| 254 | config ALL |
| 255 | bool "Select all userspace packages by default" |
| 256 | select ALL_KMODS |
| 257 | select ALL_NONSHARED |
| 258 | |
| 259 | config BUILDBOT |
| 260 | bool "Set build defaults for automatic builds (e.g. via buildbot)" |
| 261 | help |
| 262 | This option changes several defaults to be more suitable for |
| 263 | automatic builds. This includes the following changes: |
| 264 | - Deleting build directories after compiling (to save space) |
| 265 | - Enabling per-device rootfs support |
| 266 | ... |
| 267 | |
| 268 | config SIGNED_PACKAGES |
| 269 | bool "Cryptographically signed package lists" |
| 270 | default y |
| 271 | |
| 272 | config SIGNATURE_CHECK |
| 273 | bool "Enable signature checking in opkg" |
| 274 | default SIGNED_PACKAGES |
| 275 | |
| 276 | config DOWNLOAD_CHECK_CERTIFICATE |
| 277 | bool "Enable TLS certificate verification during package download" |
| 278 | default y |
| 279 | |
| 280 | config USE_APK |
| 281 | imply PACKAGE_apk-mbedtls |
| 282 | bool "Use APK instead of OPKG to build distribution (BROKEN)" |
| 283 | depends on BROKEN |
| 284 | |
| 285 | comment "General build options" |
| 286 | |
| 287 | config TESTING_KERNEL |
| 288 | bool "Use the testing kernel version" |
| 289 | depends on HAS_TESTING_KERNEL |
| 290 | default EXPERIMENTAL |
| 291 | help |
| 292 | If the target supports a newer kernel version than the default, |
| 293 | you can use this config option to enable it |
| 294 | |
| 295 | |
| 296 | config DISPLAY_SUPPORT |
| 297 | bool "Show packages that require graphics support (local or remote)" |
| 298 | |
| 299 | config BUILD_PATENTED |
| 300 | bool "Compile with support for patented functionality" |
| 301 | help |
| 302 | When this option is disabled, software which provides patented functionality |
| 303 | will not be built. In case software provides optional support for patented |
| 304 | functionality, this optional support will get disabled for this package. |
| 305 | |
| 306 | config BUILD_NLS |
| 307 | bool "Compile with full language support" |
| 308 | help |
| 309 | When this option is enabled, packages are built with the full versions of |
| 310 | iconv and GNU gettext instead of the default OpenWrt stubs. If uClibc is |
| 311 | used, it is also built with locale support. |
| 312 | |
| 313 | config SHADOW_PASSWORDS |
| 314 | bool |
| 315 | default y |
| 316 | |
| 317 | config CLEAN_IPKG |
| 318 | bool |
| 319 | prompt "Remove ipkg/opkg status data files in final images" |
| 320 | help |
| 321 | This removes all ipkg/opkg status data files from the target directory |
| 322 | before building the root filesystem. |
| 323 | |
| 324 | config IPK_FILES_CHECKSUMS |
| 325 | bool |
| 326 | prompt "Record files checksums in package metadata" |
| 327 | depends on !USE_APK |
| 328 | help |
| 329 | This makes file checksums part of package metadata. It increases size |
| 330 | but provides you with pkg_check command to check for flash corruptions. |
| 331 | |
| 332 | config INCLUDE_CONFIG |
| 333 | bool "Include build configuration in firmware" if DEVEL |
| 334 | help |
| 335 | If enabled, buildinfo files will be stored in /etc/build.* of firmware. |
| 336 | |
| 337 | config REPRODUCIBLE_DEBUG_INFO |
| 338 | bool "Make debug information reproducible" |
| 339 | default BUILDBOT |
| 340 | help |
| 341 | This strips the local build path out of debug information. This has the |
| 342 | advantage of making it reproducible, but the disadvantage of making local |
| 343 | debugging using ./scripts/remote-gdb harder, since the debug data will |
| 344 | no longer point to the full path on the build host. |
| 345 | |
| 346 | config COLLECT_KERNEL_DEBUG |
| 347 | bool |
| 348 | prompt "Collect kernel debug information" |
| 349 | select KERNEL_DEBUG_INFO |
| 350 | default BUILDBOT |
| 351 | help |
| 352 | This collects debugging symbols from the kernel and all compiled modules. |
| 353 | Useful for release builds, so that kernel issues can be debugged offline |
| 354 | later. |
| 355 | |
| 356 | menu "Kernel build options" |
| 357 | |
| 358 | source "config/Config-kernel.in" |
| 359 | |
| 360 | endmenu |
| 361 | |
| 362 | comment "Package build options" |
| 363 | |
| 364 | config DEBUG |
| 365 | bool |
| 366 | prompt "Compile packages with debugging info" |
| 367 | help |
| 368 | Adds -g3 to the CFLAGS. |
| 369 | |
| 370 | config USE_GC_SECTIONS |
| 371 | bool |
| 372 | prompt "Dead code and data elimination for all packages (EXPERIMENTAL)" |
| 373 | help |
| 374 | Places functions and data items into its own sections to use the linker's |
| 375 | garbage collection capabilites. |
| 376 | Packages can choose to opt-out via setting PKG_BUILD_FLAGS:=no-gc-sections |
| 377 | |
| 378 | config USE_LTO |
| 379 | bool |
| 380 | prompt "Use the link-time optimizer for all packages (EXPERIMENTAL)" |
| 381 | help |
| 382 | Adds LTO flags to the CFLAGS and LDFLAGS. |
| 383 | Packages can choose to opt-out via setting PKG_BUILD_FLAGS:=no-lto |
| 384 | |
| 385 | config MOLD |
| 386 | depends on (aarch64 || arm || i386 || i686 || m68k || powerpc || powerpc64 || sh4 || x86_64) |
| 387 | depends on !GCC_USE_VERSION_11 |
| 388 | def_bool $(shell, ./config/check-hostcxx.sh 10 2 12) |
| 389 | |
| 390 | config USE_MOLD |
| 391 | bool |
| 392 | prompt "Use the mold linker for all packages" |
| 393 | depends on MOLD |
| 394 | help |
| 395 | Link packages with mold, a modern linker |
| 396 | Packages can opt-out via setting PKG_BUILD_FLAGS:=no-mold |
| 397 | |
| 398 | config IPV6 |
| 399 | def_bool y |
| 400 | |
| 401 | comment "Stripping options" |
| 402 | |
| 403 | choice |
| 404 | prompt "Binary stripping method" |
| 405 | default USE_STRIP if USE_GLIBC |
| 406 | default USE_SSTRIP |
| 407 | help |
| 408 | Select the binary stripping method you wish to use. |
| 409 | |
| 410 | config NO_STRIP |
| 411 | bool "none" |
| 412 | help |
| 413 | This will install unstripped binaries (useful for native |
| 414 | compiling/debugging). |
| 415 | |
| 416 | config USE_STRIP |
| 417 | bool "strip" |
| 418 | help |
| 419 | This will install binaries stripped using strip from binutils. |
| 420 | |
| 421 | config USE_SSTRIP |
| 422 | bool "sstrip" |
| 423 | depends on !USE_GLIBC |
| 424 | help |
| 425 | This will install binaries stripped using sstrip. |
| 426 | endchoice |
| 427 | |
| 428 | config STRIP_ARGS |
| 429 | string |
| 430 | prompt "Strip arguments" |
| 431 | depends on USE_STRIP |
| 432 | default "--strip-unneeded --remove-section=.comment --remove-section=.note" if DEBUG |
| 433 | default "--strip-all" |
| 434 | help |
| 435 | Specifies arguments passed to the strip command when stripping binaries. |
| 436 | |
| 437 | config SSTRIP_DISCARD_TRAILING_ZEROES |
| 438 | bool "Strip trailing zero bytes" |
| 439 | depends on USE_SSTRIP && !USE_MOLD |
| 440 | default y |
| 441 | help |
| 442 | Use sstrip's -z option to discard trailing zero bytes |
| 443 | |
| 444 | config STRIP_KERNEL_EXPORTS |
| 445 | bool "Strip unnecessary exports from the kernel image" |
| 446 | depends on !LINUX_6_6 |
| 447 | help |
| 448 | Reduces kernel size by stripping unused kernel exports from the kernel |
| 449 | image. Note that this might make the kernel incompatible with any kernel |
| 450 | modules that were not selected at the time the kernel image was created. |
| 451 | |
| 452 | config USE_MKLIBS |
| 453 | bool "Strip unnecessary functions from libraries" |
| 454 | help |
| 455 | Reduces libraries to only those functions that are necessary for using all |
| 456 | selected packages (including those selected as <M>). Note that this will |
| 457 | make the system libraries incompatible with most of the packages that are |
| 458 | not selected during the build process. |
| 459 | |
| 460 | choice |
| 461 | prompt "Preferred standard C++ library" |
| 462 | default USE_LIBSTDCXX if USE_GLIBC |
| 463 | default USE_UCLIBCXX |
| 464 | help |
| 465 | Select the preferred standard C++ library for all packages that support this. |
| 466 | |
| 467 | config USE_UCLIBCXX |
| 468 | bool "uClibc++" |
| 469 | |
| 470 | config USE_LIBSTDCXX |
| 471 | bool "libstdc++" |
| 472 | endchoice |
| 473 | |
| 474 | comment "Hardening build options" |
| 475 | |
| 476 | config PKG_CHECK_FORMAT_SECURITY |
| 477 | bool |
| 478 | prompt "Enable gcc format-security" |
| 479 | default y |
| 480 | help |
| 481 | Add -Wformat -Werror=format-security to the CFLAGS. You can disable |
| 482 | this per package by adding PKG_CHECK_FORMAT_SECURITY:=0 in the package |
| 483 | Makefile. |
| 484 | |
| 485 | choice |
| 486 | prompt "User space ASLR PIE compilation" |
| 487 | default PKG_ASLR_PIE_NONE if ((SMALL_FLASH || LOW_MEMORY_FOOTPRINT) && !SDK) |
| 488 | default PKG_ASLR_PIE_REGULAR |
| 489 | help |
| 490 | Add -fPIC to CFLAGS and -specs=hardened-build-ld to LDFLAGS. |
| 491 | This enables package build as Position Independent Executables (PIE) |
| 492 | to protect against "return-to-text" attacks. This belongs to the |
| 493 | feature of Address Space Layout Randomisation (ASLR), which is |
| 494 | implemented by the kernel and the ELF loader by randomising the |
| 495 | location of memory allocations. This makes memory addresses harder |
| 496 | to predict when an attacker is attempting a memory-corruption exploit. |
| 497 | You can disable this per package by adding PKG_ASLR_PIE:=0 in the package |
| 498 | Makefile. |
| 499 | Be ware that ASLR increases the binary size. |
| 500 | config PKG_ASLR_PIE_NONE |
| 501 | bool "None" |
| 502 | help |
| 503 | PIE is deactivated for all applications |
| 504 | config PKG_ASLR_PIE_REGULAR |
| 505 | bool "Regular" |
| 506 | help |
| 507 | PIE is activated for some binaries, mostly network exposed applications |
| 508 | config PKG_ASLR_PIE_ALL |
| 509 | bool "All" |
| 510 | select BUSYBOX_DEFAULT_PIE |
| 511 | help |
| 512 | PIE is activated for all applications |
| 513 | endchoice |
| 514 | |
| 515 | choice |
| 516 | prompt "User space Stack-Smashing Protection" |
| 517 | default PKG_CC_STACKPROTECTOR_REGULAR |
| 518 | help |
| 519 | Enable GCC Stack Smashing Protection (SSP) for userspace applications |
| 520 | config PKG_CC_STACKPROTECTOR_NONE |
| 521 | bool "None" |
| 522 | help |
| 523 | No stack smashing protection. |
| 524 | config PKG_CC_STACKPROTECTOR_REGULAR |
| 525 | bool "Regular" |
| 526 | help |
| 527 | Protects functions with vulnerable objects. |
| 528 | This includes functions with buffers larger than 8 bytes or calls to alloca. |
| 529 | config PKG_CC_STACKPROTECTOR_STRONG |
| 530 | bool "Strong" |
| 531 | help |
| 532 | Like Regular, but also protects functions with |
| 533 | local arrays or references to local frame addresses. |
| 534 | config PKG_CC_STACKPROTECTOR_ALL |
| 535 | bool "All" |
| 536 | help |
| 537 | Protects all functions. |
| 538 | endchoice |
| 539 | |
| 540 | choice |
| 541 | prompt "Kernel space Stack-Smashing Protection" |
| 542 | default KERNEL_CC_STACKPROTECTOR_REGULAR |
| 543 | help |
| 544 | Enable GCC Stack-Smashing Protection (SSP) for the kernel |
| 545 | config KERNEL_CC_STACKPROTECTOR_NONE |
| 546 | bool "None" |
| 547 | help |
| 548 | No stack smashing protection. |
| 549 | config KERNEL_CC_STACKPROTECTOR_REGULAR |
| 550 | bool "Regular" |
| 551 | help |
| 552 | Protects functions with vulnerable objects. |
| 553 | This includes functions with buffers larger than 8 bytes or calls to alloca. |
| 554 | config KERNEL_CC_STACKPROTECTOR_STRONG |
| 555 | bool "Strong" |
| 556 | help |
| 557 | Like Regular, but also protects functions with |
| 558 | local arrays or references to local frame addresses. |
| 559 | endchoice |
| 560 | |
| 561 | config KERNEL_STACKPROTECTOR |
| 562 | bool |
| 563 | default KERNEL_CC_STACKPROTECTOR_REGULAR || KERNEL_CC_STACKPROTECTOR_STRONG |
| 564 | |
| 565 | config KERNEL_STACKPROTECTOR_STRONG |
| 566 | bool |
| 567 | default KERNEL_CC_STACKPROTECTOR_STRONG |
| 568 | |
| 569 | choice |
| 570 | prompt "Enable buffer-overflows detection (FORTIFY_SOURCE)" |
| 571 | default PKG_FORTIFY_SOURCE_1 |
| 572 | help |
| 573 | Enable the _FORTIFY_SOURCE macro which introduces additional |
| 574 | checks to detect buffer-overflows in the following standard library |
| 575 | functions: memcpy, mempcpy, memmove, memset, strcpy, stpcpy, |
| 576 | strncpy, strcat, strncat, sprintf, vsprintf, snprintf, vsnprintf, |
| 577 | gets. "Conservative" (_FORTIFY_SOURCE set to 1) only introduces |
| 578 | checks that shouldn't change the behavior of conforming programs, |
| 579 | while "aggressive" (_FORTIFY_SOURCES set to 2) some more checking is |
| 580 | added, but some conforming programs might fail. |
| 581 | config PKG_FORTIFY_SOURCE_NONE |
| 582 | bool "None" |
| 583 | config PKG_FORTIFY_SOURCE_1 |
| 584 | bool "Conservative" |
| 585 | config PKG_FORTIFY_SOURCE_2 |
| 586 | bool "Aggressive" |
| 587 | endchoice |
| 588 | |
| 589 | choice |
| 590 | prompt "Enable RELRO protection" |
| 591 | default PKG_RELRO_FULL |
| 592 | help |
| 593 | Enable a link-time protection known as RELRO (Relocation Read Only) |
| 594 | which helps to protect from certain type of exploitation techniques |
| 595 | altering the content of some ELF sections. "Partial" RELRO makes the |
| 596 | .dynamic section not writeable after initialization, introducing |
| 597 | almost no performance penalty, while "full" RELRO also marks the GOT |
| 598 | as read-only at the cost of initializing all of it at startup. |
| 599 | config PKG_RELRO_NONE |
| 600 | bool "None" |
| 601 | config PKG_RELRO_PARTIAL |
| 602 | bool "Partial" |
| 603 | config PKG_RELRO_FULL |
| 604 | bool "Full" |
| 605 | endchoice |
| 606 | |
| 607 | config TARGET_ROOTFS_SECURITY_LABELS |
| 608 | bool |
| 609 | select KERNEL_SQUASHFS_XATTR |
| 610 | select KERNEL_EXT4_FS_SECURITY |
| 611 | select KERNEL_F2FS_FS_SECURITY |
| 612 | select KERNEL_UBIFS_FS_SECURITY |
| 613 | select KERNEL_JFFS2_FS_SECURITY |
| 614 | |
| 615 | config SELINUX |
| 616 | bool "Enable SELinux" |
| 617 | select KERNEL_SECURITY_SELINUX |
| 618 | select TARGET_ROOTFS_SECURITY_LABELS |
| 619 | select PACKAGE_procd-selinux |
| 620 | select PACKAGE_busybox-selinux |
| 621 | help |
| 622 | This option enables SELinux kernel features, applies security labels |
| 623 | in squashfs rootfs and selects the selinux-variants of busybox and procd. |
| 624 | |
| 625 | Selecting this option results in about 0.5MiB of additional flash space |
| 626 | usage accounting for increased kernel and rootfs size. |
| 627 | |
| 628 | choice |
| 629 | prompt "default SELinux type" |
| 630 | depends on TARGET_ROOTFS_SECURITY_LABELS |
| 631 | default SELINUXTYPE_dssp |
| 632 | help |
| 633 | Select SELinux policy to be installed and used for applying rootfs labels. |
| 634 | |
| 635 | config SELINUXTYPE_targeted |
| 636 | bool "targeted" |
| 637 | select PACKAGE_refpolicy |
| 638 | help |
| 639 | SELinux Reference Policy (refpolicy) |
| 640 | |
| 641 | config SELINUXTYPE_dssp |
| 642 | bool "dssp" |
| 643 | select PACKAGE_selinux-policy-local |
| 644 | help |
| 645 | Defensec SELinux Security Policy -- OpenWrt edition |
| 646 | |
| 647 | endchoice |
| 648 | |
| 649 | config USE_SECCOMP |
| 650 | bool "Enable SECCOMP" |
| 651 | select KERNEL_SECCOMP |
| 652 | select PACKAGE_procd-seccomp |
| 653 | depends on (aarch64 || arm || armeb || mips || mipsel || mips64 || mips64el || i386 || powerpc || x86_64) |
| 654 | depends on !TARGET_uml |
| 655 | default y |
| 656 | help |
| 657 | This option enables seccomp kernel features to safely |
| 658 | execute untrusted bytecode and selects the seccomp-variants |
| 659 | of procd |
| 660 | |
| 661 | endmenu |