diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-19 00:52:26 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-19 00:52:26 +0200 |
commit | 28826ac8c02793431203edb4adb961d5521d643d (patch) | |
tree | fdc16e8bb697a047bc553a0e3b9d70a24885a3a0 | |
parent | 854bb6879da7277446c7a943387e2880017804e0 (diff) | |
download | busybox-w32-28826ac8c02793431203edb4adb961d5521d643d.tar.gz busybox-w32-28826ac8c02793431203edb4adb961d5521d643d.tar.bz2 busybox-w32-28826ac8c02793431203edb4adb961d5521d643d.zip |
debianutils/*: convert to new-style "one file" applets
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | debianutils/Config.src | 75 | ||||
-rw-r--r-- | debianutils/Kbuild.src | 5 | ||||
-rw-r--r-- | debianutils/mktemp.c | 9 | ||||
-rw-r--r-- | debianutils/pipe_progress.c | 9 | ||||
-rw-r--r-- | debianutils/run_parts.c | 34 | ||||
-rw-r--r-- | debianutils/start_stop_daemon.c | 28 | ||||
-rw-r--r-- | debianutils/which.c | 10 | ||||
-rw-r--r-- | include/applets.src.h | 5 |
8 files changed, 90 insertions, 85 deletions
diff --git a/debianutils/Config.src b/debianutils/Config.src index cbc09b5ce..61daeb047 100644 --- a/debianutils/Config.src +++ b/debianutils/Config.src | |||
@@ -7,79 +7,4 @@ menu "Debian Utilities" | |||
7 | 7 | ||
8 | INSERT | 8 | INSERT |
9 | 9 | ||
10 | config MKTEMP | ||
11 | bool "mktemp" | ||
12 | default y | ||
13 | help | ||
14 | mktemp is used to create unique temporary files | ||
15 | |||
16 | config PIPE_PROGRESS | ||
17 | bool "pipe_progress" | ||
18 | default y | ||
19 | help | ||
20 | Display a dot to indicate pipe activity. | ||
21 | |||
22 | config RUN_PARTS | ||
23 | bool "run-parts" | ||
24 | default y | ||
25 | help | ||
26 | run-parts is a utility designed to run all the scripts in a directory. | ||
27 | |||
28 | It is useful to set up a directory like cron.daily, where you need to | ||
29 | execute all the scripts in that directory. | ||
30 | |||
31 | In this implementation of run-parts some features (such as report | ||
32 | mode) are not implemented. | ||
33 | |||
34 | Unless you know that run-parts is used in some of your scripts | ||
35 | you can safely say N here. | ||
36 | |||
37 | config FEATURE_RUN_PARTS_LONG_OPTIONS | ||
38 | bool "Enable long options" | ||
39 | default y | ||
40 | depends on RUN_PARTS && LONG_OPTS | ||
41 | help | ||
42 | Support long options for the run-parts applet. | ||
43 | |||
44 | config FEATURE_RUN_PARTS_FANCY | ||
45 | bool "Support additional arguments" | ||
46 | default y | ||
47 | depends on RUN_PARTS | ||
48 | help | ||
49 | Support additional options: | ||
50 | -l --list print the names of the all matching files (not | ||
51 | limited to executables), but don't actually run them. | ||
52 | |||
53 | config START_STOP_DAEMON | ||
54 | bool "start-stop-daemon" | ||
55 | default y | ||
56 | help | ||
57 | start-stop-daemon is used to control the creation and | ||
58 | termination of system-level processes, usually the ones | ||
59 | started during the startup of the system. | ||
60 | |||
61 | config FEATURE_START_STOP_DAEMON_FANCY | ||
62 | bool "Support additional arguments" | ||
63 | default y | ||
64 | depends on START_STOP_DAEMON | ||
65 | help | ||
66 | Support additional arguments. | ||
67 | -o|--oknodo ignored since we exit with 0 anyway | ||
68 | -v|--verbose | ||
69 | -N|--nicelevel N | ||
70 | |||
71 | config FEATURE_START_STOP_DAEMON_LONG_OPTIONS | ||
72 | bool "Enable long options" | ||
73 | default y | ||
74 | depends on START_STOP_DAEMON && LONG_OPTS | ||
75 | help | ||
76 | Support long options for the start-stop-daemon applet. | ||
77 | |||
78 | config WHICH | ||
79 | bool "which" | ||
80 | default y | ||
81 | help | ||
82 | which is used to find programs in your PATH and | ||
83 | print out their pathnames. | ||
84 | |||
85 | endmenu | 10 | endmenu |
diff --git a/debianutils/Kbuild.src b/debianutils/Kbuild.src index d41b5c8e4..6b4fb7470 100644 --- a/debianutils/Kbuild.src +++ b/debianutils/Kbuild.src | |||
@@ -7,8 +7,3 @@ | |||
7 | lib-y:= | 7 | lib-y:= |
8 | 8 | ||
9 | INSERT | 9 | INSERT |
10 | lib-$(CONFIG_MKTEMP) += mktemp.o | ||
11 | lib-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o | ||
12 | lib-$(CONFIG_RUN_PARTS) += run_parts.o | ||
13 | lib-$(CONFIG_START_STOP_DAEMON) += start_stop_daemon.o | ||
14 | lib-$(CONFIG_WHICH) += which.o | ||
diff --git a/debianutils/mktemp.c b/debianutils/mktemp.c index 983d7a246..65353697a 100644 --- a/debianutils/mktemp.c +++ b/debianutils/mktemp.c | |||
@@ -30,6 +30,15 @@ | |||
30 | * a directory: $TMPDIR, if set; else the directory specified via | 30 | * a directory: $TMPDIR, if set; else the directory specified via |
31 | * -p; else /tmp [deprecated] | 31 | * -p; else /tmp [deprecated] |
32 | */ | 32 | */ |
33 | //config:config MKTEMP | ||
34 | //config: bool "mktemp" | ||
35 | //config: default y | ||
36 | //config: help | ||
37 | //config: mktemp is used to create unique temporary files | ||
38 | |||
39 | //applet:IF_MKTEMP(APPLET(mktemp, BB_DIR_BIN, BB_SUID_DROP)) | ||
40 | |||
41 | //kbuild:lib-$(CONFIG_MKTEMP) += mktemp.o | ||
33 | 42 | ||
34 | //usage:#define mktemp_trivial_usage | 43 | //usage:#define mktemp_trivial_usage |
35 | //usage: "[-dt] [-p DIR] [TEMPLATE]" | 44 | //usage: "[-dt] [-p DIR] [TEMPLATE]" |
diff --git a/debianutils/pipe_progress.c b/debianutils/pipe_progress.c index 2c7444f31..21d330b59 100644 --- a/debianutils/pipe_progress.c +++ b/debianutils/pipe_progress.c | |||
@@ -6,6 +6,15 @@ | |||
6 | * | 6 | * |
7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
8 | */ | 8 | */ |
9 | //config:config PIPE_PROGRESS | ||
10 | //config: bool "pipe_progress" | ||
11 | //config: default y | ||
12 | //config: help | ||
13 | //config: Display a dot to indicate pipe activity. | ||
14 | |||
15 | //applet:IF_PIPE_PROGRESS(APPLET(pipe_progress, BB_DIR_BIN, BB_SUID_DROP)) | ||
16 | |||
17 | //kbuild:lib-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o | ||
9 | 18 | ||
10 | //usage:#define pipe_progress_trivial_usage NOUSAGE_STR | 19 | //usage:#define pipe_progress_trivial_usage NOUSAGE_STR |
11 | //usage:#define pipe_progress_full_usage "" | 20 | //usage:#define pipe_progress_full_usage "" |
diff --git a/debianutils/run_parts.c b/debianutils/run_parts.c index dd6fe7d49..13617c6e1 100644 --- a/debianutils/run_parts.c +++ b/debianutils/run_parts.c | |||
@@ -22,6 +22,40 @@ | |||
22 | * report mode. As the original run-parts support only long options, I've | 22 | * report mode. As the original run-parts support only long options, I've |
23 | * broken compatibility because the BusyBox policy doesn't allow them. | 23 | * broken compatibility because the BusyBox policy doesn't allow them. |
24 | */ | 24 | */ |
25 | //config:config RUN_PARTS | ||
26 | //config: bool "run-parts" | ||
27 | //config: default y | ||
28 | //config: help | ||
29 | //config: run-parts is a utility designed to run all the scripts in a directory. | ||
30 | //config: | ||
31 | //config: It is useful to set up a directory like cron.daily, where you need to | ||
32 | //config: execute all the scripts in that directory. | ||
33 | //config: | ||
34 | //config: In this implementation of run-parts some features (such as report | ||
35 | //config: mode) are not implemented. | ||
36 | //config: | ||
37 | //config: Unless you know that run-parts is used in some of your scripts | ||
38 | //config: you can safely say N here. | ||
39 | //config: | ||
40 | //config:config FEATURE_RUN_PARTS_LONG_OPTIONS | ||
41 | //config: bool "Enable long options" | ||
42 | //config: default y | ||
43 | //config: depends on RUN_PARTS && LONG_OPTS | ||
44 | //config: help | ||
45 | //config: Support long options for the run-parts applet. | ||
46 | //config: | ||
47 | //config:config FEATURE_RUN_PARTS_FANCY | ||
48 | //config: bool "Support additional arguments" | ||
49 | //config: default y | ||
50 | //config: depends on RUN_PARTS | ||
51 | //config: help | ||
52 | //config: Support additional options: | ||
53 | //config: -l --list print the names of the all matching files (not | ||
54 | //config: limited to executables), but don't actually run them. | ||
55 | |||
56 | //applet:IF_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, BB_DIR_BIN, BB_SUID_DROP, run_parts)) | ||
57 | |||
58 | //kbuild:lib-$(CONFIG_RUN_PARTS) += run_parts.o | ||
25 | 59 | ||
26 | //usage:#define run_parts_trivial_usage | 60 | //usage:#define run_parts_trivial_usage |
27 | //usage: "[-a ARG]... [-u UMASK] " | 61 | //usage: "[-a ARG]... [-u UMASK] " |
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c index 7dadc3c9e..42f1943dd 100644 --- a/debianutils/start_stop_daemon.c +++ b/debianutils/start_stop_daemon.c | |||
@@ -56,6 +56,34 @@ Misc options: | |||
56 | -q,--quiet Quiet | 56 | -q,--quiet Quiet |
57 | -v,--verbose Verbose | 57 | -v,--verbose Verbose |
58 | */ | 58 | */ |
59 | //config:config START_STOP_DAEMON | ||
60 | //config: bool "start-stop-daemon" | ||
61 | //config: default y | ||
62 | //config: help | ||
63 | //config: start-stop-daemon is used to control the creation and | ||
64 | //config: termination of system-level processes, usually the ones | ||
65 | //config: started during the startup of the system. | ||
66 | //config: | ||
67 | //config:config FEATURE_START_STOP_DAEMON_FANCY | ||
68 | //config: bool "Support additional arguments" | ||
69 | //config: default y | ||
70 | //config: depends on START_STOP_DAEMON | ||
71 | //config: help | ||
72 | //config: Support additional arguments. | ||
73 | //config: -o|--oknodo ignored since we exit with 0 anyway | ||
74 | //config: -v|--verbose | ||
75 | //config: -N|--nicelevel N | ||
76 | //config: | ||
77 | //config:config FEATURE_START_STOP_DAEMON_LONG_OPTIONS | ||
78 | //config: bool "Enable long options" | ||
79 | //config: default y | ||
80 | //config: depends on START_STOP_DAEMON && LONG_OPTS | ||
81 | //config: help | ||
82 | //config: Support long options for the start-stop-daemon applet. | ||
83 | |||
84 | //applet:IF_START_STOP_DAEMON(APPLET_ODDNAME(start-stop-daemon, start_stop_daemon, BB_DIR_SBIN, BB_SUID_DROP, start_stop_daemon)) | ||
85 | |||
86 | //kbuild:lib-$(CONFIG_START_STOP_DAEMON) += start_stop_daemon.o | ||
59 | 87 | ||
60 | //usage:#define start_stop_daemon_trivial_usage | 88 | //usage:#define start_stop_daemon_trivial_usage |
61 | //usage: "[OPTIONS] [-S|-K] ... [-- ARGS...]" | 89 | //usage: "[OPTIONS] [-S|-K] ... [-- ARGS...]" |
diff --git a/debianutils/which.c b/debianutils/which.c index d50e7a0d3..c0f897809 100644 --- a/debianutils/which.c +++ b/debianutils/which.c | |||
@@ -5,6 +5,16 @@ | |||
5 | * | 5 | * |
6 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 6 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
7 | */ | 7 | */ |
8 | //config:config WHICH | ||
9 | //config: bool "which" | ||
10 | //config: default y | ||
11 | //config: help | ||
12 | //config: which is used to find programs in your PATH and | ||
13 | //config: print out their pathnames. | ||
14 | |||
15 | //applet:IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
16 | |||
17 | //kbuild:lib-$(CONFIG_WHICH) += which.o | ||
8 | 18 | ||
9 | //usage:#define which_trivial_usage | 19 | //usage:#define which_trivial_usage |
10 | //usage: "[COMMAND]..." | 20 | //usage: "[COMMAND]..." |
diff --git a/include/applets.src.h b/include/applets.src.h index 9c4f9daa0..f49179996 100644 --- a/include/applets.src.h +++ b/include/applets.src.h | |||
@@ -230,7 +230,6 @@ IF_MKFS_VFAT(APPLET_ODDNAME(mkfs.vfat, mkfs_vfat, BB_DIR_SBIN, BB_SUID_DROP, mkf | |||
230 | IF_MKNOD(APPLET_NOEXEC(mknod, mknod, BB_DIR_BIN, BB_SUID_DROP, mknod)) | 230 | IF_MKNOD(APPLET_NOEXEC(mknod, mknod, BB_DIR_BIN, BB_SUID_DROP, mknod)) |
231 | IF_CRYPTPW(APPLET_ODDNAME(mkpasswd, cryptpw, BB_DIR_USR_BIN, BB_SUID_DROP, mkpasswd)) | 231 | IF_CRYPTPW(APPLET_ODDNAME(mkpasswd, cryptpw, BB_DIR_USR_BIN, BB_SUID_DROP, mkpasswd)) |
232 | IF_MKSWAP(APPLET(mkswap, BB_DIR_SBIN, BB_SUID_DROP)) | 232 | IF_MKSWAP(APPLET(mkswap, BB_DIR_SBIN, BB_SUID_DROP)) |
233 | IF_MKTEMP(APPLET(mktemp, BB_DIR_BIN, BB_SUID_DROP)) | ||
234 | IF_MORE(APPLET(more, BB_DIR_BIN, BB_SUID_DROP)) | 233 | IF_MORE(APPLET(more, BB_DIR_BIN, BB_SUID_DROP)) |
235 | /* On full-blown systems, requires suid for user mounts. | 234 | /* On full-blown systems, requires suid for user mounts. |
236 | * But it's not unthinkable to have it available in non-suid flavor on some systems, | 235 | * But it's not unthinkable to have it available in non-suid flavor on some systems, |
@@ -254,7 +253,6 @@ IF_OPENVT(APPLET(openvt, BB_DIR_USR_BIN, BB_SUID_DROP)) | |||
254 | IF_PASSWD(APPLET(passwd, BB_DIR_USR_BIN, BB_SUID_REQUIRE)) | 253 | IF_PASSWD(APPLET(passwd, BB_DIR_USR_BIN, BB_SUID_REQUIRE)) |
255 | IF_PGREP(APPLET(pgrep, BB_DIR_USR_BIN, BB_SUID_DROP)) | 254 | IF_PGREP(APPLET(pgrep, BB_DIR_USR_BIN, BB_SUID_DROP)) |
256 | IF_PIDOF(APPLET(pidof, BB_DIR_BIN, BB_SUID_DROP)) | 255 | IF_PIDOF(APPLET(pidof, BB_DIR_BIN, BB_SUID_DROP)) |
257 | IF_PIPE_PROGRESS(APPLET(pipe_progress, BB_DIR_BIN, BB_SUID_DROP)) | ||
258 | IF_PIVOT_ROOT(APPLET(pivot_root, BB_DIR_SBIN, BB_SUID_DROP)) | 256 | IF_PIVOT_ROOT(APPLET(pivot_root, BB_DIR_SBIN, BB_SUID_DROP)) |
259 | IF_PKILL(APPLET_ODDNAME(pkill, pgrep, BB_DIR_USR_BIN, BB_SUID_DROP, pkill)) | 257 | IF_PKILL(APPLET_ODDNAME(pkill, pgrep, BB_DIR_USR_BIN, BB_SUID_DROP, pkill)) |
260 | IF_POPMAILDIR(APPLET(popmaildir, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 258 | IF_POPMAILDIR(APPLET(popmaildir, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
@@ -279,7 +277,6 @@ IF_RM(APPLET_NOFORK(rm, rm, BB_DIR_BIN, BB_SUID_DROP, rm)) | |||
279 | IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir)) | 277 | IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir)) |
280 | IF_ROUTE(APPLET(route, BB_DIR_SBIN, BB_SUID_DROP)) | 278 | IF_ROUTE(APPLET(route, BB_DIR_SBIN, BB_SUID_DROP)) |
281 | IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 279 | IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
282 | IF_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, BB_DIR_BIN, BB_SUID_DROP, run_parts)) | ||
283 | IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) | 280 | IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) |
284 | IF_RUNLEVEL(APPLET(runlevel, BB_DIR_SBIN, BB_SUID_DROP)) | 281 | IF_RUNLEVEL(APPLET(runlevel, BB_DIR_SBIN, BB_SUID_DROP)) |
285 | IF_RX(APPLET(rx, BB_DIR_USR_BIN, BB_SUID_DROP)) | 282 | IF_RX(APPLET(rx, BB_DIR_USR_BIN, BB_SUID_DROP)) |
@@ -308,7 +305,6 @@ IF_SLATTACH(APPLET(slattach, BB_DIR_SBIN, BB_SUID_DROP)) | |||
308 | IF_SLEEP(APPLET(sleep, BB_DIR_BIN, BB_SUID_DROP)) | 305 | IF_SLEEP(APPLET(sleep, BB_DIR_BIN, BB_SUID_DROP)) |
309 | IF_SORT(APPLET_NOEXEC(sort, sort, BB_DIR_USR_BIN, BB_SUID_DROP, sort)) | 306 | IF_SORT(APPLET_NOEXEC(sort, sort, BB_DIR_USR_BIN, BB_SUID_DROP, sort)) |
310 | IF_SPLIT(APPLET(split, BB_DIR_USR_BIN, BB_SUID_DROP)) | 307 | IF_SPLIT(APPLET(split, BB_DIR_USR_BIN, BB_SUID_DROP)) |
311 | IF_START_STOP_DAEMON(APPLET_ODDNAME(start-stop-daemon, start_stop_daemon, BB_DIR_SBIN, BB_SUID_DROP, start_stop_daemon)) | ||
312 | IF_STAT(APPLET(stat, BB_DIR_BIN, BB_SUID_DROP)) | 308 | IF_STAT(APPLET(stat, BB_DIR_BIN, BB_SUID_DROP)) |
313 | IF_STRINGS(APPLET(strings, BB_DIR_USR_BIN, BB_SUID_DROP)) | 309 | IF_STRINGS(APPLET(strings, BB_DIR_USR_BIN, BB_SUID_DROP)) |
314 | IF_STTY(APPLET(stty, BB_DIR_BIN, BB_SUID_DROP)) | 310 | IF_STTY(APPLET(stty, BB_DIR_BIN, BB_SUID_DROP)) |
@@ -362,7 +358,6 @@ IF_VOLNAME(APPLET(volname, BB_DIR_USR_BIN, BB_SUID_DROP)) | |||
362 | IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP)) | 358 | IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP)) |
363 | IF_WATCHDOG(APPLET(watchdog, BB_DIR_SBIN, BB_SUID_DROP)) | 359 | IF_WATCHDOG(APPLET(watchdog, BB_DIR_SBIN, BB_SUID_DROP)) |
364 | IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) | 360 | IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) |
365 | IF_WHICH(APPLET(which, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
366 | IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) | 361 | IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) |
367 | IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) | 362 | IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) |
368 | IF_ZCIP(APPLET(zcip, BB_DIR_SBIN, BB_SUID_DROP)) | 363 | IF_ZCIP(APPLET(zcip, BB_DIR_SBIN, BB_SUID_DROP)) |