examples/var_service: use "exec sleep 5" instead of "{ sleep 5; exit; }"
[oweals/busybox.git] / Config.in
1 #
2 # For a description of the syntax of this configuration file,
3 # see docs/Kconfig-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 (8kb)"
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_SHOW_SCRIPT
182         bool "Support --show SCRIPT"
183         default y
184         depends on BUSYBOX
185
186 config FEATURE_INSTALLER
187         bool "Support --install [-s] to install applet links at runtime"
188         default y
189         depends on BUSYBOX
190         help
191         Enable 'busybox --install [-s]' support. This will allow you to use
192         busybox at runtime to create hard links or symlinks for all the
193         applets that are compiled into busybox.
194
195 config INSTALL_NO_USR
196         bool "Don't use /usr"
197         default n
198         help
199         Disable use of /usr. "busybox --install" and "make install"
200         will install applets only to /bin and /sbin,
201         never to /usr/bin or /usr/sbin.
202
203 config FEATURE_SUID
204         bool "Drop SUID state for most applets"
205         default y
206         help
207         With this option you can install the busybox binary belonging
208         to root with the suid bit set, enabling some applets to perform
209         root-level operations even when run by ordinary users
210         (for example, mounting of user mounts in fstab needs this).
211
212         With this option enabled, busybox drops privileges for applets
213         that don't need root access, before entering their main() function.
214
215         If you are really paranoid and don't want even initial busybox code
216         to run under root for every applet, build two busybox binaries with
217         different applets in them (and the appropriate symlinks pointing
218         to each binary), and only set the suid bit on the one that needs it.
219
220         Some applets which require root rights (need suid bit on the binary
221         or to be run by root) and will refuse to execute otherwise:
222         crontab, login, passwd, su, vlock, wall.
223
224         The applets which will use root rights if they have them
225         (via suid bit, or because run by root), but would try to work
226         without root right nevertheless:
227         findfs, ping[6], traceroute[6], mount.
228
229         Note that if you DO NOT select this option, but DO make busybox
230         suid root, ALL applets will run under root, which is a huge
231         security hole (think "cp /some/file /etc/passwd").
232
233 config FEATURE_SUID_CONFIG
234         bool "Enable SUID configuration via /etc/busybox.conf"
235         default y
236         depends on FEATURE_SUID
237         help
238         Allow the SUID/SGID state of an applet to be determined at runtime
239         by checking /etc/busybox.conf. (This is sort of a poor man's sudo.)
240         The format of this file is as follows:
241
242         APPLET = [Ssx-][Ssx-][x-] [USER.GROUP]
243
244         s: USER or GROUP is allowed to execute APPLET.
245            APPLET will run under USER or GROUP
246            (regardless of who's running it).
247         S: USER or GROUP is NOT allowed to execute APPLET.
248            APPLET will run under USER or GROUP.
249            This option is not very sensical.
250         x: USER/GROUP/others are allowed to execute APPLET.
251            No UID/GID change will be done when it is run.
252         -: USER/GROUP/others are not allowed to execute APPLET.
253
254         An example might help:
255
256         |[SUID]
257         |su = ssx root.0 # applet su can be run by anyone and runs with
258         |                # euid=0,egid=0
259         |su = ssx        # exactly the same
260         |
261         |mount = sx- root.disk # applet mount can be run by root and members
262         |                      # of group disk (but not anyone else)
263         |                      # and runs with euid=0 (egid is not changed)
264         |
265         |cp = --- # disable applet cp for everyone
266
267         The file has to be owned by user root, group root and has to be
268         writeable only by root:
269                 (chown 0.0 /etc/busybox.conf; chmod 600 /etc/busybox.conf)
270         The busybox executable has to be owned by user root, group
271         root and has to be setuid root for this to work:
272                 (chown 0.0 /bin/busybox; chmod 4755 /bin/busybox)
273
274         Robert 'sandman' Griebl has more information here:
275         <url: http://www.softforge.de/bb/suid.html >.
276
277 config FEATURE_SUID_CONFIG_QUIET
278         bool "Suppress warning message if /etc/busybox.conf is not readable"
279         default y
280         depends on FEATURE_SUID_CONFIG
281         help
282         /etc/busybox.conf should be readable by the user needing the SUID,
283         check this option to avoid users to be notified about missing
284         permissions.
285
286 config FEATURE_PREFER_APPLETS
287         bool "exec prefers applets"
288         default n
289         help
290         This is an experimental option which directs applets about to
291         call 'exec' to try and find an applicable busybox applet before
292         searching the PATH. This is typically done by exec'ing
293         /proc/self/exe.
294
295         This may affect shell, find -exec, xargs and similar applets.
296         They will use applets even if /bin/APPLET -> busybox link
297         is missing (or is not a link to busybox). However, this causes
298         problems in chroot jails without mounted /proc and with ps/top
299         (command name can be shown as 'exe' for applets started this way).
300
301 config BUSYBOX_EXEC_PATH
302         string "Path to busybox executable"
303         default "/proc/self/exe"
304         help
305         When applets need to run other applets, busybox
306         sometimes needs to exec() itself. When the /proc filesystem is
307         mounted, /proc/self/exe always points to the currently running
308         executable. If you haven't got /proc, set this to wherever you
309         want to run busybox from.
310
311 config SELINUX
312         bool "Support NSA Security Enhanced Linux"
313         default n
314         select PLATFORM_LINUX
315         help
316         Enable support for SELinux in applets ls, ps, and id. Also provide
317         the option of compiling in SELinux applets.
318
319         If you do not have a complete SELinux userland installed, this stuff
320         will not compile.  Specifially, libselinux 1.28 or better is
321         directly required by busybox. If the installation is located in a
322         non-standard directory, provide it by invoking make as follows:
323
324                 CFLAGS=-I<libselinux-include-path> \
325                 LDFLAGS=-L<libselinux-lib-path> \
326                 make
327
328         Most people will leave this set to 'N'.
329
330 config FEATURE_CLEAN_UP
331         bool "Clean up all memory before exiting (usually not needed)"
332         default n
333         help
334         As a size optimization, busybox normally exits without explicitly
335         freeing dynamically allocated memory or closing files. This saves
336         space since the OS will clean up for us, but it can confuse debuggers
337         like valgrind, which report tons of memory and resource leaks.
338
339         Don't enable this unless you have a really good reason to clean
340         things up manually.
341
342 # These are auto-selected by other options
343
344 config FEATURE_SYSLOG
345         bool #No description makes it a hidden option
346         default n
347         #help
348         #This option is auto-selected when you select any applet which may
349         #send its output to syslog. You do not need to select it manually.
350
351 config PLATFORM_LINUX
352         bool #No description makes it a hidden option
353         default n
354         #help
355         #For the most part, busybox requires only POSIX compatibility
356         #from the target system, but some applets and features use
357         #Linux-specific interfaces.
358         #
359         #This is automatically selected if any applet or feature requires
360         #Linux-specific interfaces. You do not need to select it manually.
361
362 comment 'Build Options'
363
364 config STATIC
365         bool "Build static binary (no shared libs)"
366         default n
367         help
368         If you want to build a static binary, which does not use
369         or require any shared libraries, enable this option.
370         Static binaries are larger, but do not require functioning
371         dynamic libraries to be present, which is important if used
372         as a system rescue tool.
373
374 config PIE
375         bool "Build position independent executable"
376         default n
377         depends on !STATIC
378         help
379         Hardened code option. PIE binaries are loaded at a different
380         address at each invocation. This has some overhead,
381         particularly on x86-32 which is short on registers.
382
383         Most people will leave this set to 'N'.
384
385 config NOMMU
386         bool "Force NOMMU build"
387         default n
388         help
389         Busybox tries to detect whether architecture it is being
390         built against supports MMU or not. If this detection fails,
391         or if you want to build NOMMU version of busybox for testing,
392         you may force NOMMU build here.
393
394         Most people will leave this set to 'N'.
395
396 # PIE can be made to work with BUILD_LIBBUSYBOX, but currently
397 # build system does not support that
398 config BUILD_LIBBUSYBOX
399         bool "Build shared libbusybox"
400         default n
401         depends on !FEATURE_PREFER_APPLETS && !PIE && !STATIC
402         help
403         Build a shared library libbusybox.so.N.N.N which contains all
404         busybox code.
405
406         This feature allows every applet to be built as a really tiny
407         separate executable linked against the library:
408         |$ size 0_lib/l*
409         |    text  data   bss     dec    hex filename
410         |     939   212    28    1179    49b 0_lib/last
411         |     939   212    28    1179    49b 0_lib/less
412         |  919138  8328  1556  929022  e2cfe 0_lib/libbusybox.so.1.N.M
413
414         This is useful on NOMMU systems which are not capable
415         of sharing executables, but are capable of sharing code
416         in dynamic libraries.
417
418 config FEATURE_LIBBUSYBOX_STATIC
419         bool "Pull in all external references into libbusybox"
420         default n
421         depends on BUILD_LIBBUSYBOX
422         help
423         Make libbusybox library independent, not using or requiring
424         any other shared libraries.
425
426 config FEATURE_INDIVIDUAL
427         bool "Produce a binary for each applet, linked against libbusybox"
428         default y
429         depends on BUILD_LIBBUSYBOX
430         help
431         If your CPU architecture doesn't allow for sharing text/rodata
432         sections of running binaries, but allows for runtime dynamic
433         libraries, this option will allow you to reduce memory footprint
434         when you have many different applets running at once.
435
436         If your CPU architecture allows for sharing text/rodata,
437         having single binary is more optimal.
438
439         Each applet will be a tiny program, dynamically linked
440         against libbusybox.so.N.N.N.
441
442         You need to have a working dynamic linker.
443
444 config FEATURE_SHARED_BUSYBOX
445         bool "Produce additional busybox binary linked against libbusybox"
446         default y
447         depends on BUILD_LIBBUSYBOX
448         help
449         Build busybox, dynamically linked against libbusybox.so.N.N.N.
450
451         You need to have a working dynamic linker.
452
453 ### config BUILD_AT_ONCE
454 ###     bool "Compile all sources at once"
455 ###     default n
456 ###     help
457 ###     Normally each source-file is compiled with one invocation of
458 ###     the compiler.
459 ###     If you set this option, all sources are compiled at once.
460 ###     This gives the compiler more opportunities to optimize which can
461 ###     result in smaller and/or faster binaries.
462 ###
463 ###     Setting this option will consume alot of memory, e.g. if you
464 ###     enable all applets with all features, gcc uses more than 300MB
465 ###     RAM during compilation of busybox.
466 ###
467 ###     This option is most likely only beneficial for newer compilers
468 ###     such as gcc-4.1 and above.
469 ###
470 ###     Say 'N' unless you know what you are doing.
471
472 config CROSS_COMPILER_PREFIX
473         string "Cross compiler prefix"
474         default ""
475         help
476         If you want to build busybox with a cross compiler, then you
477         will need to set this to the cross-compiler prefix, for example,
478         "i386-uclibc-".
479
480         Note that CROSS_COMPILE environment variable or
481         "make CROSS_COMPILE=xxx ..." will override this selection.
482
483         Native builds leave this empty.
484
485 config SYSROOT
486         string "Path to sysroot"
487         default ""
488         help
489         If you want to build busybox with a cross compiler, then you
490         might also need to specify where /usr/include and /usr/lib
491         will be found.
492
493         For example, busybox can be built against an installed
494         Android NDK, platform version 9, for ARM ABI with
495
496         CONFIG_SYSROOT=/opt/android-ndk/platforms/android-9/arch-arm
497
498         Native builds leave this empty.
499
500 config EXTRA_CFLAGS
501         string "Additional CFLAGS"
502         default ""
503         help
504         Additional CFLAGS to pass to the compiler verbatim.
505
506 config EXTRA_LDFLAGS
507         string "Additional LDFLAGS"
508         default ""
509         help
510         Additional LDFLAGS to pass to the linker verbatim.
511
512 config EXTRA_LDLIBS
513         string "Additional LDLIBS"
514         default ""
515         help
516         Additional LDLIBS to pass to the linker with -l.
517
518 config USE_PORTABLE_CODE
519         bool "Avoid using GCC-specific code constructs"
520         default n
521         help
522         Use this option if you are trying to compile busybox with
523         compiler other than gcc.
524         If you do use gcc, this option may needlessly increase code size.
525
526 config STACK_OPTIMIZATION_386
527         bool "Use -mpreferred-stack-boundary=2 on i386 arch"
528         default y
529         help
530         This option makes for smaller code, but some libc versions
531         do not work with it (they use SSE instructions without
532         ensuring stack alignment).
533
534 comment 'Installation Options ("make install" behavior)'
535
536 choice
537         prompt "What kind of applet links to install"
538         default INSTALL_APPLET_SYMLINKS
539         help
540         Choose what kind of links to applets are created by "make install".
541
542 config INSTALL_APPLET_SYMLINKS
543         bool "as soft-links"
544         help
545         Install applets as soft-links to the busybox binary. This needs some
546         free inodes on the filesystem, but might help with filesystem
547         generators that can't cope with hard-links.
548
549 config INSTALL_APPLET_HARDLINKS
550         bool "as hard-links"
551         help
552         Install applets as hard-links to the busybox binary. This might
553         count on a filesystem with few inodes.
554
555 config INSTALL_APPLET_SCRIPT_WRAPPERS
556         bool "as script wrappers"
557         help
558         Install applets as script wrappers that call the busybox binary.
559
560 config INSTALL_APPLET_DONT
561         bool "not installed"
562         help
563         Do not install applet links. Useful when you plan to use
564         busybox --install for installing links, or plan to use
565         a standalone shell and thus don't need applet links.
566
567 endchoice
568
569 choice
570         prompt "/bin/sh applet link"
571         default INSTALL_SH_APPLET_SYMLINK
572         depends on INSTALL_APPLET_SCRIPT_WRAPPERS
573         help
574         Choose how you install /bin/sh applet link.
575
576 config INSTALL_SH_APPLET_SYMLINK
577         bool "as soft-link"
578         help
579         Install /bin/sh applet as soft-link to the busybox binary.
580
581 config INSTALL_SH_APPLET_HARDLINK
582         bool "as hard-link"
583         help
584         Install /bin/sh applet as hard-link to the busybox binary.
585
586 config INSTALL_SH_APPLET_SCRIPT_WRAPPER
587         bool "as script wrapper"
588         help
589         Install /bin/sh applet as script wrapper that calls
590         the busybox binary.
591
592 endchoice
593
594 config PREFIX
595         string "Destination path for 'make install'"
596         default "./_install"
597         help
598         Where "make install" should install busybox binary and links.
599
600 comment 'Debugging Options'
601
602 config DEBUG
603         bool "Build with debug information"
604         default n
605         help
606         Say Y here to compile with debug information.
607         This increases the size of the binary considerably, and
608         should only be used when doing development.
609
610         This adds -g option to gcc command line.
611
612         Most people should answer N.
613
614 config DEBUG_PESSIMIZE
615         bool "Disable compiler optimizations"
616         default n
617         depends on DEBUG
618         help
619         The compiler's optimization of source code can eliminate and reorder
620         code, resulting in an executable that's hard to understand when
621         stepping through it with a debugger. This switches it off, resulting
622         in a much bigger executable that more closely matches the source
623         code.
624
625         This replaces -Os/-O2 with -O0 in gcc command line.
626
627 config DEBUG_SANITIZE
628         bool "Enable runtime sanitizers (ASAN/LSAN/USAN/etc...)"
629         default n
630         help
631         Say Y here if you want to enable runtime sanitizers. These help
632         catch bad memory accesses (e.g. buffer overflows), but will make
633         the executable larger and slow down runtime a bit.
634
635         This adds -fsanitize=foo options to gcc command line.
636
637         If you aren't developing/testing busybox, say N here.
638
639 config UNIT_TEST
640         bool "Build unit tests"
641         default n
642         help
643         Say Y here if you want to build unit tests (both the framework and
644         test cases) as an applet. This results in bigger code, so you
645         probably don't want this option in production builds.
646
647 config WERROR
648         bool "Abort compilation on any warning"
649         default n
650         help
651         This adds -Werror to gcc command line.
652
653         Most people should answer N.
654
655 choice
656         prompt "Additional debugging library"
657         default NO_DEBUG_LIB
658         help
659         Using an additional debugging library will make busybox become
660         considerably larger and will cause it to run more slowly. You
661         should always leave this option disabled for production use.
662
663         dmalloc support:
664         ----------------
665         This enables compiling with dmalloc ( http://dmalloc.com/ )
666         which is an excellent public domain mem leak and malloc problem
667         detector. To enable dmalloc, before running busybox you will
668         want to properly set your environment, for example:
669                 export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile
670         The 'debug=' value is generated using the following command
671         dmalloc -p log-stats -p log-non-free -p log-bad-space \
672                 -p log-elapsed-time -p check-fence -p check-heap \
673                 -p check-lists -p check-blank -p check-funcs -p realloc-copy \
674                 -p allow-free-null
675
676         Electric-fence support:
677         -----------------------
678         This enables compiling with Electric-fence support. Electric
679         fence is another very useful malloc debugging library which uses
680         your computer's virtual memory hardware to detect illegal memory
681         accesses. This support will make busybox be considerably larger
682         and run slower, so you should leave this option disabled unless
683         you are hunting a hard to find memory problem.
684
685
686 config NO_DEBUG_LIB
687         bool "None"
688
689 config DMALLOC
690         bool "Dmalloc"
691
692 config EFENCE
693         bool "Electric-fence"
694
695 endchoice
696
697 source libbb/Config.in
698
699 endmenu
700
701 comment "Applets"
702
703 source archival/Config.in
704 source coreutils/Config.in
705 source console-tools/Config.in
706 source debianutils/Config.in
707 source klibc-utils/Config.in
708 source editors/Config.in
709 source findutils/Config.in
710 source init/Config.in
711 source loginutils/Config.in
712 source e2fsprogs/Config.in
713 source modutils/Config.in
714 source util-linux/Config.in
715 source miscutils/Config.in
716 source networking/Config.in
717 source printutils/Config.in
718 source mailutils/Config.in
719 source procps/Config.in
720 source runit/Config.in
721 source selinux/Config.in
722 source shell/Config.in
723 source sysklogd/Config.in