From fb4da167114e96d7f20ef97474f976f8ffa604e7 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 22 Nov 2016 23:14:24 +0100 Subject: Split miscutils/Config.src items into miscutils/*.c files Signed-off-by: Denys Vlasenko --- miscutils/Config.src | 524 ------------------------------------------ miscutils/adjtimex.c | 7 + miscutils/bbconfig.c | 20 ++ miscutils/beep.c | 22 ++ miscutils/chat.c | 66 ++++++ miscutils/chrt.c | 6 + miscutils/conspy.c | 9 +- miscutils/crontab.c | 8 + miscutils/dc.c | 22 +- miscutils/devfsd.c | 56 +++++ miscutils/devmem.c | 6 + miscutils/eject.c | 14 ++ miscutils/fbsplash.c | 21 ++ miscutils/flash_eraseall.c | 6 + miscutils/flash_lock_unlock.c | 13 ++ miscutils/flashcp.c | 6 + miscutils/hdparm.c | 58 +++++ miscutils/inotifyd.c | 6 + miscutils/ionice.c | 7 + miscutils/last.c | 14 ++ miscutils/makedevs.c | 31 +++ miscutils/man.c | 5 + miscutils/microcom.c | 5 + miscutils/mountpoint.c | 5 + miscutils/mt.c | 7 + miscutils/raidautorun.c | 7 + miscutils/readahead.c | 17 ++ miscutils/runlevel.c | 9 + miscutils/rx.c | 6 + miscutils/setsid.c | 5 + miscutils/strings.c | 6 + miscutils/time.c | 7 + miscutils/timeout.c | 6 + miscutils/ttysize.c | 8 + miscutils/volname.c | 5 + miscutils/watchdog.c | 11 + 36 files changed, 498 insertions(+), 533 deletions(-) (limited to 'miscutils') diff --git a/miscutils/Config.src b/miscutils/Config.src index 06f1c52ba..7325fb8fa 100644 --- a/miscutils/Config.src +++ b/miscutils/Config.src @@ -7,528 +7,4 @@ menu "Miscellaneous Utilities" INSERT -config ADJTIMEX - bool "adjtimex" - default y - select PLATFORM_LINUX - help - Adjtimex reads and optionally sets adjustment parameters for - the Linux clock adjustment algorithm. - -config BBCONFIG - bool "bbconfig" - default n - help - The bbconfig applet will print the config file with which - busybox was built. - -config FEATURE_COMPRESS_BBCONFIG - bool "Compress bbconfig data" - default y - depends on BBCONFIG - help - Store bbconfig data in compressed form, uncompress them on-the-fly - before output. - - If you have a really tiny busybox with few applets enabled (and - bunzip2 isn't one of them), the overhead of the decompressor might - be noticeable. Also, if you run executables directly from ROM - and have very little memory, this might not be a win. Otherwise, - you probably want this. - -config BEEP - bool "beep" - default y - select PLATFORM_LINUX - help - The beep applets beeps in a given freq/Hz. - -config FEATURE_BEEP_FREQ - int "default frequency" - range 0 2147483647 - default 4000 - depends on BEEP - help - Frequency for default beep. - -config FEATURE_BEEP_LENGTH_MS - int "default length" - range 0 2147483647 - default 30 - depends on BEEP - help - Length in ms for default beep. - -config CHAT - bool "chat" - default y - help - Simple chat utility. - -config FEATURE_CHAT_NOFAIL - bool "Enable NOFAIL expect strings" - depends on CHAT - default y - help - When enabled expect strings which are started with a dash trigger - no-fail mode. That is when expectation is not met within timeout - the script is not terminated but sends next SEND string and waits - for next EXPECT string. This allows to compose far more flexible - scripts. - -config FEATURE_CHAT_TTY_HIFI - bool "Force STDIN to be a TTY" - depends on CHAT - default n - help - Original chat always treats STDIN as a TTY device and sets for it - so-called raw mode. This option turns on such behaviour. - -config FEATURE_CHAT_IMPLICIT_CR - bool "Enable implicit Carriage Return" - depends on CHAT - default y - help - When enabled make chat to terminate all SEND strings with a "\r" - unless "\c" is met anywhere in the string. - -config FEATURE_CHAT_SWALLOW_OPTS - bool "Swallow options" - depends on CHAT - default y - help - Busybox chat require no options. To make it not fail when used - in place of original chat (which has a bunch of options) turn - this on. - -config FEATURE_CHAT_SEND_ESCAPES - bool "Support weird SEND escapes" - depends on CHAT - default y - help - Original chat uses some escape sequences in SEND arguments which - are not sent to device but rather performs special actions. - E.g. "\K" means to send a break sequence to device. - "\d" delays execution for a second, "\p" -- for a 1/100 of second. - Before turning this option on think twice: do you really need them? - -config FEATURE_CHAT_VAR_ABORT_LEN - bool "Support variable-length ABORT conditions" - depends on CHAT - default y - help - Original chat uses fixed 50-bytes length ABORT conditions. Say N here. - -config FEATURE_CHAT_CLR_ABORT - bool "Support revoking of ABORT conditions" - depends on CHAT - default y - help - Support CLR_ABORT directive. - -config CHRT - bool "chrt" - default y - help - manipulate real-time attributes of a process. - This requires sched_{g,s}etparam support in your libc. - -config CRONTAB - bool "crontab" - default y - help - Crontab manipulates the crontab for a particular user. Only - the superuser may specify a different user and/or crontab directory. - Note that Busybox binary must be setuid root for this applet to - work properly. - -config DC - bool "dc" - default y - help - Dc is a reverse-polish desk calculator which supports unlimited - precision arithmetic. - -config FEATURE_DC_LIBM - bool "Enable power and exp functions (requires libm)" - default y - depends on DC - help - Enable power and exp functions. - NOTE: This will require libm to be present for linking. - -config DEVFSD - bool "devfsd (obsolete)" - default n - select PLATFORM_LINUX - select FEATURE_SYSLOG - help - This is deprecated and should NOT be used anymore. - Use linux >= 2.6 (optionally with hotplug) and mdev instead! - See docs/mdev.txt for detailed instructions on how to use mdev - instead. - - Provides compatibility with old device names on a devfs systems. - You should set it to true if you have devfs enabled. - The following keywords in devsfd.conf are supported: - "CLEAR_CONFIG", "INCLUDE", "OPTIONAL_INCLUDE", "RESTORE", - "PERMISSIONS", "EXECUTE", "COPY", "IGNORE", - "MKOLDCOMPAT", "MKNEWCOMPAT","RMOLDCOMPAT", "RMNEWCOMPAT". - - But only if they are written UPPERCASE!!!!!!!! - -config DEVFSD_MODLOAD - bool "Adds support for MODLOAD keyword in devsfd.conf" - default y - depends on DEVFSD - help - This actually doesn't work with busybox modutils but needs - the external modutils. - -config DEVFSD_FG_NP - bool "Enables the -fg and -np options" - default y - depends on DEVFSD - help - -fg Run the daemon in the foreground. - -np Exit after parsing the configuration file. - Do not poll for events. - -config DEVFSD_VERBOSE - bool "Increases logging (and size)" - default y - depends on DEVFSD - help - Increases logging to stderr or syslog. - -config FEATURE_DEVFS - bool "Use devfs names for all devices (obsolete)" - default n - select PLATFORM_LINUX - help - This is obsolete and should NOT be used anymore. - Use linux >= 2.6 (optionally with hotplug) and mdev instead! - - For legacy systems -- if there is no way around devfsd -- this - tells busybox to look for names like /dev/loop/0 instead of - /dev/loop0. If your /dev directory has normal names instead of - devfs names, you don't want this. - -config DEVMEM - bool "devmem" - default y - help - devmem is a small program that reads and writes from physical - memory using /dev/mem. - -config EJECT - bool "eject" - default y - select PLATFORM_LINUX - help - Used to eject cdroms. (defaults to /dev/cdrom) - -config FEATURE_EJECT_SCSI - bool "SCSI support" - default y - depends on EJECT - help - Add the -s option to eject, this allows to eject SCSI-Devices and - usb-storage devices. - -config FBSPLASH - bool "fbsplash" - default y - select PLATFORM_LINUX - help - Shows splash image and progress bar on framebuffer device. - Can be used during boot phase of an embedded device. ~2kb. - Usage: - - use kernel option 'vga=xxx' or otherwise enable fb device. - - put somewhere fbsplash.cfg file and an image in .ppm format. - - $ setsid fbsplash [params] & - -c: hide cursor - -d /dev/fbN: framebuffer device (if not /dev/fb0) - -s path_to_image_file (can be "-" for stdin) - -i path_to_cfg_file (can be "-" for stdin) - -f path_to_fifo (can be "-" for stdin) - - if you want to run it only in presence of kernel parameter: - grep -q "fbsplash=on" = 2.6.13 - -config INOTIFYD - bool "inotifyd" - default n # doesn't build on Knoppix 5 - help - Simple inotify daemon. Reports filesystem changes. Requires - kernel >= 2.6.13 - -config LAST - bool "last" - default y - depends on FEATURE_WTMP - help - 'last' displays a list of the last users that logged into the system. - -config FEATURE_LAST_FANCY - bool "Turn on output of extra information" - default y - depends on LAST - help - 'last' displays detailed information about the last users that - logged into the system (mimics sysvinit last). +900 bytes. - -config HDPARM - bool "hdparm" - default y - select PLATFORM_LINUX - help - Get/Set hard drive parameters. Primarily intended for ATA - drives. Adds about 13k (or around 30k if you enable the - FEATURE_HDPARM_GET_IDENTITY option).... - -config FEATURE_HDPARM_GET_IDENTITY - bool "Support obtaining detailed information directly from drives" - default y - depends on HDPARM - help - Enables the -I and -i options to obtain detailed information - directly from drives about their capabilities and supported ATA - feature set. If no device name is specified, hdparm will read - identify data from stdin. Enabling this option will add about 16k... - -config FEATURE_HDPARM_HDIO_SCAN_HWIF - bool "Register an IDE interface (DANGEROUS)" - default y - depends on HDPARM - help - Enables the 'hdparm -R' option to register an IDE interface. - This is dangerous stuff, so you should probably say N. - -config FEATURE_HDPARM_HDIO_UNREGISTER_HWIF - bool "Un-register an IDE interface (DANGEROUS)" - default y - depends on HDPARM - help - Enables the 'hdparm -U' option to un-register an IDE interface. - This is dangerous stuff, so you should probably say N. - -config FEATURE_HDPARM_HDIO_DRIVE_RESET - bool "Perform device reset (DANGEROUS)" - default y - depends on HDPARM - help - Enables the 'hdparm -w' option to perform a device reset. - This is dangerous stuff, so you should probably say N. - -config FEATURE_HDPARM_HDIO_TRISTATE_HWIF - bool "Tristate device for hotswap (DANGEROUS)" - default y - depends on HDPARM - help - Enables the 'hdparm -x' option to tristate device for hotswap, - and the '-b' option to get/set bus state. This is dangerous - stuff, so you should probably say N. - -config FEATURE_HDPARM_HDIO_GETSET_DMA - bool "Get/set using_dma flag" - default y - depends on HDPARM - help - Enables the 'hdparm -d' option to get/set using_dma flag. - -config MAKEDEVS - bool "makedevs" - default y - help - 'makedevs' is a utility used to create a batch of devices with - one command. - - There are two choices for command line behaviour, the interface - as used by LEAF/Linux Router Project, or a device table file. - - 'leaf' is traditionally what busybox follows, it allows multiple - devices of a particluar type to be created per command. - e.g. /dev/hda[0-9] - Device properties are passed as command line arguments. - - 'table' reads device properties from a file or stdin, allowing - a batch of unrelated devices to be made with one command. - User/group names are allowed as an alternative to uid/gid. - -choice - prompt "Choose makedevs behaviour" - depends on MAKEDEVS - default FEATURE_MAKEDEVS_TABLE - -config FEATURE_MAKEDEVS_LEAF - bool "leaf" - -config FEATURE_MAKEDEVS_TABLE - bool "table" - -endchoice - -config MAN - bool "man" - default y - help - Format and display manual pages. - -config MICROCOM - bool "microcom" - default y - help - The poor man's minicom utility for chatting with serial port devices. - -config MOUNTPOINT - bool "mountpoint" - default y - help - mountpoint checks if the directory is a mountpoint. - -config MT - bool "mt" - default y - help - mt is used to control tape devices. You can use the mt utility - to advance or rewind a tape past a specified number of archive - files on the tape. - -config RAIDAUTORUN - bool "raidautorun" - default y - select PLATFORM_LINUX - help - raidautorun tells the kernel md driver to - search and start RAID arrays. - -config READAHEAD - bool "readahead" - default y - depends on LFS - select PLATFORM_LINUX - help - Preload the files listed on the command line into RAM cache so that - subsequent reads on these files will not block on disk I/O. - - This applet just calls the readahead(2) system call on each file. - It is mainly useful in system startup scripts to preload files - or executables before they are used. When used at the right time - (in particular when a CPU bound process is running) it can - significantly speed up system startup. - - As readahead(2) blocks until each file has been read, it is best to - run this applet as a background job. - -config RUNLEVEL - bool "runlevel" - default y - depends on FEATURE_UTMP - help - find the current and previous system runlevel. - - This applet uses utmp but does not rely on busybox supporing - utmp on purpose. It is used by e.g. emdebian via /etc/init.d/rc. - -config RX - bool "rx" - default y - select PLATFORM_LINUX - help - Receive files using the Xmodem protocol. - -config SETSID - bool "setsid" - default y - help - setsid runs a program in a new session - -config STRINGS - bool "strings" - default y - help - strings prints the printable character sequences for each file - specified. - -config TIME - bool "time" - default y - help - The time command runs the specified program with the given arguments. - When the command finishes, time writes a message to standard output - giving timing statistics about this program run. - -config TIMEOUT - bool "timeout" - default y - help - Runs a program and watches it. If it does not terminate in - specified number of seconds, it is sent a signal. - -config TTYSIZE - bool "ttysize" - default y - help - A replacement for "stty size". Unlike stty, can report only width, - only height, or both, in any order. It also does not complain on - error, but returns default 80x24. - Usage in shell scripts: width=`ttysize w`. - -config VOLNAME - bool "volname" - default y - help - Prints a CD-ROM volume name. - -config WATCHDOG - bool "watchdog" - default y - select PLATFORM_LINUX - help - The watchdog utility is used with hardware or software watchdog - device drivers. It opens the specified watchdog device special file - and periodically writes a magic character to the device. If the - watchdog applet ever fails to write the magic character within a - certain amount of time, the watchdog device assumes the system has - hung, and will cause the hardware to reboot. - endmenu diff --git a/miscutils/adjtimex.c b/miscutils/adjtimex.c index 058aa9a5c..f9d7c949d 100644 --- a/miscutils/adjtimex.c +++ b/miscutils/adjtimex.c @@ -10,6 +10,13 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config ADJTIMEX +//config: bool "adjtimex" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Adjtimex reads and optionally sets adjustment parameters for +//config: the Linux clock adjustment algorithm. //usage:#define adjtimex_trivial_usage //usage: "[-q] [-o OFF] [-f FREQ] [-p TCONST] [-t TICK]" diff --git a/miscutils/bbconfig.c b/miscutils/bbconfig.c index e5f4eb379..8a709f9d3 100644 --- a/miscutils/bbconfig.c +++ b/miscutils/bbconfig.c @@ -1,6 +1,26 @@ /* vi: set sw=4 ts=4: */ /* This file was released into the public domain by Paul Fox. */ +//config:config BBCONFIG +//config: bool "bbconfig" +//config: default n +//config: help +//config: The bbconfig applet will print the config file with which +//config: busybox was built. +//config: +//config:config FEATURE_COMPRESS_BBCONFIG +//config: bool "Compress bbconfig data" +//config: default y +//config: depends on BBCONFIG +//config: help +//config: Store bbconfig data in compressed form, uncompress them on-the-fly +//config: before output. +//config: +//config: If you have a really tiny busybox with few applets enabled (and +//config: bunzip2 isn't one of them), the overhead of the decompressor might +//config: be noticeable. Also, if you run executables directly from ROM +//config: and have very little memory, this might not be a win. Otherwise, +//config: you probably want this. //usage:#define bbconfig_trivial_usage //usage: "" diff --git a/miscutils/beep.c b/miscutils/beep.c index 18b160cc4..f6fa8348d 100644 --- a/miscutils/beep.c +++ b/miscutils/beep.c @@ -7,6 +7,28 @@ * Licensed under GPLv2 or later, see file LICENSE in this source tree. * */ +//config:config BEEP +//config: bool "beep" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The beep applets beeps in a given freq/Hz. +//config: +//config:config FEATURE_BEEP_FREQ +//config: int "default frequency" +//config: range 0 2147483647 +//config: default 4000 +//config: depends on BEEP +//config: help +//config: Frequency for default beep. +//config: +//config:config FEATURE_BEEP_LENGTH_MS +//config: int "default length" +//config: range 0 2147483647 +//config: default 30 +//config: depends on BEEP +//config: help +//config: Length in ms for default beep. //usage:#define beep_trivial_usage //usage: "-f FREQ -l LEN -d DELAY -r COUNT -n" diff --git a/miscutils/chat.c b/miscutils/chat.c index 6b429f2a6..92a23441c 100644 --- a/miscutils/chat.c +++ b/miscutils/chat.c @@ -7,6 +7,72 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config CHAT +//config: bool "chat" +//config: default y +//config: help +//config: Simple chat utility. +//config: +//config:config FEATURE_CHAT_NOFAIL +//config: bool "Enable NOFAIL expect strings" +//config: depends on CHAT +//config: default y +//config: help +//config: When enabled expect strings which are started with a dash trigger +//config: no-fail mode. That is when expectation is not met within timeout +//config: the script is not terminated but sends next SEND string and waits +//config: for next EXPECT string. This allows to compose far more flexible +//config: scripts. +//config: +//config:config FEATURE_CHAT_TTY_HIFI +//config: bool "Force STDIN to be a TTY" +//config: depends on CHAT +//config: default n +//config: help +//config: Original chat always treats STDIN as a TTY device and sets for it +//config: so-called raw mode. This option turns on such behaviour. +//config: +//config:config FEATURE_CHAT_IMPLICIT_CR +//config: bool "Enable implicit Carriage Return" +//config: depends on CHAT +//config: default y +//config: help +//config: When enabled make chat to terminate all SEND strings with a "\r" +//config: unless "\c" is met anywhere in the string. +//config: +//config:config FEATURE_CHAT_SWALLOW_OPTS +//config: bool "Swallow options" +//config: depends on CHAT +//config: default y +//config: help +//config: Busybox chat require no options. To make it not fail when used +//config: in place of original chat (which has a bunch of options) turn +//config: this on. +//config: +//config:config FEATURE_CHAT_SEND_ESCAPES +//config: bool "Support weird SEND escapes" +//config: depends on CHAT +//config: default y +//config: help +//config: Original chat uses some escape sequences in SEND arguments which +//config: are not sent to device but rather performs special actions. +//config: E.g. "\K" means to send a break sequence to device. +//config: "\d" delays execution for a second, "\p" -- for a 1/100 of second. +//config: Before turning this option on think twice: do you really need them? +//config: +//config:config FEATURE_CHAT_VAR_ABORT_LEN +//config: bool "Support variable-length ABORT conditions" +//config: depends on CHAT +//config: default y +//config: help +//config: Original chat uses fixed 50-bytes length ABORT conditions. Say N here. +//config: +//config:config FEATURE_CHAT_CLR_ABORT +//config: bool "Support revoking of ABORT conditions" +//config: depends on CHAT +//config: default y +//config: help +//config: Support CLR_ABORT directive. //usage:#define chat_trivial_usage //usage: "EXPECT [SEND [EXPECT [SEND...]]]" diff --git a/miscutils/chrt.c b/miscutils/chrt.c index f2f559fd7..d76c0d152 100644 --- a/miscutils/chrt.c +++ b/miscutils/chrt.c @@ -5,6 +5,12 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config CHRT +//config: bool "chrt" +//config: default y +//config: help +//config: manipulate real-time attributes of a process. +//config: This requires sched_{g,s}etparam support in your libc. //usage:#define chrt_trivial_usage //usage: "[-prfom] [PRIO] [PID | PROG ARGS]" diff --git a/miscutils/conspy.c b/miscutils/conspy.c index e80158e39..d9d09d482 100644 --- a/miscutils/conspy.c +++ b/miscutils/conspy.c @@ -9,11 +9,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -//applet:IF_CONSPY(APPLET(conspy, BB_DIR_BIN, BB_SUID_DROP)) - -//kbuild:lib-$(CONFIG_CONSPY) += conspy.o - //config:config CONSPY //config: bool "conspy" //config: default y @@ -24,6 +19,10 @@ //config: or conspy -nd NUM screenshot of console num //config: or conspy -cs NUM poor man's GNU screen like +//applet:IF_CONSPY(APPLET(conspy, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_CONSPY) += conspy.o + //usage:#define conspy_trivial_usage //usage: "[-vcsndfFQ] [-x COL] [-y LINE] [CONSOLE_NO]" //usage:#define conspy_full_usage "\n\n" diff --git a/miscutils/crontab.c b/miscutils/crontab.c index 85c6623b2..bcd2eab33 100644 --- a/miscutils/crontab.c +++ b/miscutils/crontab.c @@ -9,6 +9,14 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config CRONTAB +//config: bool "crontab" +//config: default y +//config: help +//config: Crontab manipulates the crontab for a particular user. Only +//config: the superuser may specify a different user and/or crontab directory. +//config: Note that Busybox binary must be setuid root for this applet to +//config: work properly. //usage:#define crontab_trivial_usage //usage: "[-c DIR] [-u USER] [-ler]|[FILE]" diff --git a/miscutils/dc.c b/miscutils/dc.c index 4d92bc3d0..2b77cd614 100644 --- a/miscutils/dc.c +++ b/miscutils/dc.c @@ -2,10 +2,20 @@ /* * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -#include "libbb.h" -#include "common_bufsiz.h" -#include +//config:config DC +//config: bool "dc" +//config: default y +//config: help +//config: Dc is a reverse-polish desk calculator which supports unlimited +//config: precision arithmetic. +//config: +//config:config FEATURE_DC_LIBM +//config: bool "Enable power and exp functions (requires libm)" +//config: default y +//config: depends on DC +//config: help +//config: Enable power and exp functions. +//config: NOTE: This will require libm to be present for linking. //usage:#define dc_trivial_usage //usage: "EXPRESSION..." @@ -30,6 +40,10 @@ //usage: "$ echo 72 9 div 8 mul p | dc\n" //usage: "64\n" +#include "libbb.h" +#include "common_bufsiz.h" +#include + #if 0 typedef unsigned data_t; #define DATA_FMT "" diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c index 6217918da..361f3666f 100644 --- a/miscutils/devfsd.c +++ b/miscutils/devfsd.c @@ -53,6 +53,62 @@ The postal address is: Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia. */ +//config:config DEVFSD +//config: bool "devfsd (obsolete)" +//config: default n +//config: select PLATFORM_LINUX +//config: select FEATURE_SYSLOG +//config: help +//config: This is deprecated and should NOT be used anymore. +//config: Use linux >= 2.6 (optionally with hotplug) and mdev instead! +//config: See docs/mdev.txt for detailed instructions on how to use mdev +//config: instead. +//config: +//config: Provides compatibility with old device names on a devfs systems. +//config: You should set it to true if you have devfs enabled. +//config: The following keywords in devsfd.conf are supported: +//config: "CLEAR_CONFIG", "INCLUDE", "OPTIONAL_INCLUDE", "RESTORE", +//config: "PERMISSIONS", "EXECUTE", "COPY", "IGNORE", +//config: "MKOLDCOMPAT", "MKNEWCOMPAT","RMOLDCOMPAT", "RMNEWCOMPAT". +//config: +//config: But only if they are written UPPERCASE!!!!!!!! +//config: +//config:config DEVFSD_MODLOAD +//config: bool "Adds support for MODLOAD keyword in devsfd.conf" +//config: default y +//config: depends on DEVFSD +//config: help +//config: This actually doesn't work with busybox modutils but needs +//config: the external modutils. +//config: +//config:config DEVFSD_FG_NP +//config: bool "Enables the -fg and -np options" +//config: default y +//config: depends on DEVFSD +//config: help +//config: -fg Run the daemon in the foreground. +//config: -np Exit after parsing the configuration file. +//config: Do not poll for events. +//config: +//config:config DEVFSD_VERBOSE +//config: bool "Increases logging (and size)" +//config: default y +//config: depends on DEVFSD +//config: help +//config: Increases logging to stderr or syslog. +//config: +//config:config FEATURE_DEVFS +//config: bool "Use devfs names for all devices (obsolete)" +//config: default n +//config: select PLATFORM_LINUX +//config: help +//config: This is obsolete and should NOT be used anymore. +//config: Use linux >= 2.6 (optionally with hotplug) and mdev instead! +//config: +//config: For legacy systems -- if there is no way around devfsd -- this +//config: tells busybox to look for names like /dev/loop/0 instead of +//config: /dev/loop0. If your /dev directory has normal names instead of +//config: devfs names, you don't want this. //usage:#define devfsd_trivial_usage //usage: "mntpnt [-v]" IF_DEVFSD_FG_NP("[-fg][-np]") diff --git a/miscutils/devmem.c b/miscutils/devmem.c index 786a21bee..dd6574e93 100644 --- a/miscutils/devmem.c +++ b/miscutils/devmem.c @@ -3,6 +3,12 @@ * Copyright (C) 2000, Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl) * Copyright (C) 2008, BusyBox Team. -solar 4/26/08 */ +//config:config DEVMEM +//config: bool "devmem" +//config: default y +//config: help +//config: devmem is a small program that reads and writes from physical +//config: memory using /dev/mem. //usage:#define devmem_trivial_usage //usage: "ADDRESS [WIDTH [VALUE]]" diff --git a/miscutils/eject.c b/miscutils/eject.c index 16ae250ff..d271066ad 100644 --- a/miscutils/eject.c +++ b/miscutils/eject.c @@ -12,6 +12,20 @@ * This is a simple hack of eject based on something Erik posted in #uclibc. * Most of the dirty work blatantly ripped off from cat.c =) */ +//config:config EJECT +//config: bool "eject" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Used to eject cdroms. (defaults to /dev/cdrom) +//config: +//config:config FEATURE_EJECT_SCSI +//config: bool "SCSI support" +//config: default y +//config: depends on EJECT +//config: help +//config: Add the -s option to eject, this allows to eject SCSI-Devices and +//config: usb-storage devices. //usage:#define eject_trivial_usage //usage: "[-t] [-T] [DEVICE]" diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c index 3ddf8a242..93fd9412b 100644 --- a/miscutils/fbsplash.c +++ b/miscutils/fbsplash.c @@ -20,6 +20,27 @@ * "NN" (ASCII decimal number) - percentage to show on progress bar. * "exit" (or just close fifo) - well you guessed it. */ +//config:config FBSPLASH +//config: bool "fbsplash" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Shows splash image and progress bar on framebuffer device. +//config: Can be used during boot phase of an embedded device. ~2kb. +//config: Usage: +//config: - use kernel option 'vga=xxx' or otherwise enable fb device. +//config: - put somewhere fbsplash.cfg file and an image in .ppm format. +//config: - $ setsid fbsplash [params] & +//config: -c: hide cursor +//config: -d /dev/fbN: framebuffer device (if not /dev/fb0) +//config: -s path_to_image_file (can be "-" for stdin) +//config: -i path_to_cfg_file (can be "-" for stdin) +//config: -f path_to_fifo (can be "-" for stdin) +//config: - if you want to run it only in presence of kernel parameter: +//config: grep -q "fbsplash=on" = 2.6.13 //usage:#define inotifyd_trivial_usage //usage: "PROG FILE1[:MASK]..." diff --git a/miscutils/ionice.c b/miscutils/ionice.c index 5fcb653a8..1e1a5861c 100644 --- a/miscutils/ionice.c +++ b/miscutils/ionice.c @@ -6,6 +6,13 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config IONICE +//config: bool "ionice" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Set/set program io scheduling class and priority +//config: Requires kernel >= 2.6.13 //usage:#define ionice_trivial_usage //usage: "[-c 1-3] [-n 0-7] [-p PID] [PROG]" diff --git a/miscutils/last.c b/miscutils/last.c index f8f34371a..2b7060c53 100644 --- a/miscutils/last.c +++ b/miscutils/last.c @@ -6,6 +6,20 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config LAST +//config: bool "last" +//config: default y +//config: depends on FEATURE_WTMP +//config: help +//config: 'last' displays a list of the last users that logged into the system. +//config: +//config:config FEATURE_LAST_FANCY +//config: bool "Turn on output of extra information" +//config: default y +//config: depends on LAST +//config: help +//config: 'last' displays detailed information about the last users that +//config: logged into the system (mimics sysvinit last). +900 bytes. //usage:#define last_trivial_usage //usage: ""IF_FEATURE_LAST_FANCY("[-HW] [-f FILE]") diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c index c945a1352..cbdb0e3a1 100644 --- a/miscutils/makedevs.c +++ b/miscutils/makedevs.c @@ -6,6 +6,37 @@ * Make ranges of device files quickly. * known bugs: can't deal with alpha ranges */ +//config:config MAKEDEVS +//config: bool "makedevs" +//config: default y +//config: help +//config: 'makedevs' is a utility used to create a batch of devices with +//config: one command. +//config: +//config: There are two choices for command line behaviour, the interface +//config: as used by LEAF/Linux Router Project, or a device table file. +//config: +//config: 'leaf' is traditionally what busybox follows, it allows multiple +//config: devices of a particluar type to be created per command. +//config: e.g. /dev/hda[0-9] +//config: Device properties are passed as command line arguments. +//config: +//config: 'table' reads device properties from a file or stdin, allowing +//config: a batch of unrelated devices to be made with one command. +//config: User/group names are allowed as an alternative to uid/gid. +//config: +//config:choice +//config: prompt "Choose makedevs behaviour" +//config: depends on MAKEDEVS +//config: default FEATURE_MAKEDEVS_TABLE +//config: +//config:config FEATURE_MAKEDEVS_LEAF +//config: bool "leaf" +//config: +//config:config FEATURE_MAKEDEVS_TABLE +//config: bool "table" +//config: +//config:endchoice //usage:#if ENABLE_FEATURE_MAKEDEVS_LEAF //usage:#define makedevs_trivial_usage diff --git a/miscutils/man.c b/miscutils/man.c index 932f0b794..cded6ebee 100644 --- a/miscutils/man.c +++ b/miscutils/man.c @@ -2,6 +2,11 @@ * Copyright (C) 2008 Denys Vlasenko * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config MAN +//config: bool "man" +//config: default y +//config: help +//config: Format and display manual pages. //usage:#define man_trivial_usage //usage: "[-aw] [MANPAGE]..." diff --git a/miscutils/microcom.c b/miscutils/microcom.c index dfc9771d8..c6ba476db 100644 --- a/miscutils/microcom.c +++ b/miscutils/microcom.c @@ -7,6 +7,11 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config MICROCOM +//config: bool "microcom" +//config: default y +//config: help +//config: The poor man's minicom utility for chatting with serial port devices. //usage:#define microcom_trivial_usage //usage: "[-d DELAY] [-t TIMEOUT] [-s SPEED] [-X] TTY" diff --git a/miscutils/mountpoint.c b/miscutils/mountpoint.c index 7041f7c59..12af2ca9a 100644 --- a/miscutils/mountpoint.c +++ b/miscutils/mountpoint.c @@ -8,6 +8,11 @@ * * Based on sysvinit's mountpoint */ +//config:config MOUNTPOINT +//config: bool "mountpoint" +//config: default y +//config: help +//config: mountpoint checks if the directory is a mountpoint. //usage:#define mountpoint_trivial_usage //usage: "[-q] <[-dn] DIR | -x DEVICE>" diff --git a/miscutils/mt.c b/miscutils/mt.c index 20afd3a50..75a09b662 100644 --- a/miscutils/mt.c +++ b/miscutils/mt.c @@ -2,6 +2,13 @@ /* * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config MT +//config: bool "mt" +//config: default y +//config: help +//config: mt is used to control tape devices. You can use the mt utility +//config: to advance or rewind a tape past a specified number of archive +//config: files on the tape. //usage:#define mt_trivial_usage //usage: "[-f device] opcode value" diff --git a/miscutils/raidautorun.c b/miscutils/raidautorun.c index b72d89058..578b2cf52 100644 --- a/miscutils/raidautorun.c +++ b/miscutils/raidautorun.c @@ -7,6 +7,13 @@ * Licensed under GPLv2 or later, see file LICENSE in this source tree. * */ +//config:config RAIDAUTORUN +//config: bool "raidautorun" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: raidautorun tells the kernel md driver to +//config: search and start RAID arrays. //usage:#define raidautorun_trivial_usage //usage: "DEVICE" diff --git a/miscutils/readahead.c b/miscutils/readahead.c index e22aaa468..0b502f88c 100644 --- a/miscutils/readahead.c +++ b/miscutils/readahead.c @@ -9,6 +9,23 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config READAHEAD +//config: bool "readahead" +//config: default y +//config: depends on LFS +//config: select PLATFORM_LINUX +//config: help +//config: Preload the files listed on the command line into RAM cache so that +//config: subsequent reads on these files will not block on disk I/O. +//config: +//config: This applet just calls the readahead(2) system call on each file. +//config: It is mainly useful in system startup scripts to preload files +//config: or executables before they are used. When used at the right time +//config: (in particular when a CPU bound process is running) it can +//config: significantly speed up system startup. +//config: +//config: As readahead(2) blocks until each file has been read, it is best to +//config: run this applet as a background job. //usage:#define readahead_trivial_usage //usage: "[FILE]..." diff --git a/miscutils/runlevel.c b/miscutils/runlevel.c index 8558db862..7c07a72e2 100644 --- a/miscutils/runlevel.c +++ b/miscutils/runlevel.c @@ -11,6 +11,15 @@ * * initially busyboxified by Bernhard Reutner-Fischer */ +//config:config RUNLEVEL +//config: bool "runlevel" +//config: default y +//config: depends on FEATURE_UTMP +//config: help +//config: find the current and previous system runlevel. +//config: +//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. //usage:#define runlevel_trivial_usage //usage: "[FILE]" diff --git a/miscutils/rx.c b/miscutils/rx.c index 1dffb593a..359ad5046 100644 --- a/miscutils/rx.c +++ b/miscutils/rx.c @@ -14,6 +14,12 @@ * * This was originally written for blob and then adapted for busybox. */ +//config:config RX +//config: bool "rx" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Receive files using the Xmodem protocol. //usage:#define rx_trivial_usage //usage: "FILE" diff --git a/miscutils/setsid.c b/miscutils/setsid.c index 9bddc2fcf..f0ec04a0b 100644 --- a/miscutils/setsid.c +++ b/miscutils/setsid.c @@ -13,6 +13,11 @@ * 2004-11-12 Paul Fox * - busyboxed */ +//config:config SETSID +//config: bool "setsid" +//config: default y +//config: help +//config: setsid runs a program in a new session //usage:#define setsid_trivial_usage //usage: "[-c] PROG ARGS" diff --git a/miscutils/strings.c b/miscutils/strings.c index ee6649625..d0e637987 100644 --- a/miscutils/strings.c +++ b/miscutils/strings.c @@ -6,6 +6,12 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config STRINGS +//config: bool "strings" +//config: default y +//config: help +//config: strings prints the printable character sequences for each file +//config: specified. //usage:#define strings_trivial_usage //usage: "[-fo] [-t o/d/x] [-n LEN] [FILE]..." diff --git a/miscutils/time.c b/miscutils/time.c index 19b0b44c9..90d2ab67c 100644 --- a/miscutils/time.c +++ b/miscutils/time.c @@ -8,6 +8,13 @@ Heavily modified by David MacKenzie . Heavily modified for busybox by Erik Andersen */ +//config:config TIME +//config: bool "time" +//config: default y +//config: help +//config: The time command runs the specified program with the given arguments. +//config: When the command finishes, time writes a message to standard output +//config: giving timing statistics about this program run. //usage:#define time_trivial_usage //usage: "[-v] PROG ARGS" diff --git a/miscutils/timeout.c b/miscutils/timeout.c index 8df9ff0fd..4d598ead2 100644 --- a/miscutils/timeout.c +++ b/miscutils/timeout.c @@ -27,6 +27,12 @@ * splitszf 12-05-2006 by Roberto A. Foglietta * rewrite 14-11-2008 vda */ +//config:config TIMEOUT +//config: bool "timeout" +//config: default y +//config: help +//config: Runs a program and watches it. If it does not terminate in +//config: specified number of seconds, it is sent a signal. //usage:#define timeout_trivial_usage //usage: "[-t SECS] [-s SIG] PROG ARGS" diff --git a/miscutils/ttysize.c b/miscutils/ttysize.c index d2d48d0a9..a63b731d2 100644 --- a/miscutils/ttysize.c +++ b/miscutils/ttysize.c @@ -9,6 +9,14 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config TTYSIZE +//config: bool "ttysize" +//config: default y +//config: help +//config: A replacement for "stty size". Unlike stty, can report only width, +//config: only height, or both, in any order. It also does not complain on +//config: error, but returns default 80x24. +//config: Usage in shell scripts: width=`ttysize w`. //usage:#define ttysize_trivial_usage //usage: "[w] [h]" diff --git a/miscutils/volname.c b/miscutils/volname.c index b50e79573..855f2206a 100644 --- a/miscutils/volname.c +++ b/miscutils/volname.c @@ -27,6 +27,11 @@ * mods from distributed source (eject-2.0.13) are by * Matthew Stoltenberg */ +//config:config VOLNAME +//config: bool "volname" +//config: default y +//config: help +//config: Prints a CD-ROM volume name. //usage:#define volname_trivial_usage //usage: "[DEVICE]" diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c index d3a76edf0..7a743ef1b 100644 --- a/miscutils/watchdog.c +++ b/miscutils/watchdog.c @@ -8,6 +8,17 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config WATCHDOG +//config: bool "watchdog" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The watchdog utility is used with hardware or software watchdog +//config: device drivers. It opens the specified watchdog device special file +//config: and periodically writes a magic character to the device. If the +//config: watchdog applet ever fails to write the magic character within a +//config: certain amount of time, the watchdog device assumes the system has +//config: hung, and will cause the hardware to reboot. //usage:#define watchdog_trivial_usage //usage: "[-t N[ms]] [-T N[ms]] [-F] DEV" -- 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 'miscutils') 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 e5dd71f94f8691c41382b89de35088695cca34b9 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Nov 2016 10:43:39 +0100 Subject: Remove trailing empty lines Signed-off-by: Denys Vlasenko --- miscutils/Kbuild.src | 2 -- 1 file changed, 2 deletions(-) (limited to 'miscutils') diff --git a/miscutils/Kbuild.src b/miscutils/Kbuild.src index 60848ffc1..6b4fb7470 100644 --- a/miscutils/Kbuild.src +++ b/miscutils/Kbuild.src @@ -7,5 +7,3 @@ lib-y:= INSERT - - -- cgit v1.2.3-55-g6feb From 2c769c69b269f43d8c9ecf4a7f5ce5cce290750a Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 27 Nov 2016 23:27:54 +0100 Subject: makedevs: make special node creation idempotent When makedevs is called for a second time with the same device file, it fails because the files already exist and mknod() gives -EEXIST. Ignore EEXIST errors. Signed-off-by: Denys Vlasenko --- miscutils/makedevs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'miscutils') diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c index 6278ee77c..c5eeed0e0 100644 --- a/miscutils/makedevs.c +++ b/miscutils/makedevs.c @@ -157,8 +157,11 @@ int makedevs_main(int argc, char **argv) /* if mode != S_IFCHR and != S_IFBLK, * third param in mknod() ignored */ - if (mknod(nodname, mode, makedev(Smajor, Sminor))) + if (mknod(nodname, mode, makedev(Smajor, Sminor)) != 0 + && errno != EEXIST + ) { bb_perror_msg("can't create '%s'", nodname); + } /*if (nodname == basedev)*/ /* ex. /dev/hda - to /dev/hda1 ... */ nodname = buf; @@ -279,7 +282,9 @@ int makedevs_main(int argc UNUSED_PARAM, char **argv) for (i = start; i <= start + count; i++) { sprintf(full_name_inc, count ? "%s%u" : "%s", full_name, i); rdev = makedev(major, minor + (i - start) * increment); - if (mknod(full_name_inc, mode, rdev) < 0) { + if (mknod(full_name_inc, mode, rdev) != 0 + && errno != EEXIST + ) { bb_perror_msg("line %d: can't create node %s", linenum, full_name_inc); ret = EXIT_FAILURE; } else if (chown(full_name_inc, uid, gid) < 0) { -- cgit v1.2.3-55-g6feb From 1d3a04a3a4be8682d4317251fc14e81ad655d58a Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 28 Nov 2016 01:22:57 +0100 Subject: Code style fixes, no code changes Signed-off-by: Denys Vlasenko --- e2fsprogs/fsck.c | 2 +- editors/patch.c | 11 ++++++----- editors/patch_toybox.c | 7 +++---- editors/sed.c | 5 ++++- loginutils/addgroup.c | 2 +- miscutils/makedevs.c | 2 +- miscutils/rx.c | 2 +- networking/interface.c | 8 ++++---- networking/tc.c | 6 +++--- procps/pgrep.c | 2 +- runit/sv.c | 2 +- util-linux/getopt.c | 4 ++-- util-linux/readprofile.c | 7 ++++--- 13 files changed, 32 insertions(+), 28 deletions(-) (limited to 'miscutils') diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c index 59514a1a6..6414988b4 100644 --- a/e2fsprogs/fsck.c +++ b/e2fsprogs/fsck.c @@ -658,7 +658,7 @@ static int device_already_active(char *device) return (G.instance_list != NULL); for (inst = G.instance_list; inst; inst = inst->next) { - if (!inst->base_device || !strcmp(base, inst->base_device)) { + if (!inst->base_device || strcmp(base, inst->base_device) == 0) { free(base); return 1; } diff --git a/editors/patch.c b/editors/patch.c index ea1fc0974..731a8c58a 100644 --- a/editors/patch.c +++ b/editors/patch.c @@ -247,7 +247,7 @@ static int apply_one_hunk(void) // Figure out which line of hunk to compare with next. (Skip lines // of the hunk we'd be adding.) while (plist && *plist->data == "+-"[reverse]) { - if (data && !strcmp(data, plist->data+1)) { + if (data && strcmp(data, plist->data+1) == 0) { if (!backwarn) { backwarn = TT.linenum; if (option_mask32 & FLAG_IGNORE) { @@ -291,8 +291,9 @@ static int apply_one_hunk(void) for (;;) { while (plist && *plist->data == "+-"[reverse]) { - if (!strcmp(check->data, plist->data+1) && - !backwarn) { + if (strcmp(check->data, plist->data+1) == 0 + && !backwarn + ) { backwarn = TT.linenum; if (option_mask32 & FLAG_IGNORE) { dummy_revert = 1; @@ -491,7 +492,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv) // We're deleting oldname if new file is /dev/null (before -p) // or if new hunk is empty (zero context) after patching - if (!strcmp(name, "/dev/null") || !(reverse ? oldsum : newsum)) { + if (strcmp(name, "/dev/null") == 0 || !(reverse ? oldsum : newsum)) { name = reverse ? newname : oldname; empty = 1; } @@ -527,7 +528,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv) struct stat statbuf; // If the old file was null, we're creating a new one. - if (!strcmp(oldname, "/dev/null") || !oldsum) { + if (strcmp(oldname, "/dev/null") == 0 || !oldsum) { printf("creating %s\n", name); s = strrchr(name, '/'); if (s) { diff --git a/editors/patch_toybox.c b/editors/patch_toybox.c index a60bf070f..5174acd6a 100644 --- a/editors/patch_toybox.c +++ b/editors/patch_toybox.c @@ -335,7 +335,7 @@ static int apply_one_hunk(void) // Figure out which line of hunk to compare with next. (Skip lines // of the hunk we'd be adding.) while (plist && *plist->data == "+-"[reverse]) { - if (data && !strcmp(data, plist->data+1)) { + if (data && strcmp(data, plist->data+1) == 0) { if (!backwarn) { fdprintf(2,"Possibly reversed hunk %d at %ld\n", TT.hunknum, TT.linenum); @@ -529,8 +529,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv) // We're deleting oldname if new file is /dev/null (before -p) // or if new hunk is empty (zero context) after patching - if (!strcmp(name, "/dev/null") || !(reverse ? oldsum : newsum)) - { + if (strcmp(name, "/dev/null") == 0 || !(reverse ? oldsum : newsum)) { name = reverse ? newname : oldname; del++; } @@ -551,7 +550,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv) // If we've got a file to open, do so. } else if (!(option_mask32 & FLAG_PATHLEN) || i <= TT.prefix) { // If the old file was null, we're creating a new one. - if (!strcmp(oldname, "/dev/null") || !oldsum) { + if (strcmp(oldname, "/dev/null") == 0 || !oldsum) { printf("creating %s\n", name); s = strrchr(name, '/'); if (s) { diff --git a/editors/sed.c b/editors/sed.c index b7add1fb1..637a6851b 100644 --- a/editors/sed.c +++ b/editors/sed.c @@ -892,7 +892,10 @@ static sed_cmd_t *branch_to(char *label) sed_cmd_t *sed_cmd; for (sed_cmd = G.sed_cmd_head; sed_cmd; sed_cmd = sed_cmd->next) { - if (sed_cmd->cmd == ':' && sed_cmd->string && !strcmp(sed_cmd->string, label)) { + if (sed_cmd->cmd == ':' + && sed_cmd->string + && strcmp(sed_cmd->string, label) == 0 + ) { return sed_cmd; } } diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c index 4d4fc3f28..6b2fd7ba9 100644 --- a/loginutils/addgroup.c +++ b/loginutils/addgroup.c @@ -186,7 +186,7 @@ int addgroup_main(int argc UNUSED_PARAM, char **argv) gr = xgetgrnam(argv[1]); /* unknown group: exit */ /* check if user is already in this group */ for (; *(gr->gr_mem) != NULL; (gr->gr_mem)++) { - if (!strcmp(argv[0], *(gr->gr_mem))) { + if (strcmp(argv[0], *(gr->gr_mem)) == 0) { /* user is already in group: do nothing */ return EXIT_SUCCESS; } diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c index c5eeed0e0..9e7ca340f 100644 --- a/miscutils/makedevs.c +++ b/miscutils/makedevs.c @@ -283,7 +283,7 @@ int makedevs_main(int argc UNUSED_PARAM, char **argv) sprintf(full_name_inc, count ? "%s%u" : "%s", full_name, i); rdev = makedev(major, minor + (i - start) * increment); if (mknod(full_name_inc, mode, rdev) != 0 - && errno != EEXIST + && errno != EEXIST ) { bb_perror_msg("line %d: can't create node %s", linenum, full_name_inc); ret = EXIT_FAILURE; diff --git a/miscutils/rx.c b/miscutils/rx.c index 7fca8e36b..660f66a89 100644 --- a/miscutils/rx.c +++ b/miscutils/rx.c @@ -111,7 +111,7 @@ static int receive(/*int read_fd, */int file_fd) && blockBuf[blockLength - 3] == PAD ) { while (blockLength - && blockBuf[blockLength - 1] == PAD + && blockBuf[blockLength - 1] == PAD ) { blockLength--; } diff --git a/networking/interface.c b/networking/interface.c index e5723b428..c5c8f2cdd 100644 --- a/networking/interface.c +++ b/networking/interface.c @@ -264,7 +264,7 @@ const struct aftype* FAST_FUNC get_aftype(const char *name) afp = aftypes; while (*afp != NULL) { - if (!strcmp((*afp)->name, name)) + if (strcmp((*afp)->name, name) == 0) return (*afp); afp++; } @@ -572,7 +572,7 @@ static int if_readlist_proc(char *target) ife = add_interface(name); get_dev_fields(s, ife, procnetdev_vsn); ife->statistics_valid = 1; - if (target && !strcmp(target, name)) + if (target && strcmp(target, name) == 0) break; } if (ferror(fh)) { @@ -781,7 +781,7 @@ const struct hwtype* FAST_FUNC get_hwtype(const char *name) hwp = hwtypes; while (*hwp != NULL) { - if (!strcmp((*hwp)->name, name)) + if (strcmp((*hwp)->name, name) == 0) return (*hwp); hwp++; } @@ -877,7 +877,7 @@ static void ife_print6(struct interface *ptr) addr6p[5], addr6p[6], addr6p[7], &if_idx, &plen, &scope, &dad_status, devname) != EOF ) { - if (!strcmp(devname, ptr->name)) { + if (strcmp(devname, ptr->name) == 0) { sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s", addr6p[0], addr6p[1], addr6p[2], addr6p[3], addr6p[4], addr6p[5], addr6p[6], addr6p[7]); diff --git a/networking/tc.c b/networking/tc.c index 271d569e4..25875aa3e 100644 --- a/networking/tc.c +++ b/networking/tc.c @@ -116,7 +116,7 @@ static int get_qdisc_handle(uint32_t *h, const char *str) { char *p; maj = TC_H_UNSPEC; - if (!strcmp(str, "none")) + if (strcmp(str, "none") == 0) goto ok; maj = strtoul(str, &p, 16); if (p == str) @@ -135,10 +135,10 @@ static int get_tc_classid(uint32_t *h, const char *str) { char *p; maj = TC_H_ROOT; - if (!strcmp(str, "root")) + if (strcmp(str, "root") == 0) goto ok; maj = TC_H_UNSPEC; - if (!strcmp(str, "none")) + if (strcmp(str, "none") == 0) goto ok; maj = strtoul(str, &p, 16); if (p == str) { diff --git a/procps/pgrep.c b/procps/pgrep.c index 974d007f3..ac82b5156 100644 --- a/procps/pgrep.c +++ b/procps/pgrep.c @@ -168,7 +168,7 @@ int pgrep_main(int argc UNUSED_PARAM, char **argv) if (ppid2match >= 0 && ppid2match != proc->ppid) continue; - if (sid2match >= 0 && sid2match != proc->sid) + if (sid2match >= 0 && sid2match != proc->sid) continue; /* NB: OPT_INVERT is always 0 or 1 */ diff --git a/runit/sv.c b/runit/sv.c index 37df9a929..42abbbbb5 100644 --- a/runit/sv.c +++ b/runit/sv.c @@ -210,7 +210,7 @@ struct globals { #define INIT_G() do { setup_common_bufsiz(); } while (0) -#define str_equal(s,t) (!strcmp((s), (t))) +#define str_equal(s,t) (strcmp((s), (t)) == 0) static void fatal_cannot(const char *m1) NORETURN; diff --git a/util-linux/getopt.c b/util-linux/getopt.c index 83cc1efea..f6ecc3dde 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c @@ -347,9 +347,9 @@ static struct option *add_long_options(struct option *long_options, char *option static void set_shell(const char *new_shell) { - if (!strcmp(new_shell, "bash") || !strcmp(new_shell, "sh")) + if (strcmp(new_shell, "bash") == 0 || strcmp(new_shell, "sh") == 0) return; - if (!strcmp(new_shell, "tcsh") || !strcmp(new_shell, "csh")) + if (strcmp(new_shell, "tcsh") == 0 || strcmp(new_shell, "csh") == 0) option_mask32 |= SHELL_IS_TCSH; else bb_error_msg("unknown shell '%s', assuming bash", new_shell); diff --git a/util-linux/readprofile.c b/util-linux/readprofile.c index d5230387c..31abb6bb2 100644 --- a/util-linux/readprofile.c +++ b/util-linux/readprofile.c @@ -174,7 +174,7 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv) bb_error_msg_and_die("%s(%i): wrong map line", mapFile, maplineno); - if (!strcmp(fn_name, "_stext")) /* only elf works like this */ { + if (strcmp(fn_name, "_stext") == 0) /* only elf works like this */ { add0 = fn_add; break; } @@ -224,8 +224,9 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv) if (optBins) { if (optVerbose || this > 0) printf(" total\t\t\t\t%u\n", this); - } else if ((this || optAll) - && (fn_len = next_add-fn_add) != 0 + } else + if ((this || optAll) + && (fn_len = next_add-fn_add) != 0 ) { if (optVerbose) printf("%016llx %-40s %6u %8.4f\n", fn_add, -- cgit v1.2.3-55-g6feb