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