sysctl: make it NOEXEC
[oweals/busybox.git] / Config.in
1 #
2 # For a description of the syntax of this configuration file,
3 # see scripts/kbuild/config-language.txt.
4 #
5
6 mainmenu "Configuration"
7
8 config HAVE_DOT_CONFIG
9         bool
10         default y
11
12 menu "Settings"
13
14 config DESKTOP
15         bool "Enable compatibility for full-blown desktop systems"
16         default y
17         help
18         Enable applet options and features which are not essential.
19         Many applet options have dedicated config options to (de)select them
20         under that applet; this options enables those options which have no
21         individual config item for them.
22
23         Select this if you plan to use busybox on full-blown desktop machine
24         with common Linux distro, which needs higher level of command-line
25         compatibility.
26
27         If you are preparing your build to be used on an embedded box
28         where you have tighter control over the entire set of userspace
29         tools, you can unselect this option for smaller code size.
30
31 config EXTRA_COMPAT
32         bool "Provide compatible behavior for rare corner cases (bigger code)"
33         default n
34         help
35         This option makes grep, sed etc handle rare corner cases
36         (embedded NUL bytes and such). This makes code bigger and uses
37         some GNU extensions in libc. You probably only need this option
38         if you plan to run busybox on desktop.
39
40 config FEDORA_COMPAT
41         bool "Building for Fedora distribution"
42         default n
43         help
44         This option makes some tools behave like they do on Fedora.
45
46         At the time of this writing (2017-08) this only affects uname:
47         normally, uname -p (processor) and uname -i (platform)
48         are shown as "unknown", but with this option uname -p
49         shows the same string as uname -m (machine type),
50         and so does uname -i unless machine type is i486/i586/i686 -
51         then uname -i shows "i386".
52
53 config INCLUDE_SUSv2
54         bool "Enable obsolete features removed before SUSv3"
55         default y
56         help
57         This option will enable backwards compatibility with SuSv2,
58         specifically, old-style numeric options ('command -1 <file>')
59         will be supported in head, tail, and fold. (Note: should
60         affect renice too.)
61
62 config LONG_OPTS
63         bool "Support --long-options"
64         default y
65         help
66         Enable this if you want busybox applets to use the gnu --long-option
67         style, in addition to single character -a -b -c style options.
68
69 config SHOW_USAGE
70         bool "Show applet usage messages"
71         default y
72         help
73         Enabling this option, applets will show terse help messages
74         when invoked with wrong arguments.
75         If you do not want to show any (helpful) usage message when
76         issuing wrong command syntax, you can say 'N' here,
77         saving approximately 7k.
78
79 config FEATURE_VERBOSE_USAGE
80         bool "Show verbose applet usage messages"
81         default y
82         depends on SHOW_USAGE
83         help
84         All applets will show verbose help messages when invoked with --help.
85         This will add a lot of text to the binary.
86
87 config FEATURE_COMPRESS_USAGE
88         bool "Store applet usage messages in compressed form"
89         default y
90         depends on SHOW_USAGE
91         help
92         Store usage messages in .bz2 compressed form, uncompress them
93         on-the-fly when "APPLET --help" is run.
94
95         If you have a really tiny busybox with few applets enabled (and
96         bunzip2 isn't one of them), the overhead of the decompressor might
97         be noticeable. Also, if you run executables directly from ROM
98         and have very little memory, this might not be a win. Otherwise,
99         you probably want this.
100
101 config LFS
102         bool "Support files > 2 GB"
103         default y
104         help
105         If you need to work with large files, enable this option.
106         This will have no effect if your kernel or your C
107         library lacks large file support for large files. Some of the
108         programs that can benefit from large file support include dd, gzip,
109         cp, mount, tar.
110
111 config PAM
112         bool "Support PAM (Pluggable Authentication Modules)"
113         default n
114         help
115         Use PAM in some applets (currently login and httpd) instead
116         of direct access to password database.
117
118 config FEATURE_DEVPTS
119         bool "Use the devpts filesystem for Unix98 PTYs"
120         default y
121         help
122         Enable if you want to use Unix98 PTY support. If enabled,
123         busybox will use /dev/ptmx for the master side of the pseudoterminal
124         and /dev/pts/<number> for the slave side. Otherwise, BSD style
125         /dev/ttyp<number> will be used. To use this option, you should have
126         devpts mounted.
127
128 config FEATURE_UTMP
129         bool "Support utmp file"
130         default y
131         help
132         The file /var/run/utmp is used to track who is currently logged in.
133         With this option on, certain applets (getty, login, telnetd etc)
134         will create and delete entries there.
135         "who" applet requires this option.
136
137 config FEATURE_WTMP
138         bool "Support wtmp file"
139         default y
140         depends on FEATURE_UTMP
141         help
142         The file /var/run/wtmp is used to track when users have logged into
143         and logged out of the system.
144         With this option on, certain applets (getty, login, telnetd etc)
145         will append new entries there.
146         "last" applet requires this option.
147
148 config FEATURE_PIDFILE
149         bool "Support writing pidfiles"
150         default y
151         help
152         This option makes some applets (e.g. crond, syslogd, inetd) write
153         a pidfile at the configured PID_FILE_PATH.  It has no effect
154         on applets which require pidfiles to run.
155
156 config PID_FILE_PATH
157         string "Directory for pidfiles"
158         default "/var/run"
159         depends on FEATURE_PIDFILE
160         help
161         This is the default path where pidfiles are created.  Applets which
162         allow you to set the pidfile path on the command line will override
163         this value.  The option has no effect on applets that require you to
164         specify a pidfile path.
165
166 config BUSYBOX
167         bool "Include busybox applet"
168         default y
169         help
170         The busybox applet provides general help message and allows
171         the included applets to be listed.  It also provides
172         optional --install command to create applet links. If you unselect
173         this option, running busybox without any arguments will give
174         just a cryptic error message:
175
176         $ busybox
177         busybox: applet not found
178
179         Running "busybox APPLET [ARGS...]" will still work, of course.
180
181 config FEATURE_INSTALLER
182         bool "Support --install [-s] to install applet links at runtime"
183         default y
184         depends on BUSYBOX
185         help
186         Enable 'busybox --install [-s]' support. This will allow you to use
187         busybox at runtime to create hard links or symlinks for all the
188         applets that are compiled into busybox.
189
190 config INSTALL_NO_USR
191         bool "Don't use /usr"
192         default n
193         help
194         Disable use of /usr. "busybox --install" and "make install"
195         will install applets only to /bin and /sbin,
196         never to /usr/bin or /usr/sbin.
197
198 config FEATURE_SUID
199         bool "Drop SUID state for most applets"
200         default y
201         help
202         With this option you can install the busybox binary belonging
203         to root with the suid bit set, enabling some applets to perform
204         root-level operations even when run by ordinary users
205         (for example, mounting of user mounts in fstab needs this).
206
207         With this option enabled, busybox drops privileges for applets
208         that don't need root access, before entering their main() function.
209
210         If you are really paranoid and don't want even initial busybox code
211         to run under root for every applet, build two busybox binaries with
212         different applets in them (and the appropriate symlinks pointing
213         to each binary), and only set the suid bit on the one that needs it.
214
215         Some applets which require root rights (need suid bit on the binary
216         or to be run by root) and will refuse to execute otherwise:
217         crontab, login, passwd, su, vlock, wall.
218
219         The applets which will use root rights if they have them
220         (via suid bit, or because run by root), but would try to work
221         without root right nevertheless:
222         findfs, ping[6], traceroute[6], mount.
223
224         Note that if you DO NOT select this option, but DO make busybox
225         suid root, ALL applets will run under root, which is a huge
226         security hole (think "cp /some/file /etc/passwd").
227
228 config FEATURE_SUID_CONFIG
229         bool "Enable SUID configuration via /etc/busybox.conf"
230         default y
231         depends on FEATURE_SUID
232         help
233         Allow the SUID/SGID state of an applet to be determined at runtime
234         by checking /etc/busybox.conf. (This is sort of a poor man's sudo.)
235         The format of this file is as follows:
236
237         APPLET = [Ssx-][Ssx-][x-] [USER.GROUP]
238
239         s: USER or GROUP is allowed to execute APPLET.
240            APPLET will run under USER or GROUP
241            (regardless of who's running it).
242         S: USER or GROUP is NOT allowed to execute APPLET.
243            APPLET will run under USER or GROUP.
244            This option is not very sensical.
245         x: USER/GROUP/others are allowed to execute APPLET.
246            No UID/GID change will be done when it is run.
247         -: USER/GROUP/others are not allowed to execute APPLET.
248
249         An example might help:
250
251         |[SUID]
252         |su = ssx root.0 # applet su can be run by anyone and runs with
253         |                # euid=0,egid=0
254         |su = ssx        # exactly the same
255         |
256         |mount = sx- root.disk # applet mount can be run by root and members
257         |                      # of group disk (but not anyone else)
258         |                      # and runs with euid=0 (egid is not changed)
259         |
260         |cp = --- # disable applet cp for everyone
261
262         The file has to be owned by user root, group root and has to be
263         writeable only by root:
264                 (chown 0.0 /etc/busybox.conf; chmod 600 /etc/busybox.conf)
265         The busybox executable has to be owned by user root, group
266         root and has to be setuid root for this to work:
267                 (chown 0.0 /bin/busybox; chmod 4755 /bin/busybox)
268
269         Robert 'sandman' Griebl has more information here:
270         <url: http://www.softforge.de/bb/suid.html >.
271
272 config FEATURE_SUID_CONFIG_QUIET
273         bool "Suppress warning message if /etc/busybox.conf is not readable"
274         default y
275         depends on FEATURE_SUID_CONFIG
276         help
277         /etc/busybox.conf should be readable by the user needing the SUID,
278         check this option to avoid users to be notified about missing
279         permissions.
280
281 config FEATURE_PREFER_APPLETS
282         bool "exec prefers applets"
283         default n
284         help
285         This is an experimental option which directs applets about to
286         call 'exec' to try and find an applicable busybox applet before
287         searching the PATH. This is typically done by exec'ing
288         /proc/self/exe.
289
290         This may affect shell, find -exec, xargs and similar applets.
291         They will use applets even if /bin/APPLET -> busybox link
292         is missing (or is not a link to busybox). However, this causes
293         problems in chroot jails without mounted /proc and with ps/top
294         (command name can be shown as 'exe' for applets started this way).
295
296 config BUSYBOX_EXEC_PATH
297         string "Path to busybox executable"
298         default "/proc/self/exe"
299         help
300         When applets need to run other applets, busybox
301         sometimes needs to exec() itself. When the /proc filesystem is
302         mounted, /proc/self/exe always points to the currently running
303         executable. If you haven't got /proc, set this to wherever you
304         want to run busybox from.
305
306 config SELINUX
307         bool "Support NSA Security Enhanced Linux"
308         default n
309         select PLATFORM_LINUX
310         help
311         Enable support for SELinux in applets ls, ps, and id. Also provide
312         the option of compiling in SELinux applets.
313
314         If you do not have a complete SELinux userland installed, this stuff
315         will not compile.  Specifially, libselinux 1.28 or better is
316         directly required by busybox. If the installation is located in a
317         non-standard directory, provide it by invoking make as follows:
318
319                 CFLAGS=-I<libselinux-include-path> \
320                 LDFLAGS=-L<libselinux-lib-path> \
321                 make
322
323         Most people will leave this set to 'N'.
324
325 config FEATURE_CLEAN_UP
326         bool "Clean up all memory before exiting (usually not needed)"
327         default n
328         help
329         As a size optimization, busybox normally exits without explicitly
330         freeing dynamically allocated memory or closing files. This saves
331         space since the OS will clean up for us, but it can confuse debuggers
332         like valgrind, which report tons of memory and resource leaks.
333
334         Don't enable this unless you have a really good reason to clean
335         things up manually.
336
337 # These are auto-selected by other options
338
339 config FEATURE_SYSLOG
340         bool #No description makes it a hidden option
341         default n
342         #help
343         #This option is auto-selected when you select any applet which may
344         #send its output to syslog. You do not need to select it manually.
345
346 config FEATURE_HAVE_RPC
347         bool #No description makes it a hidden option
348         default n
349         #help
350         #This is automatically selected if any of enabled applets need it.
351         #You do not need to select it manually.
352
353 config PLATFORM_LINUX
354         bool #No description makes it a hidden option
355         default n
356         #help
357         #For the most part, busybox requires only POSIX compatibility
358         #from the target system, but some applets and features use
359         #Linux-specific interfaces.
360         #
361         #This is automatically selected if any applet or feature requires
362         #Linux-specific interfaces. You do not need to select it manually.
363
364 comment 'Build Options'
365
366 config STATIC
367         bool "Build static binary (no shared libs)"
368         default n
369         help
370         If you want to build a static binary, which does not use
371         or require any shared libraries, enable this option.
372         Static binaries are larger, but do not require functioning
373         dynamic libraries to be present, which is important if used
374         as a system rescue tool.
375
376 config PIE
377         bool "Build position independent executable"
378         default n
379         depends on !STATIC
380         help
381         Hardened code option. PIE binaries are loaded at a different
382         address at each invocation. This has some overhead,
383         particularly on x86-32 which is short on registers.
384
385         Most people will leave this set to 'N'.
386
387 config NOMMU
388         bool "Force NOMMU build"
389         default n
390         help
391         Busybox tries to detect whether architecture it is being
392         built against supports MMU or not. If this detection fails,
393         or if you want to build NOMMU version of busybox for testing,
394         you may force NOMMU build here.
395
396         Most people will leave this set to 'N'.
397
398 # PIE can be made to work with BUILD_LIBBUSYBOX, but currently
399 # build system does not support that
400 config BUILD_LIBBUSYBOX
401         bool "Build shared libbusybox"
402         default n
403         depends on !FEATURE_PREFER_APPLETS && !PIE && !STATIC
404         help
405         Build a shared library libbusybox.so.N.N.N which contains all
406         busybox code.
407
408         This feature allows every applet to be built as a really tiny
409         separate executable linked against the library:
410         |$ size 0_lib/l*
411         |    text  data   bss     dec    hex filename
412         |     939   212    28    1179    49b 0_lib/last
413         |     939   212    28    1179    49b 0_lib/less
414         |  919138  8328  1556  929022  e2cfe 0_lib/libbusybox.so.1.N.M
415
416         This is useful on NOMMU systems which are not capable
417         of sharing executables, but are capable of sharing code
418         in dynamic libraries.
419
420 config FEATURE_LIBBUSYBOX_STATIC
421         bool "Pull in all external references into libbusybox"
422         default n
423         depends on BUILD_LIBBUSYBOX
424         help
425         Make libbusybox library independent, not using or requiring
426         any other shared libraries.
427
428 config FEATURE_INDIVIDUAL
429         bool "Produce a binary for each applet, linked against libbusybox"
430         default y
431         depends on BUILD_LIBBUSYBOX
432         help
433         If your CPU architecture doesn't allow for sharing text/rodata
434         sections of running binaries, but allows for runtime dynamic
435         libraries, this option will allow you to reduce memory footprint
436         when you have many different applets running at once.
437
438         If your CPU architecture allows for sharing text/rodata,
439         having single binary is more optimal.
440
441         Each applet will be a tiny program, dynamically linked
442         against libbusybox.so.N.N.N.
443
444         You need to have a working dynamic linker.
445
446 config FEATURE_SHARED_BUSYBOX
447         bool "Produce additional busybox binary linked against libbusybox"
448         default y
449         depends on BUILD_LIBBUSYBOX
450         help
451         Build busybox, dynamically linked against libbusybox.so.N.N.N.
452
453         You need to have a working dynamic linker.
454
455 ### config BUILD_AT_ONCE
456 ###     bool "Compile all sources at once"
457 ###     default n
458 ###     help
459 ###     Normally each source-file is compiled with one invocation of
460 ###     the compiler.
461 ###     If you set this option, all sources are compiled at once.
462 ###     This gives the compiler more opportunities to optimize which can
463 ###     result in smaller and/or faster binaries.
464 ###
465 ###     Setting this option will consume alot of memory, e.g. if you
466 ###     enable all applets with all features, gcc uses more than 300MB
467 ###     RAM during compilation of busybox.
468 ###
469 ###     This option is most likely only beneficial for newer compilers
470 ###     such as gcc-4.1 and above.
471 ###
472 ###     Say 'N' unless you know what you are doing.
473
474 config CROSS_COMPILER_PREFIX
475         string "Cross compiler prefix"
476         default ""
477         help
478         If you want to build busybox with a cross compiler, then you
479         will need to set this to the cross-compiler prefix, for example,
480         "i386-uclibc-".
481
482         Note that CROSS_COMPILE environment variable or
483         "make CROSS_COMPILE=xxx ..." will override this selection.
484
485         Native builds leave this empty.
486
487 config SYSROOT
488         string "Path to sysroot"
489         default ""
490         help
491         If you want to build busybox with a cross compiler, then you
492         might also need to specify where /usr/include and /usr/lib
493         will be found.
494
495         For example, busybox can be built against an installed
496         Android NDK, platform version 9, for ARM ABI with
497
498         CONFIG_SYSROOT=/opt/android-ndk/platforms/android-9/arch-arm
499
500         Native builds leave this empty.
501
502 config EXTRA_CFLAGS
503         string "Additional CFLAGS"
504         default ""
505         help
506         Additional CFLAGS to pass to the compiler verbatim.
507
508 config EXTRA_LDFLAGS
509         string "Additional LDFLAGS"
510         default ""
511         help
512         Additional LDFLAGS to pass to the linker verbatim.
513
514 config EXTRA_LDLIBS
515         string "Additional LDLIBS"
516         default ""
517         help
518         Additional LDLIBS to pass to the linker with -l.
519
520 config USE_PORTABLE_CODE
521         bool "Avoid using GCC-specific code constructs"
522         default n
523         help
524         Use this option if you are trying to compile busybox with
525         compiler other than gcc.
526         If you do use gcc, this option may needlessly increase code size.
527
528 comment 'Installation Options ("make install" behavior)'
529
530 choice
531         prompt "What kind of applet links to install"
532         default INSTALL_APPLET_SYMLINKS
533         help
534         Choose what kind of links to applets are created by "make install".
535
536 config INSTALL_APPLET_SYMLINKS
537         bool "as soft-links"
538         help
539         Install applets as soft-links to the busybox binary. This needs some
540         free inodes on the filesystem, but might help with filesystem
541         generators that can't cope with hard-links.
542
543 config INSTALL_APPLET_HARDLINKS
544         bool "as hard-links"
545         help
546         Install applets as hard-links to the busybox binary. This might
547         count on a filesystem with few inodes.
548
549 config INSTALL_APPLET_SCRIPT_WRAPPERS
550         bool "as script wrappers"
551         help
552         Install applets as script wrappers that call the busybox binary.
553
554 config INSTALL_APPLET_DONT
555         bool "not installed"
556         help
557         Do not install applet links. Useful when you plan to use
558         busybox --install for installing links, or plan to use
559         a standalone shell and thus don't need applet links.
560
561 endchoice
562
563 choice
564         prompt "/bin/sh applet link"
565         default INSTALL_SH_APPLET_SYMLINK
566         depends on INSTALL_APPLET_SCRIPT_WRAPPERS
567         help
568         Choose how you install /bin/sh applet link.
569
570 config INSTALL_SH_APPLET_SYMLINK
571         bool "as soft-link"
572         help
573         Install /bin/sh applet as soft-link to the busybox binary.
574
575 config INSTALL_SH_APPLET_HARDLINK
576         bool "as hard-link"
577         help
578         Install /bin/sh applet as hard-link to the busybox binary.
579
580 config INSTALL_SH_APPLET_SCRIPT_WRAPPER
581         bool "as script wrapper"
582         help
583         Install /bin/sh applet as script wrapper that calls
584         the busybox binary.
585
586 endchoice
587
588 config PREFIX
589         string "Destination path for 'make install'"
590         default "./_install"
591         help
592         Where "make install" should install busybox binary and links.
593
594 comment 'Debugging Options'
595
596 config DEBUG
597         bool "Build with debug information"
598         default n
599         help
600         Say Y here to compile with debug information.
601         This increases the size of the binary considerably, and
602         should only be used when doing development.
603
604         This adds -g option to gcc command line.
605
606         Most people should answer N.
607
608 config DEBUG_PESSIMIZE
609         bool "Disable compiler optimizations"
610         default n
611         depends on DEBUG
612         help
613         The compiler's optimization of source code can eliminate and reorder
614         code, resulting in an executable that's hard to understand when
615         stepping through it with a debugger. This switches it off, resulting
616         in a much bigger executable that more closely matches the source
617         code.
618
619         This replaces -Os/-O2 with -O0 in gcc command line.
620
621 config DEBUG_SANITIZE
622         bool "Enable runtime sanitizers (ASAN/LSAN/USAN/etc...)"
623         default n
624         help
625         Say Y here if you want to enable runtime sanitizers. These help
626         catch bad memory accesses (e.g. buffer overflows), but will make
627         the executable larger and slow down runtime a bit.
628
629         This adds -fsanitize=foo options to gcc command line.
630
631         If you aren't developing/testing busybox, say N here.
632
633 config UNIT_TEST
634         bool "Build unit tests"
635         default n
636         help
637         Say Y here if you want to build unit tests (both the framework and
638         test cases) as an applet. This results in bigger code, so you
639         probably don't want this option in production builds.
640
641 config WERROR
642         bool "Abort compilation on any warning"
643         default n
644         help
645         This adds -Werror to gcc command line.
646
647         Most people should answer N.
648
649 choice
650         prompt "Additional debugging library"
651         default NO_DEBUG_LIB
652         help
653         Using an additional debugging library will make busybox become
654         considerably larger and will cause it to run more slowly. You
655         should always leave this option disabled for production use.
656
657         dmalloc support:
658         ----------------
659         This enables compiling with dmalloc ( http://dmalloc.com/ )
660         which is an excellent public domain mem leak and malloc problem
661         detector. To enable dmalloc, before running busybox you will
662         want to properly set your environment, for example:
663                 export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile
664         The 'debug=' value is generated using the following command
665         dmalloc -p log-stats -p log-non-free -p log-bad-space \
666                 -p log-elapsed-time -p check-fence -p check-heap \
667                 -p check-lists -p check-blank -p check-funcs -p realloc-copy \
668                 -p allow-free-null
669
670         Electric-fence support:
671         -----------------------
672         This enables compiling with Electric-fence support. Electric
673         fence is another very useful malloc debugging library which uses
674         your computer's virtual memory hardware to detect illegal memory
675         accesses. This support will make busybox be considerably larger
676         and run slower, so you should leave this option disabled unless
677         you are hunting a hard to find memory problem.
678
679
680 config NO_DEBUG_LIB
681         bool "None"
682
683 config DMALLOC
684         bool "Dmalloc"
685
686 config EFENCE
687         bool "Electric-fence"
688
689 endchoice
690
691 source libbb/Config.in
692
693 endmenu
694
695 comment "Applets"
696
697 source archival/Config.in
698 source coreutils/Config.in
699 source console-tools/Config.in
700 source debianutils/Config.in
701 source editors/Config.in
702 source findutils/Config.in
703 source init/Config.in
704 source loginutils/Config.in
705 source e2fsprogs/Config.in
706 source modutils/Config.in
707 source util-linux/Config.in
708 source miscutils/Config.in
709 source networking/Config.in
710 source printutils/Config.in
711 source mailutils/Config.in
712 source procps/Config.in
713 source runit/Config.in
714 source selinux/Config.in
715 source shell/Config.in
716 source sysklogd/Config.in