From 67fd2f2858ac63d46f42ef3c096b007ac7362849 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 13 Nov 2016 22:35:10 +0100 Subject: dnsdomainname: split it from "hostname", make it independently selectable Signed-off-by: Denys Vlasenko --- include/applets.src.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/applets.src.h b/include/applets.src.h index 248d539c4..dbc45953c 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -112,7 +112,6 @@ IF_DHCPRELAY(APPLET(dhcprelay, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_DIRNAME(APPLET_NOFORK(dirname, dirname, BB_DIR_USR_BIN, BB_SUID_DROP, dirname)) IF_DMESG(APPLET(dmesg, BB_DIR_BIN, BB_SUID_DROP)) IF_DNSD(APPLET(dnsd, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_HOSTNAME(APPLET_ODDNAME(dnsdomainname, hostname, BB_DIR_BIN, BB_SUID_DROP, dnsdomainname)) IF_DOS2UNIX(APPLET_NOEXEC(dos2unix, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, dos2unix)) IF_DU(APPLET(du, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_DUMPKMAP(APPLET(dumpkmap, BB_DIR_BIN, BB_SUID_DROP)) @@ -158,7 +157,6 @@ IF_HD(APPLET_NOEXEC(hd, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hd)) IF_HDPARM(APPLET(hdparm, BB_DIR_SBIN, BB_SUID_DROP)) IF_HEAD(APPLET_NOEXEC(head, head, BB_DIR_USR_BIN, BB_SUID_DROP, head)) IF_HEXDUMP(APPLET_NOEXEC(hexdump, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hexdump)) -IF_HOSTNAME(APPLET(hostname, BB_DIR_BIN, BB_SUID_DROP)) IF_HTTPD(APPLET(httpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_HWCLOCK(APPLET(hwclock, BB_DIR_SBIN, BB_SUID_DROP)) IF_IFCONFIG(APPLET(ifconfig, BB_DIR_SBIN, BB_SUID_DROP)) -- cgit v1.2.3-55-g6feb From f417ffd88f194bbfd18605882ee242190c1bab34 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 14 Nov 2016 17:30:50 +0100 Subject: Make swapon and swapoff individually selectable. For example, without swapoff, code shrinks by 277 bytes. Signed-off-by: Denys Vlasenko --- include/applets.src.h | 2 -- util-linux/Config.src | 28 --------------------------- util-linux/Kbuild.src | 1 - util-linux/swaponoff.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 50 insertions(+), 32 deletions(-) (limited to 'include') diff --git a/include/applets.src.h b/include/applets.src.h index dbc45953c..f2c754b74 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -287,8 +287,6 @@ IF_STAT(APPLET(stat, BB_DIR_BIN, BB_SUID_DROP)) IF_STRINGS(APPLET(strings, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_STTY(APPLET(stty, BB_DIR_BIN, BB_SUID_DROP)) IF_SUM(APPLET(sum, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_SWAPONOFF(APPLET_ODDNAME(swapoff, swap_on_off, BB_DIR_SBIN, BB_SUID_DROP, swapoff)) -IF_SWAPONOFF(APPLET_ODDNAME(swapon, swap_on_off, BB_DIR_SBIN, BB_SUID_DROP, swapon)) IF_SWITCH_ROOT(APPLET(switch_root, BB_DIR_SBIN, BB_SUID_DROP)) IF_BB_SYSCTL(APPLET(sysctl, BB_DIR_SBIN, BB_SUID_DROP)) IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac)) diff --git a/util-linux/Config.src b/util-linux/Config.src index 922cabdb8..ee0d8a632 100644 --- a/util-linux/Config.src +++ b/util-linux/Config.src @@ -489,34 +489,6 @@ config SCRIPTREPLAY This program replays a typescript, using timing information given by script -t. -config SWAPONOFF - bool "swaponoff" - default y - select PLATFORM_LINUX - help - This option enables both the 'swapon' and the 'swapoff' utilities. - Once you have created some swap space using 'mkswap', you also need - to enable your swap space with the 'swapon' utility. The 'swapoff' - utility is used, typically at system shutdown, to disable any swap - space. If you are not using any swap space, you can leave this - option disabled. - -config FEATURE_SWAPON_DISCARD - bool "Support discard option -d" - default y - depends on SWAPONOFF - help - Enable support for discarding swap area blocks at swapon and/or as - the kernel frees them. This option enables both the -d option on - 'swapon' and the 'discard' option for swap entries in /etc/fstab. - -config FEATURE_SWAPON_PRI - bool "Support priority option -p" - default y - depends on SWAPONOFF - help - Enable support for setting swap device priority in swapon. - config SWITCH_ROOT bool "switch_root" default y diff --git a/util-linux/Kbuild.src b/util-linux/Kbuild.src index 0b87c52ac..5ee5cf7ff 100644 --- a/util-linux/Kbuild.src +++ b/util-linux/Kbuild.src @@ -40,6 +40,5 @@ lib-$(CONFIG_READPROFILE) += readprofile.o lib-$(CONFIG_RTCWAKE) += rtcwake.o lib-$(CONFIG_SCRIPT) += script.o lib-$(CONFIG_SCRIPTREPLAY) += scriptreplay.o -lib-$(CONFIG_SWAPONOFF) += swaponoff.o lib-$(CONFIG_SWITCH_ROOT) += switch_root.o lib-$(CONFIG_UMOUNT) += umount.o diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index 6713852e5..0a2d23f50 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c @@ -7,6 +7,47 @@ * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config SWAPON +//config: bool "swapon" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: This option enables the 'swapon' utility. +//config: Once you have created some swap space using 'mkswap', you also need +//config: to enable your swap space with the 'swapon' utility. The 'swapoff' +//config: utility is used, typically at system shutdown, to disable any swap +//config: space. If you are not using any swap space, you can leave this +//config: option disabled. +//config: +//config:config FEATURE_SWAPON_DISCARD +//config: bool "Support discard option -d" +//config: default y +//config: depends on SWAPON +//config: help +//config: Enable support for discarding swap area blocks at swapon and/or as +//config: the kernel frees them. This option enables both the -d option on +//config: 'swapon' and the 'discard' option for swap entries in /etc/fstab. +//config: +//config:config FEATURE_SWAPON_PRI +//config: bool "Support priority option -p" +//config: default y +//config: depends on SWAPON +//config: help +//config: Enable support for setting swap device priority in swapon. +//config: +//config:config SWAPOFF +//config: bool "swapoff" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: This option enables the 'swapoff' utility. + +//applet:IF_SWAPON(APPLET_ODDNAME(swapon, swap_on_off, BB_DIR_SBIN, BB_SUID_DROP, swapon)) +//applet:IF_SWAPOFF(APPLET_ODDNAME(swapoff, swap_on_off, BB_DIR_SBIN, BB_SUID_DROP, swapoff)) + +//kbuild:lib-$(CONFIG_SWAPON) += swaponoff.o +//kbuild:lib-$(CONFIG_SWAPOFF) += swaponoff.o + //usage:#define swapon_trivial_usage //usage: "[-a] [-e]" IF_FEATURE_SWAPON_DISCARD(" [-d[POL]]") IF_FEATURE_SWAPON_PRI(" [-p PRI]") " [DEVICE]" //usage:#define swapon_full_usage "\n\n" @@ -74,7 +115,15 @@ struct globals { #endif #define INIT_G() do { setup_common_bufsiz(); } while (0) -#define do_swapoff (applet_name[5] == 'f') +#if ENABLE_SWAPOFF +# if ENABLE_SWAPON +# define do_swapoff (applet_name[5] == 'f') +# else +# define do_swapoff 1 +# endif +#else +# define do_swapoff 0 +#endif /* Command line options */ enum { -- cgit v1.2.3-55-g6feb From a8c696bf09d8151323f6e99348c4bc8989f829c8 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 14 Nov 2016 18:31:07 +0100 Subject: Make ifup and ifdown individually selectable. Signed-off-by: Denys Vlasenko --- include/applets.src.h | 2 - networking/Config.src | 105 --------------------------------------- networking/Kbuild.src | 1 - networking/ifupdown.c | 135 +++++++++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 127 insertions(+), 116 deletions(-) (limited to 'include') diff --git a/include/applets.src.h b/include/applets.src.h index f2c754b74..36e1f0266 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -160,10 +160,8 @@ IF_HEXDUMP(APPLET_NOEXEC(hexdump, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hexdump IF_HTTPD(APPLET(httpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_HWCLOCK(APPLET(hwclock, BB_DIR_SBIN, BB_SUID_DROP)) IF_IFCONFIG(APPLET(ifconfig, BB_DIR_SBIN, BB_SUID_DROP)) -IF_IFUPDOWN(APPLET_ODDNAME(ifdown, ifupdown, BB_DIR_SBIN, BB_SUID_DROP, ifdown)) IF_IFENSLAVE(APPLET(ifenslave, BB_DIR_SBIN, BB_SUID_DROP)) IF_IFPLUGD(APPLET(ifplugd, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_IFUPDOWN(APPLET_ODDNAME(ifup, ifupdown, BB_DIR_SBIN, BB_SUID_DROP, ifup)) IF_INETD(APPLET(inetd, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_INOTIFYD(APPLET(inotifyd, BB_DIR_SBIN, BB_SUID_DROP)) IF_INSTALL(APPLET(install, BB_DIR_USR_BIN, BB_SUID_DROP)) diff --git a/networking/Config.src b/networking/Config.src index 398a5ee25..43667fe6a 100644 --- a/networking/Config.src +++ b/networking/Config.src @@ -342,111 +342,6 @@ config IFPLUGD help Network interface plug detection daemon. -config IFUPDOWN - bool "ifupdown" - default y - help - Activate or deactivate the specified interfaces. This applet makes - use of either "ifconfig" and "route" or the "ip" command to actually - configure network interfaces. Therefore, you will probably also want - to enable either IFCONFIG and ROUTE, or enable - FEATURE_IFUPDOWN_IP and the various IP options. Of - course you could use non-busybox versions of these programs, so - against my better judgement (since this will surely result in plenty - of support questions on the mailing list), I do not force you to - enable these additional options. It is up to you to supply either - "ifconfig", "route" and "run-parts" or the "ip" command, either - via busybox or via standalone utilities. - -config IFUPDOWN_IFSTATE_PATH - string "Absolute path to ifstate file" - default "/var/run/ifstate" - depends on IFUPDOWN - help - ifupdown keeps state information in a file called ifstate. - Typically it is located in /var/run/ifstate, however - some distributions tend to put it in other places - (debian, for example, uses /etc/network/run/ifstate). - This config option defines location of ifstate. - -config FEATURE_IFUPDOWN_IP - bool "Use ip applet" - default y - depends on IFUPDOWN - help - Use the iproute "ip" command to implement "ifup" and "ifdown", rather - than the default of using the older 'ifconfig' and 'route' utilities. - -config FEATURE_IFUPDOWN_IP_BUILTIN - bool "Use busybox ip applet" - default y - depends on FEATURE_IFUPDOWN_IP - select PLATFORM_LINUX - select IP - select FEATURE_IP_ADDRESS - select FEATURE_IP_LINK - select FEATURE_IP_ROUTE - help - Use the busybox iproute "ip" applet to implement "ifupdown". - - If left disabled, you must install the full-blown iproute2 - utility or the "ifup" and "ifdown" applets will not work. - -config FEATURE_IFUPDOWN_IFCONFIG_BUILTIN - bool "Use busybox ifconfig and route applets" - default n - depends on IFUPDOWN && !FEATURE_IFUPDOWN_IP - select IFCONFIG - select ROUTE - help - Use the busybox iproute "ifconfig" and "route" applets to - implement the "ifup" and "ifdown" utilities. - - If left disabled, you must install the full-blown ifconfig - and route utilities, or the "ifup" and "ifdown" applets will not - work. - -config FEATURE_IFUPDOWN_IPV4 - bool "Support for IPv4" - default y - depends on IFUPDOWN - help - If you want ifup/ifdown to talk IPv4, leave this on. - -config FEATURE_IFUPDOWN_IPV6 - bool "Support for IPv6" - default y - depends on IFUPDOWN && FEATURE_IPV6 - help - If you need support for IPv6, turn this option on. - -### UNUSED -###config FEATURE_IFUPDOWN_IPX -### bool "Support for IPX" -### default y -### depends on IFUPDOWN -### help -### If this option is selected you can use busybox to work with IPX -### networks. - -config FEATURE_IFUPDOWN_MAPPING - bool "Enable mapping support" - default y - depends on IFUPDOWN - help - This enables support for the "mapping" stanza, unless you have - a weird network setup you don't need it. - -config FEATURE_IFUPDOWN_EXTERNAL_DHCP - bool "Support for external dhcp clients" - default n - depends on IFUPDOWN - help - This enables support for the external dhcp clients. Clients are - tried in the following order: dhcpcd, dhclient, pump and udhcpc. - Otherwise, if udhcpc applet is enabled, it is used. - Otherwise, ifup/ifdown will have no support for DHCP. - config INETD bool "inetd" default y diff --git a/networking/Kbuild.src b/networking/Kbuild.src index e14070647..4ad750283 100644 --- a/networking/Kbuild.src +++ b/networking/Kbuild.src @@ -20,7 +20,6 @@ lib-$(CONFIG_HTTPD) += httpd.o lib-$(CONFIG_IFCONFIG) += ifconfig.o interface.o lib-$(CONFIG_IFENSLAVE) += ifenslave.o interface.o lib-$(CONFIG_IFPLUGD) += ifplugd.o -lib-$(CONFIG_IFUPDOWN) += ifupdown.o lib-$(CONFIG_INETD) += inetd.o lib-$(CONFIG_IP) += ip.o lib-$(CONFIG_IPCALC) += ipcalc.o diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 1d0fc53cf..7ac517afd 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c @@ -1,6 +1,6 @@ /* vi: set sw=4 ts=4: */ /* - * ifupdown for busybox + * ifup/ifdown for busybox * Copyright (c) 2002 Glenn McGrath * Copyright (c) 2003-2004 Erik Andersen * @@ -17,10 +17,127 @@ * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config IFUP +//config: bool "ifup" +//config: default y +//config: help +//config: Activate the specified interfaces. This applet makes use +//config: of either "ifconfig" and "route" or the "ip" command to actually +//config: configure network interfaces. Therefore, you will probably also want +//config: to enable either IFCONFIG and ROUTE, or enable +//config: FEATURE_IFUPDOWN_IP and the various IP options. Of +//config: course you could use non-busybox versions of these programs, so +//config: against my better judgement (since this will surely result in plenty +//config: of support questions on the mailing list), I do not force you to +//config: enable these additional options. It is up to you to supply either +//config: "ifconfig", "route" and "run-parts" or the "ip" command, either +//config: via busybox or via standalone utilities. +//config: +//config:config IFDOWN +//config: bool "ifdown" +//config: default y +//config: help +//config: Deactivate the specified interfaces. +//config: +//config:config IFUPDOWN_IFSTATE_PATH +//config: string "Absolute path to ifstate file" +//config: default "/var/run/ifstate" +//config: depends on IFUP || IFDOWN +//config: help +//config: ifupdown keeps state information in a file called ifstate. +//config: Typically it is located in /var/run/ifstate, however +//config: some distributions tend to put it in other places +//config: (debian, for example, uses /etc/network/run/ifstate). +//config: This config option defines location of ifstate. +//config: +//config:config FEATURE_IFUPDOWN_IP +//config: bool "Use ip applet" +//config: default y +//config: depends on IFUP || IFDOWN +//config: help +//config: Use the iproute "ip" command to implement "ifup" and "ifdown", rather +//config: than the default of using the older 'ifconfig' and 'route' utilities. +//config: +//config:config FEATURE_IFUPDOWN_IP_BUILTIN +//config: bool "Use busybox ip applet" +//config: default y +//config: depends on FEATURE_IFUPDOWN_IP +//config: select PLATFORM_LINUX +//config: select IP +//config: select FEATURE_IP_ADDRESS +//config: select FEATURE_IP_LINK +//config: select FEATURE_IP_ROUTE +//config: help +//config: Use the busybox iproute "ip" applet to implement "ifupdown". +//config: +//config: If left disabled, you must install the full-blown iproute2 +//config: utility or the "ifup" and "ifdown" applets will not work. +//config: +//config:config FEATURE_IFUPDOWN_IFCONFIG_BUILTIN +//config: bool "Use busybox ifconfig and route applets" +//config: default n +//config: depends on (IFUP || IFDOWN) && !FEATURE_IFUPDOWN_IP +//config: select IFCONFIG +//config: select ROUTE +//config: help +//config: Use the busybox iproute "ifconfig" and "route" applets to +//config: implement the "ifup" and "ifdown" utilities. +//config: +//config: If left disabled, you must install the full-blown ifconfig +//config: and route utilities, or the "ifup" and "ifdown" applets will not +//config: work. +//config: +//config:config FEATURE_IFUPDOWN_IPV4 +//config: bool "Support for IPv4" +//config: default y +//config: depends on IFUP || IFDOWN +//config: help +//config: If you want ifup/ifdown to talk IPv4, leave this on. +//config: +//config:config FEATURE_IFUPDOWN_IPV6 +//config: bool "Support for IPv6" +//config: default y +//config: depends on (IFUP || IFDOWN) && FEATURE_IPV6 +//config: help +//config: If you need support for IPv6, turn this option on. +//config: +//UNUSED: +////////:config FEATURE_IFUPDOWN_IPX +////////: bool "Support for IPX" +////////: default y +////////: depends on IFUP || IFDOWN +////////: help +////////: If this option is selected you can use busybox to work with IPX +////////: networks. +//config: +//config:config FEATURE_IFUPDOWN_MAPPING +//config: bool "Enable mapping support" +//config: default y +//config: depends on IFUP || IFDOWN +//config: help +//config: This enables support for the "mapping" stanza, unless you have +//config: a weird network setup you don't need it. +//config: +//config:config FEATURE_IFUPDOWN_EXTERNAL_DHCP +//config: bool "Support for external dhcp clients" +//config: default n +//config: depends on IFUP || IFDOWN +//config: help +//config: This enables support for the external dhcp clients. Clients are +//config: tried in the following order: dhcpcd, dhclient, pump and udhcpc. +//config: Otherwise, if udhcpc applet is enabled, it is used. +//config: Otherwise, ifup/ifdown will have no support for DHCP. + +//applet:IF_IFUP(APPLET_ODDNAME(ifup, ifupdown, BB_DIR_SBIN, BB_SUID_DROP, ifup)) +//applet:IF_IFDOWN(APPLET_ODDNAME(ifdown, ifupdown, BB_DIR_SBIN, BB_SUID_DROP, ifdown)) + +//kbuild:lib-$(CONFIG_IFUP) += ifupdown.o +//kbuild:lib-$(CONFIG_IFDOWN) += ifupdown.o + //usage:#define ifup_trivial_usage //usage: "[-an"IF_FEATURE_IFUPDOWN_MAPPING("m")"vf] [-i FILE] IFACE..." //usage:#define ifup_full_usage "\n\n" -//usage: " -a De/configure all interfaces automatically" +//usage: " -a Configure all interfaces" //usage: "\n -i FILE Use FILE instead of /etc/network/interfaces" //usage: "\n -n Print out what would happen, but don't do it" //usage: IF_FEATURE_IFUPDOWN_MAPPING( @@ -28,12 +145,12 @@ //usage: "\n -m Don't run any mappings" //usage: ) //usage: "\n -v Print out what would happen before doing it" -//usage: "\n -f Force de/configuration" +//usage: "\n -f Force configuration" //usage: //usage:#define ifdown_trivial_usage //usage: "[-an"IF_FEATURE_IFUPDOWN_MAPPING("m")"vf] [-i FILE] IFACE..." //usage:#define ifdown_full_usage "\n\n" -//usage: " -a De/configure all interfaces automatically" +//usage: " -a Deconfigure all interfaces" //usage: "\n -i FILE Use FILE for interface definitions" //usage: "\n -n Print out what would happen, but don't do it" //usage: IF_FEATURE_IFUPDOWN_MAPPING( @@ -41,7 +158,7 @@ //usage: "\n -m Don't run any mappings" //usage: ) //usage: "\n -v Print out what would happen before doing it" -//usage: "\n -f Force de/configuration" +//usage: "\n -f Force deconfiguration" #include "libbb.h" #include "common_bufsiz.h" @@ -1248,7 +1365,6 @@ static FILE *open_new_state_file(void) return xfdopen_for_write(fd); } - int ifupdown_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int ifupdown_main(int argc UNUSED_PARAM, char **argv) { @@ -1263,10 +1379,13 @@ int ifupdown_main(int argc UNUSED_PARAM, char **argv) G.startup_PATH = getenv("PATH"); G.shell = xstrdup(get_shell_name()); - cmds = iface_down; - if (applet_name[2] == 'u') { + if (ENABLE_IFUP + && (!ENABLE_IFDOWN || applet_name[2] == 'u') + ) { /* ifup command */ cmds = iface_up; + } else { + cmds = iface_down; } getopt32(argv, OPTION_STR, &interfaces); -- cgit v1.2.3-55-g6feb From 0581a2f3041184db1af997305908e211d3e4e34f Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 16 Nov 2016 16:12:11 +0100 Subject: Make mke2fs and mkfs.ext2 individually selectable Signed-off-by: Denys Vlasenko --- include/applets.src.h | 3 --- util-linux/Config.src | 7 ------- util-linux/Kbuild.src | 1 - util-linux/mkfs_ext2.c | 20 ++++++++++++++++++++ 4 files changed, 20 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/applets.src.h b/include/applets.src.h index 36e1f0266..0293952ef 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -204,10 +204,7 @@ IF_MATCHPATHCON(APPLET(matchpathcon, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_MICROCOM(APPLET(microcom, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_MKDIR(APPLET_NOFORK(mkdir, mkdir, BB_DIR_BIN, BB_SUID_DROP, mkdir)) IF_MKFS_VFAT(APPLET_ODDNAME(mkdosfs, mkfs_vfat, BB_DIR_SBIN, BB_SUID_DROP, mkfs_vfat)) -IF_MKFS_EXT2(APPLET_ODDNAME(mke2fs, mkfs_ext2, BB_DIR_SBIN, BB_SUID_DROP, mkfs_ext2)) IF_MKFIFO(APPLET_NOEXEC(mkfifo, mkfifo, BB_DIR_USR_BIN, BB_SUID_DROP, mkfifo)) -IF_MKFS_EXT2(APPLET_ODDNAME(mkfs.ext2, mkfs_ext2, BB_DIR_SBIN, BB_SUID_DROP, mkfs_ext2)) -//IF_MKE2FS(APPLET_ODDNAME(mkfs.ext3, mke2fs, BB_DIR_SBIN, BB_SUID_DROP, mkfs_ext3)) IF_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, BB_DIR_SBIN, BB_SUID_DROP, mkfs_minix)) IF_MKFS_REISER(APPLET_ODDNAME(mkfs.reiser, mkfs_reiser, BB_DIR_SBIN, BB_SUID_DROP, mkfs_reiser)) IF_MKFS_VFAT(APPLET_ODDNAME(mkfs.vfat, mkfs_vfat, BB_DIR_SBIN, BB_SUID_DROP, mkfs_vfat)) diff --git a/util-linux/Config.src b/util-linux/Config.src index ee0d8a632..72d3be1f8 100644 --- a/util-linux/Config.src +++ b/util-linux/Config.src @@ -246,13 +246,6 @@ config FSCK_MINIX check for and attempt to repair any corruption that occurs to a minix filesystem. -config MKFS_EXT2 - bool "mkfs_ext2" - default y - select PLATFORM_LINUX - help - Utility to create EXT2 filesystems. - config MKFS_MINIX bool "mkfs_minix" default y diff --git a/util-linux/Kbuild.src b/util-linux/Kbuild.src index 5ee5cf7ff..41cf77809 100644 --- a/util-linux/Kbuild.src +++ b/util-linux/Kbuild.src @@ -26,7 +26,6 @@ lib-$(CONFIG_IPCS) += ipcs.o lib-$(CONFIG_LOSETUP) += losetup.o lib-$(CONFIG_LSPCI) += lspci.o lib-$(CONFIG_LSUSB) += lsusb.o -lib-$(CONFIG_MKFS_EXT2) += mkfs_ext2.o lib-$(CONFIG_MKFS_MINIX) += mkfs_minix.o lib-$(CONFIG_MKFS_REISER) += mkfs_reiser.o lib-$(CONFIG_MKFS_VFAT) += mkfs_vfat.o diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c index 413e7aa15..5816a208e 100644 --- a/util-linux/mkfs_ext2.c +++ b/util-linux/mkfs_ext2.c @@ -7,6 +7,26 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config MKE2FS +//config: bool "mke2fs" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Utility to create EXT2 filesystems. +//config: +//config:config MKFS_EXT2 +//config: bool "mkfs.ext2" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Alias to "mke2fs". + +//applet:IF_MKE2FS(APPLET_ODDNAME(mke2fs, mkfs_ext2, BB_DIR_SBIN, BB_SUID_DROP, mkfs_ext2)) +//applet:IF_MKFS_EXT2(APPLET_ODDNAME(mkfs.ext2, mkfs_ext2, BB_DIR_SBIN, BB_SUID_DROP, mkfs_ext2)) +////////:IF_MKFS_EXT3(APPLET_ODDNAME(mkfs.ext3, mkfs_ext2, BB_DIR_SBIN, BB_SUID_DROP, mkfs_ext2)) + +//kbuild:lib-$(CONFIG_MKE2FS) += mkfs_ext2.o +//kbuild:lib-$(CONFIG_MKFS_EXT2) += mkfs_ext2.o //usage:#define mkfs_ext2_trivial_usage //usage: "[-Fn] " -- cgit v1.2.3-55-g6feb From 10880cc20ff424c5443a8fc6b6afa5c59c5ef602 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 16 Nov 2016 16:18:50 +0100 Subject: Make mkfs.vfat and mkdosfs individually selectable Signed-off-by: Denys Vlasenko --- include/applets.src.h | 2 -- util-linux/Config.src | 7 ------- util-linux/Kbuild.src | 1 - util-linux/mkfs_vfat.c | 19 +++++++++++++++++++ 4 files changed, 19 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/applets.src.h b/include/applets.src.h index 0293952ef..f834d9040 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -203,11 +203,9 @@ IF_MAN(APPLET(man, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_MATCHPATHCON(APPLET(matchpathcon, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_MICROCOM(APPLET(microcom, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_MKDIR(APPLET_NOFORK(mkdir, mkdir, BB_DIR_BIN, BB_SUID_DROP, mkdir)) -IF_MKFS_VFAT(APPLET_ODDNAME(mkdosfs, mkfs_vfat, BB_DIR_SBIN, BB_SUID_DROP, mkfs_vfat)) IF_MKFIFO(APPLET_NOEXEC(mkfifo, mkfifo, BB_DIR_USR_BIN, BB_SUID_DROP, mkfifo)) IF_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, BB_DIR_SBIN, BB_SUID_DROP, mkfs_minix)) IF_MKFS_REISER(APPLET_ODDNAME(mkfs.reiser, mkfs_reiser, BB_DIR_SBIN, BB_SUID_DROP, mkfs_reiser)) -IF_MKFS_VFAT(APPLET_ODDNAME(mkfs.vfat, mkfs_vfat, BB_DIR_SBIN, BB_SUID_DROP, mkfs_vfat)) IF_MKNOD(APPLET_NOEXEC(mknod, mknod, BB_DIR_BIN, BB_SUID_DROP, mknod)) IF_MKSWAP(APPLET(mkswap, BB_DIR_SBIN, BB_SUID_DROP)) IF_MORE(APPLET(more, BB_DIR_BIN, BB_SUID_DROP)) diff --git a/util-linux/Config.src b/util-linux/Config.src index 72d3be1f8..9bef0d532 100644 --- a/util-linux/Config.src +++ b/util-linux/Config.src @@ -272,13 +272,6 @@ config MKFS_REISER Utility to create ReiserFS filesystems. Note: this applet needs a lot of testing and polishing. -config MKFS_VFAT - bool "mkfs_vfat" - default y - select PLATFORM_LINUX - help - Utility to create FAT32 filesystems. - config GETOPT bool "getopt" default y diff --git a/util-linux/Kbuild.src b/util-linux/Kbuild.src index 41cf77809..dfd50afa2 100644 --- a/util-linux/Kbuild.src +++ b/util-linux/Kbuild.src @@ -28,7 +28,6 @@ lib-$(CONFIG_LSPCI) += lspci.o lib-$(CONFIG_LSUSB) += lsusb.o lib-$(CONFIG_MKFS_MINIX) += mkfs_minix.o lib-$(CONFIG_MKFS_REISER) += mkfs_reiser.o -lib-$(CONFIG_MKFS_VFAT) += mkfs_vfat.o lib-$(CONFIG_MKSWAP) += mkswap.o lib-$(CONFIG_MORE) += more.o lib-$(CONFIG_MOUNT) += mount.o diff --git a/util-linux/mkfs_vfat.c b/util-linux/mkfs_vfat.c index d53c751eb..ab70853a1 100644 --- a/util-linux/mkfs_vfat.c +++ b/util-linux/mkfs_vfat.c @@ -7,6 +7,25 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config MKDOSFS +//config: bool "mkdosfs" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Utility to create FAT32 filesystems. +//config: +//config:config MKFS_VFAT +//config: bool "mkfs.vfat" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Alias to "mkdosfs". + +//applet:IF_MKDOSFS(APPLET_ODDNAME(mkdosfs, mkfs_vfat, BB_DIR_SBIN, BB_SUID_DROP, mkfs_vfat)) +//applet:IF_MKFS_VFAT(APPLET_ODDNAME(mkfs.vfat, mkfs_vfat, BB_DIR_SBIN, BB_SUID_DROP, mkfs_vfat)) + +//kbuild:lib-$(CONFIG_MKDOSFS) += mkfs_vfat.o +//kbuild:lib-$(CONFIG_MKFS_VFAT) += mkfs_vfat.o //usage:#define mkfs_vfat_trivial_usage //usage: "[-v] [-n LABEL] BLOCKDEV [KBYTES]" -- cgit v1.2.3-55-g6feb From f4d0f4e7a9715375bfa4bcfb7ce26a967c78ca9e Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 17 Nov 2016 15:34:16 +0100 Subject: applets.h.sh: a script to check applet names against config options Signed-off-by: Denys Vlasenko --- include/applets.h.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 include/applets.h.sh (limited to 'include') diff --git a/include/applets.h.sh b/include/applets.h.sh new file mode 100755 index 000000000..6b8046c4b --- /dev/null +++ b/include/applets.h.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# This script allows to check whether every applet has a separate option +# enabling it. Run it after applets.h is generated. + +# CONFIG_applet names +grep ^IF_ applets.h | grep -v IF_FEATURE_ | sed 's/IF_\([A-Z0-9._-]*\)(.*/\1/' \ +| grep -v MODPROBE_SMALL | sed 's/BB_SYSCTL/SYSCTL/' \ +| sort | uniq \ +>applets_APP1 + +# command line applet names +grep ^IF_ applets.h | sed -e's/ //g' -e's/.*(\([a-z[][^,]*\),.*/\1/' \ +| grep -v '^bash$' | grep -v '^sh$' \ +| tr a-z A-Z \ +| sort | uniq \ +>applets_APP2 + +diff -u applets_APP1 applets_APP2 >applets_APP.diff +rm applets_APP1 applets_APP2 -- cgit v1.2.3-55-g6feb From f88e3bfa8ded4f1c7e7d2143a1cfcbbdfe5e8541 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 22 Nov 2016 23:54:17 +0100 Subject: Convert all miscutils/* applets to "new style" applet definitions Signed-off-by: Denys Vlasenko --- include/applets.src.h | 37 ------------------------------------- miscutils/Kbuild.src | 40 ---------------------------------------- miscutils/adjtimex.c | 4 ++++ miscutils/bbconfig.c | 4 ++++ miscutils/beep.c | 4 ++++ miscutils/chat.c | 4 ++++ miscutils/chrt.c | 4 ++++ miscutils/crontab.c | 5 +++++ miscutils/dc.c | 4 ++++ miscutils/devfsd.c | 4 ++++ miscutils/devmem.c | 4 ++++ miscutils/eject.c | 4 ++++ miscutils/fbsplash.c | 4 ++++ miscutils/flash_eraseall.c | 4 ++++ miscutils/flash_lock_unlock.c | 6 ++++++ miscutils/flashcp.c | 4 ++++ miscutils/hdparm.c | 4 ++++ miscutils/inotifyd.c | 4 ++++ miscutils/ionice.c | 4 ++++ miscutils/last.c | 8 ++++++++ miscutils/less.c | 4 ++++ miscutils/makedevs.c | 4 ++++ miscutils/man.c | 4 ++++ miscutils/microcom.c | 4 ++++ miscutils/mountpoint.c | 4 ++++ miscutils/mt.c | 4 ++++ miscutils/raidautorun.c | 4 ++++ miscutils/readahead.c | 4 ++++ miscutils/runlevel.c | 4 ++++ miscutils/rx.c | 4 ++++ miscutils/setsid.c | 4 ++++ miscutils/strings.c | 4 ++++ miscutils/time.c | 4 ++++ miscutils/timeout.c | 4 ++++ miscutils/ttysize.c | 4 ++++ miscutils/volname.c | 4 ++++ miscutils/watchdog.c | 4 ++++ 37 files changed, 147 insertions(+), 77 deletions(-) (limited to 'include') diff --git a/include/applets.src.h b/include/applets.src.h index f834d9040..5eaa5cbb8 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -76,37 +76,27 @@ INSERT IF_TEST(APPLET_NOFORK([, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) IF_TEST(APPLET_NOFORK([[, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) IF_ACPID(APPLET(acpid, BB_DIR_SBIN, BB_SUID_DROP)) -IF_ADJTIMEX(APPLET(adjtimex, BB_DIR_SBIN, BB_SUID_DROP)) IF_ARP(APPLET(arp, BB_DIR_SBIN, BB_SUID_DROP)) IF_ARPING(APPLET(arping, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_BASENAME(APPLET_NOFORK(basename, basename, BB_DIR_USR_BIN, BB_SUID_DROP, basename)) -IF_BBCONFIG(APPLET(bbconfig, BB_DIR_BIN, BB_SUID_DROP)) -IF_BEEP(APPLET(beep, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_BLKID(APPLET(blkid, BB_DIR_SBIN, BB_SUID_DROP)) IF_BRCTL(APPLET(brctl, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat)) IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP)) -IF_CHAT(APPLET(chat, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_CHCON(APPLET(chcon, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_CHGRP(APPLET_NOEXEC(chgrp, chgrp, BB_DIR_BIN, BB_SUID_DROP, chgrp)) IF_CHMOD(APPLET_NOEXEC(chmod, chmod, BB_DIR_BIN, BB_SUID_DROP, chmod)) IF_CHOWN(APPLET_NOEXEC(chown, chown, BB_DIR_BIN, BB_SUID_DROP, chown)) IF_CHROOT(APPLET(chroot, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_CHRT(APPLET(chrt, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_CHVT(APPLET(chvt, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_CKSUM(APPLET_NOEXEC(cksum, cksum, BB_DIR_USR_BIN, BB_SUID_DROP, cksum)) IF_CLEAR(APPLET(clear, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_COMM(APPLET(comm, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_CP(APPLET_NOEXEC(cp, cp, BB_DIR_BIN, BB_SUID_DROP, cp)) -/* Needs to be run by root or be suid root - needs to change /var/spool/cron* files: */ -IF_CRONTAB(APPLET(crontab, BB_DIR_USR_BIN, BB_SUID_REQUIRE)) IF_CUT(APPLET_NOEXEC(cut, cut, BB_DIR_USR_BIN, BB_SUID_DROP, cut)) -IF_DC(APPLET(dc, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_DD(APPLET_NOEXEC(dd, dd, BB_DIR_BIN, BB_SUID_DROP, dd)) IF_DEALLOCVT(APPLET(deallocvt, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_DEVFSD(APPLET(devfsd, BB_DIR_SBIN, BB_SUID_DROP)) -IF_DEVMEM(APPLET(devmem, BB_DIR_SBIN, BB_SUID_DROP)) IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP)) IF_DHCPRELAY(APPLET(dhcprelay, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_DIRNAME(APPLET_NOFORK(dirname, dirname, BB_DIR_USR_BIN, BB_SUID_DROP, dirname)) @@ -119,7 +109,6 @@ IF_DUMPLEASES(APPLET(dumpleases, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_E2FSCK(APPLET(e2fsck, BB_DIR_SBIN, BB_SUID_DROP)) //IF_E2LABEL(APPLET_ODDNAME(e2label, tune2fs, BB_DIR_SBIN, BB_SUID_DROP, e2label)) IF_ECHO(APPLET_NOFORK(echo, echo, BB_DIR_BIN, BB_SUID_DROP, echo)) -IF_EJECT(APPLET(eject, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_ENV(APPLET_NOEXEC(env, env, BB_DIR_USR_BIN, BB_SUID_DROP, env)) IF_ETHER_WAKE(APPLET_ODDNAME(ether-wake, ether_wake, BB_DIR_USR_SBIN, BB_SUID_DROP, ether_wake)) IF_EXPAND(APPLET(expand, BB_DIR_USR_BIN, BB_SUID_DROP)) @@ -127,17 +116,12 @@ IF_EXPR(APPLET(expr, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_FAKEIDENTD(APPLET(fakeidentd, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_FALSE(APPLET_NOFORK(false, false, BB_DIR_BIN, BB_SUID_DROP, false)) IF_FBSET(APPLET(fbset, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_FBSPLASH(APPLET(fbsplash, BB_DIR_SBIN, BB_SUID_DROP)) IF_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, BB_DIR_BIN, BB_SUID_DROP, fdflush)) IF_FDFORMAT(APPLET(fdformat, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_FDISK(APPLET(fdisk, BB_DIR_SBIN, BB_SUID_DROP)) IF_FGCONSOLE(APPLET(fgconsole, BB_DIR_USR_BIN, BB_SUID_DROP)) /* Benefits from suid root: better access to /dev/BLOCKDEVs: */ IF_FINDFS(APPLET(findfs, BB_DIR_SBIN, BB_SUID_MAYBE)) -IF_FLASH_ERASEALL(APPLET(flash_eraseall, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_FLASH_LOCK(APPLET_ODDNAME(flash_lock, flash_lock_unlock, BB_DIR_USR_SBIN, BB_SUID_DROP, flash_lock)) -IF_FLASH_UNLOCK(APPLET_ODDNAME(flash_unlock, flash_lock_unlock, BB_DIR_USR_SBIN, BB_SUID_DROP, flash_unlock)) -IF_FLASHCP(APPLET(flashcp, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_FLOCK(APPLET(flock, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_FOLD(APPLET_NOEXEC(fold, fold, BB_DIR_USR_BIN, BB_SUID_DROP, fold)) IF_FREE(APPLET(free, BB_DIR_USR_BIN, BB_SUID_DROP)) @@ -154,7 +138,6 @@ IF_GETENFORCE(APPLET(getenforce, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP)) IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_HD(APPLET_NOEXEC(hd, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hd)) -IF_HDPARM(APPLET(hdparm, BB_DIR_SBIN, BB_SUID_DROP)) IF_HEAD(APPLET_NOEXEC(head, head, BB_DIR_USR_BIN, BB_SUID_DROP, head)) IF_HEXDUMP(APPLET_NOEXEC(hexdump, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hexdump)) IF_HTTPD(APPLET(httpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) @@ -163,9 +146,7 @@ IF_IFCONFIG(APPLET(ifconfig, BB_DIR_SBIN, BB_SUID_DROP)) IF_IFENSLAVE(APPLET(ifenslave, BB_DIR_SBIN, BB_SUID_DROP)) IF_IFPLUGD(APPLET(ifplugd, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_INETD(APPLET(inetd, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_INOTIFYD(APPLET(inotifyd, BB_DIR_SBIN, BB_SUID_DROP)) IF_INSTALL(APPLET(install, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_IONICE(APPLET(ionice, BB_DIR_BIN, BB_SUID_DROP)) #if ENABLE_FEATURE_IP_ADDRESS \ || ENABLE_FEATURE_IP_ROUTE \ || ENABLE_FEATURE_IP_LINK \ @@ -185,9 +166,7 @@ IF_KBD_MODE(APPLET(kbd_mode, BB_DIR_BIN, BB_SUID_DROP)) IF_KILL(APPLET(kill, BB_DIR_BIN, BB_SUID_DROP)) IF_KILLALL(APPLET_ODDNAME(killall, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall)) IF_KILLALL5(APPLET_ODDNAME(killall5, kill, BB_DIR_USR_SBIN, BB_SUID_DROP, killall5)) -IF_LAST(APPLET(last, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_LENGTH(APPLET_NOFORK(length, length, BB_DIR_USR_BIN, BB_SUID_DROP, length)) -IF_LESS(APPLET(less, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, BB_SUID_DROP, ln)) IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP)) @@ -197,11 +176,8 @@ IF_LOSETUP(APPLET(losetup, BB_DIR_SBIN, BB_SUID_DROP)) IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls)) IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_LSUSB(APPLET(lsusb, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_MAKEDEVS(APPLET(makedevs, BB_DIR_SBIN, BB_SUID_DROP)) IF_MAKEMIME(APPLET(makemime, BB_DIR_BIN, BB_SUID_DROP)) -IF_MAN(APPLET(man, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_MATCHPATHCON(APPLET(matchpathcon, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_MICROCOM(APPLET(microcom, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_MKDIR(APPLET_NOFORK(mkdir, mkdir, BB_DIR_BIN, BB_SUID_DROP, mkdir)) IF_MKFIFO(APPLET_NOEXEC(mkfifo, mkfifo, BB_DIR_USR_BIN, BB_SUID_DROP, mkfifo)) IF_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, BB_DIR_SBIN, BB_SUID_DROP, mkfs_minix)) @@ -214,8 +190,6 @@ IF_MORE(APPLET(more, BB_DIR_BIN, BB_SUID_DROP)) * for viewing mount table. * Therefore we use BB_SUID_MAYBE instead of BB_SUID_REQUIRE: */ IF_MOUNT(APPLET(mount, BB_DIR_BIN, IF_DESKTOP(BB_SUID_MAYBE) IF_NOT_DESKTOP(BB_SUID_DROP))) -IF_MOUNTPOINT(APPLET(mountpoint, BB_DIR_BIN, BB_SUID_DROP)) -IF_MT(APPLET(mt, BB_DIR_BIN, BB_SUID_DROP)) IF_MV(APPLET(mv, BB_DIR_BIN, BB_SUID_DROP)) IF_NAMEIF(APPLET(nameif, BB_DIR_SBIN, BB_SUID_DROP)) IF_NC(APPLET(nc, BB_DIR_USR_BIN, BB_SUID_DROP)) @@ -237,10 +211,8 @@ IF_PRINTF(APPLET_NOFORK(printf, printf, BB_DIR_USR_BIN, BB_SUID_DROP, printf)) IF_PS(APPLET(ps, BB_DIR_BIN, BB_SUID_DROP)) IF_PSCAN(APPLET(pscan, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_PWD(APPLET_NOFORK(pwd, pwd, BB_DIR_BIN, BB_SUID_DROP, pwd)) -IF_RAIDAUTORUN(APPLET(raidautorun, BB_DIR_SBIN, BB_SUID_DROP)) IF_RDATE(APPLET(rdate, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_RDEV(APPLET(rdev, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_READAHEAD(APPLET(readahead, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_READLINK(APPLET(readlink, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP)) @@ -254,8 +226,6 @@ IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir)) IF_ROUTE(APPLET(route, BB_DIR_SBIN, BB_SUID_DROP)) IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_RUNLEVEL(APPLET(runlevel, BB_DIR_SBIN, BB_SUID_DROP)) -IF_RX(APPLET(rx, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_SCRIPT(APPLET(script, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_SCRIPTREPLAY(APPLET(scriptreplay, BB_DIR_BIN, BB_SUID_DROP)) IF_SELINUXENABLED(APPLET(selinuxenabled, BB_DIR_USR_SBIN, BB_SUID_DROP)) @@ -269,7 +239,6 @@ IF_SETFONT(APPLET(setfont, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_SETKEYCODES(APPLET(setkeycodes, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_SETLOGCONS(APPLET(setlogcons, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_SETSEBOOL(APPLET(setsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_SETSID(APPLET(setsid, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_SHOWKEY(APPLET(showkey, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_SLATTACH(APPLET(slattach, BB_DIR_SBIN, BB_SUID_DROP)) /* Do not make this applet NOFORK. It breaks ^C-ing of pauses in shells: */ @@ -277,7 +246,6 @@ IF_SLEEP(APPLET(sleep, BB_DIR_BIN, BB_SUID_DROP)) IF_SORT(APPLET_NOEXEC(sort, sort, BB_DIR_USR_BIN, BB_SUID_DROP, sort)) IF_SPLIT(APPLET(split, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_STAT(APPLET(stat, BB_DIR_BIN, BB_SUID_DROP)) -IF_STRINGS(APPLET(strings, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_STTY(APPLET(stty, BB_DIR_BIN, BB_SUID_DROP)) IF_SUM(APPLET(sum, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_SWITCH_ROOT(APPLET(switch_root, BB_DIR_SBIN, BB_SUID_DROP)) @@ -294,8 +262,6 @@ IF_TEST(APPLET_NOFORK(test, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) IF_TFTP(APPLET(tftp, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_TFTPD(APPLET(tftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) #endif -IF_TIME(APPLET(time, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_TIMEOUT(APPLET(timeout, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_TOP(APPLET(top, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_TR(APPLET(tr, BB_DIR_USR_BIN, BB_SUID_DROP)) /* Needs socket(AF_INET, SOCK_RAW, IPPROTO_ICMP), therefore BB_SUID_MAYBE: */ @@ -303,7 +269,6 @@ IF_TRACEROUTE(APPLET(traceroute, BB_DIR_USR_BIN, BB_SUID_MAYBE)) IF_TRACEROUTE6(APPLET(traceroute6, BB_DIR_USR_BIN, BB_SUID_MAYBE)) IF_TRUE(APPLET_NOFORK(true, true, BB_DIR_BIN, BB_SUID_DROP, true)) IF_TTY(APPLET(tty, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_TTYSIZE(APPLET(ttysize, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_TUNCTL(APPLET(tunctl, BB_DIR_SBIN, BB_SUID_DROP)) IF_UDHCPC(APPLET(udhcpc, BB_DIR_SBIN, BB_SUID_DROP)) IF_UDHCPD(APPLET(udhcpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) @@ -318,9 +283,7 @@ IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep)) IF_UUDECODE(APPLET(uudecode, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_UUENCODE(APPLET(uuencode, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_VCONFIG(APPLET(vconfig, BB_DIR_SBIN, BB_SUID_DROP)) -IF_VOLNAME(APPLET(volname, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP)) -IF_WATCHDOG(APPLET(watchdog, BB_DIR_SBIN, BB_SUID_DROP)) IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) diff --git a/miscutils/Kbuild.src b/miscutils/Kbuild.src index 503f54904..60848ffc1 100644 --- a/miscutils/Kbuild.src +++ b/miscutils/Kbuild.src @@ -7,45 +7,5 @@ lib-y:= INSERT -lib-$(CONFIG_ADJTIMEX) += adjtimex.o -lib-$(CONFIG_BBCONFIG) += bbconfig.o -lib-$(CONFIG_BEEP) += beep.o -lib-$(CONFIG_CHAT) += chat.o -lib-$(CONFIG_CHRT) += chrt.o -lib-$(CONFIG_CRONTAB) += crontab.o -lib-$(CONFIG_DC) += dc.o -lib-$(CONFIG_DEVFSD) += devfsd.o -lib-$(CONFIG_DEVMEM) += devmem.o -lib-$(CONFIG_EJECT) += eject.o -lib-$(CONFIG_FBSPLASH) += fbsplash.o -lib-$(CONFIG_FLASHCP) += flashcp.o -lib-$(CONFIG_FLASH_ERASEALL) += flash_eraseall.o -lib-$(CONFIG_FLASH_LOCK) += flash_lock_unlock.o -lib-$(CONFIG_FLASH_UNLOCK) += flash_lock_unlock.o -lib-$(CONFIG_IONICE) += ionice.o -lib-$(CONFIG_HDPARM) += hdparm.o -lib-$(CONFIG_INOTIFYD) += inotifyd.o -ifeq ($(CONFIG_FEATURE_LAST_FANCY),y) -lib-$(CONFIG_FEATURE_LAST_FANCY) += last_fancy.o -else -lib-$(CONFIG_LAST) += last.o -endif -lib-$(CONFIG_LESS) += less.o -lib-$(CONFIG_MAKEDEVS) += makedevs.o -lib-$(CONFIG_MAN) += man.o -lib-$(CONFIG_MICROCOM) += microcom.o -lib-$(CONFIG_MOUNTPOINT) += mountpoint.o -lib-$(CONFIG_MT) += mt.o -lib-$(CONFIG_RAIDAUTORUN) += raidautorun.o -lib-$(CONFIG_READAHEAD) += readahead.o -lib-$(CONFIG_RUNLEVEL) += runlevel.o -lib-$(CONFIG_RX) += rx.o -lib-$(CONFIG_SETSID) += setsid.o -lib-$(CONFIG_STRINGS) += strings.o -lib-$(CONFIG_TIME) += time.o -lib-$(CONFIG_TIMEOUT) += timeout.o -lib-$(CONFIG_TTYSIZE) += ttysize.o -lib-$(CONFIG_VOLNAME) += volname.o -lib-$(CONFIG_WATCHDOG) += watchdog.o diff --git a/miscutils/adjtimex.c b/miscutils/adjtimex.c index f9d7c949d..6355cc1ef 100644 --- a/miscutils/adjtimex.c +++ b/miscutils/adjtimex.c @@ -18,6 +18,10 @@ //config: Adjtimex reads and optionally sets adjustment parameters for //config: the Linux clock adjustment algorithm. +//applet:IF_ADJTIMEX(APPLET(adjtimex, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_ADJTIMEX) += adjtimex.o + //usage:#define adjtimex_trivial_usage //usage: "[-q] [-o OFF] [-f FREQ] [-p TCONST] [-t TICK]" //usage:#define adjtimex_full_usage "\n\n" diff --git a/miscutils/bbconfig.c b/miscutils/bbconfig.c index 8a709f9d3..4781a4276 100644 --- a/miscutils/bbconfig.c +++ b/miscutils/bbconfig.c @@ -22,6 +22,10 @@ //config: and have very little memory, this might not be a win. Otherwise, //config: you probably want this. +//applet:IF_BBCONFIG(APPLET(bbconfig, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_BBCONFIG) += bbconfig.o + //usage:#define bbconfig_trivial_usage //usage: "" //usage:#define bbconfig_full_usage "\n\n" diff --git a/miscutils/beep.c b/miscutils/beep.c index f6fa8348d..14802b543 100644 --- a/miscutils/beep.c +++ b/miscutils/beep.c @@ -30,6 +30,10 @@ //config: help //config: Length in ms for default beep. +//applet:IF_BEEP(APPLET(beep, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_BEEP) += beep.o + //usage:#define beep_trivial_usage //usage: "-f FREQ -l LEN -d DELAY -r COUNT -n" //usage:#define beep_full_usage "\n\n" diff --git a/miscutils/chat.c b/miscutils/chat.c index 92a23441c..dc85f82fb 100644 --- a/miscutils/chat.c +++ b/miscutils/chat.c @@ -74,6 +74,10 @@ //config: help //config: Support CLR_ABORT directive. +//applet:IF_CHAT(APPLET(chat, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_CHAT) += chat.o + //usage:#define chat_trivial_usage //usage: "EXPECT [SEND [EXPECT [SEND...]]]" //usage:#define chat_full_usage "\n\n" diff --git a/miscutils/chrt.c b/miscutils/chrt.c index d76c0d152..1604a6890 100644 --- a/miscutils/chrt.c +++ b/miscutils/chrt.c @@ -12,6 +12,10 @@ //config: manipulate real-time attributes of a process. //config: This requires sched_{g,s}etparam support in your libc. +//applet:IF_CHRT(APPLET(chrt, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_CHRT) += chrt.o + //usage:#define chrt_trivial_usage //usage: "[-prfom] [PRIO] [PID | PROG ARGS]" //usage:#define chrt_full_usage "\n\n" diff --git a/miscutils/crontab.c b/miscutils/crontab.c index bcd2eab33..bcd424578 100644 --- a/miscutils/crontab.c +++ b/miscutils/crontab.c @@ -18,6 +18,11 @@ //config: Note that Busybox binary must be setuid root for this applet to //config: work properly. +/* Needs to be run by root or be suid root - needs to change /var/spool/cron* files: */ +//applet:IF_CRONTAB(APPLET(crontab, BB_DIR_USR_BIN, BB_SUID_REQUIRE)) + +//kbuild:lib-$(CONFIG_CRONTAB) += crontab.o + //usage:#define crontab_trivial_usage //usage: "[-c DIR] [-u USER] [-ler]|[FILE]" //usage:#define crontab_full_usage "\n\n" diff --git a/miscutils/dc.c b/miscutils/dc.c index 2b77cd614..7986fef5f 100644 --- a/miscutils/dc.c +++ b/miscutils/dc.c @@ -17,6 +17,10 @@ //config: Enable power and exp functions. //config: NOTE: This will require libm to be present for linking. +//applet:IF_DC(APPLET(dc, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_DC) += dc.o + //usage:#define dc_trivial_usage //usage: "EXPRESSION..." //usage: diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c index 361f3666f..99bdc72b8 100644 --- a/miscutils/devfsd.c +++ b/miscutils/devfsd.c @@ -110,6 +110,10 @@ //config: /dev/loop0. If your /dev directory has normal names instead of //config: devfs names, you don't want this. +//applet:IF_DEVFSD(APPLET(devfsd, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_DEVFSD) += devfsd.o + //usage:#define devfsd_trivial_usage //usage: "mntpnt [-v]" IF_DEVFSD_FG_NP("[-fg][-np]") //usage:#define devfsd_full_usage "\n\n" diff --git a/miscutils/devmem.c b/miscutils/devmem.c index dd6574e93..aeb32b13a 100644 --- a/miscutils/devmem.c +++ b/miscutils/devmem.c @@ -10,6 +10,10 @@ //config: devmem is a small program that reads and writes from physical //config: memory using /dev/mem. +//applet:IF_DEVMEM(APPLET(devmem, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_DEVMEM) += devmem.o + //usage:#define devmem_trivial_usage //usage: "ADDRESS [WIDTH [VALUE]]" //usage:#define devmem_full_usage "\n\n" diff --git a/miscutils/eject.c b/miscutils/eject.c index d271066ad..667932f6c 100644 --- a/miscutils/eject.c +++ b/miscutils/eject.c @@ -27,6 +27,10 @@ //config: Add the -s option to eject, this allows to eject SCSI-Devices and //config: usb-storage devices. +//applet:IF_EJECT(APPLET(eject, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_EJECT) += eject.o + //usage:#define eject_trivial_usage //usage: "[-t] [-T] [DEVICE]" //usage:#define eject_full_usage "\n\n" diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c index 93fd9412b..fc6c9b953 100644 --- a/miscutils/fbsplash.c +++ b/miscutils/fbsplash.c @@ -42,6 +42,10 @@ //config: "NN" (ASCII decimal number) - percentage to show on progress bar //config: "exit" - well you guessed it +//applet:IF_FBSPLASH(APPLET(fbsplash, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FBSPLASH) += fbsplash.o + //usage:#define fbsplash_trivial_usage //usage: "-s IMGFILE [-c] [-d DEV] [-i INIFILE] [-f CMD]" //usage:#define fbsplash_full_usage "\n\n" diff --git a/miscutils/flash_eraseall.c b/miscutils/flash_eraseall.c index 08ec44e0c..2a9bd6cfe 100644 --- a/miscutils/flash_eraseall.c +++ b/miscutils/flash_eraseall.c @@ -16,6 +16,10 @@ //config: The flash_eraseall binary from mtd-utils as of git head c4c6a59eb. //config: This utility is used to erase the whole MTD device. +//applet:IF_FLASH_ERASEALL(APPLET(flash_eraseall, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FLASH_ERASEALL) += flash_eraseall.o + //usage:#define flash_eraseall_trivial_usage //usage: "[-jNq] MTD_DEVICE" //usage:#define flash_eraseall_full_usage "\n\n" diff --git a/miscutils/flash_lock_unlock.c b/miscutils/flash_lock_unlock.c index 287abaafd..2f698641f 100644 --- a/miscutils/flash_lock_unlock.c +++ b/miscutils/flash_lock_unlock.c @@ -17,6 +17,12 @@ //config: The flash_unlock binary from mtd-utils as of git head 5ec0c10d0. This //config: utility unlocks part or all of the flash device. +//applet:IF_FLASH_LOCK(APPLET_ODDNAME(flash_lock, flash_lock_unlock, BB_DIR_USR_SBIN, BB_SUID_DROP, flash_lock)) +//applet:IF_FLASH_UNLOCK(APPLET_ODDNAME(flash_unlock, flash_lock_unlock, BB_DIR_USR_SBIN, BB_SUID_DROP, flash_unlock)) + +//kbuild:lib-$(CONFIG_FLASH_LOCK) += flash_lock_unlock.o +//kbuild:lib-$(CONFIG_FLASH_UNLOCK) += flash_lock_unlock.o + //usage:#define flash_lock_trivial_usage //usage: "MTD_DEVICE OFFSET SECTORS" //usage:#define flash_lock_full_usage "\n\n" diff --git a/miscutils/flashcp.c b/miscutils/flashcp.c index 6cbf455ff..4bbc67727 100644 --- a/miscutils/flashcp.c +++ b/miscutils/flashcp.c @@ -13,6 +13,10 @@ //config: The flashcp binary, inspired by mtd-utils as of git head 5eceb74f7. //config: This utility is used to copy images into a MTD device. +//applet:IF_FLASHCP(APPLET(flashcp, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FLASHCP) += flashcp.o + //usage:#define flashcp_trivial_usage //usage: "-v FILE MTD_DEVICE" //usage:#define flashcp_full_usage "\n\n" diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c index 06311ccf7..e43a0dec2 100644 --- a/miscutils/hdparm.c +++ b/miscutils/hdparm.c @@ -70,6 +70,10 @@ //config: help //config: Enables the 'hdparm -d' option to get/set using_dma flag. +//applet:IF_HDPARM(APPLET(hdparm, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_HDPARM) += hdparm.o + //usage:#define hdparm_trivial_usage //usage: "[OPTIONS] [DEVICE]" //usage:#define hdparm_full_usage "\n\n" diff --git a/miscutils/inotifyd.c b/miscutils/inotifyd.c index ffac8b958..601df6465 100644 --- a/miscutils/inotifyd.c +++ b/miscutils/inotifyd.c @@ -33,6 +33,10 @@ //config: Simple inotify daemon. Reports filesystem changes. Requires //config: kernel >= 2.6.13 +//applet:IF_INOTIFYD(APPLET(inotifyd, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_INOTIFYD) += inotifyd.o + //usage:#define inotifyd_trivial_usage //usage: "PROG FILE1[:MASK]..." //usage:#define inotifyd_full_usage "\n\n" diff --git a/miscutils/ionice.c b/miscutils/ionice.c index 1e1a5861c..c54b3a6e1 100644 --- a/miscutils/ionice.c +++ b/miscutils/ionice.c @@ -14,6 +14,10 @@ //config: Set/set program io scheduling class and priority //config: Requires kernel >= 2.6.13 +//applet:IF_IONICE(APPLET(ionice, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_IONICE) += ionice.o + //usage:#define ionice_trivial_usage //usage: "[-c 1-3] [-n 0-7] [-p PID] [PROG]" //usage:#define ionice_full_usage "\n\n" diff --git a/miscutils/last.c b/miscutils/last.c index 2b7060c53..67c1343f1 100644 --- a/miscutils/last.c +++ b/miscutils/last.c @@ -21,6 +21,14 @@ //config: 'last' displays detailed information about the last users that //config: logged into the system (mimics sysvinit last). +900 bytes. +//applet:IF_LAST(APPLET(last, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:ifeq ($(CONFIG_FEATURE_LAST_FANCY),y) +//kbuild:lib-$(CONFIG_FEATURE_LAST_FANCY) += last_fancy.o +//kbuild:else +//kbuild:lib-$(CONFIG_LAST) += last.o +//kbuild:endif + //usage:#define last_trivial_usage //usage: ""IF_FEATURE_LAST_FANCY("[-HW] [-f FILE]") //usage:#define last_full_usage "\n\n" diff --git a/miscutils/less.c b/miscutils/less.c index 61acfdcb5..e90691b49 100644 --- a/miscutils/less.c +++ b/miscutils/less.c @@ -105,6 +105,10 @@ //config: help //config: Enables "-N" command. +//applet:IF_LESS(APPLET(less, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_LESS) += less.o + //usage:#define less_trivial_usage //usage: "[-E" IF_FEATURE_LESS_REGEXP("I")IF_FEATURE_LESS_FLAGS("Mm") //usage: "N" IF_FEATURE_LESS_TRUNCATE("S") "h~] [FILE]..." diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c index cbdb0e3a1..6278ee77c 100644 --- a/miscutils/makedevs.c +++ b/miscutils/makedevs.c @@ -38,6 +38,10 @@ //config: //config:endchoice +//applet:IF_MAKEDEVS(APPLET(makedevs, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_MAKEDEVS) += makedevs.o + //usage:#if ENABLE_FEATURE_MAKEDEVS_LEAF //usage:#define makedevs_trivial_usage //usage: "NAME TYPE MAJOR MINOR FIRST LAST [s]" diff --git a/miscutils/man.c b/miscutils/man.c index cded6ebee..6a636f1ec 100644 --- a/miscutils/man.c +++ b/miscutils/man.c @@ -8,6 +8,10 @@ //config: help //config: Format and display manual pages. +//applet:IF_MAN(APPLET(man, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_MAN) += man.o + //usage:#define man_trivial_usage //usage: "[-aw] [MANPAGE]..." //usage:#define man_full_usage "\n\n" diff --git a/miscutils/microcom.c b/miscutils/microcom.c index c6ba476db..04605d883 100644 --- a/miscutils/microcom.c +++ b/miscutils/microcom.c @@ -13,6 +13,10 @@ //config: help //config: The poor man's minicom utility for chatting with serial port devices. +//applet:IF_MICROCOM(APPLET(microcom, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_MICROCOM) += microcom.o + //usage:#define microcom_trivial_usage //usage: "[-d DELAY] [-t TIMEOUT] [-s SPEED] [-X] TTY" //usage:#define microcom_full_usage "\n\n" diff --git a/miscutils/mountpoint.c b/miscutils/mountpoint.c index 12af2ca9a..8b9e1d779 100644 --- a/miscutils/mountpoint.c +++ b/miscutils/mountpoint.c @@ -14,6 +14,10 @@ //config: help //config: mountpoint checks if the directory is a mountpoint. +//applet:IF_MOUNTPOINT(APPLET(mountpoint, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_MOUNTPOINT) += mountpoint.o + //usage:#define mountpoint_trivial_usage //usage: "[-q] <[-dn] DIR | -x DEVICE>" //usage:#define mountpoint_full_usage "\n\n" diff --git a/miscutils/mt.c b/miscutils/mt.c index 75a09b662..6b3169675 100644 --- a/miscutils/mt.c +++ b/miscutils/mt.c @@ -10,6 +10,10 @@ //config: to advance or rewind a tape past a specified number of archive //config: files on the tape. +//applet:IF_MT(APPLET(mt, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_MT) += mt.o + //usage:#define mt_trivial_usage //usage: "[-f device] opcode value" //usage:#define mt_full_usage "\n\n" diff --git a/miscutils/raidautorun.c b/miscutils/raidautorun.c index 578b2cf52..c6d8e6235 100644 --- a/miscutils/raidautorun.c +++ b/miscutils/raidautorun.c @@ -15,6 +15,10 @@ //config: raidautorun tells the kernel md driver to //config: search and start RAID arrays. +//applet:IF_RAIDAUTORUN(APPLET(raidautorun, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_RAIDAUTORUN) += raidautorun.o + //usage:#define raidautorun_trivial_usage //usage: "DEVICE" //usage:#define raidautorun_full_usage "\n\n" diff --git a/miscutils/readahead.c b/miscutils/readahead.c index 0b502f88c..b8e9b257f 100644 --- a/miscutils/readahead.c +++ b/miscutils/readahead.c @@ -27,6 +27,10 @@ //config: As readahead(2) blocks until each file has been read, it is best to //config: run this applet as a background job. +//applet:IF_READAHEAD(APPLET(readahead, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_READAHEAD) += readahead.o + //usage:#define readahead_trivial_usage //usage: "[FILE]..." //usage:#define readahead_full_usage "\n\n" diff --git a/miscutils/runlevel.c b/miscutils/runlevel.c index 7c07a72e2..b6412a6ea 100644 --- a/miscutils/runlevel.c +++ b/miscutils/runlevel.c @@ -21,6 +21,10 @@ //config: This applet uses utmp but does not rely on busybox supporing //config: utmp on purpose. It is used by e.g. emdebian via /etc/init.d/rc. +//applet:IF_RUNLEVEL(APPLET(runlevel, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_RUNLEVEL) += runlevel.o + //usage:#define runlevel_trivial_usage //usage: "[FILE]" //usage:#define runlevel_full_usage "\n\n" diff --git a/miscutils/rx.c b/miscutils/rx.c index 359ad5046..7fca8e36b 100644 --- a/miscutils/rx.c +++ b/miscutils/rx.c @@ -21,6 +21,10 @@ //config: help //config: Receive files using the Xmodem protocol. +//applet:IF_RX(APPLET(rx, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_RX) += rx.o + //usage:#define rx_trivial_usage //usage: "FILE" //usage:#define rx_full_usage "\n\n" diff --git a/miscutils/setsid.c b/miscutils/setsid.c index f0ec04a0b..143a8f8fa 100644 --- a/miscutils/setsid.c +++ b/miscutils/setsid.c @@ -19,6 +19,10 @@ //config: help //config: setsid runs a program in a new session +//applet:IF_SETSID(APPLET(setsid, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SETSID) += setsid.o + //usage:#define setsid_trivial_usage //usage: "[-c] PROG ARGS" //usage:#define setsid_full_usage "\n\n" diff --git a/miscutils/strings.c b/miscutils/strings.c index d0e637987..4d9bfe690 100644 --- a/miscutils/strings.c +++ b/miscutils/strings.c @@ -13,6 +13,10 @@ //config: strings prints the printable character sequences for each file //config: specified. +//applet:IF_STRINGS(APPLET(strings, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_STRINGS) += strings.o + //usage:#define strings_trivial_usage //usage: "[-fo] [-t o/d/x] [-n LEN] [FILE]..." //usage:#define strings_full_usage "\n\n" diff --git a/miscutils/time.c b/miscutils/time.c index 90d2ab67c..a73a837d8 100644 --- a/miscutils/time.c +++ b/miscutils/time.c @@ -16,6 +16,10 @@ //config: When the command finishes, time writes a message to standard output //config: giving timing statistics about this program run. +//applet:IF_TIME(APPLET(time, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_TIME) += time.o + //usage:#define time_trivial_usage //usage: "[-v] PROG ARGS" //usage:#define time_full_usage "\n\n" diff --git a/miscutils/timeout.c b/miscutils/timeout.c index 4d598ead2..f29dc8a9c 100644 --- a/miscutils/timeout.c +++ b/miscutils/timeout.c @@ -34,6 +34,10 @@ //config: Runs a program and watches it. If it does not terminate in //config: specified number of seconds, it is sent a signal. +//applet:IF_TIMEOUT(APPLET(timeout, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_TIMEOUT) += timeout.o + //usage:#define timeout_trivial_usage //usage: "[-t SECS] [-s SIG] PROG ARGS" //usage:#define timeout_full_usage "\n\n" diff --git a/miscutils/ttysize.c b/miscutils/ttysize.c index a63b731d2..135ce8535 100644 --- a/miscutils/ttysize.c +++ b/miscutils/ttysize.c @@ -18,6 +18,10 @@ //config: error, but returns default 80x24. //config: Usage in shell scripts: width=`ttysize w`. +//applet:IF_TTYSIZE(APPLET(ttysize, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_TTYSIZE) += ttysize.o + //usage:#define ttysize_trivial_usage //usage: "[w] [h]" //usage:#define ttysize_full_usage "\n\n" diff --git a/miscutils/volname.c b/miscutils/volname.c index 855f2206a..6d1addbb5 100644 --- a/miscutils/volname.c +++ b/miscutils/volname.c @@ -33,6 +33,10 @@ //config: help //config: Prints a CD-ROM volume name. +//applet:IF_VOLNAME(APPLET(volname, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_VOLNAME) += volname.o + //usage:#define volname_trivial_usage //usage: "[DEVICE]" //usage:#define volname_full_usage "\n\n" diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c index 7a743ef1b..07ae64e52 100644 --- a/miscutils/watchdog.c +++ b/miscutils/watchdog.c @@ -20,6 +20,10 @@ //config: certain amount of time, the watchdog device assumes the system has //config: hung, and will cause the hardware to reboot. +//applet:IF_WATCHDOG(APPLET(watchdog, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_WATCHDOG) += watchdog.o + //usage:#define watchdog_trivial_usage //usage: "[-t N[ms]] [-T N[ms]] [-F] DEV" //usage:#define watchdog_full_usage "\n\n" -- cgit v1.2.3-55-g6feb From f8f81ed7aaf90897fa9a4687dac75152740a71e2 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Nov 2016 06:23:44 +0100 Subject: Convert all procps/* applets to "new style" applet definitions Signed-off-by: Denys Vlasenko --- include/applets.src.h | 14 ----- procps/Config.src | 140 -------------------------------------------------- procps/Kbuild.src | 15 +----- procps/free.c | 12 ++++- procps/fuser.c | 11 ++++ procps/kill.c | 30 +++++++++++ procps/pgrep.c | 17 ++++++ procps/pidof.c | 26 ++++++++++ procps/ps.c | 49 ++++++++++++++++++ procps/renice.c | 10 ++++ procps/sysctl.c | 9 ++++ procps/top.c | 5 +- procps/uptime.c | 7 +-- procps/watch.c | 11 ++++ 14 files changed, 184 insertions(+), 172 deletions(-) (limited to 'include') diff --git a/include/applets.src.h b/include/applets.src.h index 5eaa5cbb8..1d2d9c8ed 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -124,7 +124,6 @@ IF_FGCONSOLE(APPLET(fgconsole, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_FINDFS(APPLET(findfs, BB_DIR_SBIN, BB_SUID_MAYBE)) IF_FLOCK(APPLET(flock, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_FOLD(APPLET_NOEXEC(fold, fold, BB_DIR_USR_BIN, BB_SUID_DROP, fold)) -IF_FREE(APPLET(free, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_FREERAMDISK(APPLET(freeramdisk, BB_DIR_SBIN, BB_SUID_DROP)) //IF_E2FSCK(APPLET_ODDNAME(fsck.ext2, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext2)) //IF_E2FSCK(APPLET_ODDNAME(fsck.ext3, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext3)) @@ -133,7 +132,6 @@ IF_FSYNC(APPLET_NOFORK(fsync, fsync, BB_DIR_BIN, BB_SUID_DROP, fsync)) IF_FTPD(APPLET(ftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_FTPGET(APPLET_ODDNAME(ftpget, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpget)) IF_FTPPUT(APPLET_ODDNAME(ftpput, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpput)) -IF_FUSER(APPLET(fuser, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_GETENFORCE(APPLET(getenforce, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP)) IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) @@ -163,9 +161,6 @@ IF_IPROUTE(APPLET(iproute, BB_DIR_SBIN, BB_SUID_DROP)) IF_IPRULE(APPLET(iprule, BB_DIR_SBIN, BB_SUID_DROP)) IF_IPTUNNEL(APPLET(iptunnel, BB_DIR_SBIN, BB_SUID_DROP)) IF_KBD_MODE(APPLET(kbd_mode, BB_DIR_BIN, BB_SUID_DROP)) -IF_KILL(APPLET(kill, BB_DIR_BIN, BB_SUID_DROP)) -IF_KILLALL(APPLET_ODDNAME(killall, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall)) -IF_KILLALL5(APPLET_ODDNAME(killall5, kill, BB_DIR_USR_SBIN, BB_SUID_DROP, killall5)) //IF_LENGTH(APPLET_NOFORK(length, length, BB_DIR_USR_BIN, BB_SUID_DROP, length)) IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, BB_SUID_DROP, ln)) IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP)) @@ -201,14 +196,10 @@ IF_NTPD(APPLET(ntpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_OD(APPLET(od, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_OPENVT(APPLET(openvt, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_PARSE(APPLET(parse, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_PGREP(APPLET(pgrep, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_PIDOF(APPLET(pidof, BB_DIR_BIN, BB_SUID_DROP)) IF_PIVOT_ROOT(APPLET(pivot_root, BB_DIR_SBIN, BB_SUID_DROP)) -IF_PKILL(APPLET_ODDNAME(pkill, pgrep, BB_DIR_USR_BIN, BB_SUID_DROP, pkill)) IF_POPMAILDIR(APPLET(popmaildir, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_PRINTENV(APPLET_NOFORK(printenv, printenv, BB_DIR_BIN, BB_SUID_DROP, printenv)) IF_PRINTF(APPLET_NOFORK(printf, printf, BB_DIR_USR_BIN, BB_SUID_DROP, printf)) -IF_PS(APPLET(ps, BB_DIR_BIN, BB_SUID_DROP)) IF_PSCAN(APPLET(pscan, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_PWD(APPLET_NOFORK(pwd, pwd, BB_DIR_BIN, BB_SUID_DROP, pwd)) IF_RDATE(APPLET(rdate, BB_DIR_USR_SBIN, BB_SUID_DROP)) @@ -217,7 +208,6 @@ IF_READLINK(APPLET(readlink, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_REFORMIME(APPLET(reformime, BB_DIR_BIN, BB_SUID_DROP)) -IF_RENICE(APPLET(renice, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_RESET(APPLET(reset, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_RESIZE(APPLET(resize, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon)) @@ -249,7 +239,6 @@ IF_STAT(APPLET(stat, BB_DIR_BIN, BB_SUID_DROP)) IF_STTY(APPLET(stty, BB_DIR_BIN, BB_SUID_DROP)) IF_SUM(APPLET(sum, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_SWITCH_ROOT(APPLET(switch_root, BB_DIR_SBIN, BB_SUID_DROP)) -IF_BB_SYSCTL(APPLET(sysctl, BB_DIR_SBIN, BB_SUID_DROP)) IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac)) IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP)) /* IF_TC(APPLET(tc, BB_DIR_SBIN, BB_SUID_DROP)) */ @@ -262,7 +251,6 @@ IF_TEST(APPLET_NOFORK(test, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) IF_TFTP(APPLET(tftp, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_TFTPD(APPLET(tftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) #endif -IF_TOP(APPLET(top, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_TR(APPLET(tr, BB_DIR_USR_BIN, BB_SUID_DROP)) /* Needs socket(AF_INET, SOCK_RAW, IPPROTO_ICMP), therefore BB_SUID_MAYBE: */ IF_TRACEROUTE(APPLET(traceroute, BB_DIR_USR_BIN, BB_SUID_MAYBE)) @@ -278,12 +266,10 @@ IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP)) IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand)) IF_UNIQ(APPLET(uniq, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_UNIX2DOS(APPLET_NOEXEC(unix2dos, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, unix2dos)) -IF_UPTIME(APPLET(uptime, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep)) IF_UUDECODE(APPLET(uudecode, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_UUENCODE(APPLET(uuencode, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_VCONFIG(APPLET(vconfig, BB_DIR_SBIN, BB_SUID_DROP)) -IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP)) IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) diff --git a/procps/Config.src b/procps/Config.src index 527d9ee0c..eb4760752 100644 --- a/procps/Config.src +++ b/procps/Config.src @@ -7,139 +7,6 @@ menu "Process Utilities" INSERT -config FREE - bool "free" - default y - select PLATFORM_LINUX #sysinfo() - help - free displays the total amount of free and used physical and swap - memory in the system, as well as the buffers used by the kernel. - The shared memory column should be ignored; it is obsolete. - -config FUSER - bool "fuser" - default y - help - fuser lists all PIDs (Process IDs) that currently have a given - file open. fuser can also list all PIDs that have a given network - (TCP or UDP) port open. - -config KILL - bool "kill" - default y - help - The command kill sends the specified signal to the specified - process or process group. If no signal is specified, the TERM - signal is sent. - -config KILLALL - bool "killall" - default y - depends on KILL - help - killall sends a signal to all processes running any of the - specified commands. If no signal name is specified, SIGTERM is - sent. - -config KILLALL5 - bool "killall5" - default y - depends on KILL - -config PGREP - bool "pgrep" - default y - help - Look for processes by name. - -config PIDOF - bool "pidof" - default y - help - Pidof finds the process id's (pids) of the named programs. It prints - those id's on the standard output. - -config FEATURE_PIDOF_SINGLE - bool "Enable argument for single shot (-s)" - default y - depends on PIDOF - help - Support argument '-s' for returning only the first pid found. - -config FEATURE_PIDOF_OMIT - bool "Enable argument for omitting pids (-o)" - default y - depends on PIDOF - help - Support argument '-o' for omitting the given pids in output. - The special pid %PPID can be used to name the parent process - of the pidof, in other words the calling shell or shell script. - -config PKILL - bool "pkill" - default y - help - Send signals to processes by name. - -config PS - bool "ps" - default y - help - ps gives a snapshot of the current processes. - -config FEATURE_PS_WIDE - bool "Enable wide output option (-w)" - default y - depends on PS && !DESKTOP - help - Support argument 'w' for wide output. - If given once, 132 chars are printed, and if given more - than once, the length is unlimited. - -config FEATURE_PS_LONG - bool "Enable long output option (-l)" - default y - depends on PS && !DESKTOP - help - Support argument 'l' for long output. - Adds fields PPID, RSS, START, TIME & TTY - -config FEATURE_PS_TIME - bool "Enable time and elapsed time output" - default y - depends on PS && DESKTOP - select PLATFORM_LINUX - help - Support -o time and -o etime output specifiers. - -config FEATURE_PS_ADDITIONAL_COLUMNS - bool "Enable additional ps columns" - default y - depends on PS && DESKTOP - help - Support -o rgroup, -o ruser, -o nice output specifiers. - -config FEATURE_PS_UNUSUAL_SYSTEMS - bool "Support Linux prior to 2.4.0 and non-ELF systems" - default n - depends on FEATURE_PS_TIME - help - Include support for measuring HZ on old kernels and non-ELF systems - (if you are on Linux 2.4.0+ and use ELF, you don't need this) - -config RENICE - bool "renice" - default y - help - Renice alters the scheduling priority of one or more running - processes. - -config BB_SYSCTL - bool "sysctl" - default y - help - Configure kernel parameters at runtime. - config FEATURE_SHOW_THREADS bool "Support for showing threads in ps/pstree/top" default y @@ -148,11 +15,4 @@ config FEATURE_SHOW_THREADS Enables the ps -T option, showing of threads in pstree, and 'h' command in top. -config WATCH - bool "watch" - default y - help - watch is used to execute a program periodically, showing - output to the screen. - endmenu diff --git a/procps/Kbuild.src b/procps/Kbuild.src index 89b1cc094..83af05a05 100644 --- a/procps/Kbuild.src +++ b/procps/Kbuild.src @@ -7,16 +7,5 @@ lib-y:= INSERT -lib-$(CONFIG_FREE) += free.o -lib-$(CONFIG_FUSER) += fuser.o -lib-$(CONFIG_KILL) += kill.o -lib-$(CONFIG_ASH) += kill.o # used for built-in kill by ash -lib-$(CONFIG_PGREP) += pgrep.o -lib-$(CONFIG_PKILL) += pgrep.o -lib-$(CONFIG_PIDOF) += pidof.o -lib-$(CONFIG_PS) += ps.o -lib-$(CONFIG_RENICE) += renice.o -lib-$(CONFIG_BB_SYSCTL) += sysctl.o -lib-$(CONFIG_TOP) += top.o -lib-$(CONFIG_UPTIME) += uptime.o -lib-$(CONFIG_WATCH) += watch.o + +lib-$(CONFIG_ASH) += kill.o # used for built-in kill by ash diff --git a/procps/free.c b/procps/free.c index fca9a2242..f3a2c3c0c 100644 --- a/procps/free.c +++ b/procps/free.c @@ -6,8 +6,18 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config FREE +//config: bool "free" +//config: default y +//config: select PLATFORM_LINUX #sysinfo() +//config: help +//config: free displays the total amount of free and used physical and swap +//config: memory in the system, as well as the buffers used by the kernel. +//config: The shared memory column should be ignored; it is obsolete. -/* getopt not needed */ +//applet:IF_FREE(APPLET(free, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FREE) += free.o //usage:#define free_trivial_usage //usage: "" IF_DESKTOP("[-b/k/m/g]") diff --git a/procps/fuser.c b/procps/fuser.c index 6dac852ed..db28cca79 100644 --- a/procps/fuser.c +++ b/procps/fuser.c @@ -6,6 +6,17 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config FUSER +//config: bool "fuser" +//config: default y +//config: help +//config: fuser lists all PIDs (Process IDs) that currently have a given +//config: file open. fuser can also list all PIDs that have a given network +//config: (TCP or UDP) port open. + +//applet:IF_FUSER(APPLET(fuser, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FUSER) += fuser.o //usage:#define fuser_trivial_usage //usage: "[OPTIONS] FILE or PORT/PROTO" diff --git a/procps/kill.c b/procps/kill.c index c5c7a8d72..1ee79a051 100644 --- a/procps/kill.c +++ b/procps/kill.c @@ -7,6 +7,36 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config KILL +//config: bool "kill" +//config: default y +//config: help +//config: The command kill sends the specified signal to the specified +//config: process or process group. If no signal is specified, the TERM +//config: signal is sent. +//config: +//config:config KILLALL +//config: bool "killall" +//config: default y +//config: depends on KILL +//config: help +//config: killall sends a signal to all processes running any of the +//config: specified commands. If no signal name is specified, SIGTERM is +//config: sent. +//config: +//config:config KILLALL5 +//config: bool "killall5" +//config: default y +//config: depends on KILL +//config: + +//applet:IF_KILL(APPLET(kill, BB_DIR_BIN, BB_SUID_DROP)) +//applet:IF_KILLALL(APPLET_ODDNAME(killall, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall)) +//applet:IF_KILLALL5(APPLET_ODDNAME(killall5, kill, BB_DIR_USR_SBIN, BB_SUID_DROP, killall5)) + +//kbuild:lib-$(CONFIG_KILL) += kill.o +//kbuild:lib-$(CONFIG_KILLALL) += kill.o +//kbuild:lib-$(CONFIG_KILLALL5) += kill.o //usage:#define kill_trivial_usage //usage: "[-l] [-SIG] PID..." diff --git a/procps/pgrep.c b/procps/pgrep.c index 1c594cf96..974d007f3 100644 --- a/procps/pgrep.c +++ b/procps/pgrep.c @@ -6,6 +6,23 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config PGREP +//config: bool "pgrep" +//config: default y +//config: help +//config: Look for processes by name. +//config: +//config:config PKILL +//config: bool "pkill" +//config: default y +//config: help +//config: Send signals to processes by name. + +//applet:IF_PGREP(APPLET(pgrep, BB_DIR_USR_BIN, BB_SUID_DROP)) +//applet:IF_PKILL(APPLET_ODDNAME(pkill, pgrep, BB_DIR_USR_BIN, BB_SUID_DROP, pkill)) + +//kbuild:lib-$(CONFIG_PGREP) += pgrep.o +//kbuild:lib-$(CONFIG_PKILL) += pgrep.o //usage:#define pgrep_trivial_usage //usage: "[-flnovx] [-s SID|-P PPID|PATTERN]" diff --git a/procps/pidof.c b/procps/pidof.c index 6d265667f..069adb7a4 100644 --- a/procps/pidof.c +++ b/procps/pidof.c @@ -6,6 +6,32 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config PIDOF +//config: bool "pidof" +//config: default y +//config: help +//config: Pidof finds the process id's (pids) of the named programs. It prints +//config: those id's on the standard output. +//config: +//config:config FEATURE_PIDOF_SINGLE +//config: bool "Enable argument for single shot (-s)" +//config: default y +//config: depends on PIDOF +//config: help +//config: Support argument '-s' for returning only the first pid found. +//config: +//config:config FEATURE_PIDOF_OMIT +//config: bool "Enable argument for omitting pids (-o)" +//config: default y +//config: depends on PIDOF +//config: help +//config: Support argument '-o' for omitting the given pids in output. +//config: The special pid %PPID can be used to name the parent process +//config: of the pidof, in other words the calling shell or shell script. + +//applet:IF_PIDOF(APPLET(pidof, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_PIDOF) += pidof.o //usage:#if (ENABLE_FEATURE_PIDOF_SINGLE || ENABLE_FEATURE_PIDOF_OMIT) //usage:#define pidof_trivial_usage diff --git a/procps/ps.c b/procps/ps.c index ce638261a..e291ecd7e 100644 --- a/procps/ps.c +++ b/procps/ps.c @@ -8,6 +8,55 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config PS +//config: bool "ps" +//config: default y +//config: help +//config: ps gives a snapshot of the current processes. +//config: +//config:config FEATURE_PS_WIDE +//config: bool "Enable wide output option (-w)" +//config: default y +//config: depends on PS && !DESKTOP +//config: help +//config: Support argument 'w' for wide output. +//config: If given once, 132 chars are printed, and if given more +//config: than once, the length is unlimited. +//config: +//config:config FEATURE_PS_LONG +//config: bool "Enable long output option (-l)" +//config: default y +//config: depends on PS && !DESKTOP +//config: help +//config: Support argument 'l' for long output. +//config: Adds fields PPID, RSS, START, TIME & TTY +//config: +//config:config FEATURE_PS_TIME +//config: bool "Enable time and elapsed time output" +//config: default y +//config: depends on PS && DESKTOP +//config: select PLATFORM_LINUX +//config: help +//config: Support -o time and -o etime output specifiers. +//config: +//config:config FEATURE_PS_ADDITIONAL_COLUMNS +//config: bool "Enable additional ps columns" +//config: default y +//config: depends on PS && DESKTOP +//config: help +//config: Support -o rgroup, -o ruser, -o nice output specifiers. +//config: +//config:config FEATURE_PS_UNUSUAL_SYSTEMS +//config: bool "Support Linux prior to 2.4.0 and non-ELF systems" +//config: default n +//config: depends on FEATURE_PS_TIME +//config: help +//config: Include support for measuring HZ on old kernels and non-ELF systems +//config: (if you are on Linux 2.4.0+ and use ELF, you don't need this) + +//applet:IF_PS(APPLET(ps, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_PS) += ps.o //usage:#if ENABLE_DESKTOP //usage: diff --git a/procps/renice.c b/procps/renice.c index 2b690e0ed..64213c680 100644 --- a/procps/renice.c +++ b/procps/renice.c @@ -18,6 +18,16 @@ * options -p, -g, and -u are treated as mode switches for the * following IDs (if any). Multiple switches are allowed. */ +//config:config RENICE +//config: bool "renice" +//config: default y +//config: help +//config: Renice alters the scheduling priority of one or more running +//config: processes. + +//applet:IF_RENICE(APPLET(renice, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_RENICE) += renice.o //usage:#define renice_trivial_usage //usage: "[-n] PRIORITY [[-p | -g | -u] ID...]..." diff --git a/procps/sysctl.c b/procps/sysctl.c index f0883f054..93d7c3418 100644 --- a/procps/sysctl.c +++ b/procps/sysctl.c @@ -10,6 +10,15 @@ * v1.01 - added -p to preload values from a file * v1.01.1 - busybox applet aware by */ +//config:config BB_SYSCTL +//config: bool "sysctl" +//config: default y +//config: help +//config: Configure kernel parameters at runtime. + +//applet:IF_BB_SYSCTL(APPLET(sysctl, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_BB_SYSCTL) += sysctl.o //usage:#define sysctl_trivial_usage //usage: "[OPTIONS] [KEY[=VALUE]]..." diff --git a/procps/top.c b/procps/top.c index 6f7f7d382..c66cdb764 100644 --- a/procps/top.c +++ b/procps/top.c @@ -49,7 +49,6 @@ * cp stat meminfo loadavg proc * chroot . ./top -bn1 >top1.out */ - //config:config TOP //config: bool "top" //config: default y @@ -104,6 +103,10 @@ //config: help //config: Enable 's' in top (gives lots of memory info). +//applet:IF_TOP(APPLET(top, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_TOP) += top.o + #include "libbb.h" #include "common_bufsiz.h" diff --git a/procps/uptime.c b/procps/uptime.c index 149bae6e5..436193925 100644 --- a/procps/uptime.c +++ b/procps/uptime.c @@ -11,9 +11,6 @@ * * Added FEATURE_UPTIME_UTMP_SUPPORT flag. */ - -/* getopt not needed */ - //config:config UPTIME //config: bool "uptime" //config: default y @@ -30,6 +27,10 @@ //config: help //config: Makes uptime display the number of users currently logged on. +//applet:IF_UPTIME(APPLET(uptime, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_UPTIME) += uptime.o + //usage:#define uptime_trivial_usage //usage: "" //usage:#define uptime_full_usage "\n\n" diff --git a/procps/watch.c b/procps/watch.c index 20859c3cd..bb34124c0 100644 --- a/procps/watch.c +++ b/procps/watch.c @@ -11,6 +11,17 @@ /* BB_AUDIT SUSv3 N/A */ /* BB_AUDIT GNU defects -- only option -n is supported. */ +//config:config WATCH +//config: bool "watch" +//config: default y +//config: help +//config: watch is used to execute a program periodically, showing +//config: output to the screen. + +//applet:IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_WATCH) += watch.o + //usage:#define watch_trivial_usage //usage: "[-n SEC] [-t] PROG ARGS" //usage:#define watch_full_usage "\n\n" -- cgit v1.2.3-55-g6feb From 47367e1d50b81501e8a6ce215f8be4eeacdda693 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Nov 2016 09:05:14 +0100 Subject: Convert all networking/* applets to "new style" applet definitions Signed-off-by: Denys Vlasenko --- include/applets.src.h | 49 --- networking/Config.src | 794 +---------------------------------------------- networking/Kbuild.src | 36 --- networking/arp.c | 10 + networking/arping.c | 11 + networking/brctl.c | 30 ++ networking/dnsd.c | 9 + networking/ether-wake.c | 10 + networking/ftpd.c | 34 ++ networking/ftpgetput.c | 24 ++ networking/httpd.c | 122 ++++++++ networking/ifconfig.c | 51 +++ networking/ifenslave.c | 11 + networking/ifplugd.c | 10 + networking/inetd.c | 53 ++++ networking/ip.c | 124 ++++++++ networking/ipcalc.c | 25 ++ networking/isrv_identd.c | 11 + networking/nameif.c | 4 + networking/nc.c | 10 +- networking/netstat.c | 26 ++ networking/nslookup.c | 9 + networking/ntpd.c | 26 ++ networking/pscan.c | 9 + networking/route.c | 10 + networking/slattach.c | 11 + networking/tc.c | 1 + networking/tcpudp.c | 19 ++ networking/telnet.c | 29 ++ networking/telnetd.c | 72 +++++ networking/tftp.c | 72 +++++ networking/traceroute.c | 34 ++ networking/tunctl.c | 18 ++ networking/vconfig.c | 11 + networking/zcip.c | 16 + 35 files changed, 909 insertions(+), 882 deletions(-) (limited to 'include') diff --git a/include/applets.src.h b/include/applets.src.h index 1d2d9c8ed..3fd9ba06e 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -76,11 +76,8 @@ INSERT IF_TEST(APPLET_NOFORK([, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) IF_TEST(APPLET_NOFORK([[, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) IF_ACPID(APPLET(acpid, BB_DIR_SBIN, BB_SUID_DROP)) -IF_ARP(APPLET(arp, BB_DIR_SBIN, BB_SUID_DROP)) -IF_ARPING(APPLET(arping, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_BASENAME(APPLET_NOFORK(basename, basename, BB_DIR_USR_BIN, BB_SUID_DROP, basename)) IF_BLKID(APPLET(blkid, BB_DIR_SBIN, BB_SUID_DROP)) -IF_BRCTL(APPLET(brctl, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat)) IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP)) @@ -101,7 +98,6 @@ IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP)) IF_DHCPRELAY(APPLET(dhcprelay, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_DIRNAME(APPLET_NOFORK(dirname, dirname, BB_DIR_USR_BIN, BB_SUID_DROP, dirname)) IF_DMESG(APPLET(dmesg, BB_DIR_BIN, BB_SUID_DROP)) -IF_DNSD(APPLET(dnsd, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_DOS2UNIX(APPLET_NOEXEC(dos2unix, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, dos2unix)) IF_DU(APPLET(du, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_DUMPKMAP(APPLET(dumpkmap, BB_DIR_BIN, BB_SUID_DROP)) @@ -110,10 +106,8 @@ IF_DUMPLEASES(APPLET(dumpleases, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_E2LABEL(APPLET_ODDNAME(e2label, tune2fs, BB_DIR_SBIN, BB_SUID_DROP, e2label)) IF_ECHO(APPLET_NOFORK(echo, echo, BB_DIR_BIN, BB_SUID_DROP, echo)) IF_ENV(APPLET_NOEXEC(env, env, BB_DIR_USR_BIN, BB_SUID_DROP, env)) -IF_ETHER_WAKE(APPLET_ODDNAME(ether-wake, ether_wake, BB_DIR_USR_SBIN, BB_SUID_DROP, ether_wake)) IF_EXPAND(APPLET(expand, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_EXPR(APPLET(expr, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_FAKEIDENTD(APPLET(fakeidentd, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_FALSE(APPLET_NOFORK(false, false, BB_DIR_BIN, BB_SUID_DROP, false)) IF_FBSET(APPLET(fbset, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, BB_DIR_BIN, BB_SUID_DROP, fdflush)) @@ -129,37 +123,16 @@ IF_FREERAMDISK(APPLET(freeramdisk, BB_DIR_SBIN, BB_SUID_DROP)) //IF_E2FSCK(APPLET_ODDNAME(fsck.ext3, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext3)) IF_FSCK_MINIX(APPLET_ODDNAME(fsck.minix, fsck_minix, BB_DIR_SBIN, BB_SUID_DROP, fsck_minix)) IF_FSYNC(APPLET_NOFORK(fsync, fsync, BB_DIR_BIN, BB_SUID_DROP, fsync)) -IF_FTPD(APPLET(ftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_FTPGET(APPLET_ODDNAME(ftpget, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpget)) -IF_FTPPUT(APPLET_ODDNAME(ftpput, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpput)) IF_GETENFORCE(APPLET(getenforce, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP)) IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_HD(APPLET_NOEXEC(hd, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hd)) IF_HEAD(APPLET_NOEXEC(head, head, BB_DIR_USR_BIN, BB_SUID_DROP, head)) IF_HEXDUMP(APPLET_NOEXEC(hexdump, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hexdump)) -IF_HTTPD(APPLET(httpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_HWCLOCK(APPLET(hwclock, BB_DIR_SBIN, BB_SUID_DROP)) -IF_IFCONFIG(APPLET(ifconfig, BB_DIR_SBIN, BB_SUID_DROP)) -IF_IFENSLAVE(APPLET(ifenslave, BB_DIR_SBIN, BB_SUID_DROP)) -IF_IFPLUGD(APPLET(ifplugd, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_INETD(APPLET(inetd, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_INSTALL(APPLET(install, BB_DIR_USR_BIN, BB_SUID_DROP)) -#if ENABLE_FEATURE_IP_ADDRESS \ - || ENABLE_FEATURE_IP_ROUTE \ - || ENABLE_FEATURE_IP_LINK \ - || ENABLE_FEATURE_IP_TUNNEL \ - || ENABLE_FEATURE_IP_RULE -IF_IP(APPLET(ip, BB_DIR_SBIN, BB_SUID_DROP)) -#endif -IF_IPADDR(APPLET(ipaddr, BB_DIR_SBIN, BB_SUID_DROP)) -IF_IPCALC(APPLET(ipcalc, BB_DIR_BIN, BB_SUID_DROP)) IF_IPCRM(APPLET(ipcrm, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_IPCS(APPLET(ipcs, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_IPLINK(APPLET(iplink, BB_DIR_SBIN, BB_SUID_DROP)) -IF_IPROUTE(APPLET(iproute, BB_DIR_SBIN, BB_SUID_DROP)) -IF_IPRULE(APPLET(iprule, BB_DIR_SBIN, BB_SUID_DROP)) -IF_IPTUNNEL(APPLET(iptunnel, BB_DIR_SBIN, BB_SUID_DROP)) IF_KBD_MODE(APPLET(kbd_mode, BB_DIR_BIN, BB_SUID_DROP)) //IF_LENGTH(APPLET_NOFORK(length, length, BB_DIR_USR_BIN, BB_SUID_DROP, length)) IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, BB_SUID_DROP, ln)) @@ -186,13 +159,8 @@ IF_MORE(APPLET(more, BB_DIR_BIN, BB_SUID_DROP)) * Therefore we use BB_SUID_MAYBE instead of BB_SUID_REQUIRE: */ IF_MOUNT(APPLET(mount, BB_DIR_BIN, IF_DESKTOP(BB_SUID_MAYBE) IF_NOT_DESKTOP(BB_SUID_DROP))) IF_MV(APPLET(mv, BB_DIR_BIN, BB_SUID_DROP)) -IF_NAMEIF(APPLET(nameif, BB_DIR_SBIN, BB_SUID_DROP)) -IF_NC(APPLET(nc, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_NETSTAT(APPLET(netstat, BB_DIR_BIN, BB_SUID_DROP)) IF_NICE(APPLET(nice, BB_DIR_BIN, BB_SUID_DROP)) IF_NOHUP(APPLET(nohup, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_NSLOOKUP(APPLET(nslookup, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_NTPD(APPLET(ntpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_OD(APPLET(od, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_OPENVT(APPLET(openvt, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_PARSE(APPLET(parse, BB_DIR_USR_BIN, BB_SUID_DROP)) @@ -200,7 +168,6 @@ IF_PIVOT_ROOT(APPLET(pivot_root, BB_DIR_SBIN, BB_SUID_DROP)) IF_POPMAILDIR(APPLET(popmaildir, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_PRINTENV(APPLET_NOFORK(printenv, printenv, BB_DIR_BIN, BB_SUID_DROP, printenv)) IF_PRINTF(APPLET_NOFORK(printf, printf, BB_DIR_USR_BIN, BB_SUID_DROP, printf)) -IF_PSCAN(APPLET(pscan, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_PWD(APPLET_NOFORK(pwd, pwd, BB_DIR_BIN, BB_SUID_DROP, pwd)) IF_RDATE(APPLET(rdate, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_RDEV(APPLET(rdev, BB_DIR_USR_SBIN, BB_SUID_DROP)) @@ -213,7 +180,6 @@ IF_RESIZE(APPLET(resize, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon)) IF_RM(APPLET_NOFORK(rm, rm, BB_DIR_BIN, BB_SUID_DROP, rm)) IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir)) -IF_ROUTE(APPLET(route, BB_DIR_SBIN, BB_SUID_DROP)) IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_SCRIPT(APPLET(script, BB_DIR_USR_BIN, BB_SUID_DROP)) @@ -230,7 +196,6 @@ IF_SETKEYCODES(APPLET(setkeycodes, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_SETLOGCONS(APPLET(setlogcons, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_SETSEBOOL(APPLET(setsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_SHOWKEY(APPLET(showkey, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_SLATTACH(APPLET(slattach, BB_DIR_SBIN, BB_SUID_DROP)) /* Do not make this applet NOFORK. It breaks ^C-ing of pauses in shells: */ IF_SLEEP(APPLET(sleep, BB_DIR_BIN, BB_SUID_DROP)) IF_SORT(APPLET_NOEXEC(sort, sort, BB_DIR_USR_BIN, BB_SUID_DROP, sort)) @@ -242,25 +207,13 @@ IF_SWITCH_ROOT(APPLET(switch_root, BB_DIR_SBIN, BB_SUID_DROP)) IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac)) IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP)) /* IF_TC(APPLET(tc, BB_DIR_SBIN, BB_SUID_DROP)) */ -IF_TCPSVD(APPLET_ODDNAME(tcpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, tcpsvd)) IF_TEE(APPLET(tee, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_TELNET(APPLET(telnet, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_TELNETD(APPLET(telnetd, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_TEST(APPLET_NOFORK(test, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) -#if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT -IF_TFTP(APPLET(tftp, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_TFTPD(APPLET(tftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) -#endif IF_TR(APPLET(tr, BB_DIR_USR_BIN, BB_SUID_DROP)) -/* Needs socket(AF_INET, SOCK_RAW, IPPROTO_ICMP), therefore BB_SUID_MAYBE: */ -IF_TRACEROUTE(APPLET(traceroute, BB_DIR_USR_BIN, BB_SUID_MAYBE)) -IF_TRACEROUTE6(APPLET(traceroute6, BB_DIR_USR_BIN, BB_SUID_MAYBE)) IF_TRUE(APPLET_NOFORK(true, true, BB_DIR_BIN, BB_SUID_DROP, true)) IF_TTY(APPLET(tty, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_TUNCTL(APPLET(tunctl, BB_DIR_SBIN, BB_SUID_DROP)) IF_UDHCPC(APPLET(udhcpc, BB_DIR_SBIN, BB_SUID_DROP)) IF_UDHCPD(APPLET(udhcpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, udpsvd)) IF_UMOUNT(APPLET(umount, BB_DIR_BIN, BB_SUID_DROP)) IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP)) IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand)) @@ -269,11 +222,9 @@ IF_UNIX2DOS(APPLET_NOEXEC(unix2dos, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, unix IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep)) IF_UUDECODE(APPLET(uudecode, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_UUENCODE(APPLET(uuencode, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_VCONFIG(APPLET(vconfig, BB_DIR_SBIN, BB_SUID_DROP)) IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) -IF_ZCIP(APPLET(zcip, BB_DIR_SBIN, BB_SUID_DROP)) #if !defined(PROTOTYPES) && !defined(NAME_MAIN) && !defined(MAKE_USAGE) \ && !defined(MAKE_LINKS) && !defined(MAKE_SUID) diff --git a/networking/Config.src b/networking/Config.src index 43667fe6a..4d921884f 100644 --- a/networking/Config.src +++ b/networking/Config.src @@ -5,8 +5,6 @@ menu "Networking Utilities" -INSERT - config FEATURE_IPV6 bool "Enable IPv6 support" default y @@ -48,558 +46,7 @@ config VERBOSE_RESOLUTION_ERRORS "can't resolve 'hostname.com'" and want to know more. This may increase size of your executable a bit. -config ARP - bool "arp" - default y - select PLATFORM_LINUX - help - Manipulate the system ARP cache. - -config ARPING - bool "arping" - default y - select PLATFORM_LINUX - help - Ping hosts by ARP packets. - -config BRCTL - bool "brctl" - default y - select PLATFORM_LINUX - help - Manage ethernet bridges. - Supports addbr/delbr and addif/delif. - -config FEATURE_BRCTL_FANCY - bool "Fancy options" - default y - depends on BRCTL - help - Add support for extended option like: - setageing, setfd, sethello, setmaxage, - setpathcost, setportprio, setbridgeprio, - stp - This adds about 600 bytes. - -config FEATURE_BRCTL_SHOW - bool "Support show" - default y - depends on BRCTL && FEATURE_BRCTL_FANCY - help - Add support for option which prints the current config: - show - -config DNSD - bool "dnsd" - default y - help - Small and static DNS server daemon. - -config ETHER_WAKE - bool "ether-wake" - default y - select PLATFORM_LINUX - help - Send a magic packet to wake up sleeping machines. - -config FAKEIDENTD - bool "fakeidentd" - default y - select FEATURE_SYSLOG - help - fakeidentd listens on the ident port and returns a predefined - fake value on any query. - -config FTPD - bool "ftpd" - default y - help - simple FTP daemon. You have to run it via inetd. - -config FEATURE_FTP_WRITE - bool "Enable upload commands" - default y - depends on FTPD - help - Enable all kinds of FTP upload commands (-w option) - -config FEATURE_FTPD_ACCEPT_BROKEN_LIST - bool "Enable workaround for RFC-violating clients" - default y - depends on FTPD - help - Some ftp clients (among them KDE's Konqueror) issue illegal - "LIST -l" requests. This option works around such problems. - It might prevent you from listing files starting with "-" and - it increases the code size by ~40 bytes. - Most other ftp servers seem to behave similar to this. - -config FEATURE_FTP_AUTHENTICATION - bool "Enable authentication" - default y - depends on FTPD - help - Enable basic system login as seen in telnet etc. - -config FTPGET - bool "ftpget" - default y - help - Retrieve a remote file via FTP. - -config FTPPUT - bool "ftpput" - default y - help - Store a remote file via FTP. - -config FEATURE_FTPGETPUT_LONG_OPTIONS - bool "Enable long options in ftpget/ftpput" - default y - depends on LONG_OPTS && (FTPGET || FTPPUT) - help - Support long options for the ftpget/ftpput applet. - -config HTTPD - bool "httpd" - default y - help - Serve web pages via an HTTP server. - -config FEATURE_HTTPD_RANGES - bool "Support 'Ranges:' header" - default y - depends on HTTPD - help - Makes httpd emit "Accept-Ranges: bytes" header and understand - "Range: bytes=NNN-[MMM]" header. Allows for resuming interrupted - downloads, seeking in multimedia players etc. - -config FEATURE_HTTPD_SETUID - bool "Enable -u option" - default y - depends on HTTPD - help - This option allows the server to run as a specific user - rather than defaulting to the user that starts the server. - Use of this option requires special privileges to change to a - different user. - -config FEATURE_HTTPD_BASIC_AUTH - bool "Enable Basic http Authentication" - default y - depends on HTTPD - help - Utilizes password settings from /etc/httpd.conf for basic - authentication on a per url basis. - Example for httpd.conf file: - /adm:toor:PaSsWd - -config FEATURE_HTTPD_AUTH_MD5 - bool "Support MD5 crypted passwords for http Authentication" - default y - depends on FEATURE_HTTPD_BASIC_AUTH - help - Enables encrypted passwords, and wildcard user/passwords - in httpd.conf file. - User '*' means 'any system user name is ok', - password of '*' means 'use system password for this user' - Examples: - /adm:toor:$1$P/eKnWXS$aI1aPGxT.dJD5SzqAKWrF0 - /adm:root:* - /wiki:*:* - -config FEATURE_HTTPD_CGI - bool "Support Common Gateway Interface (CGI)" - default y - depends on HTTPD - help - This option allows scripts and executables to be invoked - when specific URLs are requested. - -config FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR - bool "Support for running scripts through an interpreter" - default y - depends on FEATURE_HTTPD_CGI - help - This option enables support for running scripts through an - interpreter. Turn this on if you want PHP scripts to work - properly. You need to supply an additional line in your - httpd.conf file: - *.php:/path/to/your/php - -config FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV - bool "Set REMOTE_PORT environment variable for CGI" - default y - depends on FEATURE_HTTPD_CGI - help - Use of this option can assist scripts in generating - references that contain a unique port number. - -config FEATURE_HTTPD_ENCODE_URL_STR - bool "Enable -e option (useful for CGIs written as shell scripts)" - default y - depends on HTTPD - help - This option allows html encoding of arbitrary strings for display - by the browser. Output goes to stdout. - For example, httpd -e "" produces - "<Hello World>". - -config FEATURE_HTTPD_ERROR_PAGES - bool "Support for custom error pages" - default y - depends on HTTPD - help - This option allows you to define custom error pages in - the configuration file instead of the default HTTP status - error pages. For instance, if you add the line: - E404:/path/e404.html - in the config file, the server will respond the specified - '/path/e404.html' file instead of the terse '404 NOT FOUND' - message. - -config FEATURE_HTTPD_PROXY - bool "Support for reverse proxy" - default y - depends on HTTPD - help - This option allows you to define URLs that will be forwarded - to another HTTP server. To setup add the following line to the - configuration file - P:/url/:http://hostname[:port]/new/path/ - Then a request to /url/myfile will be forwarded to - http://hostname[:port]/new/path/myfile. - -config FEATURE_HTTPD_GZIP - bool "Support for GZIP content encoding" - default y - depends on HTTPD - help - Makes httpd send files using GZIP content encoding if the - client supports it and a pre-compressed .gz exists. - -config IFCONFIG - bool "ifconfig" - default y - select PLATFORM_LINUX - help - Ifconfig is used to configure the kernel-resident network interfaces. - -config FEATURE_IFCONFIG_STATUS - bool "Enable status reporting output (+7k)" - default y - depends on IFCONFIG - help - If ifconfig is called with no arguments it will display the status - of the currently active interfaces. - -config FEATURE_IFCONFIG_SLIP - bool "Enable slip-specific options \"keepalive\" and \"outfill\"" - default y - depends on IFCONFIG - help - Allow "keepalive" and "outfill" support for SLIP. If you're not - planning on using serial lines, leave this unchecked. - -config FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ - bool "Enable options \"mem_start\", \"io_addr\", and \"irq\"" - default y - depends on IFCONFIG - help - Allow the start address for shared memory, start address for I/O, - and/or the interrupt line used by the specified device. - -config FEATURE_IFCONFIG_HW - bool "Enable option \"hw\" (ether only)" - default y - depends on IFCONFIG - help - Set the hardware address of this interface, if the device driver - supports this operation. Currently, we only support the 'ether' - class. - -config FEATURE_IFCONFIG_BROADCAST_PLUS - bool "Set the broadcast automatically" - default y - depends on IFCONFIG - help - Setting this will make ifconfig attempt to find the broadcast - automatically if the value '+' is used. - -config IFENSLAVE - bool "ifenslave" - default y - select PLATFORM_LINUX - help - Userspace application to bind several interfaces - to a logical interface (use with kernel bonding driver). - -config IFPLUGD - bool "ifplugd" - default y - select PLATFORM_LINUX - help - Network interface plug detection daemon. - -config INETD - bool "inetd" - default y - select FEATURE_SYSLOG - help - Internet superserver daemon - -config FEATURE_INETD_SUPPORT_BUILTIN_ECHO - bool "Support echo service" - default y - depends on INETD - help - Echo received data internal inetd service - -config FEATURE_INETD_SUPPORT_BUILTIN_DISCARD - bool "Support discard service" - default y - depends on INETD - help - Internet /dev/null internal inetd service - -config FEATURE_INETD_SUPPORT_BUILTIN_TIME - bool "Support time service" - default y - depends on INETD - help - Return 32 bit time since 1900 internal inetd service - -config FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME - bool "Support daytime service" - default y - depends on INETD - help - Return human-readable time internal inetd service - -config FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN - bool "Support chargen service" - default y - depends on INETD - help - Familiar character generator internal inetd service - -config FEATURE_INETD_RPC - bool "Support RPC services" - default n # very rarely used, and needs Sun RPC support in libc - depends on INETD - select FEATURE_HAVE_RPC - help - Support Sun-RPC based services - -config IP - bool "ip" - default y - select PLATFORM_LINUX - help - The "ip" applet is a TCP/IP interface configuration and routing - utility. You generally don't need "ip" to use busybox with - TCP/IP. - -config FEATURE_IP_ADDRESS - bool "ip address" - default y - depends on IP - help - Address manipulation support for the "ip" applet. - -config FEATURE_IP_LINK - bool "ip link" - default y - depends on IP - help - Configure network devices with "ip". - -config FEATURE_IP_ROUTE - bool "ip route" - default y - depends on IP - help - Add support for routing table management to "ip". - -config FEATURE_IP_ROUTE_DIR - string "ip route configuration directory" - default "/etc/iproute2" - depends on FEATURE_IP_ROUTE - help - Location of the "ip" applet routing configuration. - -config FEATURE_IP_TUNNEL - bool "ip tunnel" - default y - depends on IP - help - Add support for tunneling commands to "ip". - -config FEATURE_IP_RULE - bool "ip rule" - default y - depends on IP - help - Add support for rule commands to "ip". - -config FEATURE_IP_NEIGH - bool "ip neighbor" - default y - depends on IP - help - Add support for neighbor commands to "ip". - -config FEATURE_IP_SHORT_FORMS - bool "Support short forms of ip commands" - default y - depends on IP - help - Also support short-form of ip commands: - ip addr -> ipaddr - ip link -> iplink - ip route -> iproute - ip tunnel -> iptunnel - ip rule -> iprule - ip neigh -> ipneigh - - Say N unless you desparately need the short form of the ip - object commands. - -config FEATURE_IP_RARE_PROTOCOLS - bool "Support displaying rarely used link types" - default n - depends on IP - help - If you are not going to use links of type "frad", "econet", - "bif" etc, you probably don't need to enable this. - Ethernet, wireless, infrared, ppp/slip, ip tunnelling - link types are supported without this option selected. - -config IPADDR - bool - default y - depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_ADDRESS - -config IPLINK - bool - default y - depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_LINK - -config IPROUTE - bool - default y - depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_ROUTE - -config IPTUNNEL - bool - default y - depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_TUNNEL - -config IPRULE - bool - default y - depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_RULE - -config IPNEIGH - bool - default y - depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_NEIGH - -config IPCALC - bool "ipcalc" - default y - help - ipcalc takes an IP address and netmask and calculates the - resulting broadcast, network, and host range. - -config FEATURE_IPCALC_FANCY - bool "Fancy IPCALC, more options, adds 1 kbyte" - default y - depends on IPCALC - help - Adds the options hostname, prefix and silent to the output of - "ipcalc". - -config FEATURE_IPCALC_LONG_OPTIONS - bool "Enable long options" - default y - depends on IPCALC && LONG_OPTS - help - Support long options for the ipcalc applet. - -config NETSTAT - bool "netstat" - default y - select PLATFORM_LINUX - help - netstat prints information about the Linux networking subsystem. - -config FEATURE_NETSTAT_WIDE - bool "Enable wide netstat output" - default y - depends on NETSTAT - help - Add support for wide columns. Useful when displaying IPv6 addresses - (-W option). - -config FEATURE_NETSTAT_PRG - bool "Enable PID/Program name output" - default y - depends on NETSTAT - help - Add support for -p flag to print out PID and program name. - +700 bytes of code. - -config NSLOOKUP - bool "nslookup" - default y - help - nslookup is a tool to query Internet name servers. - -config NTPD - bool "ntpd" - default y - select PLATFORM_LINUX - help - The NTP client/server daemon. - -config FEATURE_NTPD_SERVER - bool "Make ntpd usable as a NTP server" - default y - depends on NTPD - help - Make ntpd usable as a NTP server. If you disable this option - ntpd will be usable only as a NTP client. - -config FEATURE_NTPD_CONF - bool "Make ntpd understand /etc/ntp.conf" - default y - depends on NTPD - help - Make ntpd look in /etc/ntp.conf for peers. Only "server address" - is supported. - -config PSCAN - bool "pscan" - default y - help - Simple network port scanner. - -config ROUTE - bool "route" - default y - select PLATFORM_LINUX - help - Route displays or manipulates the kernel's IP routing tables. - -config SLATTACH - bool "slattach" - default y - select PLATFORM_LINUX - help - slattach is a small utility to attach network interfaces to serial - lines. +INSERT #config TC # bool "tc" @@ -611,218 +58,6 @@ config SLATTACH # def_bool n # depends on TC -config TCPSVD - bool "tcpsvd" - default y - help - tcpsvd listens on a TCP port and runs a program for each new - connection. - -config TELNET - bool "telnet" - default y - help - Telnet is an interface to the TELNET protocol, but is also commonly - used to test other simple protocols. - -config FEATURE_TELNET_TTYPE - bool "Pass TERM type to remote host" - default y - depends on TELNET - help - Setting this option will forward the TERM environment variable to the - remote host you are connecting to. This is useful to make sure that - things like ANSI colors and other control sequences behave. - -config FEATURE_TELNET_AUTOLOGIN - bool "Pass USER type to remote host" - default y - depends on TELNET - help - Setting this option will forward the USER environment variable to the - remote host you are connecting to. This is useful when you need to - log into a machine without telling the username (autologin). This - option enables `-a' and `-l USER' arguments. - -config TELNETD - bool "telnetd" - default y - select FEATURE_SYSLOG - help - A daemon for the TELNET protocol, allowing you to log onto the host - running the daemon. Please keep in mind that the TELNET protocol - sends passwords in plain text. If you can't afford the space for an - SSH daemon and you trust your network, you may say 'y' here. As a - more secure alternative, you should seriously consider installing the - very small Dropbear SSH daemon instead: - http://matt.ucc.asn.au/dropbear/dropbear.html - - Note that for busybox telnetd to work you need several things: - First of all, your kernel needs: - CONFIG_UNIX98_PTYS=y - - Next, you need a /dev/pts directory on your root filesystem: - - $ ls -ld /dev/pts - drwxr-xr-x 2 root root 0 Sep 23 13:21 /dev/pts/ - - Next you need the pseudo terminal master multiplexer /dev/ptmx: - - $ ls -la /dev/ptmx - crw-rw-rw- 1 root tty 5, 2 Sep 23 13:55 /dev/ptmx - - Any /dev/ttyp[0-9]* files you may have can be removed. - Next, you need to mount the devpts filesystem on /dev/pts using: - - mount -t devpts devpts /dev/pts - - You need to be sure that busybox has LOGIN and - FEATURE_SUID enabled. And finally, you should make - certain that Busybox has been installed setuid root: - - chown root.root /bin/busybox - chmod 4755 /bin/busybox - - with all that done, telnetd _should_ work.... - - -config FEATURE_TELNETD_STANDALONE - bool "Support standalone telnetd (not inetd only)" - default y - depends on TELNETD - help - Selecting this will make telnetd able to run standalone. - -config FEATURE_TELNETD_INETD_WAIT - bool "Support -w SEC option (inetd wait mode)" - default y - depends on FEATURE_TELNETD_STANDALONE - help - This option allows you to run telnetd in "inet wait" mode. - Example inetd.conf line (note "wait", not usual "nowait"): - - telnet stream tcp wait root /bin/telnetd telnetd -w10 - - In this example, inetd passes _listening_ socket_ as fd 0 - to telnetd when connection appears. - telnetd will wait for connections until all existing - connections are closed, and no new connections - appear during 10 seconds. Then it exits, and inetd continues - to listen for new connections. - - This option is rarely used. "tcp nowait" is much more usual - way of running tcp services, including telnetd. - You most probably want to say N here. - -config TFTP - bool "tftp" - default y - help - This enables the Trivial File Transfer Protocol client program. TFTP - is usually used for simple, small transfers such as a root image - for a network-enabled bootloader. - -config TFTPD - bool "tftpd" - default y - help - This enables the Trivial File Transfer Protocol server program. - It expects that stdin is a datagram socket and a packet - is already pending on it. It will exit after one transfer. - In other words: it should be run from inetd in nowait mode, - or from udpsvd. Example: "udpsvd -E 0 69 tftpd DIR" - -comment "Common options for tftp/tftpd" - depends on TFTP || TFTPD - -config FEATURE_TFTP_GET - bool "Enable 'tftp get' and/or tftpd upload code" - default y - depends on TFTP || TFTPD - help - Add support for the GET command within the TFTP client. This allows - a client to retrieve a file from a TFTP server. - Also enable upload support in tftpd, if tftpd is selected. - - Note: this option does _not_ make tftpd capable of download - (the usual operation people need from it)! - -config FEATURE_TFTP_PUT - bool "Enable 'tftp put' and/or tftpd download code" - default y - depends on TFTP || TFTPD - help - Add support for the PUT command within the TFTP client. This allows - a client to transfer a file to a TFTP server. - Also enable download support in tftpd, if tftpd is selected. - -config FEATURE_TFTP_BLOCKSIZE - bool "Enable 'blksize' and 'tsize' protocol options" - default y - depends on TFTP || TFTPD - help - Allow tftp to specify block size, and tftpd to understand - "blksize" and "tsize" options. - -config FEATURE_TFTP_PROGRESS_BAR - bool "Enable tftp progress meter" - default y - depends on TFTP && FEATURE_TFTP_BLOCKSIZE - help - Show progress bar. - -config TFTP_DEBUG - bool "Enable debug" - default n - depends on TFTP || TFTPD - help - Make tftp[d] print debugging messages on stderr. - This is useful if you are diagnosing a bug in tftp[d]. - -config TRACEROUTE - bool "traceroute" - default y - select PLATFORM_LINUX - help - Utility to trace the route of IP packets. - -config TRACEROUTE6 - bool "traceroute6" - default y - depends on FEATURE_IPV6 && TRACEROUTE - help - Utility to trace the route of IPv6 packets. - -config FEATURE_TRACEROUTE_VERBOSE - bool "Enable verbose output" - default y - depends on TRACEROUTE - help - Add some verbosity to traceroute. This includes among other things - hostnames and ICMP response types. - -config FEATURE_TRACEROUTE_USE_ICMP - bool "Enable -I option (use ICMP instead of UDP)" - default y - depends on TRACEROUTE - help - Add option -I to use ICMP ECHO instead of UDP datagrams. - -config TUNCTL - bool "tunctl" - default y - select PLATFORM_LINUX - help - tunctl creates or deletes tun devices. - -config FEATURE_TUNCTL_UG - bool "Support owner:group assignment" - default y - depends on TUNCTL - help - Allow to specify owner and group of newly created interface. - 340 bytes of pure bloat. Say no here. - source networking/udhcp/Config.in config IFUPDOWN_UDHCPC_CMD_OPTIONS @@ -834,31 +69,4 @@ config IFUPDOWN_UDHCPC_CMD_OPTIONS Intended to alter options not available in /etc/network/interfaces. (IE: --syslog --background etc...) -config UDPSVD - bool "udpsvd" - default y - help - udpsvd listens on an UDP port and runs a program for each new - connection. - -config VCONFIG - bool "vconfig" - default y - select PLATFORM_LINUX - help - Creates, removes, and configures VLAN interfaces - -config ZCIP - bool "zcip" - default y - select PLATFORM_LINUX - select FEATURE_SYSLOG - help - ZCIP provides ZeroConf IPv4 address selection, according to RFC 3927. - It's a daemon that allocates and defends a dynamically assigned - address on the 169.254/16 network, requiring no system administrator. - - See http://www.zeroconf.org for further details, and "zcip.script" - in the busybox examples. - endmenu diff --git a/networking/Kbuild.src b/networking/Kbuild.src index 4ad750283..6b4fb7470 100644 --- a/networking/Kbuild.src +++ b/networking/Kbuild.src @@ -7,39 +7,3 @@ lib-y:= INSERT -lib-$(CONFIG_ARP) += arp.o interface.o -lib-$(CONFIG_ARPING) += arping.o -lib-$(CONFIG_BRCTL) += brctl.o -lib-$(CONFIG_DNSD) += dnsd.o -lib-$(CONFIG_ETHER_WAKE) += ether-wake.o -lib-$(CONFIG_FAKEIDENTD) += isrv_identd.o isrv.o -lib-$(CONFIG_FTPD) += ftpd.o -lib-$(CONFIG_FTPGET) += ftpgetput.o -lib-$(CONFIG_FTPPUT) += ftpgetput.o -lib-$(CONFIG_HTTPD) += httpd.o -lib-$(CONFIG_IFCONFIG) += ifconfig.o interface.o -lib-$(CONFIG_IFENSLAVE) += ifenslave.o interface.o -lib-$(CONFIG_IFPLUGD) += ifplugd.o -lib-$(CONFIG_INETD) += inetd.o -lib-$(CONFIG_IP) += ip.o -lib-$(CONFIG_IPCALC) += ipcalc.o -lib-$(CONFIG_NAMEIF) += nameif.o -lib-$(CONFIG_NC) += nc.o -lib-$(CONFIG_NETSTAT) += netstat.o -lib-$(CONFIG_NSLOOKUP) += nslookup.o -lib-$(CONFIG_NTPD) += ntpd.o -lib-$(CONFIG_PSCAN) += pscan.o -lib-$(CONFIG_ROUTE) += route.o -lib-$(CONFIG_SLATTACH) += slattach.o -lib-$(CONFIG_TC) += tc.o -lib-$(CONFIG_TELNET) += telnet.o -lib-$(CONFIG_TELNETD) += telnetd.o -lib-$(CONFIG_TFTP) += tftp.o -lib-$(CONFIG_TFTPD) += tftp.o -lib-$(CONFIG_TRACEROUTE) += traceroute.o -lib-$(CONFIG_TUNCTL) += tunctl.o -lib-$(CONFIG_VCONFIG) += vconfig.o -lib-$(CONFIG_ZCIP) += zcip.o - -lib-$(CONFIG_TCPSVD) += tcpudp.o tcpudp_perhost.o -lib-$(CONFIG_UDPSVD) += tcpudp.o tcpudp_perhost.o diff --git a/networking/arp.c b/networking/arp.c index 69a5816eb..a62a3761c 100644 --- a/networking/arp.c +++ b/networking/arp.c @@ -12,6 +12,16 @@ * * modified for getopt32 by Arne Bernin */ +//config:config ARP +//config: bool "arp" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Manipulate the system ARP cache. + +//applet:IF_ARP(APPLET(arp, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_ARP) += arp.o interface.o //usage:#define arp_trivial_usage //usage: "\n[-vn] [-H HWTYPE] [-i IF] -a [HOSTNAME]" diff --git a/networking/arping.c b/networking/arping.c index 46bd65e36..5bfeb1b45 100644 --- a/networking/arping.c +++ b/networking/arping.c @@ -5,6 +5,17 @@ * Author: Alexey Kuznetsov * Busybox port: Nick Fedchik */ +//config:config ARPING +//config: bool "arping" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Ping hosts by ARP packets. +//config: + +//applet:IF_ARPING(APPLET(arping, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_ARPING) += arping.o //usage:#define arping_trivial_usage //usage: "[-fqbDUA] [-c CNT] [-w TIMEOUT] [-I IFACE] [-s SRC_IP] DST_IP" diff --git a/networking/brctl.c b/networking/brctl.c index b7320966a..35876896e 100644 --- a/networking/brctl.c +++ b/networking/brctl.c @@ -12,6 +12,36 @@ /* This applet currently uses only the ioctl interface and no sysfs at all. * At the time of this writing this was considered a feature. */ +//config:config BRCTL +//config: bool "brctl" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Manage ethernet bridges. +//config: Supports addbr/delbr and addif/delif. +//config: +//config:config FEATURE_BRCTL_FANCY +//config: bool "Fancy options" +//config: default y +//config: depends on BRCTL +//config: help +//config: Add support for extended option like: +//config: setageing, setfd, sethello, setmaxage, +//config: setpathcost, setportprio, setbridgeprio, +//config: stp +//config: This adds about 600 bytes. +//config: +//config:config FEATURE_BRCTL_SHOW +//config: bool "Support show" +//config: default y +//config: depends on BRCTL && FEATURE_BRCTL_FANCY +//config: help +//config: Add support for option which prints the current config: +//config: show + +//applet:IF_BRCTL(APPLET(brctl, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_BRCTL) += brctl.o //usage:#define brctl_trivial_usage //usage: "COMMAND [BRIDGE [INTERFACE]]" diff --git a/networking/dnsd.c b/networking/dnsd.c index 923ad6bc6..7be90018d 100644 --- a/networking/dnsd.c +++ b/networking/dnsd.c @@ -16,6 +16,15 @@ * Some bugfix and minor changes was applied by Roberto A. Foglietta who made * the first porting of oao' scdns to busybox also. */ +//config:config DNSD +//config: bool "dnsd" +//config: default y +//config: help +//config: Small and static DNS server daemon. + +//applet:IF_DNSD(APPLET(dnsd, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_DNSD) += dnsd.o //usage:#define dnsd_trivial_usage //usage: "[-dvs] [-c CONFFILE] [-t TTL_SEC] [-p PORT] [-i ADDR]" diff --git a/networking/ether-wake.c b/networking/ether-wake.c index c38547dda..d7d691772 100644 --- a/networking/ether-wake.c +++ b/networking/ether-wake.c @@ -63,6 +63,16 @@ * doing so only works with adapters configured for unicast+broadcast Rx * filter. That configuration consumes more power. */ +//config:config ETHER_WAKE +//config: bool "ether-wake" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Send a magic packet to wake up sleeping machines. + +//applet:IF_ETHER_WAKE(APPLET_ODDNAME(ether-wake, ether_wake, BB_DIR_USR_SBIN, BB_SUID_DROP, ether_wake)) + +//kbuild:lib-$(CONFIG_ETHER_WAKE) += ether-wake.o //usage:#define ether_wake_trivial_usage //usage: "[-b] [-i IFACE] [-p aa:bb:cc:dd[:ee:ff]/a.b.c.d] MAC" diff --git a/networking/ftpd.c b/networking/ftpd.c index 4cbb9b6fe..d4e6c27ce 100644 --- a/networking/ftpd.c +++ b/networking/ftpd.c @@ -11,6 +11,40 @@ * * You have to run this daemon via inetd. */ +//config:config FTPD +//config: bool "ftpd" +//config: default y +//config: help +//config: simple FTP daemon. You have to run it via inetd. +//config: +//config:config FEATURE_FTP_WRITE +//config: bool "Enable upload commands" +//config: default y +//config: depends on FTPD +//config: help +//config: Enable all kinds of FTP upload commands (-w option) +//config: +//config:config FEATURE_FTPD_ACCEPT_BROKEN_LIST +//config: bool "Enable workaround for RFC-violating clients" +//config: default y +//config: depends on FTPD +//config: help +//config: Some ftp clients (among them KDE's Konqueror) issue illegal +//config: "LIST -l" requests. This option works around such problems. +//config: It might prevent you from listing files starting with "-" and +//config: it increases the code size by ~40 bytes. +//config: Most other ftp servers seem to behave similar to this. +//config: +//config:config FEATURE_FTP_AUTHENTICATION +//config: bool "Enable authentication" +//config: default y +//config: depends on FTPD +//config: help +//config: Enable basic system login as seen in telnet etc. + +//applet:IF_FTPD(APPLET(ftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FTPD) += ftpd.o //usage:#define ftpd_trivial_usage //usage: "[-wvS] [-t N] [-T N] [DIR]" diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c index 91fb4569a..40a3271ab 100644 --- a/networking/ftpgetput.c +++ b/networking/ftpgetput.c @@ -12,6 +12,30 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config FTPGET +//config: bool "ftpget" +//config: default y +//config: help +//config: Retrieve a remote file via FTP. +//config: +//config:config FTPPUT +//config: bool "ftpput" +//config: default y +//config: help +//config: Store a remote file via FTP. +//config: +//config:config FEATURE_FTPGETPUT_LONG_OPTIONS +//config: bool "Enable long options in ftpget/ftpput" +//config: default y +//config: depends on LONG_OPTS && (FTPGET || FTPPUT) +//config: help +//config: Support long options for the ftpget/ftpput applet. + +//applet:IF_FTPGET(APPLET_ODDNAME(ftpget, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpget)) +//applet:IF_FTPPUT(APPLET_ODDNAME(ftpput, ftpgetput, BB_DIR_USR_BIN, BB_SUID_DROP, ftpput)) + +//kbuild:lib-$(CONFIG_FTPGET) += ftpgetput.o +//kbuild:lib-$(CONFIG_FTPPUT) += ftpgetput.o //usage:#define ftpget_trivial_usage //usage: "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE" diff --git a/networking/httpd.c b/networking/httpd.c index c20642e11..d301d598d 100644 --- a/networking/httpd.c +++ b/networking/httpd.c @@ -98,6 +98,128 @@ * */ /* TODO: use TCP_CORK, parse_config() */ +//config:config HTTPD +//config: bool "httpd" +//config: default y +//config: help +//config: Serve web pages via an HTTP server. +//config: +//config:config FEATURE_HTTPD_RANGES +//config: bool "Support 'Ranges:' header" +//config: default y +//config: depends on HTTPD +//config: help +//config: Makes httpd emit "Accept-Ranges: bytes" header and understand +//config: "Range: bytes=NNN-[MMM]" header. Allows for resuming interrupted +//config: downloads, seeking in multimedia players etc. +//config: +//config:config FEATURE_HTTPD_SETUID +//config: bool "Enable -u option" +//config: default y +//config: depends on HTTPD +//config: help +//config: This option allows the server to run as a specific user +//config: rather than defaulting to the user that starts the server. +//config: Use of this option requires special privileges to change to a +//config: different user. +//config: +//config:config FEATURE_HTTPD_BASIC_AUTH +//config: bool "Enable Basic http Authentication" +//config: default y +//config: depends on HTTPD +//config: help +//config: Utilizes password settings from /etc/httpd.conf for basic +//config: authentication on a per url basis. +//config: Example for httpd.conf file: +//config: /adm:toor:PaSsWd +//config: +//config:config FEATURE_HTTPD_AUTH_MD5 +//config: bool "Support MD5 crypted passwords for http Authentication" +//config: default y +//config: depends on FEATURE_HTTPD_BASIC_AUTH +//config: help +//config: Enables encrypted passwords, and wildcard user/passwords +//config: in httpd.conf file. +//config: User '*' means 'any system user name is ok', +//config: password of '*' means 'use system password for this user' +//config: Examples: +//config: /adm:toor:$1$P/eKnWXS$aI1aPGxT.dJD5SzqAKWrF0 +//config: /adm:root:* +//config: /wiki:*:* +//config: +//config:config FEATURE_HTTPD_CGI +//config: bool "Support Common Gateway Interface (CGI)" +//config: default y +//config: depends on HTTPD +//config: help +//config: This option allows scripts and executables to be invoked +//config: when specific URLs are requested. +//config: +//config:config FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR +//config: bool "Support for running scripts through an interpreter" +//config: default y +//config: depends on FEATURE_HTTPD_CGI +//config: help +//config: This option enables support for running scripts through an +//config: interpreter. Turn this on if you want PHP scripts to work +//config: properly. You need to supply an additional line in your +//config: httpd.conf file: +//config: *.php:/path/to/your/php +//config: +//config:config FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV +//config: bool "Set REMOTE_PORT environment variable for CGI" +//config: default y +//config: depends on FEATURE_HTTPD_CGI +//config: help +//config: Use of this option can assist scripts in generating +//config: references that contain a unique port number. +//config: +//config:config FEATURE_HTTPD_ENCODE_URL_STR +//config: bool "Enable -e option (useful for CGIs written as shell scripts)" +//config: default y +//config: depends on HTTPD +//config: help +//config: This option allows html encoding of arbitrary strings for display +//config: by the browser. Output goes to stdout. +//config: For example, httpd -e "" produces +//config: "<Hello World>". +//config: +//config:config FEATURE_HTTPD_ERROR_PAGES +//config: bool "Support for custom error pages" +//config: default y +//config: depends on HTTPD +//config: help +//config: This option allows you to define custom error pages in +//config: the configuration file instead of the default HTTP status +//config: error pages. For instance, if you add the line: +//config: E404:/path/e404.html +//config: in the config file, the server will respond the specified +//config: '/path/e404.html' file instead of the terse '404 NOT FOUND' +//config: message. +//config: +//config:config FEATURE_HTTPD_PROXY +//config: bool "Support for reverse proxy" +//config: default y +//config: depends on HTTPD +//config: help +//config: This option allows you to define URLs that will be forwarded +//config: to another HTTP server. To setup add the following line to the +//config: configuration file +//config: P:/url/:http://hostname[:port]/new/path/ +//config: Then a request to /url/myfile will be forwarded to +//config: http://hostname[:port]/new/path/myfile. +//config: +//config:config FEATURE_HTTPD_GZIP +//config: bool "Support for GZIP content encoding" +//config: default y +//config: depends on HTTPD +//config: help +//config: Makes httpd send files using GZIP content encoding if the +//config: client supports it and a pre-compressed .gz exists. + +//applet:IF_HTTPD(APPLET(httpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_HTTPD) += httpd.o //usage:#define httpd_trivial_usage //usage: "[-ifv[v]]" diff --git a/networking/ifconfig.c b/networking/ifconfig.c index 8984b0207..9e16936d8 100644 --- a/networking/ifconfig.c +++ b/networking/ifconfig.c @@ -25,6 +25,57 @@ * 2002-04-20 * IPV6 support added by Bart Visscher */ +//config:config IFCONFIG +//config: bool "ifconfig" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Ifconfig is used to configure the kernel-resident network interfaces. +//config: +//config:config FEATURE_IFCONFIG_STATUS +//config: bool "Enable status reporting output (+7k)" +//config: default y +//config: depends on IFCONFIG +//config: help +//config: If ifconfig is called with no arguments it will display the status +//config: of the currently active interfaces. +//config: +//config:config FEATURE_IFCONFIG_SLIP +//config: bool "Enable slip-specific options \"keepalive\" and \"outfill\"" +//config: default y +//config: depends on IFCONFIG +//config: help +//config: Allow "keepalive" and "outfill" support for SLIP. If you're not +//config: planning on using serial lines, leave this unchecked. +//config: +//config:config FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ +//config: bool "Enable options \"mem_start\", \"io_addr\", and \"irq\"" +//config: default y +//config: depends on IFCONFIG +//config: help +//config: Allow the start address for shared memory, start address for I/O, +//config: and/or the interrupt line used by the specified device. +//config: +//config:config FEATURE_IFCONFIG_HW +//config: bool "Enable option \"hw\" (ether only)" +//config: default y +//config: depends on IFCONFIG +//config: help +//config: Set the hardware address of this interface, if the device driver +//config: supports this operation. Currently, we only support the 'ether' +//config: class. +//config: +//config:config FEATURE_IFCONFIG_BROADCAST_PLUS +//config: bool "Set the broadcast automatically" +//config: default y +//config: depends on IFCONFIG +//config: help +//config: Setting this will make ifconfig attempt to find the broadcast +//config: automatically if the value '+' is used. + +//applet:IF_IFCONFIG(APPLET(ifconfig, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_IFCONFIG) += ifconfig.o interface.o //usage:#define ifconfig_trivial_usage //usage: IF_FEATURE_IFCONFIG_STATUS("[-a]") " interface [address]" diff --git a/networking/ifenslave.c b/networking/ifenslave.c index 6b234adee..1cb765e23 100644 --- a/networking/ifenslave.c +++ b/networking/ifenslave.c @@ -97,6 +97,17 @@ * - Code cleanup and style changes * set version to 1.1.0 */ +//config:config IFENSLAVE +//config: bool "ifenslave" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Userspace application to bind several interfaces +//config: to a logical interface (use with kernel bonding driver). + +//applet:IF_IFENSLAVE(APPLET(ifenslave, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_IFENSLAVE) += ifenslave.o interface.o //usage:#define ifenslave_trivial_usage //usage: "[-cdf] MASTER_IFACE SLAVE_IFACE..." diff --git a/networking/ifplugd.c b/networking/ifplugd.c index 029cba147..4f8a274b0 100644 --- a/networking/ifplugd.c +++ b/networking/ifplugd.c @@ -6,6 +6,16 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config IFPLUGD +//config: bool "ifplugd" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Network interface plug detection daemon. + +//applet:IF_IFPLUGD(APPLET(ifplugd, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_IFPLUGD) += ifplugd.o //usage:#define ifplugd_trivial_usage //usage: "[OPTIONS]" diff --git a/networking/inetd.c b/networking/inetd.c index f9295e38b..4d0ab2e0d 100644 --- a/networking/inetd.c +++ b/networking/inetd.c @@ -153,6 +153,59 @@ * setgid(specified group) * setuid() */ +//config:config INETD +//config: bool "inetd" +//config: default y +//config: select FEATURE_SYSLOG +//config: help +//config: Internet superserver daemon +//config: +//config:config FEATURE_INETD_SUPPORT_BUILTIN_ECHO +//config: bool "Support echo service" +//config: default y +//config: depends on INETD +//config: help +//config: Echo received data internal inetd service +//config: +//config:config FEATURE_INETD_SUPPORT_BUILTIN_DISCARD +//config: bool "Support discard service" +//config: default y +//config: depends on INETD +//config: help +//config: Internet /dev/null internal inetd service +//config: +//config:config FEATURE_INETD_SUPPORT_BUILTIN_TIME +//config: bool "Support time service" +//config: default y +//config: depends on INETD +//config: help +//config: Return 32 bit time since 1900 internal inetd service +//config: +//config:config FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME +//config: bool "Support daytime service" +//config: default y +//config: depends on INETD +//config: help +//config: Return human-readable time internal inetd service +//config: +//config:config FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN +//config: bool "Support chargen service" +//config: default y +//config: depends on INETD +//config: help +//config: Familiar character generator internal inetd service +//config: +//config:config FEATURE_INETD_RPC +//config: bool "Support RPC services" +//config: default n # very rarely used, and needs Sun RPC support in libc +//config: depends on INETD +//config: select FEATURE_HAVE_RPC +//config: help +//config: Support Sun-RPC based services + +//applet:IF_INETD(APPLET(inetd, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_INETD) += inetd.o //usage:#define inetd_trivial_usage //usage: "[-fe] [-q N] [-R N] [CONFFILE]" diff --git a/networking/ip.c b/networking/ip.c index ddfe74e9c..99f150e61 100644 --- a/networking/ip.c +++ b/networking/ip.c @@ -8,6 +8,130 @@ * Rani Assaf 980929: resolve addresses * Bernhard Reutner-Fischer rewrote to use index_in_substr_array */ +//config:config IP +//config: bool "ip" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The "ip" applet is a TCP/IP interface configuration and routing +//config: utility. You generally don't need "ip" to use busybox with +//config: TCP/IP. +//config: +//config:config FEATURE_IP_ADDRESS +//config: bool "ip address" +//config: default y +//config: depends on IP +//config: help +//config: Address manipulation support for the "ip" applet. +//config: +//config:config FEATURE_IP_LINK +//config: bool "ip link" +//config: default y +//config: depends on IP +//config: help +//config: Configure network devices with "ip". +//config: +//config:config FEATURE_IP_ROUTE +//config: bool "ip route" +//config: default y +//config: depends on IP +//config: help +//config: Add support for routing table management to "ip". +//config: +//config:config FEATURE_IP_ROUTE_DIR +//config: string "ip route configuration directory" +//config: default "/etc/iproute2" +//config: depends on FEATURE_IP_ROUTE +//config: help +//config: Location of the "ip" applet routing configuration. +//config: +//config:config FEATURE_IP_TUNNEL +//config: bool "ip tunnel" +//config: default y +//config: depends on IP +//config: help +//config: Add support for tunneling commands to "ip". +//config: +//config:config FEATURE_IP_RULE +//config: bool "ip rule" +//config: default y +//config: depends on IP +//config: help +//config: Add support for rule commands to "ip". +//config: +//config:config FEATURE_IP_NEIGH +//config: bool "ip neighbor" +//config: default y +//config: depends on IP +//config: help +//config: Add support for neighbor commands to "ip". +//config: +//config:config FEATURE_IP_SHORT_FORMS +//config: bool "Support short forms of ip commands" +//config: default y +//config: depends on IP +//config: help +//config: Also support short-form of ip commands: +//config: ip addr -> ipaddr +//config: ip link -> iplink +//config: ip route -> iproute +//config: ip tunnel -> iptunnel +//config: ip rule -> iprule +//config: ip neigh -> ipneigh +//config: +//config: Say N unless you desparately need the short form of the ip +//config: object commands. +//config: +//config:config FEATURE_IP_RARE_PROTOCOLS +//config: bool "Support displaying rarely used link types" +//config: default n +//config: depends on IP +//config: help +//config: If you are not going to use links of type "frad", "econet", +//config: "bif" etc, you probably don't need to enable this. +//config: Ethernet, wireless, infrared, ppp/slip, ip tunnelling +//config: link types are supported without this option selected. +//config: +//config:config IPADDR +//config: bool +//config: default y +//config: depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_ADDRESS +//config: +//config:config IPLINK +//config: bool +//config: default y +//config: depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_LINK +//config: +//config:config IPROUTE +//config: bool +//config: default y +//config: depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_ROUTE +//config: +//config:config IPTUNNEL +//config: bool +//config: default y +//config: depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_TUNNEL +//config: +//config:config IPRULE +//config: bool +//config: default y +//config: depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_RULE +//config: +//config:config IPNEIGH +//config: bool +//config: default y +//config: depends on FEATURE_IP_SHORT_FORMS && FEATURE_IP_NEIGH + +//applet:#if ENABLE_FEATURE_IP_ADDRESS || ENABLE_FEATURE_IP_ROUTE || ENABLE_FEATURE_IP_LINK || ENABLE_FEATURE_IP_TUNNEL || ENABLE_FEATURE_IP_RULE +//applet:IF_IP(APPLET(ip, BB_DIR_SBIN, BB_SUID_DROP)) +//applet:#endif +//applet:IF_IPADDR(APPLET(ipaddr, BB_DIR_SBIN, BB_SUID_DROP)) +//applet:IF_IPLINK(APPLET(iplink, BB_DIR_SBIN, BB_SUID_DROP)) +//applet:IF_IPROUTE(APPLET(iproute, BB_DIR_SBIN, BB_SUID_DROP)) +//applet:IF_IPRULE(APPLET(iprule, BB_DIR_SBIN, BB_SUID_DROP)) +//applet:IF_IPTUNNEL(APPLET(iptunnel, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_IP) += ip.o /* would need to make the " | " optional depending on more than one selected: */ //usage:#define ip_trivial_usage diff --git a/networking/ipcalc.c b/networking/ipcalc.c index f4bacd7dc..21219424f 100644 --- a/networking/ipcalc.c +++ b/networking/ipcalc.c @@ -11,6 +11,31 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config IPCALC +//config: bool "ipcalc" +//config: default y +//config: help +//config: ipcalc takes an IP address and netmask and calculates the +//config: resulting broadcast, network, and host range. +//config: +//config:config FEATURE_IPCALC_FANCY +//config: bool "Fancy IPCALC, more options, adds 1 kbyte" +//config: default y +//config: depends on IPCALC +//config: help +//config: Adds the options hostname, prefix and silent to the output of +//config: "ipcalc". +//config: +//config:config FEATURE_IPCALC_LONG_OPTIONS +//config: bool "Enable long options" +//config: default y +//config: depends on IPCALC && LONG_OPTS +//config: help +//config: Support long options for the ipcalc applet. + +//applet:IF_IPCALC(APPLET(ipcalc, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_IPCALC) += ipcalc.o //usage:#define ipcalc_trivial_usage //usage: "[OPTIONS] ADDRESS" diff --git a/networking/isrv_identd.c b/networking/isrv_identd.c index 8a15926e5..219c64b66 100644 --- a/networking/isrv_identd.c +++ b/networking/isrv_identd.c @@ -6,6 +6,17 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config FAKEIDENTD +//config: bool "fakeidentd" +//config: default y +//config: select FEATURE_SYSLOG +//config: help +//config: fakeidentd listens on the ident port and returns a predefined +//config: fake value on any query. + +//applet:IF_FAKEIDENTD(APPLET(fakeidentd, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FAKEIDENTD) += isrv_identd.o isrv.o //usage:#define fakeidentd_trivial_usage //usage: "[-fiw] [-b ADDR] [STRING]" diff --git a/networking/nameif.c b/networking/nameif.c index 9b18a6d16..cffd5bfde 100644 --- a/networking/nameif.c +++ b/networking/nameif.c @@ -40,6 +40,10 @@ //config: new_interface_name mac=00:80:C8:38:91:B5 //config: new_interface_name 00:80:C8:38:91:B5 +//applet:IF_NAMEIF(APPLET(nameif, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_NAMEIF) += nameif.o + //usage:#define nameif_trivial_usage //usage: IF_NOT_FEATURE_NAMEIF_EXTENDED( //usage: "[-s] [-c FILE] [IFNAME HWADDR]..." diff --git a/networking/nc.c b/networking/nc.c index 13a9b48a8..1b70434ac 100644 --- a/networking/nc.c +++ b/networking/nc.c @@ -6,10 +6,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -#include "libbb.h" -#include "common_bufsiz.h" - //config:config NC //config: bool "nc" //config: default y @@ -43,6 +39,12 @@ //config: -s ADDR, -n, -u, -v, -o FILE, -z options, but loses //config: busybox-specific extensions: -f FILE. +//applet:IF_NC(APPLET(nc, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_NC) += nc.o + +#include "libbb.h" +#include "common_bufsiz.h" #if ENABLE_NC_110_COMPAT # include "nc_bloaty.c" #else diff --git a/networking/netstat.c b/networking/netstat.c index 2196d42f7..90da6cdb8 100644 --- a/networking/netstat.c +++ b/networking/netstat.c @@ -13,6 +13,32 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config NETSTAT +//config: bool "netstat" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: netstat prints information about the Linux networking subsystem. +//config: +//config:config FEATURE_NETSTAT_WIDE +//config: bool "Enable wide netstat output" +//config: default y +//config: depends on NETSTAT +//config: help +//config: Add support for wide columns. Useful when displaying IPv6 addresses +//config: (-W option). +//config: +//config:config FEATURE_NETSTAT_PRG +//config: bool "Enable PID/Program name output" +//config: default y +//config: depends on NETSTAT +//config: help +//config: Add support for -p flag to print out PID and program name. +//config: +700 bytes of code. + +//applet:IF_NETSTAT(APPLET(netstat, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_NETSTAT) += netstat.o #include "libbb.h" #include "inet_common.h" diff --git a/networking/nslookup.c b/networking/nslookup.c index dd4b1ffed..8e3c8fed9 100644 --- a/networking/nslookup.c +++ b/networking/nslookup.c @@ -10,6 +10,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config NSLOOKUP +//config: bool "nslookup" +//config: default y +//config: help +//config: nslookup is a tool to query Internet name servers. + +//applet:IF_NSLOOKUP(APPLET(nslookup, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_NSLOOKUP) += nslookup.o //usage:#define nslookup_trivial_usage //usage: "[HOST] [SERVER]" diff --git a/networking/ntpd.c b/networking/ntpd.c index 8ca62cf1b..b7fa5dce9 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c @@ -40,6 +40,32 @@ * purpose. It is provided "as is" without express or implied warranty. *********************************************************************** */ +//config:config NTPD +//config: bool "ntpd" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The NTP client/server daemon. +//config: +//config:config FEATURE_NTPD_SERVER +//config: bool "Make ntpd usable as a NTP server" +//config: default y +//config: depends on NTPD +//config: help +//config: Make ntpd usable as a NTP server. If you disable this option +//config: ntpd will be usable only as a NTP client. +//config: +//config:config FEATURE_NTPD_CONF +//config: bool "Make ntpd understand /etc/ntp.conf" +//config: default y +//config: depends on NTPD +//config: help +//config: Make ntpd look in /etc/ntp.conf for peers. Only "server address" +//config: is supported. + +//applet:IF_NTPD(APPLET(ntpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_NTPD) += ntpd.o //usage:#define ntpd_trivial_usage //usage: "[-dnqNw"IF_FEATURE_NTPD_SERVER("l -I IFACE")"] [-S PROG] [-p PEER]..." diff --git a/networking/pscan.c b/networking/pscan.c index 72ed8cdb5..0893c3577 100644 --- a/networking/pscan.c +++ b/networking/pscan.c @@ -5,6 +5,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config PSCAN +//config: bool "pscan" +//config: default y +//config: help +//config: Simple network port scanner. + +//applet:IF_PSCAN(APPLET(pscan, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_PSCAN) += pscan.o //usage:#define pscan_trivial_usage //usage: "[-cb] [-p MIN_PORT] [-P MAX_PORT] [-t TIMEOUT] [-T MIN_RTT] HOST" diff --git a/networking/route.c b/networking/route.c index 102a6ec67..7dc2b5a3d 100644 --- a/networking/route.c +++ b/networking/route.c @@ -24,6 +24,16 @@ * Rewritten to fix several bugs, add additional error checking, and * remove ridiculous amounts of bloat. */ +//config:config ROUTE +//config: bool "route" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Route displays or manipulates the kernel's IP routing tables. + +//applet:IF_ROUTE(APPLET(route, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_ROUTE) += route.o //usage:#define route_trivial_usage //usage: "[{add|del|delete}]" diff --git a/networking/slattach.c b/networking/slattach.c index 2d1305e32..9267eb1d0 100644 --- a/networking/slattach.c +++ b/networking/slattach.c @@ -12,6 +12,17 @@ * * - The -F options allows disabling of RTS/CTS flow control. */ +//config:config SLATTACH +//config: bool "slattach" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: slattach is a small utility to attach network interfaces to serial +//config: lines. + +//applet:IF_SLATTACH(APPLET(slattach, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SLATTACH) += slattach.o //usage:#define slattach_trivial_usage //usage: "[-cehmLF] [-s SPEED] [-p PROTOCOL] DEVICE" diff --git a/networking/tc.c b/networking/tc.c index d0bcbdeaa..e10200c1e 100644 --- a/networking/tc.c +++ b/networking/tc.c @@ -6,6 +6,7 @@ * * Bernhard Reutner-Fischer adjusted for busybox */ +//kbuild:lib-$(CONFIG_TC) += tc.o //usage:#define tc_trivial_usage /* //usage: "[OPTIONS] OBJECT CMD [dev STRING]" */ diff --git a/networking/tcpudp.c b/networking/tcpudp.c index b27cf3ea9..94c89b9ef 100644 --- a/networking/tcpudp.c +++ b/networking/tcpudp.c @@ -28,6 +28,25 @@ * with wrong source IP... * - don't know how to retrieve ORIGDST for udp. */ +//config:config TCPSVD +//config: bool "tcpsvd" +//config: default y +//config: help +//config: tcpsvd listens on a TCP port and runs a program for each new +//config: connection. +//config: +//config:config UDPSVD +//config: bool "udpsvd" +//config: default y +//config: help +//config: udpsvd listens on an UDP port and runs a program for each new +//config: connection. + +//applet:IF_TCPSVD(APPLET_ODDNAME(tcpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, tcpsvd)) +//applet:IF_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, udpsvd)) + +//kbuild:lib-$(CONFIG_TCPSVD) += tcpudp.o tcpudp_perhost.o +//kbuild:lib-$(CONFIG_UDPSVD) += tcpudp.o tcpudp_perhost.o //usage:#define tcpsvd_trivial_usage //usage: "[-hEv] [-c N] [-C N[:MSG]] [-b N] [-u USER] [-l NAME] IP PORT PROG" diff --git a/networking/telnet.c b/networking/telnet.c index 1a6986b94..f520fe1dd 100644 --- a/networking/telnet.c +++ b/networking/telnet.c @@ -20,6 +20,35 @@ * by Fernando Silveira * */ +//config:config TELNET +//config: bool "telnet" +//config: default y +//config: help +//config: Telnet is an interface to the TELNET protocol, but is also commonly +//config: used to test other simple protocols. +//config: +//config:config FEATURE_TELNET_TTYPE +//config: bool "Pass TERM type to remote host" +//config: default y +//config: depends on TELNET +//config: help +//config: Setting this option will forward the TERM environment variable to the +//config: remote host you are connecting to. This is useful to make sure that +//config: things like ANSI colors and other control sequences behave. +//config: +//config:config FEATURE_TELNET_AUTOLOGIN +//config: bool "Pass USER type to remote host" +//config: default y +//config: depends on TELNET +//config: help +//config: Setting this option will forward the USER environment variable to the +//config: remote host you are connecting to. This is useful when you need to +//config: log into a machine without telling the username (autologin). This +//config: option enables `-a' and `-l USER' arguments. + +//applet:IF_TELNET(APPLET(telnet, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_TELNET) += telnet.o //usage:#if ENABLE_FEATURE_TELNET_AUTOLOGIN //usage:#define telnet_trivial_usage diff --git a/networking/telnetd.c b/networking/telnetd.c index 303ef1be7..f06e9583e 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c @@ -20,6 +20,78 @@ * Vladimir Oleynik 2001 * Set process group corrections, initial busybox port */ +//config:config TELNETD +//config: bool "telnetd" +//config: default y +//config: select FEATURE_SYSLOG +//config: help +//config: A daemon for the TELNET protocol, allowing you to log onto the host +//config: running the daemon. Please keep in mind that the TELNET protocol +//config: sends passwords in plain text. If you can't afford the space for an +//config: SSH daemon and you trust your network, you may say 'y' here. As a +//config: more secure alternative, you should seriously consider installing the +//config: very small Dropbear SSH daemon instead: +//config: http://matt.ucc.asn.au/dropbear/dropbear.html +//config: +//config: Note that for busybox telnetd to work you need several things: +//config: First of all, your kernel needs: +//config: CONFIG_UNIX98_PTYS=y +//config: +//config: Next, you need a /dev/pts directory on your root filesystem: +//config: +//config: $ ls -ld /dev/pts +//config: drwxr-xr-x 2 root root 0 Sep 23 13:21 /dev/pts/ +//config: +//config: Next you need the pseudo terminal master multiplexer /dev/ptmx: +//config: +//config: $ ls -la /dev/ptmx +//config: crw-rw-rw- 1 root tty 5, 2 Sep 23 13:55 /dev/ptmx +//config: +//config: Any /dev/ttyp[0-9]* files you may have can be removed. +//config: Next, you need to mount the devpts filesystem on /dev/pts using: +//config: +//config: mount -t devpts devpts /dev/pts +//config: +//config: You need to be sure that busybox has LOGIN and +//config: FEATURE_SUID enabled. And finally, you should make +//config: certain that Busybox has been installed setuid root: +//config: +//config: chown root.root /bin/busybox +//config: chmod 4755 /bin/busybox +//config: +//config: with all that done, telnetd _should_ work.... +//config: +//config:config FEATURE_TELNETD_STANDALONE +//config: bool "Support standalone telnetd (not inetd only)" +//config: default y +//config: depends on TELNETD +//config: help +//config: Selecting this will make telnetd able to run standalone. +//config: +//config:config FEATURE_TELNETD_INETD_WAIT +//config: bool "Support -w SEC option (inetd wait mode)" +//config: default y +//config: depends on FEATURE_TELNETD_STANDALONE +//config: help +//config: This option allows you to run telnetd in "inet wait" mode. +//config: Example inetd.conf line (note "wait", not usual "nowait"): +//config: +//config: telnet stream tcp wait root /bin/telnetd telnetd -w10 +//config: +//config: In this example, inetd passes _listening_ socket_ as fd 0 +//config: to telnetd when connection appears. +//config: telnetd will wait for connections until all existing +//config: connections are closed, and no new connections +//config: appear during 10 seconds. Then it exits, and inetd continues +//config: to listen for new connections. +//config: +//config: This option is rarely used. "tcp nowait" is much more usual +//config: way of running tcp services, including telnetd. +//config: You most probably want to say N here. + +//applet:IF_TELNETD(APPLET(telnetd, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_TELNETD) += telnetd.o //usage:#define telnetd_trivial_usage //usage: "[OPTIONS]" diff --git a/networking/tftp.c b/networking/tftp.c index e879c4674..ed8672025 100644 --- a/networking/tftp.c +++ b/networking/tftp.c @@ -18,6 +18,78 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config TFTP +//config: bool "tftp" +//config: default y +//config: help +//config: This enables the Trivial File Transfer Protocol client program. TFTP +//config: is usually used for simple, small transfers such as a root image +//config: for a network-enabled bootloader. +//config: +//config:config TFTPD +//config: bool "tftpd" +//config: default y +//config: help +//config: This enables the Trivial File Transfer Protocol server program. +//config: It expects that stdin is a datagram socket and a packet +//config: is already pending on it. It will exit after one transfer. +//config: In other words: it should be run from inetd in nowait mode, +//config: or from udpsvd. Example: "udpsvd -E 0 69 tftpd DIR" +//config: +//config:comment "Common options for tftp/tftpd" +//config: depends on TFTP || TFTPD +//config: +//config:config FEATURE_TFTP_GET +//config: bool "Enable 'tftp get' and/or tftpd upload code" +//config: default y +//config: depends on TFTP || TFTPD +//config: help +//config: Add support for the GET command within the TFTP client. This allows +//config: a client to retrieve a file from a TFTP server. +//config: Also enable upload support in tftpd, if tftpd is selected. +//config: +//config: Note: this option does _not_ make tftpd capable of download +//config: (the usual operation people need from it)! +//config: +//config:config FEATURE_TFTP_PUT +//config: bool "Enable 'tftp put' and/or tftpd download code" +//config: default y +//config: depends on TFTP || TFTPD +//config: help +//config: Add support for the PUT command within the TFTP client. This allows +//config: a client to transfer a file to a TFTP server. +//config: Also enable download support in tftpd, if tftpd is selected. +//config: +//config:config FEATURE_TFTP_BLOCKSIZE +//config: bool "Enable 'blksize' and 'tsize' protocol options" +//config: default y +//config: depends on TFTP || TFTPD +//config: help +//config: Allow tftp to specify block size, and tftpd to understand +//config: "blksize" and "tsize" options. +//config: +//config:config FEATURE_TFTP_PROGRESS_BAR +//config: bool "Enable tftp progress meter" +//config: default y +//config: depends on TFTP && FEATURE_TFTP_BLOCKSIZE +//config: help +//config: Show progress bar. +//config: +//config:config TFTP_DEBUG +//config: bool "Enable debug" +//config: default n +//config: depends on TFTP || TFTPD +//config: help +//config: Make tftp[d] print debugging messages on stderr. +//config: This is useful if you are diagnosing a bug in tftp[d]. + +//applet:#if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT +//applet:IF_TFTP(APPLET(tftp, BB_DIR_USR_BIN, BB_SUID_DROP)) +//applet:IF_TFTPD(APPLET(tftpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) +//applet:#endif + +//kbuild:lib-$(CONFIG_TFTP) += tftp.o +//kbuild:lib-$(CONFIG_TFTPD) += tftp.o //usage:#define tftp_trivial_usage //usage: "[OPTIONS] HOST [PORT]" diff --git a/networking/traceroute.c b/networking/traceroute.c index b9a9ca4bb..58a9b692a 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c @@ -209,6 +209,40 @@ * -- Van Jacobson (van@ee.lbl.gov) * Tue Dec 20 03:50:13 PST 1988 */ +//config:config TRACEROUTE +//config: bool "traceroute" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Utility to trace the route of IP packets. +//config: +//config:config TRACEROUTE6 +//config: bool "traceroute6" +//config: default y +//config: depends on FEATURE_IPV6 && TRACEROUTE +//config: help +//config: Utility to trace the route of IPv6 packets. +//config: +//config:config FEATURE_TRACEROUTE_VERBOSE +//config: bool "Enable verbose output" +//config: default y +//config: depends on TRACEROUTE +//config: help +//config: Add some verbosity to traceroute. This includes among other things +//config: hostnames and ICMP response types. +//config: +//config:config FEATURE_TRACEROUTE_USE_ICMP +//config: bool "Enable -I option (use ICMP instead of UDP)" +//config: default y +//config: depends on TRACEROUTE +//config: help +//config: Add option -I to use ICMP ECHO instead of UDP datagrams. + +/* Needs socket(AF_INET, SOCK_RAW, IPPROTO_ICMP), therefore BB_SUID_MAYBE: */ +//applet:IF_TRACEROUTE(APPLET(traceroute, BB_DIR_USR_BIN, BB_SUID_MAYBE)) +//applet:IF_TRACEROUTE6(APPLET(traceroute6, BB_DIR_USR_BIN, BB_SUID_MAYBE)) + +//kbuild:lib-$(CONFIG_TRACEROUTE) += traceroute.o //usage:#define traceroute_trivial_usage //usage: "[-"IF_TRACEROUTE6("46")"FIlnrv] [-f 1ST_TTL] [-m MAXTTL] [-q PROBES] [-p PORT]\n" diff --git a/networking/tunctl.c b/networking/tunctl.c index 941e8bbd3..fa904c2a9 100644 --- a/networking/tunctl.c +++ b/networking/tunctl.c @@ -9,6 +9,24 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config TUNCTL +//config: bool "tunctl" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: tunctl creates or deletes tun devices. +//config: +//config:config FEATURE_TUNCTL_UG +//config: bool "Support owner:group assignment" +//config: default y +//config: depends on TUNCTL +//config: help +//config: Allow to specify owner and group of newly created interface. +//config: 340 bytes of pure bloat. Say no here. + +//applet:IF_TUNCTL(APPLET(tunctl, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_TUNCTL) += tunctl.o //usage:#define tunctl_trivial_usage //usage: "[-f device] ([-t name] | -d name)" IF_FEATURE_TUNCTL_UG(" [-u owner] [-g group] [-b]") diff --git a/networking/vconfig.c b/networking/vconfig.c index 924b2f009..f3020409a 100644 --- a/networking/vconfig.c +++ b/networking/vconfig.c @@ -9,6 +9,17 @@ /* BB_AUDIT SUSv3 N/A */ +//config:config VCONFIG +//config: bool "vconfig" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Creates, removes, and configures VLAN interfaces + +//applet:IF_VCONFIG(APPLET(vconfig, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_VCONFIG) += vconfig.o + //usage:#define vconfig_trivial_usage //usage: "COMMAND [OPTIONS]" //usage:#define vconfig_full_usage "\n\n" diff --git a/networking/zcip.c b/networking/zcip.c index 47f3216a0..9122bd681 100644 --- a/networking/zcip.c +++ b/networking/zcip.c @@ -14,6 +14,22 @@ * routed at the IP level, though various proxies or bridges can * certainly be used. Its naming is built over multicast DNS. */ +//config:config ZCIP +//config: bool "zcip" +//config: default y +//config: select PLATFORM_LINUX +//config: select FEATURE_SYSLOG +//config: help +//config: ZCIP provides ZeroConf IPv4 address selection, according to RFC 3927. +//config: It's a daemon that allocates and defends a dynamically assigned +//config: address on the 169.254/16 network, requiring no system administrator. +//config: +//config: See http://www.zeroconf.org for further details, and "zcip.script" +//config: in the busybox examples. + +//applet:IF_ZCIP(APPLET(zcip, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_ZCIP) += zcip.o //#define DEBUG -- cgit v1.2.3-55-g6feb From 29e2c45a5b317556a890a86ca7780e589072151c Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Nov 2016 09:51:33 +0100 Subject: tc: consolidate its disabled bits Signed-off-by: Denys Vlasenko --- include/applets.src.h | 1 - networking/Config.src | 10 ---------- networking/tc.c | 17 ++++++++++++++++- 3 files changed, 16 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/applets.src.h b/include/applets.src.h index 3fd9ba06e..18baee155 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -206,7 +206,6 @@ IF_SUM(APPLET(sum, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_SWITCH_ROOT(APPLET(switch_root, BB_DIR_SBIN, BB_SUID_DROP)) IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac)) IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP)) -/* IF_TC(APPLET(tc, BB_DIR_SBIN, BB_SUID_DROP)) */ IF_TEE(APPLET(tee, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_TEST(APPLET_NOFORK(test, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) IF_TR(APPLET(tr, BB_DIR_USR_BIN, BB_SUID_DROP)) diff --git a/networking/Config.src b/networking/Config.src index 4d921884f..527bdd15d 100644 --- a/networking/Config.src +++ b/networking/Config.src @@ -48,16 +48,6 @@ config VERBOSE_RESOLUTION_ERRORS INSERT -#config TC -# bool "tc" -# default y -# help -# show / manipulate traffic control settings -# -#config FEATURE_TC_INGRESS -# def_bool n -# depends on TC - source networking/udhcp/Config.in config IFUPDOWN_UDHCPC_CMD_OPTIONS diff --git a/networking/tc.c b/networking/tc.c index e10200c1e..271d569e4 100644 --- a/networking/tc.c +++ b/networking/tc.c @@ -6,7 +6,22 @@ * * Bernhard Reutner-Fischer adjusted for busybox */ -//kbuild:lib-$(CONFIG_TC) += tc.o + +/* Was disabled in 2008 by Bernhard, not known why. +--//config:#config TC +--//config:# bool "tc" +--//config:# default y +--//config:# help +--//config:# Show / manipulate traffic control settings +--//config:# +--//config:#config FEATURE_TC_INGRESS +--//config:# default y +--//config:# depends on TC +-- +--//applet:IF_TC(APPLET(tc, BB_DIR_SBIN, BB_SUID_DROP)) +-- +--//kbuild:lib-$(CONFIG_TC) += tc.o +*/ //usage:#define tc_trivial_usage /* //usage: "[OPTIONS] OBJECT CMD [dev STRING]" */ -- cgit v1.2.3-55-g6feb From c19f7584e14522043da141189711c8db72dfbc90 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Nov 2016 09:58:03 +0100 Subject: Convert all mailutils/* applets to "new style" applet definitions Signed-off-by: Denys Vlasenko --- include/applets.src.h | 4 ---- mailutils/Config.src | 43 ------------------------------------------- mailutils/makemime.c | 7 +++++++ mailutils/popmaildir.c | 18 ++++++++++++++++++ mailutils/reformime.c | 15 +++++++++++++++ mailutils/sendmail.c | 7 +++++++ 6 files changed, 47 insertions(+), 47 deletions(-) (limited to 'include') diff --git a/include/applets.src.h b/include/applets.src.h index 18baee155..83f6237b2 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -144,7 +144,6 @@ IF_LOSETUP(APPLET(losetup, BB_DIR_SBIN, BB_SUID_DROP)) IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls)) IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_LSUSB(APPLET(lsusb, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_MAKEMIME(APPLET(makemime, BB_DIR_BIN, BB_SUID_DROP)) IF_MATCHPATHCON(APPLET(matchpathcon, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_MKDIR(APPLET_NOFORK(mkdir, mkdir, BB_DIR_BIN, BB_SUID_DROP, mkdir)) IF_MKFIFO(APPLET_NOEXEC(mkfifo, mkfifo, BB_DIR_USR_BIN, BB_SUID_DROP, mkfifo)) @@ -165,7 +164,6 @@ IF_OD(APPLET(od, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_OPENVT(APPLET(openvt, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_PARSE(APPLET(parse, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_PIVOT_ROOT(APPLET(pivot_root, BB_DIR_SBIN, BB_SUID_DROP)) -IF_POPMAILDIR(APPLET(popmaildir, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_PRINTENV(APPLET_NOFORK(printenv, printenv, BB_DIR_BIN, BB_SUID_DROP, printenv)) IF_PRINTF(APPLET_NOFORK(printf, printf, BB_DIR_USR_BIN, BB_SUID_DROP, printf)) IF_PWD(APPLET_NOFORK(pwd, pwd, BB_DIR_BIN, BB_SUID_DROP, pwd)) @@ -174,7 +172,6 @@ IF_RDEV(APPLET(rdev, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_READLINK(APPLET(readlink, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_REFORMIME(APPLET(reformime, BB_DIR_BIN, BB_SUID_DROP)) IF_RESET(APPLET(reset, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_RESIZE(APPLET(resize, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon)) @@ -185,7 +182,6 @@ IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_SCRIPT(APPLET(script, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_SCRIPTREPLAY(APPLET(scriptreplay, BB_DIR_BIN, BB_SUID_DROP)) IF_SELINUXENABLED(APPLET(selinuxenabled, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_SENDMAIL(APPLET(sendmail, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_SEQ(APPLET_NOFORK(seq, seq, BB_DIR_USR_BIN, BB_SUID_DROP, seq)) IF_SESTATUS(APPLET(sestatus, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_SETCONSOLE(APPLET(setconsole, BB_DIR_SBIN, BB_SUID_DROP)) diff --git a/mailutils/Config.src b/mailutils/Config.src index 2a9c5c074..e45a0f8fb 100644 --- a/mailutils/Config.src +++ b/mailutils/Config.src @@ -2,12 +2,6 @@ menu "Mail Utilities" INSERT -config MAKEMIME - bool "makemime" - default y - help - Create MIME-formatted messages. - config FEATURE_MIME_CHARSET string "Default charset" default "us-ascii" @@ -15,41 +9,4 @@ config FEATURE_MIME_CHARSET help Default charset of the message. -config POPMAILDIR - bool "popmaildir" - default y - help - Simple yet powerful POP3 mail popper. Delivers content - of remote mailboxes to local Maildir. - -config FEATURE_POPMAILDIR_DELIVERY - bool "Allow message filters and custom delivery program" - default y - depends on POPMAILDIR - help - Allow to use a custom program to filter the content - of the message before actual delivery (-F "prog [args...]"). - Allow to use a custom program for message actual delivery - (-M "prog [args...]"). - -config REFORMIME - bool "reformime" - default y - help - Parse MIME-formatted messages. - -config FEATURE_REFORMIME_COMPAT - bool "Accept and ignore options other than -x and -X" - default y - depends on REFORMIME - help - Accept (for compatibility only) and ignore options - other than -x and -X. - -config SENDMAIL - bool "sendmail" - default y - help - Barebones sendmail. - endmenu diff --git a/mailutils/makemime.c b/mailutils/makemime.c index 8e1bc664c..78f78bbcc 100644 --- a/mailutils/makemime.c +++ b/mailutils/makemime.c @@ -6,6 +6,13 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config MAKEMIME +//config: bool "makemime" +//config: default y +//config: help +//config: Create MIME-formatted messages. + +//applet:IF_MAKEMIME(APPLET(makemime, BB_DIR_BIN, BB_SUID_DROP)) //kbuild:lib-$(CONFIG_MAKEMIME) += makemime.o mail.o diff --git a/mailutils/popmaildir.c b/mailutils/popmaildir.c index 69eca6164..ffe373865 100644 --- a/mailutils/popmaildir.c +++ b/mailutils/popmaildir.c @@ -9,6 +9,24 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config POPMAILDIR +//config: bool "popmaildir" +//config: default y +//config: help +//config: Simple yet powerful POP3 mail popper. Delivers content +//config: of remote mailboxes to local Maildir. +//config: +//config:config FEATURE_POPMAILDIR_DELIVERY +//config: bool "Allow message filters and custom delivery program" +//config: default y +//config: depends on POPMAILDIR +//config: help +//config: Allow to use a custom program to filter the content +//config: of the message before actual delivery (-F "prog [args...]"). +//config: Allow to use a custom program for message actual delivery +//config: (-M "prog [args...]"). + +//applet:IF_POPMAILDIR(APPLET(popmaildir, BB_DIR_USR_SBIN, BB_SUID_DROP)) //kbuild:lib-$(CONFIG_POPMAILDIR) += popmaildir.o mail.o diff --git a/mailutils/reformime.c b/mailutils/reformime.c index b967dfbc7..e97bc0130 100644 --- a/mailutils/reformime.c +++ b/mailutils/reformime.c @@ -6,6 +6,21 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config REFORMIME +//config: bool "reformime" +//config: default y +//config: help +//config: Parse MIME-formatted messages. +//config: +//config:config FEATURE_REFORMIME_COMPAT +//config: bool "Accept and ignore options other than -x and -X" +//config: default y +//config: depends on REFORMIME +//config: help +//config: Accept (for compatibility only) and ignore options +//config: other than -x and -X. + +//applet:IF_REFORMIME(APPLET(reformime, BB_DIR_BIN, BB_SUID_DROP)) //kbuild:lib-$(CONFIG_REFORMIME) += reformime.o mail.o diff --git a/mailutils/sendmail.c b/mailutils/sendmail.c index 1242795b8..8ddb7826b 100644 --- a/mailutils/sendmail.c +++ b/mailutils/sendmail.c @@ -6,6 +6,13 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config SENDMAIL +//config: bool "sendmail" +//config: default y +//config: help +//config: Barebones sendmail. + +//applet:IF_SENDMAIL(APPLET(sendmail, BB_DIR_USR_SBIN, BB_SUID_DROP)) //kbuild:lib-$(CONFIG_SENDMAIL) += sendmail.o mail.o -- cgit v1.2.3-55-g6feb From 6d9329935c0621ddc056aee0d30cec52a24da499 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Nov 2016 10:39:27 +0100 Subject: Convert all console-tools/* applets to "new style" applet definitions Signed-off-by: Denys Vlasenko --- console-tools/Config.src | 166 -------------------------------------------- console-tools/Kbuild.src | 16 ----- console-tools/chvt.c | 11 +++ console-tools/clear.c | 9 +++ console-tools/deallocvt.c | 10 ++- console-tools/dumpkmap.c | 12 +++- console-tools/fgconsole.c | 10 +++ console-tools/kbd_mode.c | 10 +++ console-tools/loadfont.c | 51 ++++++++++++++ console-tools/loadkmap.c | 11 +++ console-tools/openvt.c | 11 +++ console-tools/reset.c | 13 +++- console-tools/resize.c | 21 +++++- console-tools/setconsole.c | 18 +++++ console-tools/setkeycodes.c | 11 +++ console-tools/setlogcons.c | 10 +++ console-tools/showkey.c | 10 +++ include/applets.src.h | 16 ----- 18 files changed, 213 insertions(+), 203 deletions(-) (limited to 'include') diff --git a/console-tools/Config.src b/console-tools/Config.src index c65704478..e6587ade4 100644 --- a/console-tools/Config.src +++ b/console-tools/Config.src @@ -7,170 +7,4 @@ menu "Console Utilities" INSERT -config CHVT - bool "chvt" - default y - select PLATFORM_LINUX - help - This program is used to change to another terminal. - Example: chvt 4 (change to terminal /dev/tty4) - -config FGCONSOLE - bool "fgconsole" - default y - select PLATFORM_LINUX - help - This program prints active (foreground) console number. - -config CLEAR - bool "clear" - default y - help - This program clears the terminal screen. - -config DEALLOCVT - bool "deallocvt" - default y - select PLATFORM_LINUX - help - This program deallocates unused virtual consoles. - -config DUMPKMAP - bool "dumpkmap" - default y - select PLATFORM_LINUX - help - This program dumps the kernel's keyboard translation table to - stdout, in binary format. You can then use loadkmap to load it. - -config KBD_MODE - bool "kbd_mode" - default y - select PLATFORM_LINUX - help - This program reports and sets keyboard mode. - -config LOADFONT - bool "loadfont" - default y - select PLATFORM_LINUX - help - This program loads a console font from standard input. - -config LOADKMAP - bool "loadkmap" - default y - select PLATFORM_LINUX - help - This program loads a keyboard translation table from - standard input. - -config OPENVT - bool "openvt" - default y - select PLATFORM_LINUX - help - This program is used to start a command on an unused - virtual terminal. - -config RESET - bool "reset" - default y - help - This program is used to reset the terminal screen, if it - gets messed up. - -config RESIZE - bool "resize" - default y - help - This program is used to (re)set the width and height of your current - terminal. - -config FEATURE_RESIZE_PRINT - bool "Print environment variables" - default y - depends on RESIZE - help - Prints the newly set size (number of columns and rows) of - the terminal. - E.g.: - COLUMNS=80;LINES=44;export COLUMNS LINES; - -config SETCONSOLE - bool "setconsole" - default y - select PLATFORM_LINUX - help - This program redirects the system console to another device, - like the current tty while logged in via telnet. - -config FEATURE_SETCONSOLE_LONG_OPTIONS - bool "Enable long options" - default y - depends on SETCONSOLE && LONG_OPTS - help - Support long options for the setconsole applet. - -config SETFONT - bool "setfont" - default y - select PLATFORM_LINUX - help - Allows to load console screen map. Useful for i18n. - -config FEATURE_SETFONT_TEXTUAL_MAP - bool "Support reading textual screen maps" - default y - depends on SETFONT - help - Support reading textual screen maps. - -config DEFAULT_SETFONT_DIR - string "Default directory for console-tools files" - default "" - depends on SETFONT - help - Directory to use if setfont's params are simple filenames - (not /path/to/file or ./file). Default is "" (no default directory). - -config SETKEYCODES - bool "setkeycodes" - default y - select PLATFORM_LINUX - help - This program loads entries into the kernel's scancode-to-keycode - map, allowing unusual keyboards to generate usable keycodes. - -config SETLOGCONS - bool "setlogcons" - default y - select PLATFORM_LINUX - help - This program redirects the output console of kernel messages. - -config SHOWKEY - bool "showkey" - default y - select PLATFORM_LINUX - help - Shows keys pressed. - -comment "Common options for loadfont and setfont" - depends on LOADFONT || SETFONT - -config FEATURE_LOADFONT_PSF2 - bool "Support for PSF2 console fonts" - default y - depends on LOADFONT || SETFONT - help - Support PSF2 console fonts. - -config FEATURE_LOADFONT_RAW - bool "Support for old (raw) console fonts" - default y - depends on LOADFONT || SETFONT - help - Support old (raw) console fonts. - endmenu diff --git a/console-tools/Kbuild.src b/console-tools/Kbuild.src index 94de9ad9f..6b4fb7470 100644 --- a/console-tools/Kbuild.src +++ b/console-tools/Kbuild.src @@ -7,19 +7,3 @@ lib-y:= INSERT -lib-$(CONFIG_CHVT) += chvt.o -lib-$(CONFIG_FGCONSOLE) += fgconsole.o -lib-$(CONFIG_CLEAR) += clear.o -lib-$(CONFIG_DEALLOCVT) += deallocvt.o -lib-$(CONFIG_DUMPKMAP) += dumpkmap.o -lib-$(CONFIG_SETCONSOLE) += setconsole.o -lib-$(CONFIG_KBD_MODE) += kbd_mode.o -lib-$(CONFIG_LOADFONT) += loadfont.o -lib-$(CONFIG_LOADKMAP) += loadkmap.o -lib-$(CONFIG_OPENVT) += openvt.o -lib-$(CONFIG_RESET) += reset.o -lib-$(CONFIG_RESIZE) += resize.o -lib-$(CONFIG_SETFONT) += loadfont.o -lib-$(CONFIG_SETKEYCODES) += setkeycodes.o -lib-$(CONFIG_SETLOGCONS) += setlogcons.o -lib-$(CONFIG_SHOWKEY) += showkey.o diff --git a/console-tools/chvt.c b/console-tools/chvt.c index b9c974f4a..2b993eb62 100644 --- a/console-tools/chvt.c +++ b/console-tools/chvt.c @@ -6,6 +6,17 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config CHVT +//config: bool "chvt" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: This program is used to change to another terminal. +//config: Example: chvt 4 (change to terminal /dev/tty4) + +//applet:IF_CHVT(APPLET(chvt, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_CHVT) += chvt.o //usage:#define chvt_trivial_usage //usage: "N" diff --git a/console-tools/clear.c b/console-tools/clear.c index ac22b787e..b360d34d9 100644 --- a/console-tools/clear.c +++ b/console-tools/clear.c @@ -6,6 +6,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config CLEAR +//config: bool "clear" +//config: default y +//config: help +//config: This program clears the terminal screen. + +//applet:IF_CLEAR(APPLET(clear, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_CLEAR) += clear.o //usage:#define clear_trivial_usage //usage: "" diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c index b131c0a64..37c966af3 100644 --- a/console-tools/deallocvt.c +++ b/console-tools/deallocvt.c @@ -7,8 +7,16 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config DEALLOCVT +//config: bool "deallocvt" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: This program deallocates unused virtual consoles. -/* no options, no getopt */ +//applet:IF_DEALLOCVT(APPLET(deallocvt, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_DEALLOCVT) += deallocvt.o //usage:#define deallocvt_trivial_usage //usage: "[N]" diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c index b6fd466dc..4a249868a 100644 --- a/console-tools/dumpkmap.c +++ b/console-tools/dumpkmap.c @@ -7,7 +7,17 @@ * Licensed under GPLv2 or later, see file LICENSE in this source tree. * */ -/* no options, no getopt */ +//config:config DUMPKMAP +//config: bool "dumpkmap" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: This program dumps the kernel's keyboard translation table to +//config: stdout, in binary format. You can then use loadkmap to load it. + +//applet:IF_DUMPKMAP(APPLET(dumpkmap, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_DUMPKMAP) += dumpkmap.o //usage:#define dumpkmap_trivial_usage //usage: "> keymap" diff --git a/console-tools/fgconsole.c b/console-tools/fgconsole.c index 54355bee6..019761726 100644 --- a/console-tools/fgconsole.c +++ b/console-tools/fgconsole.c @@ -6,6 +6,16 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config FGCONSOLE +//config: bool "fgconsole" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: This program prints active (foreground) console number. + +//applet:IF_FGCONSOLE(APPLET(fgconsole, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FGCONSOLE) += fgconsole.o //usage:#define fgconsole_trivial_usage //usage: "" diff --git a/console-tools/kbd_mode.c b/console-tools/kbd_mode.c index 138536721..f1238c6b4 100644 --- a/console-tools/kbd_mode.c +++ b/console-tools/kbd_mode.c @@ -8,6 +8,16 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config KBD_MODE +//config: bool "kbd_mode" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: This program reports and sets keyboard mode. + +//applet:IF_KBD_MODE(APPLET(kbd_mode, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_KBD_MODE) += kbd_mode.o //usage:#define kbd_mode_trivial_usage //usage: "[-a|k|s|u] [-C TTY]" diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c index 58073e0dc..52605baa1 100644 --- a/console-tools/loadfont.c +++ b/console-tools/loadfont.c @@ -9,6 +9,57 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config LOADFONT +//config: bool "loadfont" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: This program loads a console font from standard input. +//config: +//config:config SETFONT +//config: bool "setfont" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Allows to load console screen map. Useful for i18n. +//config: +//config:config FEATURE_SETFONT_TEXTUAL_MAP +//config: bool "Support reading textual screen maps" +//config: default y +//config: depends on SETFONT +//config: help +//config: Support reading textual screen maps. +//config: +//config:config DEFAULT_SETFONT_DIR +//config: string "Default directory for console-tools files" +//config: default "" +//config: depends on SETFONT +//config: help +//config: Directory to use if setfont's params are simple filenames +//config: (not /path/to/file or ./file). Default is "" (no default directory). +//config: +//config:comment "Common options for loadfont and setfont" +//config: depends on LOADFONT || SETFONT +//config: +//config:config FEATURE_LOADFONT_PSF2 +//config: bool "Support for PSF2 console fonts" +//config: default y +//config: depends on LOADFONT || SETFONT +//config: help +//config: Support PSF2 console fonts. +//config: +//config:config FEATURE_LOADFONT_RAW +//config: bool "Support for old (raw) console fonts" +//config: default y +//config: depends on LOADFONT || SETFONT +//config: help +//config: Support old (raw) console fonts. + +//applet:IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP)) +//applet:IF_SETFONT(APPLET(setfont, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_LOADFONT) += loadfont.o +//kbuild:lib-$(CONFIG_SETFONT) += loadfont.o //usage:#define loadfont_trivial_usage //usage: "< font" diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c index f525ee5d1..70ab55a8e 100644 --- a/console-tools/loadkmap.c +++ b/console-tools/loadkmap.c @@ -6,6 +6,17 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config LOADKMAP +//config: bool "loadkmap" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: This program loads a keyboard translation table from +//config: standard input. + +//applet:IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_LOADKMAP) += loadkmap.o //usage:#define loadkmap_trivial_usage //usage: "< keymap" diff --git a/console-tools/openvt.c b/console-tools/openvt.c index e52356692..5cbc717ec 100644 --- a/console-tools/openvt.c +++ b/console-tools/openvt.c @@ -7,6 +7,17 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config OPENVT +//config: bool "openvt" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: This program is used to start a command on an unused +//config: virtual terminal. + +//applet:IF_OPENVT(APPLET(openvt, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_OPENVT) += openvt.o //usage:#define openvt_trivial_usage //usage: "[-c N] [-sw] [PROG ARGS]" diff --git a/console-tools/reset.c b/console-tools/reset.c index 65940bdec..57cebb4ea 100644 --- a/console-tools/reset.c +++ b/console-tools/reset.c @@ -7,9 +7,18 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +/* "Standard" version of this tool is in ncurses package */ -/* BTW, which "standard" package has this utility? It doesn't seem - * to be ncurses, coreutils, console-tools... then what? */ +//config:config RESET +//config: bool "reset" +//config: default y +//config: help +//config: This program is used to reset the terminal screen, if it +//config: gets messed up. + +//applet:IF_RESET(APPLET(reset, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_RESET) += reset.o //usage:#define reset_trivial_usage //usage: "" diff --git a/console-tools/resize.c b/console-tools/resize.c index a3342a195..567086f09 100644 --- a/console-tools/resize.c +++ b/console-tools/resize.c @@ -6,7 +6,26 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ -/* no options, no getopt */ +//config:config RESIZE +//config: bool "resize" +//config: default y +//config: help +//config: This program is used to (re)set the width and height of your current +//config: terminal. +//config: +//config:config FEATURE_RESIZE_PRINT +//config: bool "Print environment variables" +//config: default y +//config: depends on RESIZE +//config: help +//config: Prints the newly set size (number of columns and rows) of +//config: the terminal. +//config: E.g.: +//config: COLUMNS=80;LINES=44;export COLUMNS LINES; + +//applet:IF_RESIZE(APPLET(resize, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_RESIZE) += resize.o //usage:#define resize_trivial_usage //usage: "" diff --git a/console-tools/setconsole.c b/console-tools/setconsole.c index c0051dcc8..58057268d 100644 --- a/console-tools/setconsole.c +++ b/console-tools/setconsole.c @@ -7,6 +7,24 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config SETCONSOLE +//config: bool "setconsole" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: This program redirects the system console to another device, +//config: like the current tty while logged in via telnet. +//config: +//config:config FEATURE_SETCONSOLE_LONG_OPTIONS +//config: bool "Enable long options" +//config: default y +//config: depends on SETCONSOLE && LONG_OPTS +//config: help +//config: Support long options for the setconsole applet. + +//applet:IF_SETCONSOLE(APPLET(setconsole, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SETCONSOLE) += setconsole.o //usage:#define setconsole_trivial_usage //usage: "[-r" IF_FEATURE_SETCONSOLE_LONG_OPTIONS("|--reset") "] [DEVICE]" diff --git a/console-tools/setkeycodes.c b/console-tools/setkeycodes.c index a6a7c2374..11fc37ae9 100644 --- a/console-tools/setkeycodes.c +++ b/console-tools/setkeycodes.c @@ -8,6 +8,17 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config SETKEYCODES +//config: bool "setkeycodes" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: This program loads entries into the kernel's scancode-to-keycode +//config: map, allowing unusual keyboards to generate usable keycodes. + +//applet:IF_SETKEYCODES(APPLET(setkeycodes, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SETKEYCODES) += setkeycodes.o //usage:#define setkeycodes_trivial_usage //usage: "SCANCODE KEYCODE..." diff --git a/console-tools/setlogcons.c b/console-tools/setlogcons.c index 2a11da329..2ea36f039 100644 --- a/console-tools/setlogcons.c +++ b/console-tools/setlogcons.c @@ -8,6 +8,16 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config SETLOGCONS +//config: bool "setlogcons" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: This program redirects the output console of kernel messages. + +//applet:IF_SETLOGCONS(APPLET(setlogcons, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SETLOGCONS) += setlogcons.o //usage:#define setlogcons_trivial_usage //usage: "[N]" diff --git a/console-tools/showkey.c b/console-tools/showkey.c index b7b4c32a8..c2447b887 100644 --- a/console-tools/showkey.c +++ b/console-tools/showkey.c @@ -6,6 +6,16 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config SHOWKEY +//config: bool "showkey" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Shows keys pressed. + +//applet:IF_SHOWKEY(APPLET(showkey, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SHOWKEY) += showkey.o //usage:#define showkey_trivial_usage //usage: "[-a | -k | -s]" diff --git a/include/applets.src.h b/include/applets.src.h index 83f6237b2..adce804e5 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -86,21 +86,17 @@ IF_CHGRP(APPLET_NOEXEC(chgrp, chgrp, BB_DIR_BIN, BB_SUID_DROP, chgrp)) IF_CHMOD(APPLET_NOEXEC(chmod, chmod, BB_DIR_BIN, BB_SUID_DROP, chmod)) IF_CHOWN(APPLET_NOEXEC(chown, chown, BB_DIR_BIN, BB_SUID_DROP, chown)) IF_CHROOT(APPLET(chroot, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_CHVT(APPLET(chvt, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_CKSUM(APPLET_NOEXEC(cksum, cksum, BB_DIR_USR_BIN, BB_SUID_DROP, cksum)) -IF_CLEAR(APPLET(clear, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_COMM(APPLET(comm, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_CP(APPLET_NOEXEC(cp, cp, BB_DIR_BIN, BB_SUID_DROP, cp)) IF_CUT(APPLET_NOEXEC(cut, cut, BB_DIR_USR_BIN, BB_SUID_DROP, cut)) IF_DD(APPLET_NOEXEC(dd, dd, BB_DIR_BIN, BB_SUID_DROP, dd)) -IF_DEALLOCVT(APPLET(deallocvt, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP)) IF_DHCPRELAY(APPLET(dhcprelay, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_DIRNAME(APPLET_NOFORK(dirname, dirname, BB_DIR_USR_BIN, BB_SUID_DROP, dirname)) IF_DMESG(APPLET(dmesg, BB_DIR_BIN, BB_SUID_DROP)) IF_DOS2UNIX(APPLET_NOEXEC(dos2unix, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, dos2unix)) IF_DU(APPLET(du, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_DUMPKMAP(APPLET(dumpkmap, BB_DIR_BIN, BB_SUID_DROP)) IF_DUMPLEASES(APPLET(dumpleases, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_E2FSCK(APPLET(e2fsck, BB_DIR_SBIN, BB_SUID_DROP)) //IF_E2LABEL(APPLET_ODDNAME(e2label, tune2fs, BB_DIR_SBIN, BB_SUID_DROP, e2label)) @@ -113,7 +109,6 @@ IF_FBSET(APPLET(fbset, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, BB_DIR_BIN, BB_SUID_DROP, fdflush)) IF_FDFORMAT(APPLET(fdformat, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_FDISK(APPLET(fdisk, BB_DIR_SBIN, BB_SUID_DROP)) -IF_FGCONSOLE(APPLET(fgconsole, BB_DIR_USR_BIN, BB_SUID_DROP)) /* Benefits from suid root: better access to /dev/BLOCKDEVs: */ IF_FINDFS(APPLET(findfs, BB_DIR_SBIN, BB_SUID_MAYBE)) IF_FLOCK(APPLET(flock, BB_DIR_USR_BIN, BB_SUID_DROP)) @@ -133,12 +128,9 @@ IF_HWCLOCK(APPLET(hwclock, BB_DIR_SBIN, BB_SUID_DROP)) IF_INSTALL(APPLET(install, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_IPCRM(APPLET(ipcrm, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_IPCS(APPLET(ipcs, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_KBD_MODE(APPLET(kbd_mode, BB_DIR_BIN, BB_SUID_DROP)) //IF_LENGTH(APPLET_NOFORK(length, length, BB_DIR_USR_BIN, BB_SUID_DROP, length)) IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, BB_SUID_DROP, ln)) IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP)) IF_LOGNAME(APPLET_NOFORK(logname, logname, BB_DIR_USR_BIN, BB_SUID_DROP, logname)) IF_LOSETUP(APPLET(losetup, BB_DIR_SBIN, BB_SUID_DROP)) IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls)) @@ -161,7 +153,6 @@ IF_MV(APPLET(mv, BB_DIR_BIN, BB_SUID_DROP)) IF_NICE(APPLET(nice, BB_DIR_BIN, BB_SUID_DROP)) IF_NOHUP(APPLET(nohup, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_OD(APPLET(od, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_OPENVT(APPLET(openvt, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_PARSE(APPLET(parse, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_PIVOT_ROOT(APPLET(pivot_root, BB_DIR_SBIN, BB_SUID_DROP)) IF_PRINTENV(APPLET_NOFORK(printenv, printenv, BB_DIR_BIN, BB_SUID_DROP, printenv)) @@ -172,8 +163,6 @@ IF_RDEV(APPLET(rdev, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_READLINK(APPLET(readlink, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_RESET(APPLET(reset, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_RESIZE(APPLET(resize, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon)) IF_RM(APPLET_NOFORK(rm, rm, BB_DIR_BIN, BB_SUID_DROP, rm)) IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir)) @@ -184,14 +173,9 @@ IF_SCRIPTREPLAY(APPLET(scriptreplay, BB_DIR_BIN, BB_SUID_DROP)) IF_SELINUXENABLED(APPLET(selinuxenabled, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_SEQ(APPLET_NOFORK(seq, seq, BB_DIR_USR_BIN, BB_SUID_DROP, seq)) IF_SESTATUS(APPLET(sestatus, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_SETCONSOLE(APPLET(setconsole, BB_DIR_SBIN, BB_SUID_DROP)) IF_SETENFORCE(APPLET(setenforce, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_SETFILES(APPLET(setfiles, BB_DIR_SBIN, BB_SUID_DROP)) -IF_SETFONT(APPLET(setfont, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_SETKEYCODES(APPLET(setkeycodes, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_SETLOGCONS(APPLET(setlogcons, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_SETSEBOOL(APPLET(setsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_SHOWKEY(APPLET(showkey, BB_DIR_USR_BIN, BB_SUID_DROP)) /* Do not make this applet NOFORK. It breaks ^C-ing of pauses in shells: */ IF_SLEEP(APPLET(sleep, BB_DIR_BIN, BB_SUID_DROP)) IF_SORT(APPLET_NOEXEC(sort, sort, BB_DIR_USR_BIN, BB_SUID_DROP, sort)) -- cgit v1.2.3-55-g6feb From dd898c9f3388fca1d7339a45150fbb7406de0971 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Nov 2016 11:46:32 +0100 Subject: Convert all util-linux/* applets to "new style" applet definitions Signed-off-by: Denys Vlasenko --- include/applets.src.h | 39 ---- util-linux/Config.src | 505 ---------------------------------------------- util-linux/Kbuild.src | 33 --- util-linux/acpid.c | 26 +++ util-linux/blkdiscard.c | 1 - util-linux/blkid.c | 20 ++ util-linux/blockdev.c | 9 +- util-linux/dmesg.c | 37 ++++ util-linux/fatattr.c | 1 + util-linux/fbset.c | 32 +++ util-linux/fdformat.c | 10 + util-linux/fdisk.c | 80 ++++++++ util-linux/findfs.c | 14 ++ util-linux/flock.c | 9 + util-linux/freeramdisk.c | 30 +++ util-linux/fsck_minix.c | 14 ++ util-linux/getopt.c | 22 +- util-linux/hexdump.c | 29 +++ util-linux/hwclock.c | 36 +++- util-linux/ipcrm.c | 11 + util-linux/ipcs.c | 11 + util-linux/losetup.c | 12 ++ util-linux/lspci.c | 13 ++ util-linux/lsusb.c | 13 ++ util-linux/mkfs_minix.c | 21 ++ util-linux/mkfs_reiser.c | 11 + util-linux/mkswap.c | 23 +++ util-linux/more.c | 13 ++ util-linux/mount.c | 8 + util-linux/pivot_root.c | 16 ++ util-linux/rdate.c | 14 +- util-linux/rdev.c | 9 + util-linux/readprofile.c | 10 + util-linux/rev.c | 9 +- util-linux/rtcwake.c | 10 + util-linux/script.c | 9 + util-linux/scriptreplay.c | 10 + util-linux/swaponoff.c | 1 - util-linux/switch_root.c | 23 +++ util-linux/uevent.c | 1 - util-linux/umount.c | 20 ++ util-linux/unshare.c | 1 - 42 files changed, 622 insertions(+), 594 deletions(-) (limited to 'include') diff --git a/include/applets.src.h b/include/applets.src.h index adce804e5..23453b0ef 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -75,9 +75,7 @@ s - suid type: INSERT IF_TEST(APPLET_NOFORK([, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) IF_TEST(APPLET_NOFORK([[, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) -IF_ACPID(APPLET(acpid, BB_DIR_SBIN, BB_SUID_DROP)) IF_BASENAME(APPLET_NOFORK(basename, basename, BB_DIR_USR_BIN, BB_SUID_DROP, basename)) -IF_BLKID(APPLET(blkid, BB_DIR_SBIN, BB_SUID_DROP)) IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat)) IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP)) @@ -94,7 +92,6 @@ IF_DD(APPLET_NOEXEC(dd, dd, BB_DIR_BIN, BB_SUID_DROP, dd)) IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP)) IF_DHCPRELAY(APPLET(dhcprelay, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_DIRNAME(APPLET_NOFORK(dirname, dirname, BB_DIR_USR_BIN, BB_SUID_DROP, dirname)) -IF_DMESG(APPLET(dmesg, BB_DIR_BIN, BB_SUID_DROP)) IF_DOS2UNIX(APPLET_NOEXEC(dos2unix, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, dos2unix)) IF_DU(APPLET(du, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_DUMPLEASES(APPLET(dumpleases, BB_DIR_USR_BIN, BB_SUID_DROP)) @@ -105,71 +102,37 @@ IF_ENV(APPLET_NOEXEC(env, env, BB_DIR_USR_BIN, BB_SUID_DROP, env)) IF_EXPAND(APPLET(expand, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_EXPR(APPLET(expr, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_FALSE(APPLET_NOFORK(false, false, BB_DIR_BIN, BB_SUID_DROP, false)) -IF_FBSET(APPLET(fbset, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, BB_DIR_BIN, BB_SUID_DROP, fdflush)) -IF_FDFORMAT(APPLET(fdformat, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_FDISK(APPLET(fdisk, BB_DIR_SBIN, BB_SUID_DROP)) -/* Benefits from suid root: better access to /dev/BLOCKDEVs: */ -IF_FINDFS(APPLET(findfs, BB_DIR_SBIN, BB_SUID_MAYBE)) -IF_FLOCK(APPLET(flock, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_FOLD(APPLET_NOEXEC(fold, fold, BB_DIR_USR_BIN, BB_SUID_DROP, fold)) -IF_FREERAMDISK(APPLET(freeramdisk, BB_DIR_SBIN, BB_SUID_DROP)) //IF_E2FSCK(APPLET_ODDNAME(fsck.ext2, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext2)) //IF_E2FSCK(APPLET_ODDNAME(fsck.ext3, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext3)) -IF_FSCK_MINIX(APPLET_ODDNAME(fsck.minix, fsck_minix, BB_DIR_SBIN, BB_SUID_DROP, fsck_minix)) IF_FSYNC(APPLET_NOFORK(fsync, fsync, BB_DIR_BIN, BB_SUID_DROP, fsync)) IF_GETENFORCE(APPLET(getenforce, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP)) IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_HD(APPLET_NOEXEC(hd, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hd)) IF_HEAD(APPLET_NOEXEC(head, head, BB_DIR_USR_BIN, BB_SUID_DROP, head)) -IF_HEXDUMP(APPLET_NOEXEC(hexdump, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hexdump)) -IF_HWCLOCK(APPLET(hwclock, BB_DIR_SBIN, BB_SUID_DROP)) IF_INSTALL(APPLET(install, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_IPCRM(APPLET(ipcrm, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_IPCS(APPLET(ipcs, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_LENGTH(APPLET_NOFORK(length, length, BB_DIR_USR_BIN, BB_SUID_DROP, length)) IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, BB_SUID_DROP, ln)) IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_LOGNAME(APPLET_NOFORK(logname, logname, BB_DIR_USR_BIN, BB_SUID_DROP, logname)) -IF_LOSETUP(APPLET(losetup, BB_DIR_SBIN, BB_SUID_DROP)) IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls)) -IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_LSUSB(APPLET(lsusb, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_MATCHPATHCON(APPLET(matchpathcon, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_MKDIR(APPLET_NOFORK(mkdir, mkdir, BB_DIR_BIN, BB_SUID_DROP, mkdir)) IF_MKFIFO(APPLET_NOEXEC(mkfifo, mkfifo, BB_DIR_USR_BIN, BB_SUID_DROP, mkfifo)) -IF_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, BB_DIR_SBIN, BB_SUID_DROP, mkfs_minix)) -IF_MKFS_REISER(APPLET_ODDNAME(mkfs.reiser, mkfs_reiser, BB_DIR_SBIN, BB_SUID_DROP, mkfs_reiser)) IF_MKNOD(APPLET_NOEXEC(mknod, mknod, BB_DIR_BIN, BB_SUID_DROP, mknod)) -IF_MKSWAP(APPLET(mkswap, BB_DIR_SBIN, BB_SUID_DROP)) -IF_MORE(APPLET(more, BB_DIR_BIN, BB_SUID_DROP)) -/* On full-blown systems, requires suid for user mounts. - * But it's not unthinkable to have it available in non-suid flavor on some systems, - * for viewing mount table. - * Therefore we use BB_SUID_MAYBE instead of BB_SUID_REQUIRE: */ -IF_MOUNT(APPLET(mount, BB_DIR_BIN, IF_DESKTOP(BB_SUID_MAYBE) IF_NOT_DESKTOP(BB_SUID_DROP))) IF_MV(APPLET(mv, BB_DIR_BIN, BB_SUID_DROP)) IF_NICE(APPLET(nice, BB_DIR_BIN, BB_SUID_DROP)) IF_NOHUP(APPLET(nohup, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_OD(APPLET(od, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_PARSE(APPLET(parse, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_PIVOT_ROOT(APPLET(pivot_root, BB_DIR_SBIN, BB_SUID_DROP)) IF_PRINTENV(APPLET_NOFORK(printenv, printenv, BB_DIR_BIN, BB_SUID_DROP, printenv)) IF_PRINTF(APPLET_NOFORK(printf, printf, BB_DIR_USR_BIN, BB_SUID_DROP, printf)) IF_PWD(APPLET_NOFORK(pwd, pwd, BB_DIR_BIN, BB_SUID_DROP, pwd)) -IF_RDATE(APPLET(rdate, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_RDEV(APPLET(rdev, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_READLINK(APPLET(readlink, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon)) IF_RM(APPLET_NOFORK(rm, rm, BB_DIR_BIN, BB_SUID_DROP, rm)) IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir)) -IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_SCRIPT(APPLET(script, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_SCRIPTREPLAY(APPLET(scriptreplay, BB_DIR_BIN, BB_SUID_DROP)) IF_SELINUXENABLED(APPLET(selinuxenabled, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_SEQ(APPLET_NOFORK(seq, seq, BB_DIR_USR_BIN, BB_SUID_DROP, seq)) IF_SESTATUS(APPLET(sestatus, BB_DIR_USR_SBIN, BB_SUID_DROP)) @@ -183,7 +146,6 @@ IF_SPLIT(APPLET(split, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_STAT(APPLET(stat, BB_DIR_BIN, BB_SUID_DROP)) IF_STTY(APPLET(stty, BB_DIR_BIN, BB_SUID_DROP)) IF_SUM(APPLET(sum, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_SWITCH_ROOT(APPLET(switch_root, BB_DIR_SBIN, BB_SUID_DROP)) IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac)) IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_TEE(APPLET(tee, BB_DIR_USR_BIN, BB_SUID_DROP)) @@ -193,7 +155,6 @@ IF_TRUE(APPLET_NOFORK(true, true, BB_DIR_BIN, BB_SUID_DROP, true)) IF_TTY(APPLET(tty, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_UDHCPC(APPLET(udhcpc, BB_DIR_SBIN, BB_SUID_DROP)) IF_UDHCPD(APPLET(udhcpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_UMOUNT(APPLET(umount, BB_DIR_BIN, BB_SUID_DROP)) IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP)) IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand)) IF_UNIQ(APPLET(uniq, BB_DIR_USR_BIN, BB_SUID_DROP)) diff --git a/util-linux/Config.src b/util-linux/Config.src index 9bef0d532..3c522f948 100644 --- a/util-linux/Config.src +++ b/util-linux/Config.src @@ -7,511 +7,6 @@ menu "Linux System Utilities" INSERT -config ACPID - bool "acpid" - default y - select PLATFORM_LINUX - help - acpid listens to ACPI events coming either in textual form from - /proc/acpi/event (though it is marked deprecated it is still widely - used and _is_ a standard) or in binary form from specified evdevs - (just use /dev/input/event*). - - It parses the event to retrieve ACTION and a possible PARAMETER. - It then spawns /etc/acpi/[/] either via run-parts - (if the resulting path is a directory) or directly as an executable. - - N.B. acpid relies on run-parts so have the latter installed. - -config FEATURE_ACPID_COMPAT - bool "Accept and ignore redundant options" - default y - depends on ACPID - help - Accept and ignore compatibility options -g -m -s -S -v. - -config BLKID - bool "blkid" - default y - select PLATFORM_LINUX - select VOLUMEID - help - Lists labels and UUIDs of all filesystems. - WARNING: - With all submodules selected, it will add ~8k to busybox. - -config FEATURE_BLKID_TYPE - bool "Print filesystem type" - default n - depends on BLKID - help - Show TYPE="filesystem type" - -config DMESG - bool "dmesg" - default y - select PLATFORM_LINUX - help - dmesg is used to examine or control the kernel ring buffer. When the - Linux kernel prints messages to the system log, they are stored in - the kernel ring buffer. You can use dmesg to print the kernel's ring - buffer, clear the kernel ring buffer, change the size of the kernel - ring buffer, and change the priority level at which kernel messages - are also logged to the system console. Enable this option if you - wish to enable the 'dmesg' utility. - -config FEATURE_DMESG_PRETTY - bool "Pretty dmesg output" - default y - depends on DMESG - help - If you wish to scrub the syslog level from the output, say 'Y' here. - The syslog level is a string prefixed to every line with the form - "<#>". - - With this option you will see: - # dmesg - Linux version 2.6.17.4 ..... - BIOS-provided physical RAM map: - BIOS-e820: 0000000000000000 - 000000000009f000 (usable) - - Without this option you will see: - # dmesg - <5>Linux version 2.6.17.4 ..... - <6>BIOS-provided physical RAM map: - <6> BIOS-e820: 0000000000000000 - 000000000009f000 (usable) - -config FBSET - bool "fbset" - default y - select PLATFORM_LINUX - help - fbset is used to show or change the settings of a Linux frame buffer - device. The frame buffer device provides a simple and unique - interface to access a graphics display. Enable this option - if you wish to enable the 'fbset' utility. - -config FEATURE_FBSET_FANCY - bool "Turn on extra fbset options" - default y - depends on FBSET - help - This option enables extended fbset options, allowing one to set the - framebuffer size, color depth, etc. interface to access a graphics - display. Enable this option if you wish to enable extended fbset - options. - -config FEATURE_FBSET_READMODE - bool "Turn on fbset readmode support" - default y - depends on FBSET - help - This option allows fbset to read the video mode database stored by - default as /etc/fb.modes, which can be used to set frame buffer - device to pre-defined video modes. - -config FDFLUSH - bool "fdflush" - default y - select PLATFORM_LINUX - help - fdflush is only needed when changing media on slightly-broken - removable media drives. It is used to make Linux believe that a - hardware disk-change switch has been actuated, which causes Linux to - forget anything it has cached from the previous media. If you have - such a slightly-broken drive, you will need to run fdflush every time - you change a disk. Most people have working hardware and can safely - leave this disabled. - -config FDFORMAT - bool "fdformat" - default y - select PLATFORM_LINUX - help - fdformat is used to low-level format a floppy disk. - -config FDISK - bool "fdisk" - default y - select PLATFORM_LINUX - help - The fdisk utility is used to divide hard disks into one or more - logical disks, which are generally called partitions. This utility - can be used to list and edit the set of partitions or BSD style - 'disk slices' that are defined on a hard drive. - -config FDISK_SUPPORT_LARGE_DISKS - bool "Support over 4GB disks" - default y - depends on FDISK - depends on !LFS # with LFS no special code is needed - help - Enable this option to support large disks > 4GB. - -config FEATURE_FDISK_WRITABLE - bool "Write support" - default y - depends on FDISK - help - Enabling this option allows you to create or change a partition table - and write those changes out to disk. If you leave this option - disabled, you will only be able to view the partition table. - -config FEATURE_AIX_LABEL - bool "Support AIX disklabels" - default n - depends on FDISK && FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change AIX disklabels. - Most people can safely leave this option disabled. - -config FEATURE_SGI_LABEL - bool "Support SGI disklabels" - default n - depends on FDISK && FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change SGI disklabels. - Most people can safely leave this option disabled. - -config FEATURE_SUN_LABEL - bool "Support SUN disklabels" - default n - depends on FDISK && FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change SUN disklabels. - Most people can safely leave this option disabled. - -config FEATURE_OSF_LABEL - bool "Support BSD disklabels" - default n - depends on FDISK && FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change BSD disklabels - and define and edit BSD disk slices. - -config FEATURE_GPT_LABEL - bool "Support GPT disklabels" - default n - depends on FDISK && FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to view GUID Partition Table - disklabels. - -config FEATURE_FDISK_ADVANCED - bool "Support expert mode" - default y - depends on FDISK && FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to do terribly unsafe things like - define arbitrary drive geometry, move the beginning of data in a - partition, and similarly evil things. Unless you have a very good - reason you would be wise to leave this disabled. - -config FINDFS - bool "findfs" - default y - select PLATFORM_LINUX - select VOLUMEID - help - Prints the name of a filesystem with given label or UUID. - WARNING: - With all submodules selected, it will add ~8k to busybox. - -config FLOCK - bool "flock" - default y - help - Manage locks from shell scripts - -config FREERAMDISK - bool "freeramdisk" - default y - select PLATFORM_LINUX - help - Linux allows you to create ramdisks. This utility allows you to - delete them and completely free all memory that was used for the - ramdisk. For example, if you boot Linux into a ramdisk and later - pivot_root, you may want to free the memory that is allocated to the - ramdisk. If you have no use for freeing memory from a ramdisk, leave - this disabled. - -config FSCK_MINIX - bool "fsck_minix" - default y - help - The minix filesystem is a nice, small, compact, read-write filesystem - with little overhead. It is not a journaling filesystem however and - can experience corruption if it is not properly unmounted or if the - power goes off in the middle of a write. This utility allows you to - check for and attempt to repair any corruption that occurs to a minix - filesystem. - -config MKFS_MINIX - bool "mkfs_minix" - default y - select PLATFORM_LINUX - help - The minix filesystem is a nice, small, compact, read-write filesystem - with little overhead. If you wish to be able to create minix - filesystems this utility will do the job for you. - -config FEATURE_MINIX2 - bool "Support Minix fs v2 (fsck_minix/mkfs_minix)" - default y - depends on FSCK_MINIX || MKFS_MINIX - help - If you wish to be able to create version 2 minix filesystems, enable - this. If you enabled 'mkfs_minix' then you almost certainly want to - be using the version 2 filesystem support. - -config MKFS_REISER - bool "mkfs_reiser" - default n - select PLATFORM_LINUX - help - Utility to create ReiserFS filesystems. - Note: this applet needs a lot of testing and polishing. - -config GETOPT - bool "getopt" - default y - help - The getopt utility is used to break up (parse) options in command - lines to make it easy to write complex shell scripts that also check - for legal (and illegal) options. If you want to write horribly - complex shell scripts, or use some horribly complex shell script - written by others, this utility may be for you. Most people will - wisely leave this disabled. - -config FEATURE_GETOPT_LONG - bool "Support option -l" - default y if LONG_OPTS - depends on GETOPT - help - Enable support for long options (option -l). - -config HEXDUMP - bool "hexdump" - default y - help - The hexdump utility is used to display binary data in a readable - way that is comparable to the output from most hex editors. - -config FEATURE_HEXDUMP_REVERSE - bool "Support -R, reverse of 'hexdump -Cv'" - default y - depends on HEXDUMP - help - The hexdump utility is used to display binary data in an ascii - readable way. This option creates binary data from an ascii input. - NB: this option is non-standard. It's unwise to use it in scripts - aimed to be portable. - -config HD - bool "hd" - default y - depends on HEXDUMP - help - hd is an alias to hexdump -C. - -config HWCLOCK - bool "hwclock" - default y - select PLATFORM_LINUX - help - The hwclock utility is used to read and set the hardware clock - on a system. This is primarily used to set the current time on - shutdown in the hardware clock, so the hardware will keep the - correct time when Linux is _not_ running. - -config FEATURE_HWCLOCK_LONG_OPTIONS - bool "Support long options (--hctosys,...)" - default y - depends on HWCLOCK && LONG_OPTS - help - By default, the hwclock utility only uses short options. If you - are overly fond of its long options, such as --hctosys, --utc, etc) - then enable this option. - -config FEATURE_HWCLOCK_ADJTIME_FHS - bool "Use FHS /var/lib/hwclock/adjtime" - default n # util-linux-ng in Fedora 13 still uses /etc/adjtime - depends on HWCLOCK - help - Starting with FHS 2.3, the adjtime state file is supposed to exist - at /var/lib/hwclock/adjtime instead of /etc/adjtime. If you wish - to use the FHS behavior, answer Y here, otherwise answer N for the - classic /etc/adjtime path. - - pathname.com/fhs/pub/fhs-2.3.html#VARLIBHWCLOCKSTATEDIRECTORYFORHWCLO - -config IPCRM - bool "ipcrm" - default y - help - The ipcrm utility allows the removal of System V interprocess - communication (IPC) objects and the associated data structures - from the system. - -config IPCS - bool "ipcs" - default y - select PLATFORM_LINUX - help - The ipcs utility is used to provide information on the currently - allocated System V interprocess (IPC) objects in the system. - -config LOSETUP - bool "losetup" - default y - select PLATFORM_LINUX - help - losetup is used to associate or detach a loop device with a regular - file or block device, and to query the status of a loop device. This - version does not currently support enabling data encryption. - -config LSPCI - bool "lspci" - default y - #select PLATFORM_LINUX - help - lspci is a utility for displaying information about PCI buses in the - system and devices connected to them. - - This version uses sysfs (/sys/bus/pci/devices) only. - -config LSUSB - bool "lsusb" - default y - #select PLATFORM_LINUX - help - lsusb is a utility for displaying information about USB buses in the - system and devices connected to them. - - This version uses sysfs (/sys/bus/usb/devices) only. - -config MKSWAP - bool "mkswap" - default y - help - The mkswap utility is used to configure a file or disk partition as - Linux swap space. This allows Linux to use the entire file or - partition as if it were additional RAM, which can greatly increase - the capability of low-memory machines. This additional memory is - much slower than real RAM, but can be very helpful at preventing your - applications being killed by the Linux out of memory (OOM) killer. - Once you have created swap space using 'mkswap' you need to enable - the swap space using the 'swapon' utility. - -config FEATURE_MKSWAP_UUID - bool "UUID support" - default y - depends on MKSWAP - help - Generate swap spaces with universally unique identifiers. - -config MORE - bool "more" - default y - help - more is a simple utility which allows you to read text one screen - sized page at a time. If you want to read text that is larger than - the screen, and you are using anything faster than a 300 baud modem, - you will probably find this utility very helpful. If you don't have - any need to reading text files, you can leave this disabled. - -config PIVOT_ROOT - bool "pivot_root" - default y - select PLATFORM_LINUX - help - The pivot_root utility swaps the mount points for the root filesystem - with some other mounted filesystem. This allows you to do all sorts - of wild and crazy things with your Linux system and is far more - powerful than 'chroot'. - - Note: This is for initrd in linux 2.4. Under initramfs (introduced - in linux 2.6) use switch_root instead. - -config RDATE - bool "rdate" - default y - help - The rdate utility allows you to synchronize the date and time of your - system clock with the date and time of a remote networked system using - the RFC868 protocol, which is built into the inetd daemon on most - systems. - -config RDEV - bool "rdev" - default y - help - Print the device node associated with the filesystem mounted at '/'. - -config READPROFILE - bool "readprofile" - default y - #select PLATFORM_LINUX - help - This allows you to parse /proc/profile for basic profiling. - -config RTCWAKE - bool "rtcwake" - default y - select PLATFORM_LINUX - help - Enter a system sleep state until specified wakeup time. - -config SCRIPT - bool "script" - default y - help - The script makes typescript of terminal session. - -config SCRIPTREPLAY - bool "scriptreplay" - default y - help - This program replays a typescript, using timing information - given by script -t. - -config SWITCH_ROOT - bool "switch_root" - default y - select PLATFORM_LINUX - help - The switch_root utility is used from initramfs to select a new - root device. Under initramfs, you have to use this instead of - pivot_root. (Stop reading here if you don't care why.) - - Booting with initramfs extracts a gzipped cpio archive into rootfs - (which is a variant of ramfs/tmpfs). Because rootfs can't be moved - or unmounted*, pivot_root will not work from initramfs. Instead, - switch_root deletes everything out of rootfs (including itself), - does a mount --move that overmounts rootfs with the new root, and - then execs the specified init program. - - * Because the Linux kernel uses rootfs internally as the starting - and ending point for searching through the kernel's doubly linked - list of active mount points. That's why. - -config UMOUNT - bool "umount" - default y - select PLATFORM_LINUX - help - When you want to remove a mounted filesystem from its current mount - point, for example when you are shutting down the system, the - 'umount' utility is the tool to use. If you enabled the 'mount' - utility, you almost certainly also want to enable 'umount'. - -config FEATURE_UMOUNT_ALL - bool "Support option -a" - default y - depends on UMOUNT - help - Support -a option to unmount all currently mounted filesystems. - comment "Common options for mount/umount" depends on MOUNT || UMOUNT diff --git a/util-linux/Kbuild.src b/util-linux/Kbuild.src index dfd50afa2..6b4fb7470 100644 --- a/util-linux/Kbuild.src +++ b/util-linux/Kbuild.src @@ -7,36 +7,3 @@ lib-y:= INSERT -lib-$(CONFIG_ACPID) += acpid.o -lib-$(CONFIG_BLKID) += blkid.o -lib-$(CONFIG_DMESG) += dmesg.o -lib-$(CONFIG_FBSET) += fbset.o -lib-$(CONFIG_FDFLUSH) += freeramdisk.o -lib-$(CONFIG_FDFORMAT) += fdformat.o -lib-$(CONFIG_FDISK) += fdisk.o -lib-$(CONFIG_FINDFS) += findfs.o -lib-$(CONFIG_FLOCK) += flock.o -lib-$(CONFIG_FREERAMDISK) += freeramdisk.o -lib-$(CONFIG_FSCK_MINIX) += fsck_minix.o -lib-$(CONFIG_GETOPT) += getopt.o -lib-$(CONFIG_HEXDUMP) += hexdump.o -lib-$(CONFIG_HWCLOCK) += hwclock.o -lib-$(CONFIG_IPCRM) += ipcrm.o -lib-$(CONFIG_IPCS) += ipcs.o -lib-$(CONFIG_LOSETUP) += losetup.o -lib-$(CONFIG_LSPCI) += lspci.o -lib-$(CONFIG_LSUSB) += lsusb.o -lib-$(CONFIG_MKFS_MINIX) += mkfs_minix.o -lib-$(CONFIG_MKFS_REISER) += mkfs_reiser.o -lib-$(CONFIG_MKSWAP) += mkswap.o -lib-$(CONFIG_MORE) += more.o -lib-$(CONFIG_MOUNT) += mount.o -lib-$(CONFIG_PIVOT_ROOT) += pivot_root.o -lib-$(CONFIG_RDATE) += rdate.o -lib-$(CONFIG_RDEV) += rdev.o -lib-$(CONFIG_READPROFILE) += readprofile.o -lib-$(CONFIG_RTCWAKE) += rtcwake.o -lib-$(CONFIG_SCRIPT) += script.o -lib-$(CONFIG_SCRIPTREPLAY) += scriptreplay.o -lib-$(CONFIG_SWITCH_ROOT) += switch_root.o -lib-$(CONFIG_UMOUNT) += umount.o diff --git a/util-linux/acpid.c b/util-linux/acpid.c index 0f2cb6bdc..3e68b61ab 100644 --- a/util-linux/acpid.c +++ b/util-linux/acpid.c @@ -6,6 +6,32 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config ACPID +//config: bool "acpid" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: acpid listens to ACPI events coming either in textual form from +//config: /proc/acpi/event (though it is marked deprecated it is still widely +//config: used and _is_ a standard) or in binary form from specified evdevs +//config: (just use /dev/input/event*). +//config: +//config: It parses the event to retrieve ACTION and a possible PARAMETER. +//config: It then spawns /etc/acpi/[/] either via run-parts +//config: (if the resulting path is a directory) or directly as an executable. +//config: +//config: N.B. acpid relies on run-parts so have the latter installed. +//config: +//config:config FEATURE_ACPID_COMPAT +//config: bool "Accept and ignore redundant options" +//config: default y +//config: depends on ACPID +//config: help +//config: Accept and ignore compatibility options -g -m -s -S -v. + +//applet:IF_ACPID(APPLET(acpid, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_ACPID) += acpid.o //usage:#define acpid_trivial_usage //usage: "[-df] [-c CONFDIR] [-l LOGFILE] [-a ACTIONFILE] [-M MAPFILE] [-e PROC_EVENT_FILE] [-p PIDFILE]" diff --git a/util-linux/blkdiscard.c b/util-linux/blkdiscard.c index ace88a1f0..af0bc946d 100644 --- a/util-linux/blkdiscard.c +++ b/util-linux/blkdiscard.c @@ -5,7 +5,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - //config:config BLKDISCARD //config: bool "blkdiscard" //config: default y diff --git a/util-linux/blkid.c b/util-linux/blkid.c index 1bbc80311..b6f33b513 100644 --- a/util-linux/blkid.c +++ b/util-linux/blkid.c @@ -6,6 +6,26 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config BLKID +//config: bool "blkid" +//config: default y +//config: select PLATFORM_LINUX +//config: select VOLUMEID +//config: help +//config: Lists labels and UUIDs of all filesystems. +//config: WARNING: +//config: With all submodules selected, it will add ~8k to busybox. +//config: +//config:config FEATURE_BLKID_TYPE +//config: bool "Print filesystem type" +//config: default n +//config: depends on BLKID +//config: help +//config: Show TYPE="filesystem type" + +//applet:IF_BLKID(APPLET(blkid, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_BLKID) += blkid.o //usage:#define blkid_trivial_usage //usage: "[BLOCKDEV]..." diff --git a/util-linux/blockdev.c b/util-linux/blockdev.c index e25e529db..bf4d49792 100644 --- a/util-linux/blockdev.c +++ b/util-linux/blockdev.c @@ -5,17 +5,16 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ - -//applet:IF_BLOCKDEV(APPLET(blockdev, BB_DIR_SBIN, BB_SUID_DROP)) - -//kbuild:lib-$(CONFIG_BLOCKDEV) += blockdev.o - //config:config BLOCKDEV //config: bool "blockdev" //config: default y //config: help //config: Performs some ioctls with block devices. +//applet:IF_BLOCKDEV(APPLET(blockdev, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_BLOCKDEV) += blockdev.o + //usage:#define blockdev_trivial_usage //usage: "OPTION BLOCKDEV" //usage:#define blockdev_full_usage "\n\n" diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c index 50e8a0fce..b7b2c6924 100644 --- a/util-linux/dmesg.c +++ b/util-linux/dmesg.c @@ -8,6 +8,43 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config DMESG +//config: bool "dmesg" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: dmesg is used to examine or control the kernel ring buffer. When the +//config: Linux kernel prints messages to the system log, they are stored in +//config: the kernel ring buffer. You can use dmesg to print the kernel's ring +//config: buffer, clear the kernel ring buffer, change the size of the kernel +//config: ring buffer, and change the priority level at which kernel messages +//config: are also logged to the system console. Enable this option if you +//config: wish to enable the 'dmesg' utility. +//config: +//config:config FEATURE_DMESG_PRETTY +//config: bool "Pretty dmesg output" +//config: default y +//config: depends on DMESG +//config: help +//config: If you wish to scrub the syslog level from the output, say 'Y' here. +//config: The syslog level is a string prefixed to every line with the form +//config: "<#>". +//config: +//config: With this option you will see: +//config: # dmesg +//config: Linux version 2.6.17.4 ..... +//config: BIOS-provided physical RAM map: +//config: BIOS-e820: 0000000000000000 - 000000000009f000 (usable) +//config: +//config: Without this option you will see: +//config: # dmesg +//config: <5>Linux version 2.6.17.4 ..... +//config: <6>BIOS-provided physical RAM map: +//config: <6> BIOS-e820: 0000000000000000 - 000000000009f000 (usable) + +//applet:IF_DMESG(APPLET(dmesg, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_DMESG) += dmesg.o //usage:#define dmesg_trivial_usage //usage: "[-c] [-n LEVEL] [-s SIZE]" diff --git a/util-linux/fatattr.c b/util-linux/fatattr.c index 6dca24a73..030978f64 100644 --- a/util-linux/fatattr.c +++ b/util-linux/fatattr.c @@ -16,6 +16,7 @@ //config: fatattr lists or changes the file attributes on a fat file system. //applet:IF_FATATTR(APPLET(fatattr, BB_DIR_BIN, BB_SUID_DROP)) + //kbuild:lib-$(CONFIG_FATATTR) += fatattr.o //usage:#define fatattr_trivial_usage diff --git a/util-linux/fbset.c b/util-linux/fbset.c index b75ec1921..8a78c1ef9 100644 --- a/util-linux/fbset.c +++ b/util-linux/fbset.c @@ -11,6 +11,38 @@ * the GPL, and is (c) 1995-1999 by: * Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be) */ +//config:config FBSET +//config: bool "fbset" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: fbset is used to show or change the settings of a Linux frame buffer +//config: device. The frame buffer device provides a simple and unique +//config: interface to access a graphics display. Enable this option +//config: if you wish to enable the 'fbset' utility. +//config: +//config:config FEATURE_FBSET_FANCY +//config: bool "Turn on extra fbset options" +//config: default y +//config: depends on FBSET +//config: help +//config: This option enables extended fbset options, allowing one to set the +//config: framebuffer size, color depth, etc. interface to access a graphics +//config: display. Enable this option if you wish to enable extended fbset +//config: options. +//config: +//config:config FEATURE_FBSET_READMODE +//config: bool "Turn on fbset readmode support" +//config: default y +//config: depends on FBSET +//config: help +//config: This option allows fbset to read the video mode database stored by +//config: default as /etc/fb.modes, which can be used to set frame buffer +//config: device to pre-defined video modes. + +//applet:IF_FBSET(APPLET(fbset, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FBSET) += fbset.o //usage:#define fbset_trivial_usage //usage: "[OPTIONS] [MODE]" diff --git a/util-linux/fdformat.c b/util-linux/fdformat.c index 6ef6445e6..67c6e1504 100644 --- a/util-linux/fdformat.c +++ b/util-linux/fdformat.c @@ -4,6 +4,16 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config FDFORMAT +//config: bool "fdformat" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: fdformat is used to low-level format a floppy disk. + +//applet:IF_FDFORMAT(APPLET(fdformat, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FDFORMAT) += fdformat.o //usage:#define fdformat_trivial_usage //usage: "[-n] DEVICE" diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index 32a66d03d..af8073532 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c @@ -6,6 +6,86 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config FDISK +//config: bool "fdisk" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The fdisk utility is used to divide hard disks into one or more +//config: logical disks, which are generally called partitions. This utility +//config: can be used to list and edit the set of partitions or BSD style +//config: 'disk slices' that are defined on a hard drive. +//config: +//config:config FDISK_SUPPORT_LARGE_DISKS +//config: bool "Support over 4GB disks" +//config: default y +//config: depends on FDISK +//config: depends on !LFS # with LFS no special code is needed +//config: help +//config: Enable this option to support large disks > 4GB. +//config: +//config:config FEATURE_FDISK_WRITABLE +//config: bool "Write support" +//config: default y +//config: depends on FDISK +//config: help +//config: Enabling this option allows you to create or change a partition table +//config: and write those changes out to disk. If you leave this option +//config: disabled, you will only be able to view the partition table. +//config: +//config:config FEATURE_AIX_LABEL +//config: bool "Support AIX disklabels" +//config: default n +//config: depends on FDISK && FEATURE_FDISK_WRITABLE +//config: help +//config: Enabling this option allows you to create or change AIX disklabels. +//config: Most people can safely leave this option disabled. +//config: +//config:config FEATURE_SGI_LABEL +//config: bool "Support SGI disklabels" +//config: default n +//config: depends on FDISK && FEATURE_FDISK_WRITABLE +//config: help +//config: Enabling this option allows you to create or change SGI disklabels. +//config: Most people can safely leave this option disabled. +//config: +//config:config FEATURE_SUN_LABEL +//config: bool "Support SUN disklabels" +//config: default n +//config: depends on FDISK && FEATURE_FDISK_WRITABLE +//config: help +//config: Enabling this option allows you to create or change SUN disklabels. +//config: Most people can safely leave this option disabled. +//config: +//config:config FEATURE_OSF_LABEL +//config: bool "Support BSD disklabels" +//config: default n +//config: depends on FDISK && FEATURE_FDISK_WRITABLE +//config: help +//config: Enabling this option allows you to create or change BSD disklabels +//config: and define and edit BSD disk slices. +//config: +//config:config FEATURE_GPT_LABEL +//config: bool "Support GPT disklabels" +//config: default n +//config: depends on FDISK && FEATURE_FDISK_WRITABLE +//config: help +//config: Enabling this option allows you to view GUID Partition Table +//config: disklabels. +//config: +//config:config FEATURE_FDISK_ADVANCED +//config: bool "Support expert mode" +//config: default y +//config: depends on FDISK && FEATURE_FDISK_WRITABLE +//config: help +//config: Enabling this option allows you to do terribly unsafe things like +//config: define arbitrary drive geometry, move the beginning of data in a +//config: partition, and similarly evil things. Unless you have a very good +//config: reason you would be wise to leave this disabled. + +//applet:IF_FDISK(APPLET(fdisk, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FDISK) += fdisk.o /* Looks like someone forgot to add this to config system */ //usage:#ifndef ENABLE_FEATURE_FDISK_BLKSIZE diff --git a/util-linux/findfs.c b/util-linux/findfs.c index 07734f359..daa46b039 100644 --- a/util-linux/findfs.c +++ b/util-linux/findfs.c @@ -7,6 +7,20 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config FINDFS +//config: bool "findfs" +//config: default y +//config: select PLATFORM_LINUX +//config: select VOLUMEID +//config: help +//config: Prints the name of a filesystem with given label or UUID. +//config: WARNING: +//config: With all submodules selected, it will add ~8k to busybox. + +/* Benefits from suid root: better access to /dev/BLOCKDEVs: */ +//applet:IF_FINDFS(APPLET(findfs, BB_DIR_SBIN, BB_SUID_MAYBE)) + +//kbuild:lib-$(CONFIG_FINDFS) += findfs.o //usage:#define findfs_trivial_usage //usage: "LABEL=label or UUID=uuid" diff --git a/util-linux/flock.c b/util-linux/flock.c index 1f7ade7c4..f34c0ad8f 100644 --- a/util-linux/flock.c +++ b/util-linux/flock.c @@ -3,6 +3,15 @@ * * This is free software, licensed under the GNU General Public License v2. */ +//config:config FLOCK +//config: bool "flock" +//config: default y +//config: help +//config: Manage locks from shell scripts + +//applet:IF_FLOCK(APPLET(flock, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FLOCK) += flock.o //usage:#define flock_trivial_usage //usage: "[-sxun] FD|{FILE [-c] PROG ARGS}" diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c index a89ae1a39..8bc2c443b 100644 --- a/util-linux/freeramdisk.c +++ b/util-linux/freeramdisk.c @@ -8,6 +8,36 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config FDFLUSH +//config: bool "fdflush" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: fdflush is only needed when changing media on slightly-broken +//config: removable media drives. It is used to make Linux believe that a +//config: hardware disk-change switch has been actuated, which causes Linux to +//config: forget anything it has cached from the previous media. If you have +//config: such a slightly-broken drive, you will need to run fdflush every time +//config: you change a disk. Most people have working hardware and can safely +//config: leave this disabled. +//config: +//config:config FREERAMDISK +//config: bool "freeramdisk" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Linux allows you to create ramdisks. This utility allows you to +//config: delete them and completely free all memory that was used for the +//config: ramdisk. For example, if you boot Linux into a ramdisk and later +//config: pivot_root, you may want to free the memory that is allocated to the +//config: ramdisk. If you have no use for freeing memory from a ramdisk, leave +//config: this disabled. + +//applet:IF_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, BB_DIR_BIN, BB_SUID_DROP, fdflush)) +//applet:IF_FREERAMDISK(APPLET(freeramdisk, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FDFLUSH) += freeramdisk.o +//kbuild:lib-$(CONFIG_FREERAMDISK) += freeramdisk.o //usage:#define freeramdisk_trivial_usage //usage: "DEVICE" diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index d2f3524b4..0eaac17c0 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c @@ -85,6 +85,20 @@ * The device may be a block device or a image of one, but this isn't * enforced (but it's not much fun on a character device :-). */ +//config:config FSCK_MINIX +//config: bool "fsck_minix" +//config: default y +//config: help +//config: The minix filesystem is a nice, small, compact, read-write filesystem +//config: with little overhead. It is not a journaling filesystem however and +//config: can experience corruption if it is not properly unmounted or if the +//config: power goes off in the middle of a write. This utility allows you to +//config: check for and attempt to repair any corruption that occurs to a minix +//config: filesystem. + +//applet:IF_FSCK_MINIX(APPLET_ODDNAME(fsck.minix, fsck_minix, BB_DIR_SBIN, BB_SUID_DROP, fsck_minix)) + +//kbuild:lib-$(CONFIG_FSCK_MINIX) += fsck_minix.o //usage:#define fsck_minix_trivial_usage //usage: "[-larvsmf] BLOCKDEV" diff --git a/util-linux/getopt.c b/util-linux/getopt.c index 18d490987..83cc1efea 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c @@ -28,8 +28,28 @@ * Removed --version/-V and --help/-h * Removed parse_error(), using bb_error_msg() from Busybox instead * Replaced our_malloc with xmalloc and our_realloc with xrealloc - * */ +//config:config GETOPT +//config: bool "getopt" +//config: default y +//config: help +//config: The getopt utility is used to break up (parse) options in command +//config: lines to make it easy to write complex shell scripts that also check +//config: for legal (and illegal) options. If you want to write horribly +//config: complex shell scripts, or use some horribly complex shell script +//config: written by others, this utility may be for you. Most people will +//config: wisely leave this disabled. +//config: +//config:config FEATURE_GETOPT_LONG +//config: bool "Support option -l" +//config: default y if LONG_OPTS +//config: depends on GETOPT +//config: help +//config: Enable support for long options (option -l). + +//applet:IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_GETOPT) += getopt.o //usage:#define getopt_trivial_usage //usage: "[OPTIONS] [--] OPTSTRING PARAMS" diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c index ac7e24ff8..5e1ef6938 100644 --- a/util-linux/hexdump.c +++ b/util-linux/hexdump.c @@ -8,6 +8,35 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config HEXDUMP +//config: bool "hexdump" +//config: default y +//config: help +//config: The hexdump utility is used to display binary data in a readable +//config: way that is comparable to the output from most hex editors. +//config: +//config:config FEATURE_HEXDUMP_REVERSE +//config: bool "Support -R, reverse of 'hexdump -Cv'" +//config: default y +//config: depends on HEXDUMP +//config: help +//config: The hexdump utility is used to display binary data in an ascii +//config: readable way. This option creates binary data from an ascii input. +//config: NB: this option is non-standard. It's unwise to use it in scripts +//config: aimed to be portable. +//config: +//config:config HD +//config: bool "hd" +//config: default y +//config: depends on HEXDUMP +//config: help +//config: hd is an alias to hexdump -C. + +//applet:IF_HEXDUMP(APPLET_NOEXEC(hexdump, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hexdump)) +//applet:IF_HD(APPLET_NOEXEC(hd, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hd)) + +//kbuild:lib-$(CONFIG_HEXDUMP) += hexdump.o +//kbuild:lib-$(CONFIG_HD) += hexdump.o //usage:#define hexdump_trivial_usage //usage: "[-bcCdefnosvx" IF_FEATURE_HEXDUMP_REVERSE("R") "] [FILE]..." diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c index 6c99977cf..084a7f1e9 100644 --- a/util-linux/hwclock.c +++ b/util-linux/hwclock.c @@ -5,7 +5,41 @@ * Copyright (C) 2002 Robert Griebl * * Licensed under GPLv2 or later, see file LICENSE in this source tree. -*/ + */ +//config:config HWCLOCK +//config: bool "hwclock" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The hwclock utility is used to read and set the hardware clock +//config: on a system. This is primarily used to set the current time on +//config: shutdown in the hardware clock, so the hardware will keep the +//config: correct time when Linux is _not_ running. +//config: +//config:config FEATURE_HWCLOCK_LONG_OPTIONS +//config: bool "Support long options (--hctosys,...)" +//config: default y +//config: depends on HWCLOCK && LONG_OPTS +//config: help +//config: By default, the hwclock utility only uses short options. If you +//config: are overly fond of its long options, such as --hctosys, --utc, etc) +//config: then enable this option. +//config: +//config:config FEATURE_HWCLOCK_ADJTIME_FHS +//config: bool "Use FHS /var/lib/hwclock/adjtime" +//config: default n # util-linux-ng in Fedora 13 still uses /etc/adjtime +//config: depends on HWCLOCK +//config: help +//config: Starting with FHS 2.3, the adjtime state file is supposed to exist +//config: at /var/lib/hwclock/adjtime instead of /etc/adjtime. If you wish +//config: to use the FHS behavior, answer Y here, otherwise answer N for the +//config: classic /etc/adjtime path. +//config: +//config: pathname.com/fhs/pub/fhs-2.3.html#VARLIBHWCLOCKSTATEDIRECTORYFORHWCLO + +//applet:IF_HWCLOCK(APPLET(hwclock, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_HWCLOCK) += hwclock.o #include "libbb.h" /* After libbb.h, since it needs sys/types.h on some systems */ diff --git a/util-linux/ipcrm.c b/util-linux/ipcrm.c index 38d81af50..76ea3ca4f 100644 --- a/util-linux/ipcrm.c +++ b/util-linux/ipcrm.c @@ -7,6 +7,17 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config IPCRM +//config: bool "ipcrm" +//config: default y +//config: help +//config: The ipcrm utility allows the removal of System V interprocess +//config: communication (IPC) objects and the associated data structures +//config: from the system. + +//applet:IF_IPCRM(APPLET(ipcrm, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_IPCRM) += ipcrm.o //usage:#define ipcrm_trivial_usage //usage: "[-MQS key] [-mqs id]" diff --git a/util-linux/ipcs.c b/util-linux/ipcs.c index 67a25a8ef..88ae9225d 100644 --- a/util-linux/ipcs.c +++ b/util-linux/ipcs.c @@ -7,6 +7,17 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config IPCS +//config: bool "ipcs" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The ipcs utility is used to provide information on the currently +//config: allocated System V interprocess (IPC) objects in the system. + +//applet:IF_IPCS(APPLET(ipcs, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_IPCS) += ipcs.o //usage:#define ipcs_trivial_usage //usage: "[[-smq] -i shmid] | [[-asmq] [-tcplu]]" diff --git a/util-linux/losetup.c b/util-linux/losetup.c index d450b5a78..4424d9cbb 100644 --- a/util-linux/losetup.c +++ b/util-linux/losetup.c @@ -6,6 +6,18 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config LOSETUP +//config: bool "losetup" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: losetup is used to associate or detach a loop device with a regular +//config: file or block device, and to query the status of a loop device. This +//config: version does not currently support enabling data encryption. + +//kbuild:lib-$(CONFIG_LOSETUP) += losetup.o + +//applet:IF_LOSETUP(APPLET(losetup, BB_DIR_SBIN, BB_SUID_DROP)) //usage:#define losetup_trivial_usage //usage: "[-r] [-o OFS] {-f|LOOPDEV} FILE - associate loop devices\n" diff --git a/util-linux/lspci.c b/util-linux/lspci.c index 514678afd..8b38a2366 100644 --- a/util-linux/lspci.c +++ b/util-linux/lspci.c @@ -6,6 +6,19 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config LSPCI +//config: bool "lspci" +//config: default y +//config: #select PLATFORM_LINUX +//config: help +//config: lspci is a utility for displaying information about PCI buses in the +//config: system and devices connected to them. +//config: +//config: This version uses sysfs (/sys/bus/pci/devices) only. + +//applet:IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_LSPCI) += lspci.o //usage:#define lspci_trivial_usage //usage: "[-mk]" diff --git a/util-linux/lsusb.c b/util-linux/lsusb.c index 540f21ec6..7d36d6f5a 100644 --- a/util-linux/lsusb.c +++ b/util-linux/lsusb.c @@ -6,6 +6,19 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config LSUSB +//config: bool "lsusb" +//config: default y +//config: #select PLATFORM_LINUX +//config: help +//config: lsusb is a utility for displaying information about USB buses in the +//config: system and devices connected to them. +//config: +//config: This version uses sysfs (/sys/bus/usb/devices) only. + +//applet:IF_LSUSB(APPLET(lsusb, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_LSUSB) += lsusb.o //usage:#define lsusb_trivial_usage NOUSAGE_STR //usage:#define lsusb_full_usage "" diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index aaabf8453..912246b93 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c @@ -62,6 +62,27 @@ * Modified for BusyBox by Erik Andersen -- * removed getopt based parser and added a hand rolled one. */ +//config:config MKFS_MINIX +//config: bool "mkfs_minix" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The minix filesystem is a nice, small, compact, read-write filesystem +//config: with little overhead. If you wish to be able to create minix +//config: filesystems this utility will do the job for you. +//config: +//config:config FEATURE_MINIX2 +//config: bool "Support Minix fs v2 (fsck_minix/mkfs_minix)" +//config: default y +//config: depends on FSCK_MINIX || MKFS_MINIX +//config: help +//config: If you wish to be able to create version 2 minix filesystems, enable +//config: this. If you enabled 'mkfs_minix' then you almost certainly want to +//config: be using the version 2 filesystem support. + +//applet:IF_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, BB_DIR_SBIN, BB_SUID_DROP, mkfs_minix)) + +//kbuild:lib-$(CONFIG_MKFS_MINIX) += mkfs_minix.o //usage:#define mkfs_minix_trivial_usage //usage: "[-c | -l FILE] [-nXX] [-iXX] BLOCKDEV [KBYTES]" diff --git a/util-linux/mkfs_reiser.c b/util-linux/mkfs_reiser.c index 0a31ee44f..d01119f7f 100644 --- a/util-linux/mkfs_reiser.c +++ b/util-linux/mkfs_reiser.c @@ -6,6 +6,17 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config MKFS_REISER +//config: bool "mkfs_reiser" +//config: default n +//config: select PLATFORM_LINUX +//config: help +//config: Utility to create ReiserFS filesystems. +//config: Note: this applet needs a lot of testing and polishing. + +//applet:IF_MKFS_REISER(APPLET_ODDNAME(mkfs.reiser, mkfs_reiser, BB_DIR_SBIN, BB_SUID_DROP, mkfs_reiser)) + +//kbuild:lib-$(CONFIG_MKFS_REISER) += mkfs_reiser.o //usage:#define mkfs_reiser_trivial_usage //usage: "[-f] [-l LABEL] BLOCKDEV [4K-BLOCKS]" diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c index dcb53f008..954a1948d 100644 --- a/util-linux/mkswap.c +++ b/util-linux/mkswap.c @@ -5,6 +5,29 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config MKSWAP +//config: bool "mkswap" +//config: default y +//config: help +//config: The mkswap utility is used to configure a file or disk partition as +//config: Linux swap space. This allows Linux to use the entire file or +//config: partition as if it were additional RAM, which can greatly increase +//config: the capability of low-memory machines. This additional memory is +//config: much slower than real RAM, but can be very helpful at preventing your +//config: applications being killed by the Linux out of memory (OOM) killer. +//config: Once you have created swap space using 'mkswap' you need to enable +//config: the swap space using the 'swapon' utility. +//config: +//config:config FEATURE_MKSWAP_UUID +//config: bool "UUID support" +//config: default y +//config: depends on MKSWAP +//config: help +//config: Generate swap spaces with universally unique identifiers. + +//applet:IF_MKSWAP(APPLET(mkswap, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_MKSWAP) += mkswap.o //usage:#define mkswap_trivial_usage //usage: "[-L LBL] BLOCKDEV [KBYTES]" diff --git a/util-linux/more.c b/util-linux/more.c index 07836e29d..934b30f8a 100644 --- a/util-linux/more.c +++ b/util-linux/more.c @@ -13,6 +13,19 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config MORE +//config: bool "more" +//config: default y +//config: help +//config: more is a simple utility which allows you to read text one screen +//config: sized page at a time. If you want to read text that is larger than +//config: the screen, and you are using anything faster than a 300 baud modem, +//config: you will probably find this utility very helpful. If you don't have +//config: any need to reading text files, you can leave this disabled. + +//applet:IF_MORE(APPLET(more, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_MORE) += more.o //usage:#define more_trivial_usage //usage: "[FILE]..." diff --git a/util-linux/mount.c b/util-linux/mount.c index eb8b7ba7b..42962b859 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c @@ -112,6 +112,14 @@ //config: help //config: Support mount -T (specifying an alternate fstab) +/* On full-blown systems, requires suid for user mounts. + * But it's not unthinkable to have it available in non-suid flavor on some systems, + * for viewing mount table. + * Therefore we use BB_SUID_MAYBE instead of BB_SUID_REQUIRE: */ +//applet:IF_MOUNT(APPLET(mount, BB_DIR_BIN, IF_DESKTOP(BB_SUID_MAYBE) IF_NOT_DESKTOP(BB_SUID_DROP))) + +//kbuild:lib-$(CONFIG_MOUNT) += mount.o + //usage:#define mount_trivial_usage //usage: "[OPTIONS] [-o OPT] DEVICE NODE" //usage:#define mount_full_usage "\n\n" diff --git a/util-linux/pivot_root.c b/util-linux/pivot_root.c index 83f01fabd..9bdae506c 100644 --- a/util-linux/pivot_root.c +++ b/util-linux/pivot_root.c @@ -8,6 +8,22 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config PIVOT_ROOT +//config: bool "pivot_root" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The pivot_root utility swaps the mount points for the root filesystem +//config: with some other mounted filesystem. This allows you to do all sorts +//config: of wild and crazy things with your Linux system and is far more +//config: powerful than 'chroot'. +//config: +//config: Note: This is for initrd in linux 2.4. Under initramfs (introduced +//config: in linux 2.6) use switch_root instead. + +//applet:IF_PIVOT_ROOT(APPLET(pivot_root, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_PIVOT_ROOT) += pivot_root.o //usage:#define pivot_root_trivial_usage //usage: "NEW_ROOT PUT_OLD" diff --git a/util-linux/rdate.c b/util-linux/rdate.c index 8075ef6af..8dd784d3d 100644 --- a/util-linux/rdate.c +++ b/util-linux/rdate.c @@ -6,7 +6,19 @@ * by Sterling Huxley * * Licensed under GPLv2 or later, see file LICENSE in this source tree. -*/ + */ +//config:config RDATE +//config: bool "rdate" +//config: default y +//config: help +//config: The rdate utility allows you to synchronize the date and time of your +//config: system clock with the date and time of a remote networked system using +//config: the RFC868 protocol, which is built into the inetd daemon on most +//config: systems. + +//applet:IF_RDATE(APPLET(rdate, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_RDATE) += rdate.o //usage:#define rdate_trivial_usage //usage: "[-sp] HOST" diff --git a/util-linux/rdev.c b/util-linux/rdev.c index 465281756..0e1578e33 100644 --- a/util-linux/rdev.c +++ b/util-linux/rdev.c @@ -8,6 +8,15 @@ * Licensed under GPLv2, see file LICENSE in this source tree. * */ +//config:config RDEV +//config: bool "rdev" +//config: default y +//config: help +//config: Print the device node associated with the filesystem mounted at '/'. + +//applet:IF_RDEV(APPLET(rdev, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_RDEV) += rdev.o //usage:#define rdev_trivial_usage //usage: "" diff --git a/util-linux/readprofile.c b/util-linux/readprofile.c index 345b676ba..d5230387c 100644 --- a/util-linux/readprofile.c +++ b/util-linux/readprofile.c @@ -31,6 +31,16 @@ * Taken from util-linux and adapted for busybox by * Paul Mundt . */ +//config:config READPROFILE +//config: bool "readprofile" +//config: default y +//config: #select PLATFORM_LINUX +//config: help +//config: This allows you to parse /proc/profile for basic profiling. + +//applet:IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_READPROFILE) += readprofile.o //usage:#define readprofile_trivial_usage //usage: "[OPTIONS]" diff --git a/util-linux/rev.c b/util-linux/rev.c index 3c1b22f09..c22505314 100644 --- a/util-linux/rev.c +++ b/util-linux/rev.c @@ -5,17 +5,16 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ - -//applet:IF_REV(APPLET(rev, BB_DIR_BIN, BB_SUID_DROP)) - -//kbuild:lib-$(CONFIG_REV) += rev.o - //config:config REV //config: bool "rev" //config: default y //config: help //config: Reverse lines of a file or files. +//applet:IF_REV(APPLET(rev, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_REV) += rev.o + //usage:#define rev_trivial_usage //usage: "[FILE]..." //usage:#define rev_full_usage "\n\n" diff --git a/util-linux/rtcwake.c b/util-linux/rtcwake.c index 8aee0cfcb..54fc70583 100644 --- a/util-linux/rtcwake.c +++ b/util-linux/rtcwake.c @@ -22,6 +22,16 @@ * RTC uses a local timezone instead (maybe you dual-boot MS-Windows). * That flag should not be needed on systems with adjtime support. */ +//config:config RTCWAKE +//config: bool "rtcwake" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Enter a system sleep state until specified wakeup time. + +//applet:IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_RTCWAKE) += rtcwake.o //usage:#define rtcwake_trivial_usage //usage: "[-a | -l | -u] [-d DEV] [-m MODE] [-s SEC | -t TIME]" diff --git a/util-linux/script.c b/util-linux/script.c index 86475c1f1..c5063e8a1 100644 --- a/util-linux/script.c +++ b/util-linux/script.c @@ -10,6 +10,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config SCRIPT +//config: bool "script" +//config: default y +//config: help +//config: The script makes typescript of terminal session. + +//applet:IF_SCRIPT(APPLET(script, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SCRIPT) += script.o //usage:#define script_trivial_usage //usage: "[-afq" IF_SCRIPTREPLAY("t") "] [-c PROG] [OUTFILE]" diff --git a/util-linux/scriptreplay.c b/util-linux/scriptreplay.c index 382f56d9a..8a0c7489d 100644 --- a/util-linux/scriptreplay.c +++ b/util-linux/scriptreplay.c @@ -7,6 +7,16 @@ * Licensed under GPLv2 or later, see file LICENSE in this source tree. * */ +//config:config SCRIPTREPLAY +//config: bool "scriptreplay" +//config: default y +//config: help +//config: This program replays a typescript, using timing information +//config: given by script -t. + +//applet:IF_SCRIPTREPLAY(APPLET(scriptreplay, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SCRIPTREPLAY) += scriptreplay.o //usage:#define scriptreplay_trivial_usage //usage: "timingfile [typescript [divisor]]" diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index 0a2d23f50..b8f4e9447 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c @@ -6,7 +6,6 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ - //config:config SWAPON //config: bool "swapon" //config: default y diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c index 7960b672c..6034485d7 100644 --- a/util-linux/switch_root.c +++ b/util-linux/switch_root.c @@ -5,6 +5,29 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config SWITCH_ROOT +//config: bool "switch_root" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The switch_root utility is used from initramfs to select a new +//config: root device. Under initramfs, you have to use this instead of +//config: pivot_root. (Stop reading here if you don't care why.) +//config: +//config: Booting with initramfs extracts a gzipped cpio archive into rootfs +//config: (which is a variant of ramfs/tmpfs). Because rootfs can't be moved +//config: or unmounted*, pivot_root will not work from initramfs. Instead, +//config: switch_root deletes everything out of rootfs (including itself), +//config: does a mount --move that overmounts rootfs with the new root, and +//config: then execs the specified init program. +//config: +//config: * Because the Linux kernel uses rootfs internally as the starting +//config: and ending point for searching through the kernel's doubly linked +//config: list of active mount points. That's why. + +//applet:IF_SWITCH_ROOT(APPLET(switch_root, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SWITCH_ROOT) += switch_root.o //usage:#define switch_root_trivial_usage //usage: "[-c /dev/console] NEW_ROOT NEW_INIT [ARGS]" diff --git a/util-linux/uevent.c b/util-linux/uevent.c index b98fe6160..c22216a8a 100644 --- a/util-linux/uevent.c +++ b/util-linux/uevent.c @@ -3,7 +3,6 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ - //config:config UEVENT //config: bool "uevent" //config: default y diff --git a/util-linux/umount.c b/util-linux/umount.c index 91da69674..78eef57a5 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c @@ -7,6 +7,26 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config UMOUNT +//config: bool "umount" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: When you want to remove a mounted filesystem from its current mount +//config: point, for example when you are shutting down the system, the +//config: 'umount' utility is the tool to use. If you enabled the 'mount' +//config: utility, you almost certainly also want to enable 'umount'. +//config: +//config:config FEATURE_UMOUNT_ALL +//config: bool "Support option -a" +//config: default y +//config: depends on UMOUNT +//config: help +//config: Support -a option to unmount all currently mounted filesystems. + +//applet:IF_UMOUNT(APPLET(umount, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_UMOUNT) += umount.o //usage:#define umount_trivial_usage //usage: "[OPTIONS] FILESYSTEM|DIRECTORY" diff --git a/util-linux/unshare.c b/util-linux/unshare.c index dcc59559a..bbabeef55 100644 --- a/util-linux/unshare.c +++ b/util-linux/unshare.c @@ -6,7 +6,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - //config:config UNSHARE //config: bool "unshare" //config: default y -- cgit v1.2.3-55-g6feb From af3f42011628585cd5c8f5c1fd4b43f2e370a23d Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Nov 2016 14:46:56 +0100 Subject: Convert all coreutils/* applets to "new style" applet definitions Signed-off-by: Denys Vlasenko --- coreutils/Config.src | 644 -------------------------------------------------- coreutils/Kbuild.src | 73 +----- coreutils/basename.c | 13 +- coreutils/cal.c | 18 +- coreutils/cat.c | 16 +- coreutils/catv.c | 11 + coreutils/chgrp.c | 9 + coreutils/chmod.c | 9 + coreutils/chown.c | 17 ++ coreutils/chroot.c | 10 + coreutils/cksum.c | 9 + coreutils/comm.c | 10 + coreutils/cp.c | 22 +- coreutils/cut.c | 10 + coreutils/date.c | 11 +- coreutils/dd.c | 6 +- coreutils/df.c | 28 ++- coreutils/dirname.c | 10 + coreutils/dos2unix.c | 22 +- coreutils/du.c | 24 +- coreutils/echo.c | 24 +- coreutils/env.c | 26 +- coreutils/expand.c | 31 +++ coreutils/expr.c | 25 +- coreutils/false.c | 9 + coreutils/fold.c | 9 + coreutils/fsync.c | 9 + coreutils/head.c | 19 +- coreutils/hostid.c | 5 +- coreutils/id.c | 11 +- coreutils/install.c | 16 ++ coreutils/ln.c | 9 + coreutils/logname.c | 16 +- coreutils/ls.c | 70 +++++- coreutils/mkdir.c | 24 +- coreutils/mkfifo.c | 10 + coreutils/mknod.c | 10 + coreutils/mv.c | 23 +- coreutils/nice.c | 9 + coreutils/nohup.c | 9 + coreutils/od.c | 9 + coreutils/printenv.c | 9 + coreutils/printf.c | 11 + coreutils/pwd.c | 11 +- coreutils/readlink.c | 17 ++ coreutils/realpath.c | 15 +- coreutils/rm.c | 16 +- coreutils/rmdir.c | 17 ++ coreutils/seq.c | 9 + coreutils/sleep.c | 44 +++- coreutils/sort.c | 21 ++ coreutils/split.c | 19 ++ coreutils/stat.c | 3 + coreutils/stty.c | 10 +- coreutils/sum.c | 9 + coreutils/sync.c | 7 +- coreutils/tac.c | 14 +- coreutils/tail.c | 30 ++- coreutils/tee.c | 17 ++ coreutils/test.c | 13 +- coreutils/touch.c | 14 +- coreutils/tr.c | 7 +- coreutils/true.c | 9 + coreutils/truncate.c | 4 +- coreutils/tty.c | 10 + coreutils/uname.c | 25 +- coreutils/uniq.c | 9 + coreutils/unlink.c | 5 +- coreutils/usleep.c | 9 + coreutils/uudecode.c | 9 + coreutils/uuencode.c | 9 + coreutils/wc.c | 25 +- coreutils/who.c | 8 +- coreutils/whoami.c | 12 +- coreutils/yes.c | 17 +- include/applets.src.h | 70 ------ 76 files changed, 950 insertions(+), 929 deletions(-) (limited to 'include') diff --git a/coreutils/Config.src b/coreutils/Config.src index b9dde1209..a35198a3b 100644 --- a/coreutils/Config.src +++ b/coreutils/Config.src @@ -7,656 +7,12 @@ menu "Coreutils" INSERT -config CAL - bool "cal" - default y - help - cal is used to display a monthly calendar. - -config CATV - bool "catv" - default y - help - Display nonprinting characters as escape sequences (like some - implementations' cat -v option). - -config CHGRP - bool "chgrp" - default y - help - chgrp is used to change the group ownership of files. - -config CHMOD - bool "chmod" - default y - help - chmod is used to change the access permission of files. - -config CHOWN - bool "chown" - default y - help - chown is used to change the user and/or group ownership - of files. - -config FEATURE_CHOWN_LONG_OPTIONS - bool "Enable long options" - default y - depends on CHOWN && LONG_OPTS - help - Enable use of long options - -config CHROOT - bool "chroot" - default y - help - chroot is used to change the root directory and run a command. - The default command is `/bin/sh'. - -config CKSUM - bool "cksum" - default y - help - cksum is used to calculate the CRC32 checksum of a file. - -config COMM - bool "comm" - default y - help - comm is used to compare two files line by line and return - a three-column output. - -config CP - bool "cp" - default y - help - cp is used to copy files and directories. - -config FEATURE_CP_LONG_OPTIONS - bool "Enable long options for cp" - default y - depends on CP && LONG_OPTS - help - Enable long options for cp. - Also add support for --parents option. - -config CUT - bool "cut" - default y - help - cut is used to print selected parts of lines from - each file to stdout. - -config DF - bool "df" - default y - help - df reports the amount of disk space used and available - on filesystems. - -config FEATURE_DF_FANCY - bool "Enable -a, -i, -B" - default y - depends on DF - help - This option enables -a, -i and -B. - - -a Show all filesystems - -i Inodes - -B Blocksize - -config DIRNAME - bool "dirname" - default y - help - dirname is used to strip a non-directory suffix from - a file name. - -config DOS2UNIX - bool "dos2unix/unix2dos" - default y - help - dos2unix is used to convert a text file from DOS format to - UNIX format, and vice versa. - -config UNIX2DOS - bool - default y - depends on DOS2UNIX - help - unix2dos is used to convert a text file from UNIX format to - DOS format, and vice versa. - -config DU - bool "du (default blocksize of 512 bytes)" - default y - help - du is used to report the amount of disk space used - for specified files. - -config FEATURE_DU_DEFAULT_BLOCKSIZE_1K - bool "Use a default blocksize of 1024 bytes (1K)" - default y - depends on DU - help - Use a blocksize of (1K) instead of the default 512b. - -config ECHO - bool "echo (basic SuSv3 version taking no options)" - default y - help - echo is used to print a specified string to stdout. - -# this entry also appears in shell/Config.in, next to the echo builtin -config FEATURE_FANCY_ECHO - bool "Enable echo options (-n and -e)" - default y - depends on ECHO || ASH_BUILTIN_ECHO || HUSH - help - This adds options (-n and -e) to echo. - -config ENV - bool "env" - default y - help - env is used to set an environment variable and run - a command; without options it displays the current - environment. - -config FEATURE_ENV_LONG_OPTIONS - bool "Enable long options" - default y - depends on ENV && LONG_OPTS - help - Support long options for the env applet. - -config EXPAND - bool "expand" - default y - help - By default, convert all tabs to spaces. - -config FEATURE_EXPAND_LONG_OPTIONS - bool "Enable long options" - default y - depends on EXPAND && LONG_OPTS - help - Support long options for the expand applet. - -config EXPR - bool "expr" - default y - help - expr is used to calculate numbers and print the result - to standard output. - -config EXPR_MATH_SUPPORT_64 - bool "Extend Posix numbers support to 64 bit" - default y - depends on EXPR - help - Enable 64-bit math support in the expr applet. This will make - the applet slightly larger, but will allow computation with very - large numbers. - -config FALSE - bool "false" - default y - help - false returns an exit code of FALSE (1). - -config FOLD - bool "fold" - default y - help - Wrap text to fit a specific width. - -config FSYNC - bool "fsync" - default y - help - fsync is used to flush file-related cached blocks to disk. - -config HEAD - bool "head" - default y - help - head is used to print the first specified number of lines - from files. - -config FEATURE_FANCY_HEAD - bool "Enable head options (-c, -q, and -v)" - default y - depends on HEAD - help - This enables the head options (-c, -q, and -v). - -config INSTALL - bool "install" - default y - help - Copy files and set attributes. - -config FEATURE_INSTALL_LONG_OPTIONS - bool "Enable long options" - default y - depends on INSTALL && LONG_OPTS - help - Support long options for the install applet. - ####config LENGTH #### bool "length" #### default y #### help #### length is used to print out the length of a specified string. -config LN - bool "ln" - default y - help - ln is used to create hard or soft links between files. - -config LOGNAME - bool "logname" - default y - help - logname is used to print the current user's login name. - -config LS - bool "ls" - default y - help - ls is used to list the contents of directories. - -config FEATURE_LS_FILETYPES - bool "Enable filetyping options (-p and -F)" - default y - depends on LS - help - Enable the ls options (-p and -F). - -config FEATURE_LS_FOLLOWLINKS - bool "Enable symlinks dereferencing (-L)" - default y - depends on LS - help - Enable the ls option (-L). - -config FEATURE_LS_RECURSIVE - bool "Enable recursion (-R)" - default y - depends on LS - help - Enable the ls option (-R). - -config FEATURE_LS_SORTFILES - bool "Sort the file names" - default y - depends on LS - help - Allow ls to sort file names alphabetically. - -config FEATURE_LS_TIMESTAMPS - bool "Show file timestamps" - default y - depends on LS - help - Allow ls to display timestamps for files. - -config FEATURE_LS_USERNAME - bool "Show username/groupnames" - default y - depends on LS - help - Allow ls to display username/groupname for files. - -config FEATURE_LS_COLOR - bool "Allow use of color to identify file types" - default y - depends on LS && LONG_OPTS - help - This enables the --color option to ls. - -config FEATURE_LS_COLOR_IS_DEFAULT - bool "Produce colored ls output by default" - default y - depends on FEATURE_LS_COLOR - help - Saying yes here will turn coloring on by default, - even if no "--color" option is given to the ls command. - This is not recommended, since the colors are not - configurable, and the output may not be legible on - many output screens. - -config MKDIR - bool "mkdir" - default y - help - mkdir is used to create directories with the specified names. - -config FEATURE_MKDIR_LONG_OPTIONS - bool "Enable long options" - default y - depends on MKDIR && LONG_OPTS - help - Support long options for the mkdir applet. - -config MKFIFO - bool "mkfifo" - default y - help - mkfifo is used to create FIFOs (named pipes). - The `mknod' program can also create FIFOs. - -config MKNOD - bool "mknod" - default y - help - mknod is used to create FIFOs or block/character special - files with the specified names. - -config MV - bool "mv" - default y - help - mv is used to move or rename files or directories. - -config FEATURE_MV_LONG_OPTIONS - bool "Enable long options" - default y - depends on MV && LONG_OPTS - help - Support long options for the mv applet. - -config NICE - bool "nice" - default y - help - nice runs a program with modified scheduling priority. - -config NOHUP - bool "nohup" - default y - help - run a command immune to hangups, with output to a non-tty. - -config OD - bool "od" - default y - help - od is used to dump binary files in octal and other formats. - -config PRINTENV - bool "printenv" - default y - help - printenv is used to print all or part of environment. - -config PRINTF - bool "printf" - default y - help - printf is used to format and print specified strings. - It's similar to `echo' except it has more options. - -config PWD - bool "pwd" - default y - help - pwd is used to print the current directory. - -config READLINK - bool "readlink" - default y - help - This program reads a symbolic link and returns the name - of the file it points to - -config FEATURE_READLINK_FOLLOW - bool "Enable canonicalization by following all symlinks (-f)" - default y - depends on READLINK - help - Enable the readlink option (-f). - -config REALPATH - bool "realpath" - default y - help - Return the canonicalized absolute pathname. - This isn't provided by GNU shellutils, but where else does it belong. - -config RM - bool "rm" - default y - help - rm is used to remove files or directories. - -config RMDIR - bool "rmdir" - default y - help - rmdir is used to remove empty directories. - -config FEATURE_RMDIR_LONG_OPTIONS - bool "Enable long options" - default y - depends on RMDIR && LONG_OPTS - help - Support long options for the rmdir applet, including - --ignore-fail-on-non-empty for compatibility with GNU rmdir. - -config SEQ - bool "seq" - default y - help - print a sequence of numbers - -config SLEEP - bool "sleep" - default y - help - sleep is used to pause for a specified number of seconds. - It comes in 3 versions: - - small: takes one integer parameter - - fancy: takes multiple integer arguments with suffixes: - sleep 1d 2h 3m 15s - - fancy with fractional numbers: - sleep 2.3s 4.5h sleeps for 16202.3 seconds - Last one is "the most compatible" with coreutils sleep, - but it adds around 1k of code. - -config FEATURE_FANCY_SLEEP - bool "Enable multiple arguments and s/m/h/d suffixes" - default y - depends on SLEEP - help - Allow sleep to pause for specified minutes, hours, and days. - -config FEATURE_FLOAT_SLEEP - bool "Enable fractional arguments" - default y - depends on FEATURE_FANCY_SLEEP - help - Allow for fractional numeric parameters. - -config SORT - bool "sort" - default y - help - sort is used to sort lines of text in specified files. - -config FEATURE_SORT_BIG - bool "Full SuSv3 compliant sort (support -ktcsbdfiozgM)" - default y - depends on SORT - help - Without this, sort only supports -r, -u, and an integer version - of -n. Selecting this adds sort keys, floating point support, and - more. This adds a little over 3k to a nonstatic build on x86. - - The SuSv3 sort standard is available at: - http://www.opengroup.org/onlinepubs/007904975/utilities/sort.html - -config SPLIT - bool "split" - default y - help - split a file into pieces. - -config FEATURE_SPLIT_FANCY - bool "Fancy extensions" - default y - depends on SPLIT - help - Add support for features not required by SUSv3. - Supports additional suffixes 'b' for 512 bytes, - 'g' for 1GiB for the -b option. - -config STTY - bool "stty" - default y - help - stty is used to change and print terminal line settings. - -config SUM - bool "sum" - default y - help - checksum and count the blocks in a file - -config TAC - bool "tac" - default y - help - tac is used to concatenate and print files in reverse. - -config TAIL - bool "tail" - default y - help - tail is used to print the last specified number of lines - from files. - -config FEATURE_FANCY_TAIL - bool "Enable extra tail options (-q, -s, -v, and -F)" - default y - depends on TAIL - help - The options (-q, -s, -v and -F) are provided by GNU tail, but - are not specific in the SUSv3 standard. - - -q Never output headers giving file names - -s SEC Wait SEC seconds between reads with -f - -v Always output headers giving file names - -F Same as -f, but keep retrying - -config TEE - bool "tee" - default y - help - tee is used to read from standard input and write - to standard output and files. - -config FEATURE_TEE_USE_BLOCK_IO - bool "Enable block I/O (larger/faster) instead of byte I/O" - default y - depends on TEE - help - Enable this option for a faster tee, at expense of size. - -config TRUE - bool "true" - default y - help - true returns an exit code of TRUE (0). - -config TTY - bool "tty" - default y - help - tty is used to print the name of the current terminal to - standard output. - -config UNAME - bool "uname" - default y - help - uname is used to print system information. - -config UNAME_OSNAME - string "Operating system name" - default "GNU/Linux" - depends on UNAME - help - Sets the operating system name reported by uname -o. The - default is "GNU/Linux". - -config UNEXPAND - bool "unexpand" - default y - help - By default, convert only leading sequences of blanks to tabs. - -config FEATURE_UNEXPAND_LONG_OPTIONS - bool "Enable long options" - default y - depends on UNEXPAND && LONG_OPTS - help - Support long options for the unexpand applet. - -config UNIQ - bool "uniq" - default y - help - uniq is used to remove duplicate lines from a sorted file. - -config USLEEP - bool "usleep" - default y - help - usleep is used to pause for a specified number of microseconds. - -config UUDECODE - bool "uudecode" - default y - help - uudecode is used to decode a uuencoded file. - -config UUENCODE - bool "uuencode" - default y - help - uuencode is used to uuencode a file. - -config WC - bool "wc" - default y - help - wc is used to print the number of bytes, words, and lines, - in specified files. - -config FEATURE_WC_LARGE - bool "Support very large files in wc" - default y - depends on WC - help - Use "unsigned long long" in wc for counter variables. - -config WHOAMI - bool "whoami" - default y - help - whoami is used to print the username of the current - user id (same as id -un). - -config YES - bool "yes" - default y - help - yes is used to repeatedly output a specific string, or - the default string `y'. - comment "Common options" config FEATURE_VERBOSE diff --git a/coreutils/Kbuild.src b/coreutils/Kbuild.src index 5a64fee35..c93aa63a1 100644 --- a/coreutils/Kbuild.src +++ b/coreutils/Kbuild.src @@ -9,70 +9,15 @@ libs-y += libcoreutils/ lib-y:= INSERT -lib-$(CONFIG_CAL) += cal.o -lib-$(CONFIG_CATV) += catv.o -lib-$(CONFIG_CHGRP) += chgrp.o chown.o -lib-$(CONFIG_CHMOD) += chmod.o -lib-$(CONFIG_CHOWN) += chown.o + +#lib-$(CONFIG_LENGTH) += length.o + +lib-$(CONFIG_MORE) += cat.o # more uses it if stdout isn't a tty +lib-$(CONFIG_LESS) += cat.o # less too +lib-$(CONFIG_CRONTAB) += cat.o # crontab -l lib-$(CONFIG_ADDUSER) += chown.o # used by adduser lib-$(CONFIG_ADDGROUP) += chown.o # used by adduser -lib-$(CONFIG_CHROOT) += chroot.o -lib-$(CONFIG_CKSUM) += cksum.o -lib-$(CONFIG_COMM) += comm.o -lib-$(CONFIG_CP) += cp.o -lib-$(CONFIG_CUT) += cut.o -lib-$(CONFIG_DD) += dd.o -lib-$(CONFIG_DF) += df.o -lib-$(CONFIG_DIRNAME) += dirname.o -lib-$(CONFIG_DOS2UNIX) += dos2unix.o -lib-$(CONFIG_DU) += du.o -lib-$(CONFIG_ECHO) += echo.o -lib-$(CONFIG_ASH) += echo.o # used by ash -lib-$(CONFIG_HUSH) += echo.o # used by hush -lib-$(CONFIG_ENV) += env.o -lib-$(CONFIG_EXPR) += expr.o -lib-$(CONFIG_EXPAND) += expand.o -lib-$(CONFIG_FALSE) += false.o -lib-$(CONFIG_FOLD) += fold.o -lib-$(CONFIG_FSYNC) += fsync.o -lib-$(CONFIG_INSTALL) += install.o -#lib-$(CONFIG_LENGTH) += length.o -lib-$(CONFIG_LN) += ln.o -lib-$(CONFIG_LOGNAME) += logname.o -lib-$(CONFIG_LS) += ls.o -lib-$(CONFIG_FTPD) += ls.o -lib-$(CONFIG_MKDIR) += mkdir.o -lib-$(CONFIG_MKFIFO) += mkfifo.o -lib-$(CONFIG_MKNOD) += mknod.o -lib-$(CONFIG_MV) += mv.o -lib-$(CONFIG_NICE) += nice.o -lib-$(CONFIG_NOHUP) += nohup.o -lib-$(CONFIG_OD) += od.o -lib-$(CONFIG_PRINTENV) += printenv.o -lib-$(CONFIG_PRINTF) += printf.o +lib-$(CONFIG_ASH) += echo.o # used by ash +lib-$(CONFIG_HUSH) += echo.o # used by hush +lib-$(CONFIG_FTPD) += ls.o # used by ftpd lib-$(CONFIG_ASH_BUILTIN_PRINTF) += printf.o -lib-$(CONFIG_PWD) += pwd.o -lib-$(CONFIG_READLINK) += readlink.o -lib-$(CONFIG_REALPATH) += realpath.o -lib-$(CONFIG_RM) += rm.o -lib-$(CONFIG_RMDIR) += rmdir.o -lib-$(CONFIG_SEQ) += seq.o -lib-$(CONFIG_SLEEP) += sleep.o -lib-$(CONFIG_SPLIT) += split.o -lib-$(CONFIG_SORT) += sort.o -lib-$(CONFIG_STAT) += stat.o -lib-$(CONFIG_STTY) += stty.o -lib-$(CONFIG_SUM) += sum.o -lib-$(CONFIG_TAC) += tac.o -lib-$(CONFIG_TEE) += tee.o -lib-$(CONFIG_TRUE) += true.o -lib-$(CONFIG_TTY) += tty.o -lib-$(CONFIG_UNAME) += uname.o -lib-$(CONFIG_UNEXPAND) += expand.o -lib-$(CONFIG_UNIQ) += uniq.o -lib-$(CONFIG_USLEEP) += usleep.o -lib-$(CONFIG_UUDECODE) += uudecode.o -lib-$(CONFIG_UUENCODE) += uuencode.o -lib-$(CONFIG_WC) += wc.o -lib-$(CONFIG_WHOAMI) += whoami.o -lib-$(CONFIG_YES) += yes.o diff --git a/coreutils/basename.c b/coreutils/basename.c index ab0c972ed..ace0148c0 100644 --- a/coreutils/basename.c +++ b/coreutils/basename.c @@ -14,12 +14,6 @@ * 2) Don't check for options, as per SUSv3. * 3) Save some space by using strcmp(). Calling strncmp() here was silly. */ - -/* BB_AUDIT SUSv3 compliant */ -/* http://www.opengroup.org/onlinepubs/007904975/utilities/basename.html */ - -//kbuild:lib-$(CONFIG_BASENAME) += basename.o - //config:config BASENAME //config: bool "basename" //config: default y @@ -28,6 +22,13 @@ //config: leaving just the filename itself. Enable this option if you wish //config: to enable the 'basename' utility. +//applet:IF_BASENAME(APPLET_NOFORK(basename, basename, BB_DIR_USR_BIN, BB_SUID_DROP, basename)) + +//kbuild:lib-$(CONFIG_BASENAME) += basename.o + +/* BB_AUDIT SUSv3 compliant */ +/* http://www.opengroup.org/onlinepubs/007904975/utilities/basename.html */ + //usage:#define basename_trivial_usage //usage: "FILE [SUFFIX]" //usage:#define basename_full_usage "\n\n" diff --git a/coreutils/cal.c b/coreutils/cal.c index 12c46b14f..af02608f0 100644 --- a/coreutils/cal.c +++ b/coreutils/cal.c @@ -6,17 +6,25 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +/* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) + * + * Major size reduction... over 50% (>1.5k) on i386. + */ +//config:config CAL +//config: bool "cal" +//config: default y +//config: help +//config: cal is used to display a monthly calendar. + +//applet:IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_CAL) += cal.o /* BB_AUDIT SUSv3 compliant with -j and -y extensions (from util-linux). */ /* BB_AUDIT BUG: The output of 'cal -j 1752' is incorrect. The upstream * BB_AUDIT BUG: version in util-linux seems to be broken as well. */ /* http://www.opengroup.org/onlinepubs/007904975/utilities/cal.html */ -/* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) - * - * Major size reduction... over 50% (>1.5k) on i386. - */ - //usage:#define cal_trivial_usage //usage: "[-jy] [[MONTH] YEAR]" //usage:#define cal_full_usage "\n\n" diff --git a/coreutils/cat.c b/coreutils/cat.c index 00c38d486..65978887e 100644 --- a/coreutils/cat.c +++ b/coreutils/cat.c @@ -6,15 +6,6 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ - -/* BB_AUDIT SUSv3 compliant */ -/* http://www.opengroup.org/onlinepubs/007904975/utilities/cat.html */ - -//kbuild:lib-$(CONFIG_CAT) += cat.o -//kbuild:lib-$(CONFIG_MORE) += cat.o # more uses it if stdout isn't a tty -//kbuild:lib-$(CONFIG_LESS) += cat.o # less too -//kbuild:lib-$(CONFIG_CRONTAB) += cat.o # crontab -l - //config:config CAT //config: bool "cat" //config: default y @@ -22,6 +13,13 @@ //config: cat is used to concatenate files and print them to the standard //config: output. Enable this option if you wish to enable the 'cat' utility. +//applet:IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat)) + +//kbuild:lib-$(CONFIG_CAT) += cat.o + +/* BB_AUDIT SUSv3 compliant */ +/* http://www.opengroup.org/onlinepubs/007904975/utilities/cat.html */ + //usage:#define cat_trivial_usage //usage: "[FILE]..." //usage:#define cat_full_usage "\n\n" diff --git a/coreutils/catv.c b/coreutils/catv.c index 0e71368a5..1aeebe1d9 100644 --- a/coreutils/catv.c +++ b/coreutils/catv.c @@ -10,6 +10,17 @@ /* See "Cat -v considered harmful" at * http://cm.bell-labs.com/cm/cs/doc/84/kp.ps.gz */ +//config:config CATV +//config: bool "catv" +//config: default y +//config: help +//config: Display nonprinting characters as escape sequences (like some +//config: implementations' cat -v option). + +//applet:IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_CATV) += catv.o + //usage:#define catv_trivial_usage //usage: "[-etv] [FILE]..." //usage:#define catv_full_usage "\n\n" diff --git a/coreutils/chgrp.c b/coreutils/chgrp.c index 7076db62f..8dca63cf7 100644 --- a/coreutils/chgrp.c +++ b/coreutils/chgrp.c @@ -6,6 +6,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config CHGRP +//config: bool "chgrp" +//config: default y +//config: help +//config: chgrp is used to change the group ownership of files. + +//applet:IF_CHGRP(APPLET_NOEXEC(chgrp, chgrp, BB_DIR_BIN, BB_SUID_DROP, chgrp)) + +//kbuild:lib-$(CONFIG_CHGRP) += chgrp.o chown.o /* BB_AUDIT SUSv3 defects - none? */ /* BB_AUDIT GNU defects - unsupported long options. */ diff --git a/coreutils/chmod.c b/coreutils/chmod.c index a21c6d501..80913f542 100644 --- a/coreutils/chmod.c +++ b/coreutils/chmod.c @@ -9,6 +9,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config CHMOD +//config: bool "chmod" +//config: default y +//config: help +//config: chmod is used to change the access permission of files. + +//applet:IF_CHMOD(APPLET_NOEXEC(chmod, chmod, BB_DIR_BIN, BB_SUID_DROP, chmod)) + +//kbuild:lib-$(CONFIG_CHMOD) += chmod.o /* BB_AUDIT SUSv3 compliant */ /* BB_AUDIT GNU defects - unsupported long options. */ diff --git a/coreutils/chown.c b/coreutils/chown.c index 247aa3bf1..50b06d73a 100644 --- a/coreutils/chown.c +++ b/coreutils/chown.c @@ -6,6 +6,23 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config CHOWN +//config: bool "chown" +//config: default y +//config: help +//config: chown is used to change the user and/or group ownership +//config: of files. +//config: +//config:config FEATURE_CHOWN_LONG_OPTIONS +//config: bool "Enable long options" +//config: default y +//config: depends on CHOWN && LONG_OPTS +//config: help +//config: Enable use of long options + +//applet:IF_CHOWN(APPLET_NOEXEC(chown, chown, BB_DIR_BIN, BB_SUID_DROP, chown)) + +//kbuild:lib-$(CONFIG_CHOWN) += chown.o /* BB_AUDIT SUSv3 defects - none? */ /* http://www.opengroup.org/onlinepubs/007904975/utilities/chown.html */ diff --git a/coreutils/chroot.c b/coreutils/chroot.c index 633e66b38..5c067c1bd 100644 --- a/coreutils/chroot.c +++ b/coreutils/chroot.c @@ -6,6 +6,16 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config CHROOT +//config: bool "chroot" +//config: default y +//config: help +//config: chroot is used to change the root directory and run a command. +//config: The default command is `/bin/sh'. + +//applet:IF_CHROOT(APPLET(chroot, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_CHROOT) += chroot.o /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ diff --git a/coreutils/cksum.c b/coreutils/cksum.c index 8a8a39f68..aeec0188d 100644 --- a/coreutils/cksum.c +++ b/coreutils/cksum.c @@ -6,6 +6,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config CKSUM +//config: bool "cksum" +//config: default y +//config: help +//config: cksum is used to calculate the CRC32 checksum of a file. + +//applet:IF_CKSUM(APPLET_NOEXEC(cksum, cksum, BB_DIR_USR_BIN, BB_SUID_DROP, cksum)) + +//kbuild:lib-$(CONFIG_CKSUM) += cksum.o //usage:#define cksum_trivial_usage //usage: "FILES..." diff --git a/coreutils/comm.c b/coreutils/comm.c index cd450950b..b6a127809 100644 --- a/coreutils/comm.c +++ b/coreutils/comm.c @@ -6,6 +6,16 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config COMM +//config: bool "comm" +//config: default y +//config: help +//config: comm is used to compare two files line by line and return +//config: a three-column output. + +//applet:IF_COMM(APPLET(comm, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_COMM) += comm.o //usage:#define comm_trivial_usage //usage: "[-123] FILE1 FILE2" diff --git a/coreutils/cp.c b/coreutils/cp.c index 2630c0d59..4ecdaafda 100644 --- a/coreutils/cp.c +++ b/coreutils/cp.c @@ -7,13 +7,29 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -/* http://www.opengroup.org/onlinepubs/007904975/utilities/cp.html */ - /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) * * Size reduction. */ +//config:config CP +//config: bool "cp" +//config: default y +//config: help +//config: cp is used to copy files and directories. +//config: +//config:config FEATURE_CP_LONG_OPTIONS +//config: bool "Enable long options for cp" +//config: default y +//config: depends on CP && LONG_OPTS +//config: help +//config: Enable long options for cp. +//config: Also add support for --parents option. + +//applet:IF_CP(APPLET_NOEXEC(cp, cp, BB_DIR_BIN, BB_SUID_DROP, cp)) + +//kbuild:lib-$(CONFIG_CP) += cp.o + +/* http://www.opengroup.org/onlinepubs/007904975/utilities/cp.html */ //usage:#define cp_trivial_usage //usage: "[OPTIONS] SOURCE... DEST" diff --git a/coreutils/cut.c b/coreutils/cut.c index 84449c775..a33a825f8 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c @@ -8,6 +8,16 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config CUT +//config: bool "cut" +//config: default y +//config: help +//config: cut is used to print selected parts of lines from +//config: each file to stdout. + +//applet:IF_CUT(APPLET_NOEXEC(cut, cut, BB_DIR_USR_BIN, BB_SUID_DROP, cut)) + +//kbuild:lib-$(CONFIG_CUT) += cut.o //usage:#define cut_trivial_usage //usage: "[OPTIONS] [FILE]..." diff --git a/coreutils/date.c b/coreutils/date.c index ff3214d85..9d4a7dfea 100644 --- a/coreutils/date.c +++ b/coreutils/date.c @@ -8,8 +8,7 @@ * bugfixes and cleanup by Bernhard Reutner-Fischer * * Licensed under GPLv2 or later, see file LICENSE in this source tree. -*/ - + */ /* This 'date' command supports only 2 time setting formats, all the GNU strftime stuff (its in libc, lets use it), setting time using UTC and displaying it, as well as @@ -19,10 +18,6 @@ /* Input parsing code is always bulky - used heavy duty libc stuff as much as possible, missed out a lot of bounds checking */ -//applet:IF_DATE(APPLET(date, BB_DIR_BIN, BB_SUID_DROP)) - -//kbuild:lib-$(CONFIG_DATE) += date.o - //config:config DATE //config: bool "date" //config: default y @@ -63,6 +58,10 @@ //config: the same format. With it on, 'date DATE' additionally supports //config: MMDDhhmm[[YY]YY][.ss] format. +//applet:IF_DATE(APPLET(date, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_DATE) += date.o + /* GNU coreutils 6.9 man page: * date [OPTION]... [+FORMAT] * date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]] diff --git a/coreutils/dd.c b/coreutils/dd.c index 4dc302926..3d1ba2ee6 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c @@ -2,12 +2,10 @@ /* * Mini dd implementation for busybox * - * * Copyright (C) 2000,2001 Matt Kraai * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - //config:config DD //config: bool "dd" //config: default y @@ -53,6 +51,10 @@ //config: help //config: Enables support for status=noxfer/none option. +//applet:IF_DD(APPLET_NOEXEC(dd, dd, BB_DIR_BIN, BB_SUID_DROP, dd)) + +//kbuild:lib-$(CONFIG_DD) += dd.o + //usage:#define dd_trivial_usage //usage: "[if=FILE] [of=FILE] " IF_FEATURE_DD_IBS_OBS("[ibs=N] [obs=N] ") "[bs=N] [count=N] [skip=N]\n" //usage: " [seek=N]" IF_FEATURE_DD_IBS_OBS(" [conv=notrunc|noerror|sync|fsync] [iflag=skip_bytes]") diff --git a/coreutils/df.c b/coreutils/df.c index 06b292018..fdcdae675 100644 --- a/coreutils/df.c +++ b/coreutils/df.c @@ -7,10 +7,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -/* BB_AUDIT SUSv3 _NOT_ compliant -- option -t missing. */ -/* http://www.opengroup.org/onlinepubs/007904975/utilities/df.html */ - /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) * * Size reduction. Removed floating point dependency. Added error checking @@ -21,6 +17,30 @@ * * Implement -P and -B; better coreutils compat; cleanup */ +//config:config DF +//config: bool "df" +//config: default y +//config: help +//config: df reports the amount of disk space used and available +//config: on filesystems. +//config: +//config:config FEATURE_DF_FANCY +//config: bool "Enable -a, -i, -B" +//config: default y +//config: depends on DF +//config: help +//config: This option enables -a, -i and -B. +//config: +//config: -a Show all filesystems +//config: -i Inodes +//config: -B Blocksize + +//applet:IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_DF) += df.o + +/* BB_AUDIT SUSv3 _NOT_ compliant -- option -t missing. */ +/* http://www.opengroup.org/onlinepubs/007904975/utilities/df.html */ //usage:#define df_trivial_usage //usage: "[-Pk" diff --git a/coreutils/dirname.c b/coreutils/dirname.c index 101067c90..659381886 100644 --- a/coreutils/dirname.c +++ b/coreutils/dirname.c @@ -6,6 +6,16 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config DIRNAME +//config: bool "dirname" +//config: default y +//config: help +//config: dirname is used to strip a non-directory suffix from +//config: a file name. + +//applet:IF_DIRNAME(APPLET_NOFORK(dirname, dirname, BB_DIR_USR_BIN, BB_SUID_DROP, dirname)) + +//kbuild:lib-$(CONFIG_DIRNAME) += dirname.o /* BB_AUDIT SUSv3 compliant */ /* http://www.opengroup.org/onlinepubs/007904975/utilities/dirname.html */ diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c index ccb74a113..03986ad39 100644 --- a/coreutils/dos2unix.c +++ b/coreutils/dos2unix.c @@ -10,7 +10,27 @@ * dos2unix filters reading input from stdin and writing output to stdout. * * Licensed under GPLv2 or later, see file LICENSE in this source tree. -*/ + */ +//config:config DOS2UNIX +//config: bool "dos2unix/unix2dos" +//config: default y +//config: help +//config: dos2unix is used to convert a text file from DOS format to +//config: UNIX format, and vice versa. +//config: +//config:config UNIX2DOS +//config: bool +//config: default y +//config: depends on DOS2UNIX +//config: help +//config: unix2dos is used to convert a text file from UNIX format to +//config: DOS format, and vice versa. + +//applet:IF_DOS2UNIX(APPLET_NOEXEC(dos2unix, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, dos2unix)) +//applet:IF_UNIX2DOS(APPLET_NOEXEC(unix2dos, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, unix2dos)) + +//kbuild:lib-$(CONFIG_DOS2UNIX) += dos2unix.o +//kbuild:lib-$(CONFIG_UNIX2DOS) += dos2unix.o //usage:#define dos2unix_trivial_usage //usage: "[-ud] [FILE]" diff --git a/coreutils/du.c b/coreutils/du.c index 5f104736b..03e31a0e4 100644 --- a/coreutils/du.c +++ b/coreutils/du.c @@ -8,10 +8,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -/* BB_AUDIT SUSv3 compliant (unless default blocksize set to 1k) */ -/* http://www.opengroup.org/onlinepubs/007904975/utilities/du.html */ - /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) * * Mostly rewritten for SUSv3 compliance and to fix bugs/defects. @@ -22,6 +18,26 @@ * 3) Added error checking of output. * 4) Fixed busybox bug #1284 involving long overflow with human_readable. */ +//config:config DU +//config: bool "du (default blocksize of 512 bytes)" +//config: default y +//config: help +//config: du is used to report the amount of disk space used +//config: for specified files. +//config: +//config:config FEATURE_DU_DEFAULT_BLOCKSIZE_1K +//config: bool "Use a default blocksize of 1024 bytes (1K)" +//config: default y +//config: depends on DU +//config: help +//config: Use a blocksize of (1K) instead of the default 512b. + +//applet:IF_DU(APPLET(du, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_DU) += du.o + +/* BB_AUDIT SUSv3 compliant (unless default blocksize set to 1k) */ +/* http://www.opengroup.org/onlinepubs/007904975/utilities/du.html */ //usage:#define du_trivial_usage //usage: "[-aHLdclsx" IF_FEATURE_HUMAN_READABLE("hm") "k] [FILE]..." diff --git a/coreutils/echo.c b/coreutils/echo.c index 1c4174559..fd0d9b780 100644 --- a/coreutils/echo.c +++ b/coreutils/echo.c @@ -9,10 +9,6 @@ * * Original copyright notice is retained at the end of this file. */ - -/* BB_AUDIT SUSv3 compliant -- unless configured as fancy echo. */ -/* http://www.opengroup.org/onlinepubs/007904975/utilities/echo.html */ - /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) * * Because of behavioral differences, implemented configurable SUSv3 @@ -22,6 +18,26 @@ * 2) SUSv3 specifies that octal escapes are of the form \0{#{#{#}}}. * The previous version did not allow 4-digit octals. */ +//config:config ECHO +//config: bool "echo (basic SuSv3 version taking no options)" +//config: default y +//config: help +//config: echo is used to print a specified string to stdout. +//config: +//config:# this entry also appears in shell/Config.in, next to the echo builtin +//config:config FEATURE_FANCY_ECHO +//config: bool "Enable echo options (-n and -e)" +//config: default y +//config: depends on ECHO || ASH_BUILTIN_ECHO || HUSH +//config: help +//config: This adds options (-n and -e) to echo. + +//applet:IF_ECHO(APPLET_NOFORK(echo, echo, BB_DIR_BIN, BB_SUID_DROP, echo)) + +//kbuild:lib-$(CONFIG_ECHO) += echo.o + +/* BB_AUDIT SUSv3 compliant -- unless configured as fancy echo. */ +/* http://www.opengroup.org/onlinepubs/007904975/utilities/echo.html */ //usage:#define echo_trivial_usage //usage: IF_FEATURE_FANCY_ECHO("[-neE] ") "[ARG]..." diff --git a/coreutils/env.c b/coreutils/env.c index cdfc30e14..e91eddb5c 100644 --- a/coreutils/env.c +++ b/coreutils/env.c @@ -11,16 +11,11 @@ * * Modified for BusyBox by Erik Andersen */ - -/* BB_AUDIT SUSv3 compliant */ -/* http://www.opengroup.org/onlinepubs/007904975/utilities/env.html */ - /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) * * Fixed bug involving exit return codes if execvp fails. Also added * output error checking. */ - /* * Modified by Vladimir Oleynik (C) 2003 * - correct "-" option usage @@ -28,8 +23,27 @@ * - GNU long option support * - use xfunc_error_retval */ +//config:config ENV +//config: bool "env" +//config: default y +//config: help +//config: env is used to set an environment variable and run +//config: a command; without options it displays the current +//config: environment. +//config: +//config:config FEATURE_ENV_LONG_OPTIONS +//config: bool "Enable long options" +//config: default y +//config: depends on ENV && LONG_OPTS +//config: help +//config: Support long options for the env applet. -/* This is a NOEXEC applet. Be very careful! */ +//applet:IF_ENV(APPLET_NOEXEC(env, env, BB_DIR_USR_BIN, BB_SUID_DROP, env)) + +//kbuild:lib-$(CONFIG_ENV) += env.o + +/* BB_AUDIT SUSv3 compliant */ +/* http://www.opengroup.org/onlinepubs/007904975/utilities/env.html */ //usage:#define env_trivial_usage //usage: "[-iu] [-] [name=value]... [PROG ARGS]" diff --git a/coreutils/expand.c b/coreutils/expand.c index 8d376ff4e..bb59af46d 100644 --- a/coreutils/expand.c +++ b/coreutils/expand.c @@ -20,6 +20,37 @@ * * Caveat: this versions of expand and unexpand don't accept tab lists. */ +//config:config EXPAND +//config: bool "expand" +//config: default y +//config: help +//config: By default, convert all tabs to spaces. +//config: +//config:config FEATURE_EXPAND_LONG_OPTIONS +//config: bool "Enable long options" +//config: default y +//config: depends on EXPAND && LONG_OPTS +//config: help +//config: Support long options for the expand applet. +//config: +//config:config UNEXPAND +//config: bool "unexpand" +//config: default y +//config: help +//config: By default, convert only leading sequences of blanks to tabs. +//config: +//config:config FEATURE_UNEXPAND_LONG_OPTIONS +//config: bool "Enable long options" +//config: default y +//config: depends on UNEXPAND && LONG_OPTS +//config: help +//config: Support long options for the unexpand applet. + +//applet:IF_EXPAND(APPLET(expand, BB_DIR_USR_BIN, BB_SUID_DROP)) +//applet:IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand)) + +//kbuild:lib-$(CONFIG_EXPAND) += expand.o +//kbuild:lib-$(CONFIG_UNEXPAND) += expand.o //usage:#define expand_trivial_usage //usage: "[-i] [-t N] [FILE]..." diff --git a/coreutils/expr.c b/coreutils/expr.c index efc435443..5d2fbf2f7 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c @@ -13,7 +13,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - /* This program evaluates expressions. Each token (operator, operand, * parenthesis) of the expression must be a separate argument. The * parser used is a reasonably general one, though any incarnation of @@ -21,9 +20,27 @@ * * No parse tree is needed; a new node is evaluated immediately. * One function can handle multiple operators all of equal precedence, - * provided they all associate ((x op x) op x). */ - -/* no getopt needed */ + * provided they all associate ((x op x) op x). + */ +//config:config EXPR +//config: bool "expr" +//config: default y +//config: help +//config: expr is used to calculate numbers and print the result +//config: to standard output. +//config: +//config:config EXPR_MATH_SUPPORT_64 +//config: bool "Extend Posix numbers support to 64 bit" +//config: default y +//config: depends on EXPR +//config: help +//config: Enable 64-bit math support in the expr applet. This will make +//config: the applet slightly larger, but will allow computation with very +//config: large numbers. + +//applet:IF_EXPR(APPLET(expr, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_EXPR) += expr.o //usage:#define expr_trivial_usage //usage: "EXPRESSION" diff --git a/coreutils/false.c b/coreutils/false.c index 0591a6cdc..b8f17c6a6 100644 --- a/coreutils/false.c +++ b/coreutils/false.c @@ -6,6 +6,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config FALSE +//config: bool "false" +//config: default y +//config: help +//config: false returns an exit code of FALSE (1). + +//applet:IF_FALSE(APPLET_NOFORK(false, false, BB_DIR_BIN, BB_SUID_DROP, false)) + +//kbuild:lib-$(CONFIG_FALSE) += false.o /* BB_AUDIT SUSv3 compliant */ /* http://www.opengroup.org/onlinepubs/000095399/utilities/false.html */ diff --git a/coreutils/fold.c b/coreutils/fold.c index 0e7306377..01f9bce74 100644 --- a/coreutils/fold.c +++ b/coreutils/fold.c @@ -9,6 +9,15 @@ Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config FOLD +//config: bool "fold" +//config: default y +//config: help +//config: Wrap text to fit a specific width. + +//applet:IF_FOLD(APPLET_NOEXEC(fold, fold, BB_DIR_USR_BIN, BB_SUID_DROP, fold)) + +//kbuild:lib-$(CONFIG_FOLD) += fold.o //usage:#define fold_trivial_usage //usage: "[-bs] [-w WIDTH] [FILE]..." diff --git a/coreutils/fsync.c b/coreutils/fsync.c index 652a41c33..596a2bcaf 100644 --- a/coreutils/fsync.c +++ b/coreutils/fsync.c @@ -6,6 +6,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config FSYNC +//config: bool "fsync" +//config: default y +//config: help +//config: fsync is used to flush file-related cached blocks to disk. + +//applet:IF_FSYNC(APPLET_NOFORK(fsync, fsync, BB_DIR_BIN, BB_SUID_DROP, fsync)) + +//kbuild:lib-$(CONFIG_FSYNC) += fsync.o //usage:#define fsync_trivial_usage //usage: "[-d] FILE..." diff --git a/coreutils/head.c b/coreutils/head.c index 9388b026a..176e91e3a 100644 --- a/coreutils/head.c +++ b/coreutils/head.c @@ -6,13 +6,28 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config HEAD +//config: bool "head" +//config: default y +//config: help +//config: head is used to print the first specified number of lines +//config: from files. +//config: +//config:config FEATURE_FANCY_HEAD +//config: bool "Enable head options (-c, -q, and -v)" +//config: default y +//config: depends on HEAD +//config: help +//config: This enables the head options (-c, -q, and -v). + +//applet:IF_HEAD(APPLET_NOEXEC(head, head, BB_DIR_USR_BIN, BB_SUID_DROP, head)) + +//kbuild:lib-$(CONFIG_HEAD) += head.o /* BB_AUDIT SUSv3 compliant */ /* BB_AUDIT GNU compatible -c, -q, and -v options in 'fancy' configuration. */ /* http://www.opengroup.org/onlinepubs/007904975/utilities/head.html */ -//kbuild:lib-$(CONFIG_HEAD) += head.o - //usage:#define head_trivial_usage //usage: "[OPTIONS] [FILE]..." //usage:#define head_full_usage "\n\n" diff --git a/coreutils/hostid.c b/coreutils/hostid.c index e5b1f5188..5b47de1bc 100644 --- a/coreutils/hostid.c +++ b/coreutils/hostid.c @@ -6,9 +6,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -/* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ - //config:config HOSTID //config: bool "hostid" //config: default y @@ -20,6 +17,8 @@ //kbuild:lib-$(CONFIG_HOSTID) += hostid.o +/* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ + //usage:#define hostid_trivial_usage //usage: "" //usage:#define hostid_full_usage "\n\n" diff --git a/coreutils/id.c b/coreutils/id.c index 1f3e1c4c2..ab7ac1e55 100644 --- a/coreutils/id.c +++ b/coreutils/id.c @@ -7,31 +7,30 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -/* BB_AUDIT SUSv3 compliant. */ /* Hacked by Tito Ragusa (C) 2004 to handle usernames of whatever * length and to be more similar to GNU id. * -Z option support: by Yuichi Nakamura * Added -G option Tito Ragusa (C) 2008 for SUSv3. */ - //config:config ID //config: bool "id" //config: default y //config: help //config: id displays the current user and group ID names. - +//config: //config:config GROUPS //config: bool "groups" //config: default y //config: help //config: Print the group names associated with current user id. +//applet:IF_GROUPS(APPLET_NOEXEC(groups, id, BB_DIR_USR_BIN, BB_SUID_DROP, groups)) +//applet:IF_ID( APPLET_NOEXEC(id, id, BB_DIR_USR_BIN, BB_SUID_DROP, id )) + //kbuild:lib-$(CONFIG_GROUPS) += id.o //kbuild:lib-$(CONFIG_ID) += id.o -//applet:IF_GROUPS(APPLET_NOEXEC(groups, id, BB_DIR_USR_BIN, BB_SUID_DROP, groups)) -//applet:IF_ID( APPLET_NOEXEC(id, id, BB_DIR_USR_BIN, BB_SUID_DROP, id )) +/* BB_AUDIT SUSv3 compliant. */ //usage:#define id_trivial_usage //usage: "[OPTIONS] [USER]" diff --git a/coreutils/install.c b/coreutils/install.c index 8aa51cc34..e68589229 100644 --- a/coreutils/install.c +++ b/coreutils/install.c @@ -5,6 +5,22 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config INSTALL +//config: bool "install" +//config: default y +//config: help +//config: Copy files and set attributes. +//config: +//config:config FEATURE_INSTALL_LONG_OPTIONS +//config: bool "Enable long options" +//config: default y +//config: depends on INSTALL && LONG_OPTS +//config: help +//config: Support long options for the install applet. + +//applet:IF_INSTALL(APPLET(install, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_INSTALL) += install.o /* -v, -b, -c are ignored */ //usage:#define install_trivial_usage diff --git a/coreutils/ln.c b/coreutils/ln.c index 168814801..0e2abace4 100644 --- a/coreutils/ln.c +++ b/coreutils/ln.c @@ -6,6 +6,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config LN +//config: bool "ln" +//config: default y +//config: help +//config: ln is used to create hard or soft links between files. + +//applet:IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, BB_SUID_DROP, ln)) + +//kbuild:lib-$(CONFIG_LN) += ln.o /* BB_AUDIT SUSv3 compliant */ /* BB_AUDIT GNU options missing: -d, -F, -i, and -v. */ diff --git a/coreutils/logname.c b/coreutils/logname.c index 10b9615a1..a9b1c956d 100644 --- a/coreutils/logname.c +++ b/coreutils/logname.c @@ -6,10 +6,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -/* BB_AUDIT SUSv3 compliant */ -/* http://www.opengroup.org/onlinepubs/007904975/utilities/logname.html */ - /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) * * SUSv3 specifies the string used is that returned from getlogin(). @@ -19,6 +15,18 @@ * correct course of action wrt SUSv3 for a failing getlogin() is * a diagnostic message and an error return. */ +//config:config LOGNAME +//config: bool "logname" +//config: default y +//config: help +//config: logname is used to print the current user's login name. + +//applet:IF_LOGNAME(APPLET_NOFORK(logname, logname, BB_DIR_USR_BIN, BB_SUID_DROP, logname)) + +//kbuild:lib-$(CONFIG_LOGNAME) += logname.o + +/* BB_AUDIT SUSv3 compliant */ +/* http://www.opengroup.org/onlinepubs/007904975/utilities/logname.html */ //usage:#define logname_trivial_usage //usage: "" diff --git a/coreutils/ls.c b/coreutils/ls.c index 344b4e61e..0f35c70d5 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c @@ -4,7 +4,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - /* [date unknown. Perhaps before year 2000] * To achieve a small memory footprint, this version of 'ls' doesn't do any * file sorting, and only has the most essential command line switches @@ -28,6 +27,75 @@ * [2009-03] * ls sorts listing now, and supports almost all options. */ +//config:config LS +//config: bool "ls" +//config: default y +//config: help +//config: ls is used to list the contents of directories. +//config: +//config:config FEATURE_LS_FILETYPES +//config: bool "Enable filetyping options (-p and -F)" +//config: default y +//config: depends on LS +//config: help +//config: Enable the ls options (-p and -F). +//config: +//config:config FEATURE_LS_FOLLOWLINKS +//config: bool "Enable symlinks dereferencing (-L)" +//config: default y +//config: depends on LS +//config: help +//config: Enable the ls option (-L). +//config: +//config:config FEATURE_LS_RECURSIVE +//config: bool "Enable recursion (-R)" +//config: default y +//config: depends on LS +//config: help +//config: Enable the ls option (-R). +//config: +//config:config FEATURE_LS_SORTFILES +//config: bool "Sort the file names" +//config: default y +//config: depends on LS +//config: help +//config: Allow ls to sort file names alphabetically. +//config: +//config:config FEATURE_LS_TIMESTAMPS +//config: bool "Show file timestamps" +//config: default y +//config: depends on LS +//config: help +//config: Allow ls to display timestamps for files. +//config: +//config:config FEATURE_LS_USERNAME +//config: bool "Show username/groupnames" +//config: default y +//config: depends on LS +//config: help +//config: Allow ls to display username/groupname for files. +//config: +//config:config FEATURE_LS_COLOR +//config: bool "Allow use of color to identify file types" +//config: default y +//config: depends on LS && LONG_OPTS +//config: help +//config: This enables the --color option to ls. +//config: +//config:config FEATURE_LS_COLOR_IS_DEFAULT +//config: bool "Produce colored ls output by default" +//config: default y +//config: depends on FEATURE_LS_COLOR +//config: help +//config: Saying yes here will turn coloring on by default, +//config: even if no "--color" option is given to the ls command. +//config: This is not recommended, since the colors are not +//config: configurable, and the output may not be legible on +//config: many output screens. + +//applet:IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls)) + +//kbuild:lib-$(CONFIG_LS) += ls.o //usage:#define ls_trivial_usage //usage: "[-1AaCxd" diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c index 6f7b004dd..3afe76c28 100644 --- a/coreutils/mkdir.c +++ b/coreutils/mkdir.c @@ -6,18 +6,32 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -/* BB_AUDIT SUSv3 compliant */ -/* http://www.opengroup.org/onlinepubs/007904975/utilities/mkdir.html */ - /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) * * Fixed broken permission setting when -p was used; especially in * conjunction with -m. */ - /* Nov 28, 2006 Yoshinori Sato : Add SELinux Support. */ +//config:config MKDIR +//config: bool "mkdir" +//config: default y +//config: help +//config: mkdir is used to create directories with the specified names. +//config: +//config:config FEATURE_MKDIR_LONG_OPTIONS +//config: bool "Enable long options" +//config: default y +//config: depends on MKDIR && LONG_OPTS +//config: help +//config: Support long options for the mkdir applet. + +//applet:IF_MKDIR(APPLET_NOFORK(mkdir, mkdir, BB_DIR_BIN, BB_SUID_DROP, mkdir)) + +//kbuild:lib-$(CONFIG_MKDIR) += mkdir.o + +/* BB_AUDIT SUSv3 compliant */ +/* http://www.opengroup.org/onlinepubs/007904975/utilities/mkdir.html */ //usage:#define mkdir_trivial_usage //usage: "[OPTIONS] DIRECTORY..." diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c index ef58325b3..66509a9c0 100644 --- a/coreutils/mkfifo.c +++ b/coreutils/mkfifo.c @@ -6,6 +6,16 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config MKFIFO +//config: bool "mkfifo" +//config: default y +//config: help +//config: mkfifo is used to create FIFOs (named pipes). +//config: The 'mknod' program can also create FIFOs. + +//applet:IF_MKFIFO(APPLET_NOEXEC(mkfifo, mkfifo, BB_DIR_USR_BIN, BB_SUID_DROP, mkfifo)) + +//kbuild:lib-$(CONFIG_MKFIFO) += mkfifo.o /* BB_AUDIT SUSv3 compliant */ /* http://www.opengroup.org/onlinepubs/007904975/utilities/mkfifo.html */ diff --git a/coreutils/mknod.c b/coreutils/mknod.c index aa0450481..466ef5c06 100644 --- a/coreutils/mknod.c +++ b/coreutils/mknod.c @@ -6,6 +6,16 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config MKNOD +//config: bool "mknod" +//config: default y +//config: help +//config: mknod is used to create FIFOs or block/character special +//config: files with the specified names. + +//applet:IF_MKNOD(APPLET_NOEXEC(mknod, mknod, BB_DIR_BIN, BB_SUID_DROP, mknod)) + +//kbuild:lib-$(CONFIG_MKNOD) += mknod.o /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ diff --git a/coreutils/mv.c b/coreutils/mv.c index 50571755b..1cc318fd1 100644 --- a/coreutils/mv.c +++ b/coreutils/mv.c @@ -7,14 +7,26 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) * * Size reduction and improved error checking. */ - -#include "libbb.h" -#include "libcoreutils/coreutils.h" +//config:config MV +//config: bool "mv" +//config: default y +//config: help +//config: mv is used to move or rename files or directories. +//config: +//config:config FEATURE_MV_LONG_OPTIONS +//config: bool "Enable long options" +//config: default y +//config: depends on MV && LONG_OPTS +//config: help +//config: Support long options for the mv applet. + +//applet:IF_MV(APPLET(mv, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_MV) += mv.o //usage:#define mv_trivial_usage //usage: "[-fin] SOURCE DEST\n" @@ -28,6 +40,9 @@ //usage:#define mv_example_usage //usage: "$ mv /tmp/foo /bin/bar\n" +#include "libbb.h" +#include "libcoreutils/coreutils.h" + #if ENABLE_FEATURE_MV_LONG_OPTIONS static const char mv_longopts[] ALIGN1 = "interactive\0" No_argument "i" diff --git a/coreutils/nice.c b/coreutils/nice.c index ce759916f..3676ee663 100644 --- a/coreutils/nice.c +++ b/coreutils/nice.c @@ -6,6 +6,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config NICE +//config: bool "nice" +//config: default y +//config: help +//config: nice runs a program with modified scheduling priority. + +//applet:IF_NICE(APPLET(nice, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_NICE) += nice.o //usage:#define nice_trivial_usage //usage: "[-n ADJUST] [PROG ARGS]" diff --git a/coreutils/nohup.c b/coreutils/nohup.c index 63853fd55..d8489686d 100644 --- a/coreutils/nohup.c +++ b/coreutils/nohup.c @@ -9,6 +9,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config NOHUP +//config: bool "nohup" +//config: default y +//config: help +//config: run a command immune to hangups, with output to a non-tty. + +//applet:IF_NOHUP(APPLET(nohup, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_NOHUP) += nohup.o //usage:#define nohup_trivial_usage //usage: "PROG ARGS" diff --git a/coreutils/od.c b/coreutils/od.c index fb11fcfe3..4b05ee77c 100644 --- a/coreutils/od.c +++ b/coreutils/od.c @@ -10,6 +10,15 @@ * * Original copyright notice is retained at the end of this file. */ +//config:config OD +//config: bool "od" +//config: default y +//config: help +//config: od is used to dump binary files in octal and other formats. + +//applet:IF_OD(APPLET(od, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_OD) += od.o //usage:#if !ENABLE_DESKTOP //usage:#define od_trivial_usage diff --git a/coreutils/printenv.c b/coreutils/printenv.c index bd5db7073..fbd64945d 100644 --- a/coreutils/printenv.c +++ b/coreutils/printenv.c @@ -7,6 +7,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config PRINTENV +//config: bool "printenv" +//config: default y +//config: help +//config: printenv is used to print all or part of environment. + +//applet:IF_PRINTENV(APPLET_NOFORK(printenv, printenv, BB_DIR_BIN, BB_SUID_DROP, printenv)) + +//kbuild:lib-$(CONFIG_PRINTENV) += printenv.o //usage:#define printenv_trivial_usage //usage: "[VARIABLE]..." diff --git a/coreutils/printf.c b/coreutils/printf.c index 9ee7350d0..6c8e115d8 100644 --- a/coreutils/printf.c +++ b/coreutils/printf.c @@ -38,6 +38,17 @@ /* 19990508 Busy Boxed! Dave Cinege */ +//config:config PRINTF +//config: bool "printf" +//config: default y +//config: help +//config: printf is used to format and print specified strings. +//config: It's similar to `echo' except it has more options. + +//applet:IF_PRINTF(APPLET_NOFORK(printf, printf, BB_DIR_USR_BIN, BB_SUID_DROP, printf)) + +//kbuild:lib-$(CONFIG_PRINTF) += printf.o + //usage:#define printf_trivial_usage //usage: "FORMAT [ARG]..." //usage:#define printf_full_usage "\n\n" diff --git a/coreutils/pwd.c b/coreutils/pwd.c index bb3ad04fc..05dee497b 100644 --- a/coreutils/pwd.c +++ b/coreutils/pwd.c @@ -6,6 +6,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config PWD +//config: bool "pwd" +//config: default y +//config: help +//config: pwd is used to print the current directory. + +//applet:IF_PWD(APPLET_NOFORK(pwd, pwd, BB_DIR_BIN, BB_SUID_DROP, pwd)) + +//kbuild:lib-$(CONFIG_PWD) += pwd.o //usage:#define pwd_trivial_usage //usage: "" @@ -18,8 +27,6 @@ #include "libbb.h" -/* This is a NOFORK applet. Be very careful! */ - static int logical_getcwd(void) { struct stat st1; diff --git a/coreutils/readlink.c b/coreutils/readlink.c index d73ef4ddb..1b223b3c5 100644 --- a/coreutils/readlink.c +++ b/coreutils/readlink.c @@ -6,6 +6,23 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config READLINK +//config: bool "readlink" +//config: default y +//config: help +//config: This program reads a symbolic link and returns the name +//config: of the file it points to +//config: +//config:config FEATURE_READLINK_FOLLOW +//config: bool "Enable canonicalization by following all symlinks (-f)" +//config: default y +//config: depends on READLINK +//config: help +//config: Enable the readlink option (-f). + +//applet:IF_READLINK(APPLET(readlink, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_READLINK) += readlink.o //usage:#define readlink_trivial_usage //usage: IF_FEATURE_READLINK_FOLLOW("[-fnv] ") "FILE" diff --git a/coreutils/realpath.c b/coreutils/realpath.c index c513b5549..0c2d544e4 100644 --- a/coreutils/realpath.c +++ b/coreutils/realpath.c @@ -1,7 +1,4 @@ /* vi: set sw=4 ts=4: */ - -/* BB_AUDIT SUSv3 N/A -- Apparently a busybox extension. */ - /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) * * Now does proper error checking on output and returns a failure exit code @@ -9,6 +6,18 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config REALPATH +//config: bool "realpath" +//config: default y +//config: help +//config: Return the canonicalized absolute pathname. +//config: This isn't provided by GNU shellutils, but where else does it belong. + +//applet:IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_REALPATH) += realpath.o + +/* BB_AUDIT SUSv3 N/A -- Apparently a busybox extension. */ //usage:#define realpath_trivial_usage //usage: "FILE..." diff --git a/coreutils/rm.c b/coreutils/rm.c index d0ad81dfc..cec34cb9d 100644 --- a/coreutils/rm.c +++ b/coreutils/rm.c @@ -6,14 +6,22 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -/* BB_AUDIT SUSv3 compliant */ -/* http://www.opengroup.org/onlinepubs/007904975/utilities/rm.html */ - /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) * * Size reduction. */ +//config:config RM +//config: bool "rm" +//config: default y +//config: help +//config: rm is used to remove files or directories. + +//applet:IF_RM(APPLET_NOFORK(rm, rm, BB_DIR_BIN, BB_SUID_DROP, rm)) + +//kbuild:lib-$(CONFIG_RM) += rm.o + +/* BB_AUDIT SUSv3 compliant */ +/* http://www.opengroup.org/onlinepubs/007904975/utilities/rm.html */ //usage:#define rm_trivial_usage //usage: "[-irf] FILE..." diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c index 0792a1c8e..8979941ce 100644 --- a/coreutils/rmdir.c +++ b/coreutils/rmdir.c @@ -6,6 +6,23 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config RMDIR +//config: bool "rmdir" +//config: default y +//config: help +//config: rmdir is used to remove empty directories. +//config: +//config:config FEATURE_RMDIR_LONG_OPTIONS +//config: bool "Enable long options" +//config: default y +//config: depends on RMDIR && LONG_OPTS +//config: help +//config: Support long options for the rmdir applet, including +//config: --ignore-fail-on-non-empty for compatibility with GNU rmdir. + +//applet:IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir)) + +//kbuild:lib-$(CONFIG_RMDIR) += rmdir.o /* BB_AUDIT SUSv3 compliant */ /* http://www.opengroup.org/onlinepubs/007904975/utilities/rmdir.html */ diff --git a/coreutils/seq.c b/coreutils/seq.c index 898619293..ed4946b05 100644 --- a/coreutils/seq.c +++ b/coreutils/seq.c @@ -6,6 +6,15 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config SEQ +//config: bool "seq" +//config: default y +//config: help +//config: print a sequence of numbers + +//applet:IF_SEQ(APPLET_NOFORK(seq, seq, BB_DIR_USR_BIN, BB_SUID_DROP, seq)) + +//kbuild:lib-$(CONFIG_SEQ) += seq.o //usage:#define seq_trivial_usage //usage: "[-w] [-s SEP] [FIRST [INC]] LAST" diff --git a/coreutils/sleep.c b/coreutils/sleep.c index 0ffbd16eb..ad2d6b526 100644 --- a/coreutils/sleep.c +++ b/coreutils/sleep.c @@ -6,17 +6,48 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -/* BB_AUDIT SUSv3 compliant */ -/* BB_AUDIT GNU issues -- fancy version matches except args must be ints. */ -/* http://www.opengroup.org/onlinepubs/007904975/utilities/sleep.html */ - /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) * * Rewritten to do proper arg and error checking. * Also, added a 'fancy' configuration to accept multiple args with * time suffixes for seconds, minutes, hours, and days. */ +//config:config SLEEP +//config: bool "sleep" +//config: default y +//config: help +//config: sleep is used to pause for a specified number of seconds. +//config: It comes in 3 versions: +//config: - small: takes one integer parameter +//config: - fancy: takes multiple integer arguments with suffixes: +//config: sleep 1d 2h 3m 15s +//config: - fancy with fractional numbers: +//config: sleep 2.3s 4.5h sleeps for 16202.3 seconds +//config: Last one is "the most compatible" with coreutils sleep, +//config: but it adds around 1k of code. +//config: +//config:config FEATURE_FANCY_SLEEP +//config: bool "Enable multiple arguments and s/m/h/d suffixes" +//config: default y +//config: depends on SLEEP +//config: help +//config: Allow sleep to pause for specified minutes, hours, and days. +//config: +//config:config FEATURE_FLOAT_SLEEP +//config: bool "Enable fractional arguments" +//config: default y +//config: depends on FEATURE_FANCY_SLEEP +//config: help +//config: Allow for fractional numeric parameters. + +/* Do not make this applet NOFORK. It breaks ^C-ing of pauses in shells */ +//applet:IF_SLEEP(APPLET(sleep, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SLEEP) += sleep.o + +/* BB_AUDIT SUSv3 compliant */ +/* BB_AUDIT GNU issues -- fancy version matches except args must be ints. */ +/* http://www.opengroup.org/onlinepubs/007904975/utilities/sleep.html */ //usage:#define sleep_trivial_usage //usage: IF_FEATURE_FANCY_SLEEP("[") "N" IF_FEATURE_FANCY_SLEEP("]...") @@ -35,9 +66,6 @@ #include "libbb.h" -/* Do not make this applet NOFORK. It breaks ^C-ing of pauses in shells */ - - #if ENABLE_FEATURE_FANCY_SLEEP || ENABLE_FEATURE_FLOAT_SLEEP static const struct suffix_mult sfx[] = { { "s", 1 }, diff --git a/coreutils/sort.c b/coreutils/sort.c index 34a41999b..1ccce93c5 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c @@ -11,6 +11,27 @@ * See SuS3 sort standard at: * http://www.opengroup.org/onlinepubs/007904975/utilities/sort.html */ +//config:config SORT +//config: bool "sort" +//config: default y +//config: help +//config: sort is used to sort lines of text in specified files. +//config: +//config:config FEATURE_SORT_BIG +//config: bool "Full SuSv3 compliant sort (support -ktcsbdfiozgM)" +//config: default y +//config: depends on SORT +//config: help +//config: Without this, sort only supports -r, -u, and an integer version +//config: of -n. Selecting this adds sort keys, floating point support, and +//config: more. This adds a little over 3k to a nonstatic build on x86. +//config: +//config: The SuSv3 sort standard is available at: +//config: http://www.opengroup.org/onlinepubs/007904975/utilities/sort.html + +//applet:IF_SORT(APPLET_NOEXEC(sort, sort, BB_DIR_USR_BIN, BB_SUID_DROP, sort)) + +//kbuild:lib-$(CONFIG_SORT) += sort.o //usage:#define sort_trivial_usage //usage: "[-nru" diff --git a/coreutils/split.c b/coreutils/split.c index 19d58a21b..50918a1ce 100644 --- a/coreutils/split.c +++ b/coreutils/split.c @@ -5,6 +5,25 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config SPLIT +//config: bool "split" +//config: default y +//config: help +//config: split a file into pieces. +//config: +//config:config FEATURE_SPLIT_FANCY +//config: bool "Fancy extensions" +//config: default y +//config: depends on SPLIT +//config: help +//config: Add support for features not required by SUSv3. +//config: Supports additional suffixes 'b' for 512 bytes, +//config: 'g' for 1GiB for the -b option. + +//applet:IF_SPLIT(APPLET(split, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SPLIT) += split.o + /* BB_AUDIT: SUSv3 compliant * SUSv3 requirements: * http://www.opengroup.org/onlinepubs/009695399/utilities/split.html diff --git a/coreutils/stat.c b/coreutils/stat.c index ddcfcf2d7..b918ec62e 100644 --- a/coreutils/stat.c +++ b/coreutils/stat.c @@ -36,6 +36,9 @@ //config: Without this, stat will not support the '-f' option to display //config: information about filesystem status. +//applet:IF_STAT(APPLET(stat, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_STAT) += stat.o //usage:#define stat_trivial_usage //usage: "[OPTIONS] FILE..." diff --git a/coreutils/stty.c b/coreutils/stty.c index 52967ea8f..e818d579c 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c @@ -18,8 +18,16 @@ David MacKenzie Special for busybox ported by Vladimir Oleynik 2001 +*/ +//config:config STTY +//config: bool "stty" +//config: default y +//config: help +//config: stty is used to change and print terminal line settings. + +//applet:IF_STTY(APPLET(stty, BB_DIR_BIN, BB_SUID_DROP)) - */ +//kbuild:lib-$(CONFIG_STTY) += stty.o //usage:#define stty_trivial_usage //usage: "[-a|g] [-F DEVICE] [SETTING]..." diff --git a/coreutils/sum.c b/coreutils/sum.c index ec9ed2a11..c55293dc9 100644 --- a/coreutils/sum.c +++ b/coreutils/sum.c @@ -12,6 +12,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config SUM +//config: bool "sum" +//config: default y +//config: help +//config: checksum and count the blocks in a file + +//applet:IF_SUM(APPLET(sum, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SUM) += sum.o //usage:#define sum_trivial_usage //usage: "[-rs] [FILE]..." diff --git a/coreutils/sync.c b/coreutils/sync.c index e65d9cd8d..5e189f6f4 100644 --- a/coreutils/sync.c +++ b/coreutils/sync.c @@ -7,8 +7,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -/* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ //config:config SYNC //config: bool "sync" //config: default y @@ -22,9 +20,12 @@ //config: sync -d FILE... executes fdatasync() on each FILE. //config: sync -f FILE... executes syncfs() on each FILE. -//kbuild:lib-$(CONFIG_SYNC) += sync.o //applet:IF_SYNC(APPLET_NOFORK(sync, sync, BB_DIR_BIN, BB_SUID_DROP, sync)) +//kbuild:lib-$(CONFIG_SYNC) += sync.o + +/* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ + //usage:#define sync_trivial_usage //usage: ""IF_FEATURE_SYNC_FANCY("[-df] [FILE]...") //usage:#define sync_full_usage "\n\n" diff --git a/coreutils/tac.c b/coreutils/tac.c index 94d669de1..ca5617c83 100644 --- a/coreutils/tac.c +++ b/coreutils/tac.c @@ -1,20 +1,26 @@ /* vi: set sw=4 ts=4: */ /* * tac implementation for busybox + * tac - concatenate and print files in reverse * * Copyright (C) 2003 Yang Xiaopeng * Copyright (C) 2007 Natanael Copa * Copyright (C) 2007 Tito Ragusa * * Licensed under GPLv2, see file LICENSE in this source tree. - * */ - -/* tac - concatenate and print files in reverse */ - /* Based on Yang Xiaopeng's (yxp at hanwang.com.cn) patch * http://www.uclibc.org/lists/busybox/2003-July/008813.html */ +//config:config TAC +//config: bool "tac" +//config: default y +//config: help +//config: tac is used to concatenate and print files in reverse. + +//applet:IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac)) + +//kbuild:lib-$(CONFIG_TAC) += tac.o //usage:#define tac_trivial_usage //usage: "[FILE]..." diff --git a/coreutils/tail.c b/coreutils/tail.c index 57ad0f3b7..99f58ddd8 100644 --- a/coreutils/tail.c +++ b/coreutils/tail.c @@ -6,11 +6,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -/* BB_AUDIT SUSv3 compliant (need fancy for -c) */ -/* BB_AUDIT GNU compatible -c, -q, and -v options in 'fancy' configuration. */ -/* http://www.opengroup.org/onlinepubs/007904975/utilities/tail.html */ - /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) * * Pretty much rewritten to fix numerous bugs and reduce realloc() calls. @@ -23,9 +18,34 @@ * 6) no check for lseek error * 7) lseek attempted when count==0 even if arg was +0 (from top) */ +//config:config TAIL +//config: bool "tail" +//config: default y +//config: help +//config: tail is used to print the last specified number of lines +//config: from files. +//config: +//config:config FEATURE_FANCY_TAIL +//config: bool "Enable extra tail options (-q, -s, -v, and -F)" +//config: default y +//config: depends on TAIL +//config: help +//config: The options (-q, -s, -v and -F) are provided by GNU tail, but +//config: are not specific in the SUSv3 standard. +//config: +//config: -q Never output headers giving file names +//config: -s SEC Wait SEC seconds between reads with -f +//config: -v Always output headers giving file names +//config: -F Same as -f, but keep retrying + +//applet:IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP)) //kbuild:lib-$(CONFIG_TAIL) += tail.o +/* BB_AUDIT SUSv3 compliant (need fancy for -c) */ +/* BB_AUDIT GNU compatible -c, -q, and -v options in 'fancy' configuration. */ +/* http://www.opengroup.org/onlinepubs/007904975/utilities/tail.html */ + //usage:#define tail_trivial_usage //usage: "[OPTIONS] [FILE]..." //usage:#define tail_full_usage "\n\n" diff --git a/coreutils/tee.c b/coreutils/tee.c index a68e9446f..602d06737 100644 --- a/coreutils/tee.c +++ b/coreutils/tee.c @@ -6,6 +6,23 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config TEE +//config: bool "tee" +//config: default y +//config: help +//config: tee is used to read from standard input and write +//config: to standard output and files. +//config: +//config:config FEATURE_TEE_USE_BLOCK_IO +//config: bool "Enable block I/O (larger/faster) instead of byte I/O" +//config: default y +//config: depends on TEE +//config: help +//config: Enable this option for a faster tee, at expense of size. + +//applet:IF_TEE(APPLET(tee, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_TEE) += tee.o /* BB_AUDIT SUSv3 compliant */ /* http://www.opengroup.org/onlinepubs/007904975/utilities/tee.html */ diff --git a/coreutils/test.c b/coreutils/test.c index bf8dc47e8..81c9b7dfe 100644 --- a/coreutils/test.c +++ b/coreutils/test.c @@ -19,11 +19,6 @@ * Original copyright notice states: * "This program is in the Public Domain." */ - -//kbuild:lib-$(CONFIG_TEST) += test.o test_ptr_hack.o -//kbuild:lib-$(CONFIG_ASH) += test.o test_ptr_hack.o -//kbuild:lib-$(CONFIG_HUSH) += test.o test_ptr_hack.o - //config:config TEST //config: bool "test" //config: default y @@ -39,6 +34,14 @@ //config: help //config: Enable 64-bit support in test. +//applet:IF_TEST(APPLET_NOFORK([, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) +//applet:IF_TEST(APPLET_NOFORK([[, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) +//applet:IF_TEST(APPLET_NOFORK(test, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) + +//kbuild:lib-$(CONFIG_TEST) += test.o test_ptr_hack.o +//kbuild:lib-$(CONFIG_ASH) += test.o test_ptr_hack.o +//kbuild:lib-$(CONFIG_HUSH) += test.o test_ptr_hack.o + /* "test --help" is special-cased to ignore --help */ //usage:#define test_trivial_usage NOUSAGE_STR //usage:#define test_full_usage "" diff --git a/coreutils/touch.c b/coreutils/touch.c index 293a96890..92d5a718a 100644 --- a/coreutils/touch.c +++ b/coreutils/touch.c @@ -6,19 +6,12 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -/* BB_AUDIT SUSv3 _NOT_ compliant -- options -a, -m not supported. */ -/* http://www.opengroup.org/onlinepubs/007904975/utilities/touch.html */ - /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) * * Previous version called open() and then utime(). While this will be * be necessary to implement -r and -t, it currently only makes things bigger. * Also, exiting on a failure was a bug. All args should be processed. */ - -#include "libbb.h" - //config:config TOUCH //config: bool "touch" //config: default y @@ -45,6 +38,9 @@ //kbuild:lib-$(CONFIG_TOUCH) += touch.o +/* BB_AUDIT SUSv3 _NOT_ compliant -- options -a, -m not supported. */ +/* http://www.opengroup.org/onlinepubs/007904975/utilities/touch.html */ + //usage:#define touch_trivial_usage //usage: "[-c]" IF_FEATURE_TOUCH_SUSV3(" [-d DATE] [-t DATE] [-r FILE]") " FILE..." //usage:#define touch_full_usage "\n\n" @@ -66,8 +62,6 @@ //usage: "$ ls -l /tmp/foo\n" //usage: "-rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo\n" -/* This is a NOFORK applet. Be very careful! */ - /* coreutils implements: * -a change only the access time * -c, --no-create @@ -85,6 +79,8 @@ * change the specified time: WORD is access, atime, or use */ +#include "libbb.h" + int touch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int touch_main(int argc UNUSED_PARAM, char **argv) { diff --git a/coreutils/tr.c b/coreutils/tr.c index 2f49d5a86..f552096f3 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c @@ -18,9 +18,6 @@ /* http://www.opengroup.org/onlinepubs/009695399/utilities/tr.html * TODO: graph, print */ - -//kbuild:lib-$(CONFIG_TR) += tr.o - //config:config TR //config: bool "tr" //config: default y @@ -47,6 +44,10 @@ //config: useful for cases when no other way of expressing a character //config: is possible. +//applet:IF_TR(APPLET(tr, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_TR) += tr.o + //usage:#define tr_trivial_usage //usage: "[-cds] STRING1 [STRING2]" //usage:#define tr_full_usage "\n\n" diff --git a/coreutils/true.c b/coreutils/true.c index 89f892961..6a9493f9d 100644 --- a/coreutils/true.c +++ b/coreutils/true.c @@ -6,6 +6,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config TRUE +//config: bool "true" +//config: default y +//config: help +//config: true returns an exit code of TRUE (0). + +//applet:IF_TRUE(APPLET_NOFORK(true, true, BB_DIR_BIN, BB_SUID_DROP, true)) + +//kbuild:lib-$(CONFIG_TRUE) += true.o /* BB_AUDIT SUSv3 compliant */ /* http://www.opengroup.org/onlinepubs/007904975/utilities/true.html */ diff --git a/coreutils/truncate.c b/coreutils/truncate.c index 8d845f218..253fe0015 100644 --- a/coreutils/truncate.c +++ b/coreutils/truncate.c @@ -5,7 +5,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - //config:config TRUNCATE //config: bool "truncate" //config: default y @@ -13,9 +12,10 @@ //config: truncate truncates files to a given size. If a file does //config: not exist, it is created unless told otherwise. -//kbuild:lib-$(CONFIG_TRUNCATE) += truncate.o //applet:IF_TRUNCATE(APPLET_NOFORK(truncate, truncate, BB_DIR_USR_BIN, BB_SUID_DROP, truncate)) +//kbuild:lib-$(CONFIG_TRUNCATE) += truncate.o + //usage:#define truncate_trivial_usage //usage: "[-c] -s SIZE FILE..." //usage:#define truncate_full_usage "\n\n" diff --git a/coreutils/tty.c b/coreutils/tty.c index 45175054e..359e5bc93 100644 --- a/coreutils/tty.c +++ b/coreutils/tty.c @@ -6,6 +6,16 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config TTY +//config: bool "tty" +//config: default y +//config: help +//config: tty is used to print the name of the current terminal to +//config: standard output. + +//applet:IF_TTY(APPLET(tty, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_TTY) += tty.o /* BB_AUDIT SUSv4 compliant */ /* http://www.opengroup.org/onlinepubs/9699919799/utilities/tty.html */ diff --git a/coreutils/uname.c b/coreutils/uname.c index fd677d27c..4d98fde25 100644 --- a/coreutils/uname.c +++ b/coreutils/uname.c @@ -4,10 +4,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -/* BB_AUDIT SUSv3 compliant */ -/* http://www.opengroup.org/onlinepubs/007904975/utilities/uname.html */ - /* Option Example * -s, --sysname SunOS * -n, --nodename rocky8 @@ -37,7 +33,6 @@ * -a, --all: all of the above, in the order shown. * If -p or -i is not known, don't show them */ - /* Busyboxed by Erik Andersen * * Before 2003: Glenn McGrath and Manuel Novoa III @@ -47,6 +42,26 @@ * Jan 2009: * Fix handling of -a to not print "unknown", add -o and -i support. */ +//config:config UNAME +//config: bool "uname" +//config: default y +//config: help +//config: uname is used to print system information. +//config: +//config:config UNAME_OSNAME +//config: string "Operating system name" +//config: default "GNU/Linux" +//config: depends on UNAME +//config: help +//config: Sets the operating system name reported by uname -o. The +//config: default is "GNU/Linux". + +//applet:IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_UNAME) += uname.o + +/* BB_AUDIT SUSv3 compliant */ +/* http://www.opengroup.org/onlinepubs/007904975/utilities/uname.html */ //usage:#define uname_trivial_usage //usage: "[-amnrspvio]" diff --git a/coreutils/uniq.c b/coreutils/uniq.c index ec7bde418..be550b5cd 100644 --- a/coreutils/uniq.c +++ b/coreutils/uniq.c @@ -6,6 +6,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config UNIQ +//config: bool "uniq" +//config: default y +//config: help +//config: uniq is used to remove duplicate lines from a sorted file. + +//applet:IF_UNIQ(APPLET(uniq, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_UNIQ) += uniq.o /* BB_AUDIT SUSv3 compliant */ /* http://www.opengroup.org/onlinepubs/007904975/utilities/uniq.html */ diff --git a/coreutils/unlink.c b/coreutils/unlink.c index 3b7d0fb2b..2879638d3 100644 --- a/coreutils/unlink.c +++ b/coreutils/unlink.c @@ -5,17 +5,16 @@ * * Licensed under GPLv2, see LICENSE in this source tree */ - //config:config UNLINK //config: bool "unlink" //config: default y //config: help //config: unlink deletes a file by calling unlink() -//kbuild:lib-$(CONFIG_UNLINK) += unlink.o - //applet:IF_UNLINK(APPLET(unlink, BB_DIR_USR_BIN, BB_SUID_DROP)) +//kbuild:lib-$(CONFIG_UNLINK) += unlink.o + //usage:#define unlink_trivial_usage //usage: "FILE" //usage:#define unlink_full_usage "\n\n" diff --git a/coreutils/usleep.c b/coreutils/usleep.c index 2e4eb5721..7bc30c2a2 100644 --- a/coreutils/usleep.c +++ b/coreutils/usleep.c @@ -6,6 +6,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config USLEEP +//config: bool "usleep" +//config: default y +//config: help +//config: usleep is used to pause for a specified number of microseconds. + +//applet:IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep)) + +//kbuild:lib-$(CONFIG_USLEEP) += usleep.o /* BB_AUDIT SUSv3 N/A -- Apparently a busybox extension. */ diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index 37b254d30..ddce2548b 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c @@ -10,6 +10,15 @@ * Bugs: the spec doesn't mention anything about "`\n`\n" prior to the * "end" line */ +//config:config UUDECODE +//config: bool "uudecode" +//config: default y +//config: help +//config: uudecode is used to decode a uuencoded file. + +//applet:IF_UUDECODE(APPLET(uudecode, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_UUDECODE) += uudecode.o //usage:#define uudecode_trivial_usage //usage: "[-o OUTFILE] [INFILE]" diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c index 673ef36e7..917cdaea5 100644 --- a/coreutils/uuencode.c +++ b/coreutils/uuencode.c @@ -7,6 +7,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config UUENCODE +//config: bool "uuencode" +//config: default y +//config: help +//config: uuencode is used to uuencode a file. + +//applet:IF_UUENCODE(APPLET(uuencode, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_UUENCODE) += uuencode.o //usage:#define uuencode_trivial_usage //usage: "[-m] [FILE] STORED_FILENAME" diff --git a/coreutils/wc.c b/coreutils/wc.c index a410e407a..73837141e 100644 --- a/coreutils/wc.c +++ b/coreutils/wc.c @@ -6,10 +6,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -/* BB_AUDIT SUSv3 compliant. */ -/* http://www.opengroup.org/onlinepubs/007904975/utilities/wc.html */ - /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) * * Rewritten to fix a number of problems and do some size optimizations. @@ -36,6 +32,27 @@ * * for which 'wc -c' should output '0'. */ +//config:config WC +//config: bool "wc" +//config: default y +//config: help +//config: wc is used to print the number of bytes, words, and lines, +//config: in specified files. +//config: +//config:config FEATURE_WC_LARGE +//config: bool "Support very large files in wc" +//config: default y +//config: depends on WC +//config: help +//config: Use "unsigned long long" in wc for counter variables. + +//applet:IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_WC) += wc.o + +/* BB_AUDIT SUSv3 compliant. */ +/* http://www.opengroup.org/onlinepubs/007904975/utilities/wc.html */ + #include "libbb.h" #include "unicode.h" diff --git a/coreutils/who.c b/coreutils/who.c index f694d0c60..ac19dc720 100644 --- a/coreutils/who.c +++ b/coreutils/who.c @@ -16,15 +16,13 @@ * *---------------------------------------------------------------------- */ -/* BB_AUDIT SUSv3 _NOT_ compliant -- missing options -b, -d, -l, -m, -p, -q, -r, -s, -t, -T, -u; Missing argument 'file'. */ - //config:config WHO //config: bool "who" //config: default y //config: depends on FEATURE_UTMP //config: help //config: who is used to show who is logged on. - +//config: //config:config USERS //config: bool "users" //config: default y @@ -33,11 +31,13 @@ //config: Print users currently logged on. //applet:IF_USERS(APPLET_ODDNAME(users, who, BB_DIR_USR_BIN, BB_SUID_DROP, users)) -//applet:IF_WHO( APPLET( who, BB_DIR_USR_BIN, BB_SUID_DROP)) +//applet:IF_WHO(APPLET(who, BB_DIR_USR_BIN, BB_SUID_DROP)) //kbuild:lib-$(CONFIG_USERS) += who.o //kbuild:lib-$(CONFIG_WHO) += who.o +/* BB_AUDIT SUSv3 _NOT_ compliant -- missing options -b, -d, -l, -m, -p, -q, -r, -s, -t, -T, -u; Missing argument 'file'. */ + //usage:#define users_trivial_usage //usage: "" //usage:#define users_full_usage "\n\n" diff --git a/coreutils/whoami.c b/coreutils/whoami.c index 30b17cab3..635712829 100644 --- a/coreutils/whoami.c +++ b/coreutils/whoami.c @@ -6,6 +6,16 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config WHOAMI +//config: bool "whoami" +//config: default y +//config: help +//config: whoami is used to print the username of the current +//config: user id (same as id -un). + +//applet:IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) + +//kbuild:lib-$(CONFIG_WHOAMI) += whoami.o /* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ @@ -16,8 +26,6 @@ #include "libbb.h" -/* This is a NOFORK applet. Be very careful! */ - int whoami_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int whoami_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) { diff --git a/coreutils/yes.c b/coreutils/yes.c index 5d799f09b..81d875589 100644 --- a/coreutils/yes.c +++ b/coreutils/yes.c @@ -6,23 +6,30 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -/* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ - /* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) * * Size reductions and removed redundant applet name prefix from error messages. */ +//config:config YES +//config: bool "yes" +//config: default y +//config: help +//config: yes is used to repeatedly output a specific string, or +//config: the default string `y'. -#include "libbb.h" +//applet:IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) -/* This is a NOFORK applet. Be very careful! */ +//kbuild:lib-$(CONFIG_YES) += yes.o + +/* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ //usage:#define yes_trivial_usage //usage: "[STRING]" //usage:#define yes_full_usage "\n\n" //usage: "Repeatedly output a line with STRING, or 'y'" +#include "libbb.h" + int yes_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int yes_main(int argc UNUSED_PARAM, char **argv) { diff --git a/include/applets.src.h b/include/applets.src.h index 23453b0ef..82907e2a5 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -73,98 +73,28 @@ s - suid type: INSERT -IF_TEST(APPLET_NOFORK([, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) -IF_TEST(APPLET_NOFORK([[, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) -IF_BASENAME(APPLET_NOFORK(basename, basename, BB_DIR_USR_BIN, BB_SUID_DROP, basename)) -IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat)) -IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP)) IF_CHCON(APPLET(chcon, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_CHGRP(APPLET_NOEXEC(chgrp, chgrp, BB_DIR_BIN, BB_SUID_DROP, chgrp)) -IF_CHMOD(APPLET_NOEXEC(chmod, chmod, BB_DIR_BIN, BB_SUID_DROP, chmod)) -IF_CHOWN(APPLET_NOEXEC(chown, chown, BB_DIR_BIN, BB_SUID_DROP, chown)) -IF_CHROOT(APPLET(chroot, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_CKSUM(APPLET_NOEXEC(cksum, cksum, BB_DIR_USR_BIN, BB_SUID_DROP, cksum)) -IF_COMM(APPLET(comm, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_CP(APPLET_NOEXEC(cp, cp, BB_DIR_BIN, BB_SUID_DROP, cp)) -IF_CUT(APPLET_NOEXEC(cut, cut, BB_DIR_USR_BIN, BB_SUID_DROP, cut)) -IF_DD(APPLET_NOEXEC(dd, dd, BB_DIR_BIN, BB_SUID_DROP, dd)) -IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP)) IF_DHCPRELAY(APPLET(dhcprelay, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_DIRNAME(APPLET_NOFORK(dirname, dirname, BB_DIR_USR_BIN, BB_SUID_DROP, dirname)) -IF_DOS2UNIX(APPLET_NOEXEC(dos2unix, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, dos2unix)) -IF_DU(APPLET(du, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_DUMPLEASES(APPLET(dumpleases, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_E2FSCK(APPLET(e2fsck, BB_DIR_SBIN, BB_SUID_DROP)) //IF_E2LABEL(APPLET_ODDNAME(e2label, tune2fs, BB_DIR_SBIN, BB_SUID_DROP, e2label)) -IF_ECHO(APPLET_NOFORK(echo, echo, BB_DIR_BIN, BB_SUID_DROP, echo)) -IF_ENV(APPLET_NOEXEC(env, env, BB_DIR_USR_BIN, BB_SUID_DROP, env)) -IF_EXPAND(APPLET(expand, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_EXPR(APPLET(expr, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_FALSE(APPLET_NOFORK(false, false, BB_DIR_BIN, BB_SUID_DROP, false)) -IF_FOLD(APPLET_NOEXEC(fold, fold, BB_DIR_USR_BIN, BB_SUID_DROP, fold)) //IF_E2FSCK(APPLET_ODDNAME(fsck.ext2, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext2)) //IF_E2FSCK(APPLET_ODDNAME(fsck.ext3, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext3)) -IF_FSYNC(APPLET_NOFORK(fsync, fsync, BB_DIR_BIN, BB_SUID_DROP, fsync)) IF_GETENFORCE(APPLET(getenforce, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_HEAD(APPLET_NOEXEC(head, head, BB_DIR_USR_BIN, BB_SUID_DROP, head)) -IF_INSTALL(APPLET(install, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_LENGTH(APPLET_NOFORK(length, length, BB_DIR_USR_BIN, BB_SUID_DROP, length)) -IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, BB_SUID_DROP, ln)) IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_LOGNAME(APPLET_NOFORK(logname, logname, BB_DIR_USR_BIN, BB_SUID_DROP, logname)) -IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls)) IF_MATCHPATHCON(APPLET(matchpathcon, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_MKDIR(APPLET_NOFORK(mkdir, mkdir, BB_DIR_BIN, BB_SUID_DROP, mkdir)) -IF_MKFIFO(APPLET_NOEXEC(mkfifo, mkfifo, BB_DIR_USR_BIN, BB_SUID_DROP, mkfifo)) -IF_MKNOD(APPLET_NOEXEC(mknod, mknod, BB_DIR_BIN, BB_SUID_DROP, mknod)) -IF_MV(APPLET(mv, BB_DIR_BIN, BB_SUID_DROP)) -IF_NICE(APPLET(nice, BB_DIR_BIN, BB_SUID_DROP)) -IF_NOHUP(APPLET(nohup, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_OD(APPLET(od, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_PARSE(APPLET(parse, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_PRINTENV(APPLET_NOFORK(printenv, printenv, BB_DIR_BIN, BB_SUID_DROP, printenv)) -IF_PRINTF(APPLET_NOFORK(printf, printf, BB_DIR_USR_BIN, BB_SUID_DROP, printf)) -IF_PWD(APPLET_NOFORK(pwd, pwd, BB_DIR_BIN, BB_SUID_DROP, pwd)) -IF_READLINK(APPLET(readlink, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon)) -IF_RM(APPLET_NOFORK(rm, rm, BB_DIR_BIN, BB_SUID_DROP, rm)) -IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir)) IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_SELINUXENABLED(APPLET(selinuxenabled, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_SEQ(APPLET_NOFORK(seq, seq, BB_DIR_USR_BIN, BB_SUID_DROP, seq)) IF_SESTATUS(APPLET(sestatus, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_SETENFORCE(APPLET(setenforce, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_SETFILES(APPLET(setfiles, BB_DIR_SBIN, BB_SUID_DROP)) IF_SETSEBOOL(APPLET(setsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) -/* Do not make this applet NOFORK. It breaks ^C-ing of pauses in shells: */ -IF_SLEEP(APPLET(sleep, BB_DIR_BIN, BB_SUID_DROP)) -IF_SORT(APPLET_NOEXEC(sort, sort, BB_DIR_USR_BIN, BB_SUID_DROP, sort)) -IF_SPLIT(APPLET(split, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_STAT(APPLET(stat, BB_DIR_BIN, BB_SUID_DROP)) -IF_STTY(APPLET(stty, BB_DIR_BIN, BB_SUID_DROP)) -IF_SUM(APPLET(sum, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac)) -IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_TEE(APPLET(tee, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_TEST(APPLET_NOFORK(test, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) -IF_TR(APPLET(tr, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_TRUE(APPLET_NOFORK(true, true, BB_DIR_BIN, BB_SUID_DROP, true)) -IF_TTY(APPLET(tty, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_UDHCPC(APPLET(udhcpc, BB_DIR_SBIN, BB_SUID_DROP)) IF_UDHCPD(APPLET(udhcpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP)) -IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand)) -IF_UNIQ(APPLET(uniq, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_UNIX2DOS(APPLET_NOEXEC(unix2dos, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, unix2dos)) -IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep)) -IF_UUDECODE(APPLET(uudecode, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_UUENCODE(APPLET(uuencode, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_WC(APPLET(wc, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_WHOAMI(APPLET_NOFORK(whoami, whoami, BB_DIR_USR_BIN, BB_SUID_DROP, whoami)) -IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes)) #if !defined(PROTOTYPES) && !defined(NAME_MAIN) && !defined(MAKE_USAGE) \ && !defined(MAKE_LINKS) && !defined(MAKE_SUID) -- cgit v1.2.3-55-g6feb From 73f743a381dc389287d2d0e56a2b7988f67c0bfc Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Nov 2016 14:54:38 +0100 Subject: Remove remnants of disabled "length" applet Signed-off-by: Denys Vlasenko --- coreutils/Config.src | 6 ------ coreutils/Kbuild.src | 2 -- coreutils/length.c.disabled | 31 ------------------------------- include/applets.src.h | 1 - 4 files changed, 40 deletions(-) delete mode 100644 coreutils/length.c.disabled (limited to 'include') diff --git a/coreutils/Config.src b/coreutils/Config.src index a35198a3b..c056320f8 100644 --- a/coreutils/Config.src +++ b/coreutils/Config.src @@ -7,12 +7,6 @@ menu "Coreutils" INSERT -####config LENGTH -#### bool "length" -#### default y -#### help -#### length is used to print out the length of a specified string. - comment "Common options" config FEATURE_VERBOSE diff --git a/coreutils/Kbuild.src b/coreutils/Kbuild.src index c93aa63a1..8e2c097a3 100644 --- a/coreutils/Kbuild.src +++ b/coreutils/Kbuild.src @@ -10,8 +10,6 @@ lib-y:= INSERT -#lib-$(CONFIG_LENGTH) += length.o - lib-$(CONFIG_MORE) += cat.o # more uses it if stdout isn't a tty lib-$(CONFIG_LESS) += cat.o # less too lib-$(CONFIG_CRONTAB) += cat.o # crontab -l diff --git a/coreutils/length.c.disabled b/coreutils/length.c.disabled deleted file mode 100644 index aee898d22..000000000 --- a/coreutils/length.c.disabled +++ /dev/null @@ -1,31 +0,0 @@ -/* vi: set sw=4 ts=4: */ -/* - * Licensed under GPLv2, see file LICENSE in this source tree. - */ - -/* BB_AUDIT SUSv3 N/A -- Apparently a busybox (obsolete?) extension. */ - -//usage:#define length_trivial_usage -//usage: "STRING" -//usage:#define length_full_usage "\n\n" -//usage: "Print STRING's length" -//usage: -//usage:#define length_example_usage -//usage: "$ length Hello\n" -//usage: "5\n" - -#include "libbb.h" - -/* This is a NOFORK applet. Be very careful! */ - -int length_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; -int length_main(int argc, char **argv) -{ - if ((argc != 2) || (**(++argv) == '-')) { - bb_show_usage(); - } - - printf("%u\n", (unsigned)strlen(*argv)); - - return fflush_all(); -} diff --git a/include/applets.src.h b/include/applets.src.h index 82907e2a5..c72dca849 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -82,7 +82,6 @@ IF_DUMPLEASES(APPLET(dumpleases, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_E2FSCK(APPLET_ODDNAME(fsck.ext3, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext3)) IF_GETENFORCE(APPLET(getenforce, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) -//IF_LENGTH(APPLET_NOFORK(length, length, BB_DIR_USR_BIN, BB_SUID_DROP, length)) IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_MATCHPATHCON(APPLET(matchpathcon, BB_DIR_USR_SBIN, BB_SUID_DROP)) //IF_PARSE(APPLET(parse, BB_DIR_USR_BIN, BB_SUID_DROP)) -- cgit v1.2.3-55-g6feb From 15fb91cefb22d64952f34fe246fc8f257172af63 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Nov 2016 18:31:48 +0100 Subject: test: make [ and [[ forms individually selectable Signed-off-by: Denys Vlasenko --- coreutils/test.c | 26 +++++++++++++++++++++----- include/applets.h.sh | 8 ++++++-- shell/ash.c | 4 ++-- 3 files changed, 29 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/coreutils/test.c b/coreutils/test.c index 81c9b7dfe..9e18ee986 100644 --- a/coreutils/test.c +++ b/coreutils/test.c @@ -27,19 +27,33 @@ //config: returning an appropriate exit code. The bash shell //config: has test built in, ash can build it in optionally. //config: +//config:config TEST1 +//config: bool "test as [" +//config: default y +//config: help +//config: Provide test command in the "[ EXPR ]" form +//config: +//config:config TEST2 +//config: bool "test as [[" +//config: default y +//config: help +//config: Provide test command in the "[[ EXPR ]]" form +//config: //config:config FEATURE_TEST_64 //config: bool "Extend test to 64 bit" //config: default y -//config: depends on TEST || ASH_BUILTIN_TEST || HUSH +//config: depends on TEST || TEST1 || TEST2 || ASH_BUILTIN_TEST || HUSH //config: help //config: Enable 64-bit support in test. -//applet:IF_TEST(APPLET_NOFORK([, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) -//applet:IF_TEST(APPLET_NOFORK([[, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) //applet:IF_TEST(APPLET_NOFORK(test, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) +//applet:IF_TEST1(APPLET_NOFORK([, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) +//applet:IF_TEST2(APPLET_NOFORK([[, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) //kbuild:lib-$(CONFIG_TEST) += test.o test_ptr_hack.o -//kbuild:lib-$(CONFIG_ASH) += test.o test_ptr_hack.o +//kbuild:lib-$(CONFIG_TEST1) += test.o test_ptr_hack.o +//kbuild:lib-$(CONFIG_TEST2) += test.o test_ptr_hack.o +//kbuild:lib-$(CONFIG_ASH_BUILTIN_TEST) += test.o test_ptr_hack.o //kbuild:lib-$(CONFIG_HUSH) += test.o test_ptr_hack.o /* "test --help" is special-cased to ignore --help */ @@ -827,7 +841,9 @@ int test_main(int argc, char **argv) const char *arg0; arg0 = bb_basename(argv[0]); - if (arg0[0] == '[') { + if ((ENABLE_TEST1 || ENABLE_TEST2 || ENABLE_ASH_BUILTIN_TEST || ENABLE_HUSH) + && (arg0[0] == '[') + ) { --argc; if (!arg0[1]) { /* "[" ? */ if (NOT_LONE_CHAR(argv[argc], ']')) { diff --git a/include/applets.h.sh b/include/applets.h.sh index 6b8046c4b..bab4e0d72 100755 --- a/include/applets.h.sh +++ b/include/applets.h.sh @@ -5,13 +5,17 @@ # CONFIG_applet names grep ^IF_ applets.h | grep -v IF_FEATURE_ | sed 's/IF_\([A-Z0-9._-]*\)(.*/\1/' \ -| grep -v MODPROBE_SMALL | sed 's/BB_SYSCTL/SYSCTL/' \ +| grep -v MODPROBE_SMALL \ +| sed 's/BB_SYSCTL/SYSCTL/' \ +| sed 's/TEST1/[/' \ +| sed 's/TEST2/[[/' \ | sort | uniq \ >applets_APP1 # command line applet names grep ^IF_ applets.h | sed -e's/ //g' -e's/.*(\([a-z[][^,]*\),.*/\1/' \ -| grep -v '^bash$' | grep -v '^sh$' \ +| grep -v '^bash$' \ +| grep -v '^sh$' \ | tr a-z A-Z \ | sort | uniq \ >applets_APP2 diff --git a/shell/ash.c b/shell/ash.c index 87f2127a1..15246f55f 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -9282,9 +9282,9 @@ static const struct builtincmd builtintab[] = { { BUILTIN_SPEC_REG ":" , truecmd }, #if ENABLE_ASH_BUILTIN_TEST { BUILTIN_REGULAR "[" , testcmd }, -#if ENABLE_ASH_BASH_COMPAT +# if ENABLE_ASH_BASH_COMPAT { BUILTIN_REGULAR "[[" , testcmd }, -#endif +# endif #endif #if ENABLE_ASH_ALIAS { BUILTIN_REG_ASSG "alias" , aliascmd }, -- cgit v1.2.3-55-g6feb From a8e52da7742b2bc8a3993f7f7c3c70da8fe79848 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Nov 2016 18:46:40 +0100 Subject: Convert all selinux/* applets to "new style" applet definitions Signed-off-by: Denys Vlasenko --- include/applets.src.h | 12 ----- selinux/Config.src | 113 ----------------------------------------------- selinux/Kbuild.src | 12 ----- selinux/chcon.c | 17 +++++++ selinux/getenforce.c | 10 +++++ selinux/getsebool.c | 10 +++++ selinux/load_policy.c | 10 +++++ selinux/matchpathcon.c | 11 +++++ selinux/runcon.c | 17 +++++++ selinux/selinuxenabled.c | 11 +++++ selinux/sestatus.c | 10 +++++ selinux/setenforce.c | 10 +++++ selinux/setfiles.c | 31 +++++++++++++ selinux/setsebool.c | 11 +++++ 14 files changed, 148 insertions(+), 137 deletions(-) (limited to 'include') diff --git a/include/applets.src.h b/include/applets.src.h index c72dca849..4e789151d 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -73,25 +73,13 @@ s - suid type: INSERT -IF_CHCON(APPLET(chcon, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_DHCPRELAY(APPLET(dhcprelay, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_DUMPLEASES(APPLET(dumpleases, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_E2FSCK(APPLET(e2fsck, BB_DIR_SBIN, BB_SUID_DROP)) //IF_E2LABEL(APPLET_ODDNAME(e2label, tune2fs, BB_DIR_SBIN, BB_SUID_DROP, e2label)) //IF_E2FSCK(APPLET_ODDNAME(fsck.ext2, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext2)) //IF_E2FSCK(APPLET_ODDNAME(fsck.ext3, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext3)) -IF_GETENFORCE(APPLET(getenforce, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_MATCHPATHCON(APPLET(matchpathcon, BB_DIR_USR_SBIN, BB_SUID_DROP)) //IF_PARSE(APPLET(parse, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon)) -IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_SELINUXENABLED(APPLET(selinuxenabled, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_SESTATUS(APPLET(sestatus, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_SETENFORCE(APPLET(setenforce, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_SETFILES(APPLET(setfiles, BB_DIR_SBIN, BB_SUID_DROP)) -IF_SETSEBOOL(APPLET(setsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_UDHCPC(APPLET(udhcpc, BB_DIR_SBIN, BB_SUID_DROP)) IF_UDHCPD(APPLET(udhcpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) diff --git a/selinux/Config.src b/selinux/Config.src index d4701f60b..9cb755a0f 100644 --- a/selinux/Config.src +++ b/selinux/Config.src @@ -8,117 +8,4 @@ menu "SELinux Utilities" INSERT -config CHCON - bool "chcon" - default n - depends on SELINUX - help - Enable support to change the security context of file. - -config FEATURE_CHCON_LONG_OPTIONS - bool "Enable long options" - default y - depends on CHCON && LONG_OPTS - help - Support long options for the chcon applet. - -config GETENFORCE - bool "getenforce" - default n - depends on SELINUX - help - Enable support to get the current mode of SELinux. - -config GETSEBOOL - bool "getsebool" - default n - depends on SELINUX - help - Enable support to get SELinux boolean values. - -config LOAD_POLICY - bool "load_policy" - default n - depends on SELINUX - help - Enable support to load SELinux policy. - -config MATCHPATHCON - bool "matchpathcon" - default n - depends on SELINUX - help - Enable support to get default security context of the - specified path from the file contexts configuration. - -config RESTORECON - bool "restorecon" - default n - depends on SELINUX - help - Enable support to relabel files. The feature is almost - the same as setfiles, but usage is a little different. - -config RUNCON - bool "runcon" - default n - depends on SELINUX - help - Enable support to run command in specified security context. - -config FEATURE_RUNCON_LONG_OPTIONS - bool "Enable long options" - default y - depends on RUNCON && LONG_OPTS - help - Support long options for the runcon applet. - -config SELINUXENABLED - bool "selinuxenabled" - default n - depends on SELINUX - help - Enable support for this command to be used within shell scripts - to determine if selinux is enabled. - -config SETENFORCE - bool "setenforce" - default n - depends on SELINUX - help - Enable support to modify the mode SELinux is running in. - -config SETFILES - bool "setfiles" - default n - depends on SELINUX - help - Enable support to modify to relabel files. - Notice: If you built libselinux with -D_FILE_OFFSET_BITS=64, - (It is default in libselinux's Makefile), you _must_ enable - CONFIG_LFS. - -config FEATURE_SETFILES_CHECK_OPTION - bool "Enable check option" - default n - depends on SETFILES - help - Support "-c" option (check the validity of the contexts against - the specified binary policy) for setfiles. Requires libsepol. - -config SETSEBOOL - bool "setsebool" - default n - depends on SELINUX - help - Enable support for change boolean. - semanage and -P option is not supported yet. - -config SESTATUS - bool "sestatus" - default n - depends on SELINUX - help - Displays the status of SELinux. - endmenu diff --git a/selinux/Kbuild.src b/selinux/Kbuild.src index cdd5f2adf..62c9e64cd 100644 --- a/selinux/Kbuild.src +++ b/selinux/Kbuild.src @@ -8,15 +8,3 @@ lib-y:= INSERT -lib-$(CONFIG_CHCON) += chcon.o -lib-$(CONFIG_GETENFORCE) += getenforce.o -lib-$(CONFIG_GETSEBOOL) += getsebool.o -lib-$(CONFIG_LOAD_POLICY) += load_policy.o -lib-$(CONFIG_MATCHPATHCON) += matchpathcon.o -lib-$(CONFIG_RUNCON) += runcon.o -lib-$(CONFIG_SELINUXENABLED) += selinuxenabled.o -lib-$(CONFIG_SETENFORCE) += setenforce.o -lib-$(CONFIG_SETFILES) += setfiles.o -lib-$(CONFIG_RESTORECON) += setfiles.o -lib-$(CONFIG_SETSEBOOL) += setsebool.o -lib-$(CONFIG_SESTATUS) += sestatus.o diff --git a/selinux/chcon.c b/selinux/chcon.c index f947c2c12..c743013ce 100644 --- a/selinux/chcon.c +++ b/selinux/chcon.c @@ -7,6 +7,23 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config CHCON +//config: bool "chcon" +//config: default n +//config: depends on SELINUX +//config: help +//config: Enable support to change the security context of file. +//config: +//config:config FEATURE_CHCON_LONG_OPTIONS +//config: bool "Enable long options" +//config: default y +//config: depends on CHCON && LONG_OPTS +//config: help +//config: Support long options for the chcon applet. + +//applet:IF_CHCON(APPLET(chcon, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_CHCON) += chcon.o //usage:#define chcon_trivial_usage //usage: "[OPTIONS] CONTEXT FILE..." diff --git a/selinux/getenforce.c b/selinux/getenforce.c index 56611d693..37477652b 100644 --- a/selinux/getenforce.c +++ b/selinux/getenforce.c @@ -6,6 +6,16 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config GETENFORCE +//config: bool "getenforce" +//config: default n +//config: depends on SELINUX +//config: help +//config: Enable support to get the current mode of SELinux. + +//applet:IF_GETENFORCE(APPLET(getenforce, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_GETENFORCE) += getenforce.o //usage:#define getenforce_trivial_usage NOUSAGE_STR //usage:#define getenforce_full_usage "" diff --git a/selinux/getsebool.c b/selinux/getsebool.c index e8f0fefb0..fce478f5b 100644 --- a/selinux/getsebool.c +++ b/selinux/getsebool.c @@ -6,6 +6,16 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config GETSEBOOL +//config: bool "getsebool" +//config: default n +//config: depends on SELINUX +//config: help +//config: Enable support to get SELinux boolean values. + +//applet:IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_GETSEBOOL) += getsebool.o //usage:#define getsebool_trivial_usage //usage: "-a or getsebool boolean..." diff --git a/selinux/load_policy.c b/selinux/load_policy.c index ce139dbf2..f969453e3 100644 --- a/selinux/load_policy.c +++ b/selinux/load_policy.c @@ -4,6 +4,16 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config LOAD_POLICY +//config: bool "load_policy" +//config: default n +//config: depends on SELINUX +//config: help +//config: Enable support to load SELinux policy. + +//applet:IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_LOAD_POLICY) += load_policy.o //usage:#define load_policy_trivial_usage NOUSAGE_STR //usage:#define load_policy_full_usage "" diff --git a/selinux/matchpathcon.c b/selinux/matchpathcon.c index 9e5728eb3..a3b2fcb74 100644 --- a/selinux/matchpathcon.c +++ b/selinux/matchpathcon.c @@ -5,6 +5,17 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config MATCHPATHCON +//config: bool "matchpathcon" +//config: default n +//config: depends on SELINUX +//config: help +//config: Enable support to get default security context of the +//config: specified path from the file contexts configuration. + +//applet:IF_MATCHPATHCON(APPLET(matchpathcon, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_MATCHPATHCON) += matchpathcon.o //usage:#define matchpathcon_trivial_usage //usage: "[-n] [-N] [-f file_contexts_file] [-p prefix] [-V]" diff --git a/selinux/runcon.c b/selinux/runcon.c index 27f2be3a9..366834e46 100644 --- a/selinux/runcon.c +++ b/selinux/runcon.c @@ -28,6 +28,23 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config RUNCON +//config: bool "runcon" +//config: default n +//config: depends on SELINUX +//config: help +//config: Enable support to run command in specified security context. +//config: +//config:config FEATURE_RUNCON_LONG_OPTIONS +//config: bool "Enable long options" +//config: default y +//config: depends on RUNCON && LONG_OPTS +//config: help +//config: Support long options for the runcon applet. + +//applet:IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_RUNCON) += runcon.o //usage:#define runcon_trivial_usage //usage: "[-c] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] PROG ARGS\n" diff --git a/selinux/selinuxenabled.c b/selinux/selinuxenabled.c index ce830dc22..b80c4e71b 100644 --- a/selinux/selinuxenabled.c +++ b/selinux/selinuxenabled.c @@ -6,6 +6,17 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config SELINUXENABLED +//config: bool "selinuxenabled" +//config: default n +//config: depends on SELINUX +//config: help +//config: Enable support for this command to be used within shell scripts +//config: to determine if selinux is enabled. + +//applet:IF_SELINUXENABLED(APPLET(selinuxenabled, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SELINUXENABLED) += selinuxenabled.o //usage:#define selinuxenabled_trivial_usage NOUSAGE_STR //usage:#define selinuxenabled_full_usage "" diff --git a/selinux/sestatus.c b/selinux/sestatus.c index e59431873..ad49c9d25 100644 --- a/selinux/sestatus.c +++ b/selinux/sestatus.c @@ -7,6 +7,16 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config SESTATUS +//config: bool "sestatus" +//config: default n +//config: depends on SELINUX +//config: help +//config: Displays the status of SELinux. + +//applet:IF_SESTATUS(APPLET(sestatus, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SESTATUS) += sestatus.o //usage:#define sestatus_trivial_usage //usage: "[-vb]" diff --git a/selinux/setenforce.c b/selinux/setenforce.c index c5bc0a5a6..8d18abd29 100644 --- a/selinux/setenforce.c +++ b/selinux/setenforce.c @@ -6,6 +6,16 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config SETENFORCE +//config: bool "setenforce" +//config: default n +//config: depends on SELINUX +//config: help +//config: Enable support to modify the mode SELinux is running in. + +//applet:IF_SETENFORCE(APPLET(setenforce, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SETENFORCE) += setenforce.o //usage:#define setenforce_trivial_usage //usage: "[Enforcing | Permissive | 1 | 0]" diff --git a/selinux/setfiles.c b/selinux/setfiles.c index c9597d54e..4fc307f55 100644 --- a/selinux/setfiles.c +++ b/selinux/setfiles.c @@ -3,6 +3,37 @@ policycoreutils was released under GPL 2. Port to BusyBox (c) 2007 by Yuichi Nakamura */ +//config:config SETFILES +//config: bool "setfiles" +//config: default n +//config: depends on SELINUX +//config: help +//config: Enable support to modify to relabel files. +//config: Notice: If you built libselinux with -D_FILE_OFFSET_BITS=64, +//config: (It is default in libselinux's Makefile), you _must_ enable +//config: CONFIG_LFS. +//config: +//config:config FEATURE_SETFILES_CHECK_OPTION +//config: bool "Enable check option" +//config: default n +//config: depends on SETFILES +//config: help +//config: Support "-c" option (check the validity of the contexts against +//config: the specified binary policy) for setfiles. Requires libsepol. +//config: +//config:config RESTORECON +//config: bool "restorecon" +//config: default n +//config: depends on SELINUX +//config: help +//config: Enable support to relabel files. The feature is almost +//config: the same as setfiles, but usage is a little different. + +//applet:IF_SETFILES(APPLET(setfiles, BB_DIR_SBIN, BB_SUID_DROP)) +//applet:IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon)) + +//kbuild:lib-$(CONFIG_SETFILES) += setfiles.o +//kbuild:lib-$(CONFIG_RESTORECON) += setfiles.o //usage:#define setfiles_trivial_usage //usage: "[-dnpqsvW] [-e DIR]... [-o FILE] [-r alt_root_path]" diff --git a/selinux/setsebool.c b/selinux/setsebool.c index ec682e5c5..6a6bd031c 100644 --- a/selinux/setsebool.c +++ b/selinux/setsebool.c @@ -7,6 +7,17 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config SETSEBOOL +//config: bool "setsebool" +//config: default n +//config: depends on SELINUX +//config: help +//config: Enable support for change boolean. +//config: semanage and -P option is not supported yet. + +//applet:IF_SETSEBOOL(APPLET(setsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SETSEBOOL) += setsebool.o //usage:#define setsebool_trivial_usage //usage: "boolean value" -- cgit v1.2.3-55-g6feb From f7683cdf83f9eb6793b0be34058dcff92e41252d Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Nov 2016 18:54:59 +0100 Subject: Convert all udhcp applets to "new style" applet definitions Signed-off-by: Denys Vlasenko --- include/applets.src.h | 5 +---- networking/udhcp/dhcpc.c | 7 +++++++ networking/udhcp/dhcpd.c | 5 +++++ networking/udhcp/dhcprelay.c | 3 +++ networking/udhcp/dumpleases.c | 3 +++ 5 files changed, 19 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/applets.src.h b/include/applets.src.h index 4e789151d..10e85de78 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -73,15 +73,12 @@ s - suid type: INSERT -IF_DHCPRELAY(APPLET(dhcprelay, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_DUMPLEASES(APPLET(dumpleases, BB_DIR_USR_BIN, BB_SUID_DROP)) + //IF_E2FSCK(APPLET(e2fsck, BB_DIR_SBIN, BB_SUID_DROP)) //IF_E2LABEL(APPLET_ODDNAME(e2label, tune2fs, BB_DIR_SBIN, BB_SUID_DROP, e2label)) //IF_E2FSCK(APPLET_ODDNAME(fsck.ext2, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext2)) //IF_E2FSCK(APPLET_ODDNAME(fsck.ext3, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext3)) //IF_PARSE(APPLET(parse, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_UDHCPC(APPLET(udhcpc, BB_DIR_SBIN, BB_SUID_DROP)) -IF_UDHCPD(APPLET(udhcpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) #if !defined(PROTOTYPES) && !defined(NAME_MAIN) && !defined(MAKE_USAGE) \ && !defined(MAKE_LINKS) && !defined(MAKE_SUID) diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 1c1051107..0e236261b 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c @@ -18,6 +18,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +//applet:IF_UDHCPC(APPLET(udhcpc, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_UDHCPC) += common.o packet.o signalpipe.o socket.o +//kbuild:lib-$(CONFIG_UDHCPC) += dhcpc.o +//kbuild:lib-$(CONFIG_FEATURE_UDHCPC_ARPING) += arpping.o +//kbuild:lib-$(CONFIG_FEATURE_UDHCP_RFC3397) += domain_codec.o + #include /* Override ENABLE_FEATURE_PIDFILE - ifupdown needs our pidfile to always exist */ #define WANT_PIDFILE 1 diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c index 56116d01f..e116ba3af 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c @@ -20,6 +20,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +//applet:IF_UDHCPD(APPLET(udhcpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_UDHCPD) += common.o packet.o signalpipe.o socket.o +//kbuild:lib-$(CONFIG_UDHCPD) += dhcpd.o arpping.o +//kbuild:lib-$(CONFIG_FEATURE_UDHCP_RFC3397) += domain_codec.o //usage:#define udhcpd_trivial_usage //usage: "[-fS] [-I ADDR]" IF_FEATURE_UDHCP_PORT(" [-P N]") " [CONFFILE]" diff --git a/networking/udhcp/dhcprelay.c b/networking/udhcp/dhcprelay.c index f52a0cf88..7cb19b14e 100644 --- a/networking/udhcp/dhcprelay.c +++ b/networking/udhcp/dhcprelay.c @@ -9,6 +9,9 @@ * Netbeat AG * Upstream has GPL v2 or later */ +//applet:IF_DHCPRELAY(APPLET(dhcprelay, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_DHCPRELAY) += dhcprelay.o //usage:#define dhcprelay_trivial_usage //usage: "CLIENT_IFACE[,CLIENT_IFACE2]... SERVER_IFACE [SERVER_IP]" diff --git a/networking/udhcp/dumpleases.c b/networking/udhcp/dumpleases.c index 987cc9aff..d83344a8d 100644 --- a/networking/udhcp/dumpleases.c +++ b/networking/udhcp/dumpleases.c @@ -2,6 +2,9 @@ /* * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//applet:IF_DUMPLEASES(APPLET(dumpleases, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_DUMPLEASES) += dumpleases.o //usage:#define dumpleases_trivial_usage //usage: "[-r|-a] [-d] [-f LEASEFILE]" -- cgit v1.2.3-55-g6feb From 5bbee27c0fcafe60f43a294afa1352b5ddcab6f3 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Nov 2016 21:51:11 +0100 Subject: Remove outdated comments Signed-off-by: Denys Vlasenko --- e2fsprogs/tune2fs.c | 2 ++ include/applets.src.h | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/e2fsprogs/tune2fs.c b/e2fsprogs/tune2fs.c index c9f88b39d..e9bad66ad 100644 --- a/e2fsprogs/tune2fs.c +++ b/e2fsprogs/tune2fs.c @@ -15,6 +15,8 @@ //applet:IF_TUNE2FS(APPLET(tune2fs, BB_DIR_SBIN, BB_SUID_DROP)) +//TODO alias to "tune2fs -L LABEL": //applet:IF_E2LABEL(APPLET_ODDNAME(e2label, tune2fs, BB_DIR_SBIN, BB_SUID_DROP, e2label)) + //kbuild:lib-$(CONFIG_TUNE2FS) += tune2fs.o //usage:#define tune2fs_trivial_usage diff --git a/include/applets.src.h b/include/applets.src.h index 10e85de78..2ddf120ad 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -74,11 +74,6 @@ s - suid type: INSERT -//IF_E2FSCK(APPLET(e2fsck, BB_DIR_SBIN, BB_SUID_DROP)) -//IF_E2LABEL(APPLET_ODDNAME(e2label, tune2fs, BB_DIR_SBIN, BB_SUID_DROP, e2label)) -//IF_E2FSCK(APPLET_ODDNAME(fsck.ext2, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext2)) -//IF_E2FSCK(APPLET_ODDNAME(fsck.ext3, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext3)) -//IF_PARSE(APPLET(parse, BB_DIR_USR_BIN, BB_SUID_DROP)) #if !defined(PROTOTYPES) && !defined(NAME_MAIN) && !defined(MAKE_USAGE) \ && !defined(MAKE_LINKS) && !defined(MAKE_SUID) -- cgit v1.2.3-55-g6feb From 2e4ef38743c3d4aef109b5cc04429ec1f0e2f6c8 Mon Sep 17 00:00:00 2001 From: Rostislav Skudnov Date: Thu, 24 Nov 2016 15:04:00 +0100 Subject: lineedit: fix handling of repeating Alt-b, Alt-f, Alt-d, Alt-Backspace These key combinations should repeat correctly when the keys are pressed and held. Before this change, they do this erratically - many repeats are "eaten" because they are treated as unrecognized ESC seqs: ESC 0x7f is treated by Alt+baskspace, but ESC 0x7f ESC 0x7f ESC 0x7f is unrecognized. Escape sequences corresponding to these key combinations are moved from read_line_input to lineedit_read_key. Also, these key sequences are now enabled regardless of whether FEATURE_EDITING_VI is set, since Vim does not actually support these key combinations, but they are present in readline library. function old new delta static.esccmds 93 103 +10 read_line_input 3737 3687 -50 Signed-off-by: Rostislav Skudnov Signed-off-by: Denys Vlasenko --- include/libbb.h | 76 ++++++++++++++++++++++++++++---------------------------- libbb/lineedit.c | 60 ++++++++++++++------------------------------ libbb/read_key.c | 12 +++++++++ 3 files changed, 68 insertions(+), 80 deletions(-) (limited to 'include') diff --git a/include/libbb.h b/include/libbb.h index 20fc7329f..bdafcf5a6 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1463,46 +1463,46 @@ unsigned long long bb_makedev(unsigned major, unsigned minor) FAST_FUNC; * yet doesn't represent any valid Unicode character. * Also, -1 is reserved for error indication and we don't use it. */ enum { - KEYCODE_UP = -2, - KEYCODE_DOWN = -3, - KEYCODE_RIGHT = -4, - KEYCODE_LEFT = -5, - KEYCODE_HOME = -6, - KEYCODE_END = -7, - KEYCODE_INSERT = -8, - KEYCODE_DELETE = -9, - KEYCODE_PAGEUP = -10, - KEYCODE_PAGEDOWN = -11, - // -12 is reserved for Alt/Ctrl/Shift-TAB + KEYCODE_UP = -2, + KEYCODE_DOWN = -3, + KEYCODE_RIGHT = -4, + KEYCODE_LEFT = -5, + KEYCODE_HOME = -6, + KEYCODE_END = -7, + KEYCODE_INSERT = -8, + KEYCODE_DELETE = -9, + KEYCODE_PAGEUP = -10, + KEYCODE_PAGEDOWN = -11, + KEYCODE_BACKSPACE = -12, /* Used only if Alt/Ctrl/Shifted */ + KEYCODE_D = -13, /* Used only if Alted */ #if 0 - KEYCODE_FUN1 = -13, - KEYCODE_FUN2 = -14, - KEYCODE_FUN3 = -15, - KEYCODE_FUN4 = -16, - KEYCODE_FUN5 = -17, - KEYCODE_FUN6 = -18, - KEYCODE_FUN7 = -19, - KEYCODE_FUN8 = -20, - KEYCODE_FUN9 = -21, - KEYCODE_FUN10 = -22, - KEYCODE_FUN11 = -23, - KEYCODE_FUN12 = -24, -#endif - /* Be sure that last defined value is small enough - * to not interfere with Alt/Ctrl/Shift bits. - * So far we do not exceed -31 (0xfff..fffe1), - * which gives us three upper bits in LSB to play with. + KEYCODE_FUN1 = , + KEYCODE_FUN2 = , + KEYCODE_FUN3 = , + KEYCODE_FUN4 = , + KEYCODE_FUN5 = , + KEYCODE_FUN6 = , + KEYCODE_FUN7 = , + KEYCODE_FUN8 = , + KEYCODE_FUN9 = , + KEYCODE_FUN10 = , + KEYCODE_FUN11 = , + KEYCODE_FUN12 = , +#endif + /* ^^^^^ Be sure that last defined value is small enough. + * Current read_key() code allows going up to -32 (0xfff..fffe0). + * This gives three upper bits in LSB to play with: + * KEYCODE_foo values are 0xfff..fffXX, lowest XX bits are: scavvvvv, + * s=0 if SHIFT, c=0 if CTRL, a=0 if ALT, + * vvvvv bits are the same for same key regardless of "shift bits". */ - //KEYCODE_SHIFT_TAB = (-12) & ~0x80, - //KEYCODE_SHIFT_... = KEYCODE_... & ~0x80, - //KEYCODE_CTRL_UP = KEYCODE_UP & ~0x40, - //KEYCODE_CTRL_DOWN = KEYCODE_DOWN & ~0x40, - KEYCODE_CTRL_RIGHT = KEYCODE_RIGHT & ~0x40, - KEYCODE_CTRL_LEFT = KEYCODE_LEFT & ~0x40, - //KEYCODE_ALT_UP = KEYCODE_UP & ~0x20, - //KEYCODE_ALT_DOWN = KEYCODE_DOWN & ~0x20, - KEYCODE_ALT_RIGHT = KEYCODE_RIGHT & ~0x20, - KEYCODE_ALT_LEFT = KEYCODE_LEFT & ~0x20, + //KEYCODE_SHIFT_... = KEYCODE_... & ~0x80, + KEYCODE_CTRL_RIGHT = KEYCODE_RIGHT & ~0x40, + KEYCODE_CTRL_LEFT = KEYCODE_LEFT & ~0x40, + KEYCODE_ALT_RIGHT = KEYCODE_RIGHT & ~0x20, + KEYCODE_ALT_LEFT = KEYCODE_LEFT & ~0x20, + KEYCODE_ALT_BACKSPACE = KEYCODE_BACKSPACE & ~0x20, + KEYCODE_ALT_D = KEYCODE_D & ~0x20, KEYCODE_CURSOR_POS = -0x100, /* 0xfff..fff00 */ /* How long is the longest ESC sequence we know? diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 2cc61db40..ac049f57d 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -13,7 +13,6 @@ * * This code is 'as is' with no warranty. */ - /* * Usage and known bugs: * Terminal key codes are not extensive, more needs to be added. @@ -23,9 +22,6 @@ * Ctrl-E also works as End. * * The following readline-like commands are not implemented: - * ESC-b -- Move back one word - * ESC-f -- Move forward one word - * ESC-d -- Delete forward one word * CTL-t -- Transpose two characters * * lineedit does not know that the terminal escape sequences do not @@ -2483,6 +2479,24 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman while (cursor > 0 && !BB_isspace(command_ps[cursor-1])) input_backspace(); break; + case KEYCODE_ALT_D: { + /* Delete word forward */ + int nc, sc = cursor; + ctrl_right(); + nc = cursor - sc; + input_backward(nc); + while (--nc >= 0) + input_delete(1); + break; + } + case KEYCODE_ALT_BACKSPACE: { + /* Delete word backward */ + int sc = cursor; + ctrl_left(); + while (sc-- > cursor) + input_delete(1); + break; + } #if ENABLE_FEATURE_REVERSE_SEARCH case CTRL('R'): ic = ic_raw = reverse_i_search(); @@ -2625,44 +2639,6 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman vi_cmdmode = 1; input_backward(1); } - /* Handle a few ESC- combinations the same way - * standard readline bindings (IOW: bash) do. - * Often, Alt- generates ESC-. - */ - ic = lineedit_read_key(read_key_buffer, 50); - switch (ic) { - //case KEYCODE_LEFT: - bash doesn't do this - case 'b': - ctrl_left(); - break; - //case KEYCODE_RIGHT: - bash doesn't do this - case 'f': - ctrl_right(); - break; - //case KEYCODE_DELETE: - bash doesn't do this - case 'd': /* Alt-D */ - { - /* Delete word forward */ - int nc, sc = cursor; - ctrl_right(); - nc = cursor - sc; - input_backward(nc); - while (--nc >= 0) - input_delete(1); - break; - } - case '\b': /* Alt-Backspace(?) */ - case '\x7f': /* Alt-Backspace(?) */ - //case 'w': - bash doesn't do this - { - /* Delete word backward */ - int sc = cursor; - ctrl_left(); - while (sc-- > cursor) - input_delete(1); - break; - } - } break; #endif /* FEATURE_COMMAND_EDITING_VI */ diff --git a/libbb/read_key.c b/libbb/read_key.c index ace23defb..951786869 100644 --- a/libbb/read_key.c +++ b/libbb/read_key.c @@ -18,8 +18,20 @@ int64_t FAST_FUNC read_key(int fd, char *buffer, int timeout) /* Known escape sequences for cursor and function keys. * See "Xterm Control Sequences" * http://invisible-island.net/xterm/ctlseqs/ctlseqs.html + * Array should be sorted from shortest to longest. */ static const char esccmds[] ALIGN1 = { + '\x7f' |0x80,KEYCODE_ALT_BACKSPACE, + '\b' |0x80,KEYCODE_ALT_BACKSPACE, + 'd' |0x80,KEYCODE_ALT_D , + /* lineedit mimics bash: Alt-f and Alt-b are forward/backward + * word jumps. We cheat here and make them return ALT_LEFT/RIGHT + * keycodes. This way, lineedit need no special code to handle them. + * If we'll need to distinguish them, introduce new ALT_F/B keycodes, + * and update lineedit to react to them. + */ + 'f' |0x80,KEYCODE_ALT_RIGHT, + 'b' |0x80,KEYCODE_ALT_LEFT, 'O','A' |0x80,KEYCODE_UP , 'O','B' |0x80,KEYCODE_DOWN , 'O','C' |0x80,KEYCODE_RIGHT , -- cgit v1.2.3-55-g6feb