Skip to content

Commit 94c78aa

Browse files
author
Denys Vlasenko
committed
config system: move some options closer to relevalnt tool subdirectories
Signed-off-by: Denys Vlasenko <[email protected]>
1 parent 7c3e96d commit 94c78aa

File tree

6 files changed

+132
-131
lines changed

6 files changed

+132
-131
lines changed

coreutils/Config.src

+15-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55

66
menu "Coreutils"
77

8-
INSERT
9-
10-
comment "Common options"
11-
128
config FEATURE_VERBOSE
139
bool "Support verbose options (usually -v) for various applets"
1410
default y
@@ -17,6 +13,19 @@ config FEATURE_VERBOSE
1713
Also enables long option (--verbose) if it exists.
1814
Without this option, -v is accepted but ignored.
1915

16+
comment "Common options for date and touch"
17+
18+
config FEATURE_TIMEZONE
19+
bool "Allow timezone in dates"
20+
default y
21+
depends on DESKTOP
22+
help
23+
Permit the use of timezones when parsing user-provided data
24+
strings, e.g. '1996-04-09 12:45:00 -0500'.
25+
26+
This requires support for the '%z' extension to strptime() which
27+
may not be available in all implementations.
28+
2029
comment "Common options for cp and mv"
2130
depends on CP || MV
2231

@@ -37,4 +46,6 @@ config FEATURE_HUMAN_READABLE
3746
help
3847
Allow df, du, and ls to have human readable output.
3948

49+
INSERT
50+
4051
endmenu

coreutils/df.c

+20
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,26 @@
3232
//config: -a Show all filesystems
3333
//config: -i Inodes
3434
//config: -B <SIZE> Blocksize
35+
//config:
36+
//config:config FEATURE_SKIP_ROOTFS
37+
//config: bool "Skip rootfs in mount table"
38+
//config: default y
39+
//config: depends on DF
40+
//config: help
41+
//config: Ignore rootfs entry in mount table.
42+
//config:
43+
//config: In Linux, kernel has a special filesystem, rootfs, which is initially
44+
//config: mounted on /. It contains initramfs data, if kernel is configured
45+
//config: to have one. Usually, another file system is mounted over / early
46+
//config: in boot process, and therefore most tools which manipulate
47+
//config: mount table, such as df, will skip rootfs entry.
48+
//config:
49+
//config: However, some systems do not mount anything on /.
50+
//config: If you need to configure busybox for one of these systems,
51+
//config: you may find it useful to turn this option off to make df show
52+
//config: initramfs statistics.
53+
//config:
54+
//config: Otherwise, choose Y.
3555

3656
//applet:IF_DF(APPLET_NOEXEC(df, df, BB_DIR_BIN, BB_SUID_DROP, df))
3757

libbb/Config.src

+61-124
Original file line numberDiff line numberDiff line change
@@ -61,32 +61,73 @@ config SHA3_SMALL
6161
64-bit x86: +270 bytes of code, 45% faster
6262
32-bit x86: +450 bytes of code, 75% faster
6363

64-
config FEATURE_FAST_TOP
65-
bool "Faster /proc scanning code (+100 bytes)"
66-
default n # all "fast or small" options default to small
64+
config FEATURE_NON_POSIX_CP
65+
bool "Non-POSIX, but safer, copying to special nodes"
66+
default y
6767
help
68-
This option makes top and ps ~20% faster (or 20% less CPU hungry),
69-
but code size is slightly bigger.
68+
With this option, "cp file symlink" will delete symlink
69+
and create a regular file. This does not conform to POSIX,
70+
but prevents a symlink attack.
71+
Similarly, "cp file device" will not send file's data
72+
to the device. (To do that, use "cat file >device")
7073

71-
config FEATURE_ETC_NETWORKS
72-
bool "Support /etc/networks"
74+
config FEATURE_VERBOSE_CP_MESSAGE
75+
bool "Give more precise messages when copy fails (cp, mv etc)"
7376
default n
7477
help
75-
Enable support for network names in /etc/networks. This is
76-
a rarely used feature which allows you to use names
77-
instead of IP/mask pairs in route command.
78+
Error messages with this feature enabled:
7879

