502b10c2ab
--signal is simply a synonym for the exiting -s. --foreground disables functionality we didn't yet have: putting the child into a new process group. I've added the functionality and the flag to disable it. --preserve-status also makes it clear that our exit statuses didn't match the coreutils version. In addition to callers that use --preserve-status to get away from this madness, I also have callers that check for specific exit values. This patch implements --preserve-status but also fixes all the other exit statuses. (The "125" exit value is broken for toybox in the same way that `toybox grep --whoops ; echo $?` is. To fix this, we'd need some way to signal that command-line parsing failures should exit with a different value than the usual 1 --- 2 for grep, 125 for timeout. I've done as much as grep manages, and left a TODO.) Also add timeout tests. I couldn't think of an easy test for --foreground, so I tested that manually with strace. Also add some newlines to the `toybox --help` output to make it easier to find the different sections, and expand the section on durations to call out that fractions are supported as a matter of policy. As long as timeout and sleep have text describing the duration syntax, make them the same. (Personally I'd remove both in favor of the `toybox --help` output, but as long as they're duplicated, keep them consistent.) Also remove the SLEEP_FLOAT variant --- xparsetime means that sleep no longer requires floating point to support sub-second resolution.
185 lines
5.4 KiB
Plaintext
185 lines
5.4 KiB
Plaintext
mainmenu "Toybox Configuration"
|
|
|
|
|
|
source generated/Config.probed
|
|
source generated/Config.in
|
|
|
|
comment ""
|
|
|
|
menu "Toybox global settings"
|
|
|
|
# This entry controls the multiplexer, disabled for single command builds
|
|
config TOYBOX
|
|
bool
|
|
default y
|
|
help
|
|
usage: toybox [--long | --help | --version | [command] [arguments...]]
|
|
|
|
With no arguments, shows available commands. First argument is
|
|
name of a command to run, followed by any arguments to that command.
|
|
|
|
--long Show path to each command
|
|
|
|
To install command symlinks, try:
|
|
for i in $(/bin/toybox --long); do ln -s /bin/toybox $i; done
|
|
|
|
Most toybox commands also understand the following arguments:
|
|
|
|
--help Show command help (only)
|
|
--version Show toybox version (only)
|
|
|
|
The filename "-" means stdin/stdout, and "--" stops argument parsing.
|
|
|
|
Numerical arguments accept a single letter suffix for
|
|
kilo, mega, giga, tera, peta, and exabytes, plus an additional
|
|
"d" to indicate decimal 1000's instead of 1024.
|
|
|
|
Durations can be decimal fractions and accept minute ("m"), hour ("h"),
|
|
or day ("d") suffixes (so 0.1m = 6s).
|
|
|
|
config TOYBOX_SUID
|
|
bool "SUID support"
|
|
default y
|
|
help
|
|
Support for the Set User ID bit, to install toybox suid root and drop
|
|
permissions for commands which do not require root access. To use
|
|
this change ownership of the file to the root user and set the suid
|
|
bit in the file permissions:
|
|
|
|
chown root:root toybox; chmod +s toybox
|
|
|
|
choice
|
|
prompt "Security Blanket"
|
|
default TOYBOX_LSM_NONE
|
|
help
|
|
Select a Linux Security Module to complicate your system
|
|
until you can't find holes in it.
|
|
|
|
config TOYBOX_LSM_NONE
|
|
bool "None"
|
|
help
|
|
Don't try to achieve "watertight" by plugging the holes in a
|
|
collander, instead use conventional unix security (and possibly
|
|
Linux Containers) for a simple straightforward system.
|
|
|
|
config TOYBOX_SELINUX
|
|
bool "SELinux support"
|
|
help
|
|
Include SELinux options in commands such as ls, and add
|
|
SELinux-specific commands such as chcon to the Android menu.
|
|
|
|
config TOYBOX_SMACK
|
|
bool "SMACK support"
|
|
help
|
|
Include SMACK options in commands like ls for systems like Tizen.
|
|
|
|
endchoice
|
|
|
|
config TOYBOX_LIBCRYPTO
|
|
bool "Use libcrypto (OpenSSL/BoringSSL)"
|
|
default n
|
|
help
|
|
Use faster hash functions out of external -lcrypto library.
|
|
|
|
config TOYBOX_LIBZ
|
|
bool "Use libz (zlib)"
|
|
default n
|
|
help
|
|
Use libz for gz support.
|
|
|
|
config TOYBOX_FLOAT
|
|
bool "Floating point support"
|
|
default y
|
|
help
|
|
Include floating point support infrastructure and commands that
|
|
require it.
|
|
|
|
config TOYBOX_HELP
|
|
bool "Help messages"
|
|
default y
|
|
help
|
|
Include help text for each command.
|
|
|
|
config TOYBOX_HELP_DASHDASH
|
|
bool "--help and --version"
|
|
default y
|
|
depends on TOYBOX_HELP
|
|
help
|
|
Support --help argument in all commands, even ones with a NULL
|
|
optstring. (Use TOYFLAG_NOHELP to disable.) Produces the same output
|
|
as "help command". --version shows toybox version.
|
|
|
|
config TOYBOX_I18N
|
|
bool "Internationalization support"
|
|
default y
|
|
help
|
|
Support for UTF-8 character sets, and some locale support.
|
|
|
|
config TOYBOX_FREE
|
|
bool "Free memory unnecessarily"
|
|
default n
|
|
help
|
|
When a program exits, the operating system will clean up after it
|
|
(free memory, close files, etc). To save size, toybox usually relies
|
|
on this behavior. If you're running toybox under a debugger or
|
|
without a real OS (ala newlib+libgloss), enable this to make toybox
|
|
clean up after itself.
|
|
|
|
config TOYBOX_NORECURSE
|
|
bool "Disable recursive execution"
|
|
default n
|
|
help
|
|
When one toybox command calls another, usually it just calls the new
|
|
command's main() function rather than searching the $PATH and calling
|
|
exec on another file (which is much slower).
|
|
|
|
This disables that optimization, so toybox will run external commands
|
|
even when it has a built-in version of that command. This requires
|
|
toybox symlinks to be installed in the $PATH, or re-invoking the
|
|
"toybox" multiplexer command by name.
|
|
|
|
config TOYBOX_DEBUG
|
|
bool "Debugging tests"
|
|
default n
|
|
help
|
|
Enable extra checks for debugging purposes. All of them catch
|
|
things that can only go wrong at development time, not runtime.
|
|
|
|
config TOYBOX_PEDANTIC_ARGS
|
|
bool "Pedantic argument checking"
|
|
default n
|
|
help
|
|
Check arguments for commands that have no arguments.
|
|
|
|
config TOYBOX_UID_SYS
|
|
int "First system UID"
|
|
default 100
|
|
help
|
|
When commands like useradd/groupadd allocate system IDs, start here.
|
|
|
|
config TOYBOX_UID_USR
|
|
int "First user UID"
|
|
default 500
|
|
help
|
|
When commands like useradd/groupadd allocate user IDs, start here.
|
|
|
|
config TOYBOX_MUSL_NOMMU_IS_BROKEN
|
|
bool "Workaround for musl-libc breakage on nommu systems."
|
|
default n
|
|
help
|
|
When using musl-libc on a nommu system, you'll need to say "y" here.
|
|
|
|
Although uclibc lets you detect support for things like fork() and
|
|
daemon() at compile time, musl intentionally includes broken versions
|
|
that always return -ENOSYS on nommu systems, and goes out of its way
|
|
to prevent any cross-compile compatible compile-time probes for a
|
|
nommu system. (It doesn't even #define __MUSL__ in features.h.)
|
|
|
|
Musl does this despite the fact that a nommu system can't even run
|
|
standard ELF binaries, and requires specially packaged executables.
|
|
So our only choice is to manually provide a musl nommu bug workaround
|
|
you can manually select to enable (larger, slower) nommu support with
|
|
musl.
|
|
|
|
endmenu
|