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