79-
config FEATURE_ETC_SERVICES
80-
bool "Consult /etc/services even for well-known ports"
81-
default n
80+
$ cp file /does_not_exist/file
81+
cp: cannot create '/does_not_exist/file': Path does not exist
82+
$ cp file /vmlinuz/file
83+
cp: cannot stat '/vmlinuz/file': Path has non-directory component
84+
85+
If this feature is not enabled, they will be, respectively:
86+
87+
cp: cannot create '/does_not_exist/file': No such file or directory
88+
cp: cannot stat '/vmlinuz/file': Not a directory
89+
90+
This will cost you ~60 bytes.
91+
92+
config FEATURE_USE_SENDFILE
93+
bool "Use sendfile system call"
94+
default y
95+
help
96+
When enabled, busybox will use the kernel sendfile() function
97+
instead of read/write loops to copy data between file descriptors
98+
(for example, cp command does this a lot).
99+
If sendfile() doesn't work, copying code falls back to read/write
100+
loop. sendfile() was originally implemented for faster I/O
101+
from files to sockets, but since Linux 2.6.33 it was extended
102+
to work for many more file types.
103+
104+
config FEATURE_COPYBUF_KB
105+
int "Copy buffer size, in kilobytes"
106+
range 1 1024
107+
default 4
108+
help
109+
Size of buffer used by cp, mv, install, wget etc.
110+
Buffers which are 4 kb or less will be allocated on stack.
111+
Bigger buffers will be allocated with mmap, with fallback to 4 kb
112+
stack buffer if mmap fails.
113+
114+
config MONOTONIC_SYSCALL
115+
bool "Use clock_gettime(CLOCK_MONOTONIC) syscall"
116+
default y
117+
help
118+
Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring
119+
time intervals (time, ping, traceroute etc need this).
120+
Probably requires Linux 2.6+. If not selected, gettimeofday
121+
will be used instead (which gives wrong results if date/time
122+
is reset).
123+
124+
config IOCTL_HEX2STR_ERROR
125+
bool "Use ioctl names rather than hex values in error messages"
126+
default y
82127
help
83-
Look up e.g. "telnet" and "http" in /etc/services file
84-
instead of assuming ports 23 and 80.
85-
This is almost never necessary (everybody uses standard ports),
86-
and it makes sense to avoid reading this file.
87-
If you disable this option, in the cases where port is explicitly
88-
specified as a service name (e.g. "telnet HOST PORTNAME"),
89-
it will still be looked up in /etc/services.
128+
Use ioctl names rather than hex values in error messages
129+
(e.g. VT_DISALLOCATE rather than 0x5608). If disabled this
130+
saves about 1400 bytes.
90131

91132
config FEATURE_EDITING
92133
bool "Command line editing"
@@ -302,107 +343,3 @@ config UNICODE_PRESERVE_BROKEN
302343
For example, this means that entering 'l', 's', ' ', 0xff, [Enter]
303344
at shell prompt will list file named 0xff (single char name
304345
with char value 255), not file named '?'.
305-
306-
config FEATURE_NON_POSIX_CP
307-
bool "Non-POSIX, but safer, copying to special nodes"
308-
default y
309-
help
310-
With this option, "cp file symlink" will delete symlink
311-
and create a regular file. This does not conform to POSIX,
312-
but prevents a symlink attack.
313-
Similarly, "cp file device" will not send file's data
314-
to the device. (To do that, use "cat file >device")
315-
316-
config FEATURE_VERBOSE_CP_MESSAGE
317-
bool "Give more precise messages when copy fails (cp, mv etc)"
318-
default n
319-
help
320-
Error messages with this feature enabled:
321-
322-
$ cp file /does_not_exist/file
323-
cp: cannot create '/does_not_exist/file': Path does not exist
324-
$ cp file /vmlinuz/file
325-
cp: cannot stat '/vmlinuz/file': Path has non-directory component
326-
327-
If this feature is not enabled, they will be, respectively:
328-
329-
cp: cannot create '/does_not_exist/file': No such file or directory
330-
cp: cannot stat '/vmlinuz/file': Not a directory
331-
332-
This will cost you ~60 bytes.
333-
334-
config FEATURE_USE_SENDFILE
335-
bool "Use sendfile system call"
336-
default y
337-
help
338-
When enabled, busybox will use the kernel sendfile() function
339-
instead of read/write loops to copy data between file descriptors
340-
(for example, cp command does this a lot).
341-
If sendfile() doesn't work, copying code falls back to read/write
342-
loop. sendfile() was originally implemented for faster I/O
343-
from files to sockets, but since Linux 2.6.33 it was extended
344-
to work for many more file types.
345-
346-
config FEATURE_COPYBUF_KB
347-
int "Copy buffer size, in kilobytes"
348-
range 1 1024
349-
default 4
350-
help
351-
Size of buffer used by cp, mv, install, wget etc.
352-
Buffers which are 4 kb or less will be allocated on stack.
353-
Bigger buffers will be allocated with mmap, with fallback to 4 kb
354-
stack buffer if mmap fails.
355-
356-
config FEATURE_SKIP_ROOTFS
357-
bool "Skip rootfs in mount table"
358-
default y
359-
help
360-
Ignore rootfs entry in mount table.
361-
362-
In Linux, kernel has a special filesystem, rootfs, which is initially
363-
mounted on /. It contains initramfs data, if kernel is configured
364-
to have one. Usually, another file system is mounted over / early
365-
in boot process, and therefore most tools which manipulate
366-
mount table, such as df, will skip rootfs entry.
367-
368-
However, some systems do not mount anything on /.
369-
If you need to configure busybox for one of these systems,
370-
you may find it useful to turn this option off to make df show
371-
initramfs statistics.
372-
373-
Otherwise, choose Y.
374-
375-
config MONOTONIC_SYSCALL
376-
bool "Use clock_gettime(CLOCK_MONOTONIC) syscall"
377-
default y
378-
help
379-
Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring
380-
time intervals (time, ping, traceroute etc need this).
381-
Probably requires Linux 2.6+. If not selected, gettimeofday
382-
will be used instead (which gives wrong results if date/time
383-
is reset).
384-
385-
config IOCTL_HEX2STR_ERROR
386-
bool "Use ioctl names rather than hex values in error messages"
387-
default y
388-
help
389-
Use ioctl names rather than hex values in error messages
390-
(e.g. VT_DISALLOCATE rather than 0x5608). If disabled this
391-
saves about 1400 bytes.
392-
393-
config FEATURE_HWIB
394-
bool "Support infiniband HW"
395-
default y
396-
help
397-
Support for printing infiniband addresses in network applets.
398-
399-
config FEATURE_TIMEZONE
400-
bool "Allow timezone in dates"
401-
default y
402-
depends on DESKTOP
403-
help
404-
Permit the use of timezones when parsing user-provided data
405-
strings, e.g. '1996-04-09 12:45:00 -0500'.
406-
407-
This requires support for the '%z' extension to strptime() which
408-
may not be available in all implementations.

mailutils/Config.src

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
menu "Mail Utilities"
22

3-
INSERT
4-
53
config FEATURE_MIME_CHARSET
64
string "Default charset"
75
default "us-ascii"
86
depends on MAKEMIME || REFORMIME || SENDMAIL
97
help
108
Default charset of the message.
119

10+
INSERT
11+
1212
endmenu

networking/Config.src

+26
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,32 @@ config VERBOSE_RESOLUTION_ERRORS
4646
"can't resolve 'hostname.com'" and want to know more.
4747
This may increase size of your executable a bit.
4848

49+
config FEATURE_ETC_NETWORKS
50+
bool "Support /etc/networks"
51+
default n
52+
help
53+
Enable support for network names in /etc/networks. This is
54+
a rarely used feature which allows you to use names
55+
instead of IP/mask pairs in route command.
56+
57+
config FEATURE_ETC_SERVICES
58+
bool "Consult /etc/services even for well-known ports"
59+
default n
60+
help
61+
Look up e.g. "telnet" and "http" in /etc/services file
62+
instead of assuming ports 23 and 80.
63+
This is almost never necessary (everybody uses standard ports),
64+
and it makes sense to avoid reading this file.
65+
If you disable this option, in the cases where port is explicitly
66+
specified as a service name (e.g. "telnet HOST PORTNAME"),
67+
it will still be looked up in /etc/services.
68+
69+
config FEATURE_HWIB
70+
bool "Support infiniband HW"
71+
default y
72+
help
73+
Support for printing infiniband addresses in network applets.
74+
4975
config FEATURE_TLS_SHA1
5076
bool "In TLS code, support ciphers which use deprecated SHA1"
5177
depends on TLS

procps/Config.src

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55

66
menu "Process Utilities"
77

8-
INSERT
8+
config FEATURE_FAST_TOP
9+
bool "Faster /proc scanning code (+100 bytes)"
10+
default n # all "fast or small" options default to small
11+
help
12+
This option makes top and ps ~20% faster (or 20% less CPU hungry),
13+
but code size is slightly bigger.
914

1015
config FEATURE_SHOW_THREADS
1116
bool "Support thread display in ps/pstree/top"
@@ -15,4 +20,6 @@ config FEATURE_SHOW_THREADS
1520
Enables the ps -T option, showing of threads in pstree,
1621
and 'h' command in top.
1722

23+
INSERT
24+
1825
endmenu

0 commit comments

Comments
 (0)