Compare commits

..
4 Commits
263 changed files with 10553 additions and 13848 deletions

No files matched your search

+1 -1
View File
@@ -166,7 +166,7 @@ Paul Fox <pgf@foxharp.boston.ma.us>
Roberto A. Foglietta <me@roberto.foglietta.name>
port: dnsd
Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Fischer <rep.nop@aon.at>
misc
Mike Frysinger <vapier@gentoo.org>
+20 -26
View File
@@ -155,17 +155,15 @@ config FEATURE_SUID
default n
help
With this option you can install the busybox binary belonging
to root with the suid bit set, and it will automatically drop
to root with the suid bit set, and it'll and it'll automatically drop
priviledges for applets that don't need root access.
If you are really paranoid and don't want to do this, build two
If you're really paranoid and don't want to do this, build two
busybox binaries with different applets in them (and the appropriate
symlinks pointing to each binary), and only set the suid bit on the
one that needs it. The applets currently marked to need the suid bit
are:
crontab, dnsd, findfs, ipcrm, ipcs, login, passwd, ping, su,
traceroute, vlock.
are login, passwd, su, ping, traceroute, crontab, dnsd, ipcrm, ipcs,
and vlock.
config FEATURE_SUID_CONFIG
bool "Runtime SUID/SGID configuration via /etc/busybox.conf"
@@ -256,18 +254,18 @@ config BUSYBOX_EXEC_PATH
# These are auto-selected by other options
config FEATURE_SYSLOG
bool #No description makes it a hidden option
bool "Support for logging to syslog"
default n
#help
# This option is auto-selected when you select any applet which may
# send its output to syslog. You do not need to select it manually.
help
This option is auto-selected when you select any applet which may
send its output to syslog. You do not need to select it manually.
config FEATURE_HAVE_RPC
bool #No description makes it a hidden option
bool "RPC support"
default n
#help
# This is automatically selected if any of enabled applets need it.
# You do not need to select it manually.
help
This is automatically selected if any of enabled applets need it.
You do not need to select it manually.
endmenu
@@ -404,12 +402,9 @@ config CROSS_COMPILER_PREFIX
help
If you want to build BusyBox with a cross compiler, then you
will need to set this to the cross-compiler prefix, for example,
"i386-uclibc-".
Note that CROSS_COMPILE environment variable or
"make CROSS_COMPILE=xxx ..." will override this selection.
Native builds leave this empty.
"i386-uclibc-". Note that CROSS_COMPILE environment variable
or "make CROSS_COMPILE=xxx ..." will override this selection.
For native build leave it empty.
endmenu
@@ -496,8 +491,8 @@ config INCLUDE_SUSv2
will be supported in head, tail, and fold. (Note: should
affect renice too.)
### config PARSE
### bool "Uniform config file parser debugging applet: parse"
config PARSE
bool "Uniform config file parser debugging applet: parse"
endmenu
@@ -595,10 +590,9 @@ source modutils/Config.in
source util-linux/Config.in
source miscutils/Config.in
source networking/Config.in
source printutils/Config.in
source mailutils/Config.in
source procps/Config.in
source runit/Config.in
source selinux/Config.in
source shell/Config.in
source sysklogd/Config.in
source runit/Config.in
source selinux/Config.in
source printutils/Config.in
+3 -10
View File
@@ -1,6 +1,6 @@
VERSION = 1
PATCHLEVEL = 13
SUBLEVEL = 2
PATCHLEVEL = 12
SUBLEVEL = 4
EXTRAVERSION =
NAME = Unnamed
@@ -456,7 +456,6 @@ libs-y := \
libbb/ \
libpwdgrp/ \
loginutils/ \
mailutils/ \
miscutils/ \
modutils/ \
networking/ \
@@ -506,7 +505,7 @@ endif
# command line.
# This allow a user to issue only 'make' to build a kernel including modules
# Defaults busybox but it is usually overridden in the arch makefile
all: busybox doc
all: busybox
-include $(srctree)/arch/$(ARCH)/Makefile
@@ -967,12 +966,6 @@ clean: archclean $(clean-dirs)
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \
-type f -print | xargs rm -f
PHONY += doc-clean
doc-clean: rm-files := docs/busybox.pod \
docs/BusyBox.html docs/BusyBox.1 docs/BusyBox.txt
doc-clean:
$(call cmd,rmfiles)
# mrproper - Delete all generated files, including .config
#
mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS))
-4
View File
@@ -105,10 +105,6 @@ bigdata: busybox_unstripped
.PHONY: doc
doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
# FIXME: Doesn't belong here
disp_doc = \
@$(if $(quiet),echo " DOC $(@F)")
docs/busybox.pod: $(srctree)/docs/busybox_header.pod \
$(srctree)/include/usage.h \
$(srctree)/docs/busybox_footer.pod \
-1
View File
@@ -6,7 +6,6 @@ help:
@echo 'Cleaning:'
@echo ' clean - delete temporary files created by build'
@echo ' distclean - delete all non-source files (including .config)'
@echo ' doc-clean - delete all generated documentation'
@echo
@echo 'Build:'
@echo ' all - Executable and documentation'
+1 -1
View File
@@ -99,7 +99,7 @@ Rob Landley suggested these:
This one's open to everybody, but I'll wind up doing it...
Bernhard Reutner-Fischer <busybox@busybox.net> suggests to look at these:
Bernhard Fischer <busybox@busybox.net> suggests to look at these:
New debug options:
-Wlarger-than-127
Cleanup any big users
+72 -92
View File
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Busybox version: 1.13.0.svn
# Sun Nov 9 17:09:13 2008
# Busybox version: 1.12.0.svn
# Wed Aug 20 00:24:07 2008
#
CONFIG_HAVE_DOT_CONFIG=y
@@ -13,8 +13,8 @@ CONFIG_HAVE_DOT_CONFIG=y
# General Configuration
#
CONFIG_DESKTOP=y
CONFIG_EXTRA_COMPAT=y
# CONFIG_FEATURE_ASSUME_UNICODE is not set
# CONFIG_EXTRA_COMPAT is not set
CONFIG_FEATURE_ASSUME_UNICODE=y
CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
@@ -58,6 +58,7 @@ CONFIG_NO_DEBUG_LIB=y
# CONFIG_DMALLOC is not set
# CONFIG_EFENCE is not set
CONFIG_INCLUDE_SUSv2=y
# CONFIG_PARSE is not set
#
# Installation Options
@@ -152,7 +153,7 @@ CONFIG_DD=y
CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
CONFIG_FEATURE_DD_IBS_OBS=y
CONFIG_DF=y
CONFIG_FEATURE_DF_FANCY=y
CONFIG_FEATURE_DF_INODE=y
CONFIG_DIRNAME=y
CONFIG_DOS2UNIX=y
CONFIG_UNIX2DOS=y
@@ -282,8 +283,6 @@ CONFIG_FEATURE_RESIZE_PRINT=y
CONFIG_SETCONSOLE=y
CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS=y
CONFIG_SETFONT=y
CONFIG_FEATURE_SETFONT_TEXTUAL_MAP=y
CONFIG_DEFAULT_SETFONT_DIR=""
CONFIG_SETKEYCODES=y
CONFIG_SETLOGCONS=y
CONFIG_SHOWKEY=y
@@ -305,7 +304,7 @@ CONFIG_WHICH=y
# Editors
#
CONFIG_AWK=y
CONFIG_FEATURE_AWK_LIBM=y
CONFIG_FEATURE_AWK_MATH=y
CONFIG_CMP=y
CONFIG_DIFF=y
CONFIG_FEATURE_DIFF_BINARY=y
@@ -368,6 +367,7 @@ CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y
# Init Utilities
#
CONFIG_INIT=y
# CONFIG_DEBUG_INIT is not set
CONFIG_FEATURE_USE_INITTAB=y
CONFIG_FEATURE_KILL_REMOVED=y
CONFIG_FEATURE_KILL_DELAY=1
@@ -422,36 +422,35 @@ CONFIG_LSATTR=y
#
# Linux Module Utilities
#
CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
CONFIG_MODPROBE_SMALL=y
CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE=y
CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED=y
# CONFIG_INSMOD is not set
# CONFIG_RMMOD is not set
# CONFIG_LSMOD is not set
# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
# CONFIG_MODPROBE is not set
# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
# CONFIG_DEPMOD is not set
#
# Options common to multiple modutils
#
# CONFIG_FEATURE_2_4_MODULES is not set
# CONFIG_FEATURE_DEPMOD_PRUNE_FANCY is not set
# CONFIG_FEATURE_DEPMOD_ALIAS is not set
# CONFIG_INSMOD is not set
# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
# CONFIG_RMMOD is not set
# CONFIG_LSMOD is not set
# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
# CONFIG_MODPROBE is not set
# CONFIG_FEATURE_MODPROBE_MULTIPLE_OPTIONS is not set
# CONFIG_FEATURE_MODPROBE_FANCY_ALIAS is not set
# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set
# CONFIG_FEATURE_MODUTILS_ALIAS is not set
# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set
# CONFIG_FEATURE_2_4_MODULES is not set
# CONFIG_FEATURE_2_6_MODULES is not set
CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
# CONFIG_FEATURE_QUERY_MODULE_INTERFACE is not set
#
# Linux System Utilities
#
CONFIG_BLKID=y
CONFIG_DMESG=y
CONFIG_FEATURE_DMESG_PRETTY=y
CONFIG_FBSET=y
@@ -556,17 +555,15 @@ CONFIG_FEATURE_CHAT_VAR_ABORT_LEN=y
CONFIG_FEATURE_CHAT_CLR_ABORT=y
CONFIG_CHRT=y
CONFIG_CROND=y
CONFIG_FEATURE_CROND_D=y
CONFIG_DEBUG_CROND_OPTION=y
CONFIG_FEATURE_CROND_CALL_SENDMAIL=y
CONFIG_CRONTAB=y
CONFIG_DC=y
CONFIG_FEATURE_DC_LIBM=y
# CONFIG_DEVFSD is not set
# CONFIG_DEVFSD_MODLOAD is not set
# CONFIG_DEVFSD_FG_NP is not set
# CONFIG_DEVFSD_VERBOSE is not set
# CONFIG_FEATURE_DEVFS is not set
CONFIG_DEVMEM=y
CONFIG_EJECT=y
CONFIG_FEATURE_EJECT_SCSI=y
CONFIG_FBSPLASH=y
@@ -578,11 +575,9 @@ CONFIG_LESS=y
CONFIG_FEATURE_LESS_MAXLINES=9999999
CONFIG_FEATURE_LESS_BRACKETS=y
CONFIG_FEATURE_LESS_FLAGS=y
CONFIG_FEATURE_LESS_DASHCMD=y
CONFIG_FEATURE_LESS_FLAGCS=y
CONFIG_FEATURE_LESS_MARKS=y
CONFIG_FEATURE_LESS_REGEXP=y
CONFIG_FEATURE_LESS_LINENUMS=y
CONFIG_FEATURE_LESS_WINCH=y
CONFIG_HDPARM=y
CONFIG_FEATURE_HDPARM_GET_IDENTITY=y
CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF=y
@@ -694,6 +689,8 @@ CONFIG_PING6=y
CONFIG_FEATURE_FANCY_PING=y
CONFIG_PSCAN=y
CONFIG_ROUTE=y
CONFIG_SENDMAIL=y
CONFIG_FETCHMAIL=y
CONFIG_SLATTACH=y
CONFIG_TELNET=y
CONFIG_FEATURE_TELNET_TTYPE=y
@@ -705,7 +702,7 @@ CONFIG_TFTPD=y
CONFIG_FEATURE_TFTP_GET=y
CONFIG_FEATURE_TFTP_PUT=y
CONFIG_FEATURE_TFTP_BLOCKSIZE=y
CONFIG_TFTP_DEBUG=y
CONFIG_DEBUG_TFTP=y
CONFIG_TRACEROUTE=y
CONFIG_FEATURE_TRACEROUTE_VERBOSE=y
CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE=y
@@ -718,9 +715,9 @@ CONFIG_DHCPD_LEASES_FILE="/var/lib/misc/udhcpd.leases"
CONFIG_APP_UDHCPC=y
CONFIG_FEATURE_UDHCPC_ARPING=y
CONFIG_FEATURE_UDHCP_PORT=y
CONFIG_UDHCP_DEBUG=y
CONFIG_FEATURE_UDHCP_RFC3397=y
CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
CONFIG_FEATURE_UDHCP_DEBUG=y
CONFIG_FEATURE_RFC3397=y
CONFIG_DHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
CONFIG_VCONFIG=y
CONFIG_WGET=y
@@ -731,26 +728,6 @@ CONFIG_ZCIP=y
CONFIG_TCPSVD=y
CONFIG_UDPSVD=y
#
# Print Utilities
#
CONFIG_LPD=y
CONFIG_LPR=y
CONFIG_LPQ=y
#
# Mail Utilities
#
CONFIG_MAKEMIME=y
CONFIG_FEATURE_MIME_CHARSET="us-ascii"
CONFIG_POPMAILDIR=y
CONFIG_FEATURE_POPMAILDIR_DELIVERY=y
CONFIG_REFORMIME=y
CONFIG_FEATURE_REFORMIME_COMPAT=y
CONFIG_SENDMAIL=y
CONFIG_FEATURE_SENDMAIL_MAILX=y
CONFIG_FEATURE_SENDMAIL_MAILXX=y
#
# Process Utilities
#
@@ -774,54 +751,18 @@ CONFIG_BB_SYSCTL=y
CONFIG_TOP=y
CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y
CONFIG_FEATURE_TOP_SMP_CPU=y
CONFIG_FEATURE_TOP_DECIMALS=y
CONFIG_FEATURE_TOP_SMP_PROCESS=y
CONFIG_FEATURE_TOPMEM=y
CONFIG_UPTIME=y
CONFIG_WATCH=y
#
# Runit Utilities
#
CONFIG_RUNSV=y
CONFIG_RUNSVDIR=y
CONFIG_FEATURE_RUNSVDIR_LOG=y
CONFIG_SV=y
CONFIG_SV_DEFAULT_SERVICE_DIR="/var/service"
CONFIG_SVLOGD=y
CONFIG_CHPST=y
CONFIG_SETUIDGID=y
CONFIG_ENVUIDGID=y
CONFIG_ENVDIR=y
CONFIG_SOFTLIMIT=y
#
# SELinux Utilities
#
CONFIG_CHCON=y
CONFIG_FEATURE_CHCON_LONG_OPTIONS=y
CONFIG_GETENFORCE=y
CONFIG_GETSEBOOL=y
CONFIG_LOAD_POLICY=y
CONFIG_MATCHPATHCON=y
CONFIG_RESTORECON=y
CONFIG_RUNCON=y
CONFIG_FEATURE_RUNCON_LONG_OPTIONS=y
CONFIG_SELINUXENABLED=y
CONFIG_SETENFORCE=y
CONFIG_SETFILES=y
CONFIG_FEATURE_SETFILES_CHECK_OPTION=y
CONFIG_SETSEBOOL=y
CONFIG_SESTATUS=y
#
# Shells
#
# CONFIG_FEATURE_SH_IS_ASH is not set
CONFIG_FEATURE_SH_IS_HUSH=y
# CONFIG_FEATURE_SH_IS_HUSH is not set
# CONFIG_FEATURE_SH_IS_MSH is not set
# CONFIG_FEATURE_SH_IS_NONE is not set
CONFIG_FEATURE_SH_IS_NONE=y
# CONFIG_ASH is not set
# CONFIG_ASH_BASH_COMPAT is not set
# CONFIG_ASH_JOB_CONTROL is not set
@@ -871,3 +812,42 @@ CONFIG_LOGREAD=y
CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y
CONFIG_KLOGD=y
CONFIG_LOGGER=y
#
# Runit Utilities
#
CONFIG_RUNSV=y
CONFIG_RUNSVDIR=y
CONFIG_SV=y
CONFIG_SVLOGD=y
CONFIG_CHPST=y
CONFIG_SETUIDGID=y
CONFIG_ENVUIDGID=y
CONFIG_ENVDIR=y
CONFIG_SOFTLIMIT=y
#
# Selinux Utilities
#
CONFIG_CHCON=y
CONFIG_FEATURE_CHCON_LONG_OPTIONS=y
CONFIG_GETENFORCE=y
CONFIG_GETSEBOOL=y
CONFIG_LOAD_POLICY=y
CONFIG_MATCHPATHCON=y
CONFIG_RESTORECON=y
CONFIG_RUNCON=y
CONFIG_FEATURE_RUNCON_LONG_OPTIONS=y
CONFIG_SELINUXENABLED=y
CONFIG_SETENFORCE=y
CONFIG_SETFILES=y
CONFIG_FEATURE_SETFILES_CHECK_OPTION=y
CONFIG_SETSEBOOL=y
CONFIG_SESTATUS=y
#
# Print Utilities
#
CONFIG_LPD=y
CONFIG_LPR=y
CONFIG_LPQ=y
+1 -1
View File
@@ -17,7 +17,7 @@ echo 'static const char packed_usage[] ALIGN1 = {'
## Breaks on big-endian systems!
## # Extra effort to avoid using "od -t x1": -t is not available
## # in non-CONFIG_DESKTOPed busybox od
##
##
## "$loc/usage" | bzip2 -1 | od -v -x \
## | $SED -e 's/^[^ ]*//' \
## | $SED -e 's/ //g' \
+2 -3
View File
@@ -113,7 +113,6 @@ config FEATURE_CPIO_O
config DPKG
bool "dpkg"
default n
select FEATURE_SEAMLESS_GZ
help
dpkg is a medium-level tool to install, build, remove and manage
Debian packages.
@@ -124,9 +123,9 @@ config DPKG
config DPKG_DEB
bool "dpkg_deb"
default n
select FEATURE_SEAMLESS_GZ
help
dpkg-deb unpacks and provides information about Debian archives.
dpkg-deb packs, unpacks and provides information about Debian
archives.
This implementation of dpkg-deb cannot pack archives.
+8 -24
View File
@@ -30,14 +30,13 @@ int open_to_or_warn(int to_fd, const char *filename, int flags, int mode)
int FAST_FUNC bbunpack(char **argv,
char* (*make_new_name)(char *filename),
USE_DESKTOP(long long) int (*unpacker)(unpack_info_t *info)
USE_DESKTOP(long long) int (*unpacker)(void)
)
{
struct stat stat_buf;
USE_DESKTOP(long long) int status;
char *filename, *new_name;
smallint exitcode = 0;
unpack_info_t info;
do {
/* NB: new_name is *maybe* malloc'ed! */
@@ -93,29 +92,14 @@ int FAST_FUNC bbunpack(char **argv,
"use -f to force it");
}
/* memset(&info, 0, sizeof(info)); */
info.mtime = 0; /* so far it has one member only */
status = unpacker(&info);
status = unpacker();
if (status < 0)
exitcode = 1;
if (filename) {
char *del = new_name;
if (status >= 0) {
/* TODO: restore other things? */
if (info.mtime) {
struct utimbuf times;
times.actime = info.mtime;
times.modtime = info.mtime;
/* Close first.
* On some systems calling utime
* then closing resets the mtime. */
close(STDOUT_FILENO);
/* Ignoring errors */
utime(new_name, &times);
}
/* TODO: restore user/group/times here? */
/* Delete _compressed_ file */
del = filename;
/* restore extension (unless tgz -> tar case) */
@@ -175,7 +159,7 @@ char* make_new_name_bunzip2(char *filename)
}
static
USE_DESKTOP(long long) int unpack_bunzip2(unpack_info_t *info UNUSED_PARAM)
USE_DESKTOP(long long) int unpack_bunzip2(void)
{
return unpack_bz2_stream_prime(STDIN_FILENO, STDOUT_FILENO);
}
@@ -251,7 +235,7 @@ char* make_new_name_gunzip(char *filename)
}
static
USE_DESKTOP(long long) int unpack_gunzip(unpack_info_t *info)
USE_DESKTOP(long long) int unpack_gunzip(void)
{
USE_DESKTOP(long long) int status = -1;
@@ -263,7 +247,7 @@ USE_DESKTOP(long long) int unpack_gunzip(unpack_info_t *info)
if (ENABLE_FEATURE_SEAMLESS_Z && magic2 == 0x9d) {
status = unpack_Z_stream(STDIN_FILENO, STDOUT_FILENO);
} else if (magic2 == 0x8b) {
status = unpack_gz_stream_with_info(STDIN_FILENO, STDOUT_FILENO, info);
status = unpack_gz_stream(STDIN_FILENO, STDOUT_FILENO);
} else {
goto bad_magic;
}
@@ -325,7 +309,7 @@ char* make_new_name_unlzma(char *filename)
}
static
USE_DESKTOP(long long) int unpack_unlzma(unpack_info_t *info UNUSED_PARAM)
USE_DESKTOP(long long) int unpack_unlzma(void)
{
return unpack_lzma_stream(STDIN_FILENO, STDOUT_FILENO);
}
@@ -360,7 +344,7 @@ char* make_new_name_uncompress(char *filename)
}
static
USE_DESKTOP(long long) int unpack_uncompress(unpack_info_t *info UNUSED_PARAM)
USE_DESKTOP(long long) int unpack_uncompress(void)
{
USE_DESKTOP(long long) int status = -1;
+1 -2
View File
@@ -8,7 +8,6 @@
*/
#include "libbb.h"
#include "unarchive.h"
#define CONFIG_BZIP2_FEATURE_SPEED 1
@@ -102,7 +101,7 @@ USE_DESKTOP(long long) int bz_write(bz_stream *strm, void* rbuf, ssize_t rlen, v
}
static
USE_DESKTOP(long long) int compressStream(unpack_info_t *info UNUSED_PARAM)
USE_DESKTOP(long long) int compressStream(void)
{
USE_DESKTOP(long long) int total;
ssize_t count;
+2 -8
View File
@@ -30,7 +30,6 @@ static off_t cpio_pad4(off_t size)
* It's ok to exit instead of return. */
static int cpio_o(void)
{
static const char trailer[] ALIGN1 = "TRAILER!!!";
struct name_s {
struct name_s *next;
char name[1];
@@ -120,7 +119,7 @@ static int cpio_o(void)
} else {
/* If no (more) hardlinks to output,
* output "trailer" entry */
name = trailer;
name = "TRAILER!!!";
/* st.st_size == 0 is a must, but for uniformity
* in the output, we zero out everything */
memset(&st, 0, sizeof(st));
@@ -168,7 +167,7 @@ static int cpio_o(void)
}
if (!line) {
if (name != trailer)
if (links)
goto next_link;
/* TODO: GNU cpio pads trailer to 512 bytes, do we want that? */
return EXIT_SUCCESS;
@@ -342,13 +341,8 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
argv++;
}
/* see get_header_cpio */
archive_handle->ah_priv[2] = (void*) ~(ptrdiff_t)0;
while (get_header_cpio(archive_handle) == EXIT_SUCCESS)
continue;
if (archive_handle->ah_priv[2] != (void*) ~(ptrdiff_t)0)
printf("%lu blocks\n", (unsigned long)(ptrdiff_t)(archive_handle->ah_priv[2]));
return EXIT_SUCCESS;
}
+2 -6
View File
@@ -25,7 +25,6 @@
*/
#include "libbb.h"
#include <fnmatch.h>
#include "unarchive.h"
/* note: if you vary hash_prime sizes be aware,
@@ -1294,7 +1293,7 @@ static void free_array(char **array)
* the status_hashtable to retrieve the info. This results in smaller code than
* scanning the status file. The resulting list, however, is unsorted.
*/
static void list_packages(const char *pattern)
static void list_packages(void)
{
int i;
@@ -1315,9 +1314,6 @@ static void list_packages(const char *pattern)
name_str = name_hashtable[package_hashtable[status_hashtable[i]->package]->name];
vers_str = name_hashtable[package_hashtable[status_hashtable[i]->package]->version];
if (pattern && fnmatch(pattern, name_str, 0))
continue;
/* get abbreviation for status field 1 */
s1 = stat_str[0] == 'i' ? 'i' : 'r';
@@ -1630,7 +1626,7 @@ int dpkg_main(int argc UNUSED_PARAM, char **argv)
/* if the list action was given print the installed packages and exit */
if (opt & OPT_list_installed) {
list_packages(argv[0]);
list_packages();
return EXIT_SUCCESS;
}
+1 -2
View File
@@ -40,7 +40,6 @@ aa: 85.1% -- replaced with aa.gz
*/
#include "libbb.h"
#include "unarchive.h"
/* ===========================================================================
@@ -2015,7 +2014,7 @@ char* make_new_name_gzip(char *filename)
}
static
USE_DESKTOP(long long) int pack_gzip(unpack_info_t *info UNUSED_PARAM)
USE_DESKTOP(long long) int pack_gzip(void)
{
struct stat s;
+1 -3
View File
@@ -77,9 +77,7 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
}
case S_IFDIR:
res = mkdir(file_header->name, file_header->mode);
if ((res == -1)
&& (errno != EISDIR) /* btw, Linux doesn't return this */
&& (errno != EEXIST)
if ((res == -1) && (errno != EISDIR)
&& !(archive_handle->ah_flags & ARCHIVE_EXTRACT_QUIET)
) {
bb_perror_msg("cannot make dir %s", file_header->name);
+7 -19
View File
@@ -1108,21 +1108,18 @@ static uint32_t buffer_read_le_u32(STATE_PARAM_ONLY)
return res;
}
static int check_header_gzip(STATE_PARAM unpack_info_t *info)
static int check_header_gzip(STATE_PARAM_ONLY)
{
union {
unsigned char raw[8];
struct {
uint8_t gz_method;
uint8_t flags;
uint32_t mtime;
uint8_t xtra_flags_UNUSED;
uint8_t os_flags_UNUSED;
} __attribute__((packed)) formatted;
//uint32_t mtime; - unused fields
//uint8_t xtra_flags;
//uint8_t os_flags;
} formatted; /* packed */
} header;
struct BUG_header {
char BUG_header[sizeof(header) == 8 ? 1 : -1];
};
/*
* Rewind bytebuffer. We use the beginning because the header has 8
@@ -1170,9 +1167,6 @@ static int check_header_gzip(STATE_PARAM unpack_info_t *info)
}
}
if (info)
info->mtime = SWAP_LE32(header.formatted.mtime);
/* Read the header checksum */
if (header.formatted.flags & 0x02) {
if (!top_up(PASS_STATE 2))
@@ -1183,7 +1177,7 @@ static int check_header_gzip(STATE_PARAM unpack_info_t *info)
}
USE_DESKTOP(long long) int FAST_FUNC
unpack_gz_stream_with_info(int in, int out, unpack_info_t *info)
unpack_gz_stream(int in, int out)
{
uint32_t v32;
USE_DESKTOP(long long) int n;
@@ -1198,7 +1192,7 @@ unpack_gz_stream_with_info(int in, int out, unpack_info_t *info)
gunzip_src_fd = in;
again:
if (!check_header_gzip(PASS_STATE info)) {
if (!check_header_gzip(PASS_STATE_ONLY)) {
bb_error_msg("corrupted data");
n = -1;
goto ret;
@@ -1245,9 +1239,3 @@ unpack_gz_stream_with_info(int in, int out, unpack_info_t *info)
DEALLOC_STATE;
return n;
}
USE_DESKTOP(long long) int FAST_FUNC
unpack_gz_stream(int in, int out)
{
return unpack_gz_stream_with_info(in, out, NULL);
}
+1 -2
View File
@@ -27,7 +27,6 @@ char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle)
#define hardlinks_to_create (*(hardlinks_t **)(&archive_handle->ah_priv[0]))
#define created_hardlinks (*(hardlinks_t **)(&archive_handle->ah_priv[1]))
#define block_count (archive_handle->ah_priv[2])
// if (!archive_handle->ah_priv_inited) {
// archive_handle->ah_priv_inited = 1;
// hardlinks_to_create = NULL;
@@ -77,7 +76,7 @@ char FAST_FUNC get_header_cpio(archive_handle_t *archive_handle)
if (strcmp(file_header->name, "TRAILER!!!") == 0) {
/* Always round up. ">> 9" divides by 512 */
block_count = (void*)(ptrdiff_t) ((archive_handle->offset + 511) >> 9);
printf("%"OFF_FMT"u blocks\n", (archive_handle->offset + 511) >> 9);
goto create_hardlinks;
}
+10 -20
View File
@@ -115,8 +115,8 @@ int rpm_main(int argc, char **argv)
}
}
argv += optind;
//argc -= optind;
if (!argv[0]) bb_show_usage();
argc -= optind;
if (!argc) bb_show_usage();
while (*argv) {
rpm_fd = xopen(*argv++, O_RDONLY);
@@ -202,12 +202,7 @@ static void extract_cpio_gz(int fd)
archive_handle->seek = seek_by_read;
//archive_handle->action_header = header_list;
archive_handle->action_data = data_extract_all;
archive_handle->ah_flags = ARCHIVE_PRESERVE_DATE | ARCHIVE_CREATE_LEADING_DIRS
/* compat: overwrite existing files.
* try "rpm -i foo.src.rpm" few times in a row -
* standard rpm will not complain.
* (TODO? real rpm creates "file;1234" and then renames it) */
| ARCHIVE_EXTRACT_UNCONDITIONAL;
archive_handle->ah_flags = ARCHIVE_PRESERVE_DATE | ARCHIVE_CREATE_LEADING_DIRS;
archive_handle->src_fd = fd;
/*archive_handle->offset = 0; - init_handle() did it */
@@ -251,7 +246,7 @@ static void extract_cpio_gz(int fd)
static rpm_index **rpm_gettags(int fd, int *num_tags)
{
/* We should never need mode than 200, and realloc later */
rpm_index **tags = xzalloc(200 * sizeof(tags[0]));
rpm_index **tags = xzalloc(200 * sizeof(struct rpmtag *));
int pass, tagindex = 0;
xlseek(fd, 96, SEEK_CUR); /* Seek past the unused lead */
@@ -265,9 +260,6 @@ static rpm_index **rpm_gettags(int fd, int *num_tags)
uint32_t entries; /* Number of entries in header (4 bytes) */
uint32_t size; /* Size of store (4 bytes) */
} header;
struct BUG_header {
char BUG_header[sizeof(header) == 16 ? 1 : -1];
};
rpm_index *tmpindex;
int storepos;
@@ -281,8 +273,8 @@ static rpm_index **rpm_gettags(int fd, int *num_tags)
storepos = xlseek(fd,0,SEEK_CUR) + header.entries * 16;
while (header.entries--) {
tmpindex = tags[tagindex++] = xmalloc(sizeof(*tmpindex));
xread(fd, tmpindex, sizeof(*tmpindex));
tmpindex = tags[tagindex++] = xmalloc(sizeof(rpm_index));
xread(fd, tmpindex, sizeof(rpm_index));
tmpindex->tag = ntohl(tmpindex->tag);
tmpindex->type = ntohl(tmpindex->type);
tmpindex->count = ntohl(tmpindex->count);
@@ -295,7 +287,7 @@ static rpm_index **rpm_gettags(int fd, int *num_tags)
if (pass == 0)
xlseek(fd, (8 - (xlseek(fd,0,SEEK_CUR) % 8)) % 8, SEEK_CUR);
}
tags = xrealloc(tags, tagindex * sizeof(tags[0])); /* realloc tags to save space */
tags = xrealloc(tags, tagindex * sizeof(struct rpmtag *)); /* realloc tags to save space */
*num_tags = tagindex;
return tags; /* All done, leave the file at the start of the gzipped cpio archive */
}
@@ -386,11 +378,9 @@ static void fileaction_dobackup(char *filename, int fileref)
static void fileaction_setowngrp(char *filename, int fileref)
{
/* real rpm warns: "user foo does not exist - using <you>" */
struct passwd *pw = getpwnam(rpm_getstr(TAG_FILEUSERNAME, fileref));
int uid = pw ? pw->pw_uid : getuid(); /* or euid? */
struct group *gr = getgrnam(rpm_getstr(TAG_FILEGROUPNAME, fileref));
int gid = gr ? gr->gr_gid : getgid();
int uid, gid;
uid = xuname2uid(rpm_getstr(TAG_FILEUSERNAME, fileref));
gid = xgroup2gid(rpm_getstr(TAG_FILEGROUPNAME, fileref));
chown(filename, uid, gid);
}
-4
View File
@@ -818,10 +818,6 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
| ARCHIVE_PRESERVE_DATE
| ARCHIVE_EXTRACT_UNCONDITIONAL;
/* Apparently only root's tar preserves perms (see bug 3844) */
if (getuid() != 0)
tar_handle->ah_flags |= ARCHIVE_NOPRESERVE_PERM;
/* Prepend '-' to the first argument if required */
opt_complementary = "--:" // first arg is options
"tt:vv:" // count -t,-v
+47 -196
View File
@@ -16,7 +16,12 @@
*/
/* TODO
* Endian issues
* Zip64 + other methods
* Improve handling of zip format, ie.
* - deferred CRC, comp. & uncomp. lengths (zip header flags bit 3)
* - unix file permissions, etc.
* - central directory
*/
#include "libbb.h"
@@ -26,12 +31,12 @@ enum {
#if BB_BIG_ENDIAN
ZIP_FILEHEADER_MAGIC = 0x504b0304,
ZIP_CDS_MAGIC = 0x504b0102,
ZIP_CDE_MAGIC = 0x504b0506,
ZIP_CDS_END_MAGIC = 0x504b0506,
ZIP_DD_MAGIC = 0x504b0708,
#else
ZIP_FILEHEADER_MAGIC = 0x04034b50,
ZIP_CDS_MAGIC = 0x02014b50,
ZIP_CDE_MAGIC = 0x06054b50,
ZIP_CDS_END_MAGIC = 0x06054b50,
ZIP_DD_MAGIC = 0x08074b50,
#endif
};
@@ -41,16 +46,16 @@ enum {
typedef union {
uint8_t raw[ZIP_HEADER_LEN];
struct {
uint16_t version; /* 0-1 */
uint16_t flags; /* 2-3 */
uint16_t method; /* 4-5 */
uint16_t modtime; /* 6-7 */
uint16_t moddate; /* 8-9 */
uint32_t crc32 PACKED; /* 10-13 */
uint32_t cmpsize PACKED; /* 14-17 */
uint32_t ucmpsize PACKED; /* 18-21 */
uint16_t filename_len; /* 22-23 */
uint16_t extra_len; /* 24-25 */
uint16_t version; /* 0-1 */
uint16_t flags; /* 2-3 */
uint16_t method; /* 4-5 */
uint16_t modtime; /* 6-7 */
uint16_t moddate; /* 8-9 */
uint32_t crc32 PACKED; /* 10-13 */
uint32_t cmpsize PACKED; /* 14-17 */
uint32_t ucmpsize PACKED; /* 18-21 */
uint16_t filename_len; /* 22-23 */
uint16_t extra_len; /* 24-25 */
} formatted PACKED;
} zip_header_t; /* PACKED - gcc 4.2.1 doesn't like it (spews warning) */
@@ -60,11 +65,11 @@ typedef union {
*/
struct BUG_zip_header_must_be_26_bytes {
char BUG_zip_header_must_be_26_bytes[
offsetof(zip_header_t, formatted.extra_len) + 2
== ZIP_HEADER_LEN ? 1 : -1];
offsetof(zip_header_t, formatted.extra_len) + 2 ==
ZIP_HEADER_LEN ? 1 : -1];
};
#define FIX_ENDIANNESS_ZIP(zip_header) do { \
#define FIX_ENDIANNESS(zip_header) do { \
(zip_header).formatted.version = SWAP_LE16((zip_header).formatted.version ); \
(zip_header).formatted.flags = SWAP_LE16((zip_header).formatted.flags ); \
(zip_header).formatted.method = SWAP_LE16((zip_header).formatted.method ); \
@@ -77,138 +82,9 @@ struct BUG_zip_header_must_be_26_bytes {
(zip_header).formatted.extra_len = SWAP_LE16((zip_header).formatted.extra_len ); \
} while (0)
#define CDS_HEADER_LEN 42
typedef union {
uint8_t raw[CDS_HEADER_LEN];
struct {
/* uint32_t signature; 50 4b 01 02 */
uint16_t version_made_by; /* 0-1 */
uint16_t version_needed; /* 2-3 */
uint16_t cds_flags; /* 4-5 */
uint16_t method; /* 6-7 */
uint16_t mtime; /* 8-9 */
uint16_t mdate; /* 10-11 */
uint32_t crc32; /* 12-15 */
uint32_t cmpsize; /* 16-19 */
uint32_t ucmpsize; /* 20-23 */
uint16_t file_name_length; /* 24-25 */
uint16_t extra_field_length; /* 26-27 */
uint16_t file_comment_length; /* 28-29 */
uint16_t disk_number_start; /* 30-31 */
uint16_t internal_file_attributes; /* 32-33 */
uint32_t external_file_attributes PACKED; /* 34-37 */
uint32_t relative_offset_of_local_header PACKED; /* 38-41 */
} formatted PACKED;
} cds_header_t;
struct BUG_cds_header_must_be_42_bytes {
char BUG_cds_header_must_be_42_bytes[
offsetof(cds_header_t, formatted.relative_offset_of_local_header) + 4
== CDS_HEADER_LEN ? 1 : -1];
};
#define FIX_ENDIANNESS_CDS(cds_header) do { \
(cds_header).formatted.crc32 = SWAP_LE32((cds_header).formatted.crc32 ); \
(cds_header).formatted.cmpsize = SWAP_LE32((cds_header).formatted.cmpsize ); \
(cds_header).formatted.ucmpsize = SWAP_LE32((cds_header).formatted.ucmpsize ); \
(cds_header).formatted.file_name_length = SWAP_LE16((cds_header).formatted.file_name_length); \
(cds_header).formatted.extra_field_length = SWAP_LE16((cds_header).formatted.extra_field_length); \
(cds_header).formatted.file_comment_length = SWAP_LE16((cds_header).formatted.file_comment_length); \
} while (0)
#define CDE_HEADER_LEN 16
typedef union {
uint8_t raw[CDE_HEADER_LEN];
struct {
/* uint32_t signature; 50 4b 05 06 */
uint16_t this_disk_no;
uint16_t disk_with_cds_no;
uint16_t cds_entries_on_this_disk;
uint16_t cds_entries_total;
uint32_t cds_size;
uint32_t cds_offset;
/* uint16_t file_comment_length; */
/* .ZIP file comment (variable size) */
} formatted PACKED;
} cde_header_t;
struct BUG_cde_header_must_be_16_bytes {
char BUG_cde_header_must_be_16_bytes[
sizeof(cde_header_t) == CDE_HEADER_LEN ? 1 : -1];
};
#define FIX_ENDIANNESS_CDE(cde_header) do { \
(cde_header).formatted.cds_offset = SWAP_LE16((cde_header).formatted.cds_offset); \
} while (0)
enum { zip_fd = 3 };
#if ENABLE_DESKTOP
/* NB: does not preserve file position! */
static uint32_t find_cds_offset(void)
static void unzip_skip(int fd, off_t skip)
{
unsigned char buf[1024];
cde_header_t cde_header;
unsigned char *p;
off_t end;
end = xlseek(zip_fd, 0, SEEK_END);
if (end < 1024)
end = 1024;
end -= 1024;
xlseek(zip_fd, end, SEEK_SET);
full_read(zip_fd, buf, 1024);
p = buf;
while (p <= buf + 1024 - CDE_HEADER_LEN - 4) {
if (*p != 'P') {
p++;
continue;
}
if (*++p != 'K')
continue;
if (*++p != 5)
continue;
if (*++p != 6)
continue;
/* we found CDE! */
memcpy(cde_header.raw, p + 1, CDE_HEADER_LEN);
FIX_ENDIANNESS_CDE(cde_header);
return cde_header.formatted.cds_offset;
}
bb_error_msg_and_die("can't find file table");
};
static uint32_t read_next_cds(int count_m1, uint32_t cds_offset, cds_header_t *cds_ptr)
{
off_t org;
org = xlseek(zip_fd, 0, SEEK_CUR);
if (!cds_offset)
cds_offset = find_cds_offset();
while (count_m1-- >= 0) {
xlseek(zip_fd, cds_offset + 4, SEEK_SET);
xread(zip_fd, cds_ptr->raw, CDS_HEADER_LEN);
FIX_ENDIANNESS_CDS(*cds_ptr);
cds_offset += 4 + CDS_HEADER_LEN
+ cds_ptr->formatted.file_name_length
+ cds_ptr->formatted.extra_field_length
+ cds_ptr->formatted.file_comment_length;
}
xlseek(zip_fd, org, SEEK_SET);
return cds_offset;
};
#endif
static void unzip_skip(off_t skip)
{
bb_copyfd_exact_size(zip_fd, -1, skip);
bb_copyfd_exact_size(fd, -1, skip);
}
static void unzip_create_leading_dirs(const char *fn)
@@ -221,17 +97,17 @@ static void unzip_create_leading_dirs(const char *fn)
free(name);
}
static void unzip_extract(zip_header_t *zip_header, int dst_fd)
static void unzip_extract(zip_header_t *zip_header, int src_fd, int dst_fd)
{
if (zip_header->formatted.method == 0) {
/* Method 0 - stored (not compressed) */
off_t size = zip_header->formatted.ucmpsize;
if (size)
bb_copyfd_exact_size(zip_fd, dst_fd, size);
bb_copyfd_exact_size(src_fd, dst_fd, size);
} else {
/* Method 8 - inflate */
inflate_unzip_result res;
if (inflate_unzip(&res, zip_header->formatted.cmpsize, zip_fd, dst_fd) < 0)
if (inflate_unzip(&res, zip_header->formatted.cmpsize, src_fd, dst_fd) < 0)
bb_error_msg_and_die("inflate error");
/* Validate decompression - crc */
if (zip_header->formatted.crc32 != (res.crc ^ 0xffffffffL)) {
@@ -255,12 +131,9 @@ int unzip_main(int argc, char **argv)
smallint verbose = 1;
smallint listing = 0;
smallint overwrite = O_PROMPT;
#if ENABLE_DESKTOP
uint32_t cds_offset;
unsigned cds_entries;
#endif
unsigned total_size;
unsigned total_entries;
int src_fd = -1;
int dst_fd = -1;
char *src_fn = NULL;
char *dst_fn = NULL;
@@ -348,14 +221,13 @@ int unzip_main(int argc, char **argv)
/* Open input file */
if (LONE_DASH(src_fn)) {
xdup2(STDIN_FILENO, zip_fd);
src_fd = STDIN_FILENO;
/* Cannot use prompt mode since zip data is arriving on STDIN */
if (overwrite == O_PROMPT)
overwrite = O_NEVER;
} else {
static const char extn[][5] = {"", ".zip", ".ZIP"};
int orig_src_fn_len = strlen(src_fn);
int src_fd = -1;
for (i = 0; (i < 3) && (src_fd == -1); i++) {
strcpy(src_fn + orig_src_fn_len, extn[i]);
@@ -365,7 +237,6 @@ int unzip_main(int argc, char **argv)
src_fn[orig_src_fn_len] = '\0';
bb_error_msg_and_die("can't open %s, %s.zip, %s.ZIP", src_fn, src_fn, src_fn);
}
xmove_fd(src_fd, zip_fd);
}
/* Change dir if necessary */
@@ -382,63 +253,37 @@ int unzip_main(int argc, char **argv)
total_size = 0;
total_entries = 0;
#if ENABLE_DESKTOP
cds_entries = 0;
cds_offset = 0;
#endif
while (1) {
uint32_t magic;
/* Check magic number */
xread(zip_fd, &magic, 4);
xread(src_fd, &magic, 4);
/* Central directory? It's at the end, so exit */
if (magic == ZIP_CDS_MAGIC)
break;
#if ENABLE_DESKTOP
/* Data descriptor? It was a streaming file, go on */
if (magic == ZIP_DD_MAGIC) {
/* skip over duplicate crc32, cmpsize and ucmpsize */
unzip_skip(3 * 4);
continue;
}
#endif
if (magic != ZIP_FILEHEADER_MAGIC)
bb_error_msg_and_die("invalid zip magic %08X", (int)magic);
/* Read the file header */
xread(zip_fd, zip_header.raw, ZIP_HEADER_LEN);
FIX_ENDIANNESS_ZIP(zip_header);
xread(src_fd, zip_header.raw, ZIP_HEADER_LEN);
FIX_ENDIANNESS(zip_header);
if ((zip_header.formatted.method != 0) && (zip_header.formatted.method != 8)) {
bb_error_msg_and_die("unsupported method %d", zip_header.formatted.method);
}
#if !ENABLE_DESKTOP
if (zip_header.formatted.flags & 0x0009) {
bb_error_msg_and_die("zip flags 1 and 8 are not supported");
}
#else
if (zip_header.formatted.flags & 0x0001) {
if (zip_header.formatted.flags & (0x0008|0x0001)) {
/* 0x0001 - encrypted */
bb_error_msg_and_die("zip flag 1 (encryption) is not supported");
}
if (zip_header.formatted.flags & 0x0008) {
cds_header_t cds_header;
/* 0x0008 - streaming. [u]cmpsize can be reliably gotten
* only from Central Directory. See unzip_doc.txt */
cds_offset = read_next_cds(total_entries - cds_entries, cds_offset, &cds_header);
cds_entries = total_entries + 1;
zip_header.formatted.crc32 = cds_header.formatted.crc32;
zip_header.formatted.cmpsize = cds_header.formatted.cmpsize;
zip_header.formatted.ucmpsize = cds_header.formatted.ucmpsize;
bb_error_msg_and_die("zip flags 8 and 1 are not supported");
}
#endif
/* Read filename */
free(dst_fn);
dst_fn = xzalloc(zip_header.formatted.filename_len + 1);
xread(zip_fd, dst_fn, zip_header.formatted.filename_len);
xread(src_fd, dst_fn, zip_header.formatted.filename_len);
/* Skip extra header bytes */
unzip_skip(zip_header.formatted.extra_len);
unzip_skip(src_fd, zip_header.formatted.extra_len);
/* Filter zip entries */
if (find_list_entry(zreject, dst_fn)
@@ -459,6 +304,7 @@ int unzip_main(int argc, char **argv)
(dostime & 0x000007e0) >> 5,
dst_fn);
total_size += zip_header.formatted.ucmpsize;
total_entries++;
} else {
/* short listing -- filenames only */
puts(dst_fn);
@@ -469,7 +315,7 @@ int unzip_main(int argc, char **argv)
} else if (last_char_is(dst_fn, '/')) { /* Extract directory */
if (stat(dst_fn, &stat_buf) == -1) {
if (errno != ENOENT) {
bb_perror_msg_and_die("can't stat '%s'", dst_fn);
bb_perror_msg_and_die("cannot stat '%s'", dst_fn);
}
if (verbose) {
printf(" creating: %s\n", dst_fn);
@@ -489,7 +335,7 @@ int unzip_main(int argc, char **argv)
check_file:
if (stat(dst_fn, &stat_buf) == -1) { /* File does not exist */
if (errno != ENOENT) {
bb_perror_msg_and_die("can't stat '%s'", dst_fn);
bb_perror_msg_and_die("cannot stat '%s'", dst_fn);
}
i = 'y';
} else { /* File already exists */
@@ -501,7 +347,7 @@ int unzip_main(int argc, char **argv)
} else {
printf("replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: ", dst_fn);
if (!fgets(key_buf, sizeof(key_buf), stdin)) {
bb_perror_msg_and_die("can't read input");
bb_perror_msg_and_die("cannot read input");
}
i = key_buf[0];
}
@@ -522,7 +368,7 @@ int unzip_main(int argc, char **argv)
if (verbose) {
printf(" inflating: %s\n", dst_fn);
}
unzip_extract(&zip_header, dst_fd);
unzip_extract(&zip_header, src_fd, dst_fd);
if (dst_fd != STDOUT_FILENO) {
/* closing STDOUT is potentially bad for future business */
close(dst_fd);
@@ -533,14 +379,14 @@ int unzip_main(int argc, char **argv)
overwrite = O_NEVER;
case 'n':
/* Skip entry data */
unzip_skip(zip_header.formatted.cmpsize);
unzip_skip(src_fd, zip_header.formatted.cmpsize);
break;
case 'r':
/* Prompt for new name */
printf("new name: ");
if (!fgets(key_buf, sizeof(key_buf), stdin)) {
bb_perror_msg_and_die("can't read input");
bb_perror_msg_and_die("cannot read input");
}
free(dst_fn);
dst_fn = xstrdup(key_buf);
@@ -552,7 +398,12 @@ int unzip_main(int argc, char **argv)
goto check_file;
}
total_entries++;
// Looks like bug (data descriptor cannot be identified this way)
// /* Data descriptor section */
// if (zip_header.formatted.flags & 4) {
// /* skip over duplicate crc, compressed size and uncompressed size */
// unzip_skip(src_fd, 12);
// }
}
if (listing && verbose) {
Binary file not shown.
-15
View File
@@ -101,21 +101,6 @@ config SETFONT
help
Allows to load console screen map. Useful for i18n.
config FEATURE_SETFONT_TEXTUAL_MAP
bool "Support reading textual screen maps"
default n
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 n
+10 -11
View File
@@ -2,37 +2,37 @@
/*
* Mini kbd_mode implementation for busybox
*
* Copyright (C) 2007 Loic Grenie <loic.grenie@gmail.com>
* Copyright (C) 2007 Loïc Grenié <loic.grenie@gmail.com>
* written using Andries Brouwer <aeb@cwi.nl>'s kbd_mode from
* console-utils v0.2.3, licensed under GNU GPLv2
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
*/
#include "libbb.h"
#include <linux/kd.h>
int kbd_mode_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int kbd_mode_main(int argc UNUSED_PARAM, char **argv)
{
int fd;
unsigned opt;
enum {
SCANCODE = (1 << 0),
ASCII = (1 << 1),
MEDIUMRAW = (1 << 2),
UNICODE = (1 << 3),
UNICODE = (1 << 3)
};
int fd;
unsigned opt;
const char *tty_name = CURRENT_TTY;
opt = getopt32(argv, "sakuC:", &tty_name);
fd = xopen(tty_name, O_NONBLOCK);
opt &= 0xf; /* clear -C bit, see (*) */
static const char KD_xxx[] ALIGN1 = "saku";
opt = getopt32(argv, KD_xxx);
fd = get_console_fd_or_die();
if (!opt) { /* print current setting */
const char *mode = "unknown";
int m;
xioctl(fd, KDGKBMODE, &m);
ioctl(fd, KDGKBMODE, &m);
if (m == K_RAW)
mode = "raw (scancode)";
else if (m == K_XLATE)
@@ -43,7 +43,6 @@ int kbd_mode_main(int argc UNUSED_PARAM, char **argv)
mode = "Unicode (UTF-8)";
printf("The keyboard is in %s mode\n", mode);
} else {
/* here we depend on specific bits assigned to options (*) */
opt = opt & UNICODE ? 3 : opt >> 1;
/* double cast prevents warnings about widening conversion */
xioctl(fd, KDSKBMODE, (void*)(ptrdiff_t)opt);
+10 -184
View File
@@ -10,28 +10,6 @@
#include "libbb.h"
#include <sys/kd.h>
#ifndef KDFONTOP
#define KDFONTOP 0x4B72
struct console_font_op {
unsigned op; /* KD_FONT_OP_* */
unsigned flags; /* KD_FONT_FLAG_* */
unsigned width, height;
unsigned charcount;
unsigned char *data; /* font data with height fixed to 32 */
};
#define KD_FONT_OP_SET 0 /* Set font */
#define KD_FONT_OP_GET 1 /* Get font */
#define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default,
data points to name / NULL */
#define KD_FONT_OP_COPY 3 /* Copy from another console */
#define KD_FONT_FLAG_OLD 0x80000000 /* Invoked via old interface */
#define KD_FONT_FLAG_DONT_RECALC 1 /* Don't call adjust_height() */
/* (Used internally for PIO_FONT support) */
#endif /* KDFONTOP */
enum {
PSF_MAGIC1 = 0x36,
PSF_MAGIC2 = 0x04,
@@ -39,7 +17,7 @@ enum {
PSF_MODE512 = 0x01,
PSF_MODEHASTAB = 0x02,
PSF_MAXMODE = 0x03,
PSF_SEPARATOR = 0xffff
PSF_SEPARATOR = 0xFFFF
};
struct psf_header {
@@ -62,28 +40,6 @@ static void do_loadfont(int fd, unsigned char *inbuf, int unit, int fontsize)
for (i = 0; i < fontsize; i++)
memcpy(buf + (32 * i), inbuf + (unit * i), unit);
{ /* KDFONTOP */
struct console_font_op cfo;
cfo.op = KD_FONT_OP_SET;
cfo.flags = 0;
cfo.width = 8;
cfo.height = unit;
cfo.charcount = fontsize;
cfo.data = (void*)buf;
#if 0
if (!ioctl_or_perror(fd, KDFONTOP, &cfo, "KDFONTOP ioctl failed (will try PIO_FONTX)"))
goto ret; /* success */
#else
xioctl(fd, KDFONTOP, &cfo);
#endif
}
#if 0
/* These ones do not honour -C tty (they set font on current tty regardless)
* On x86, this distinction is visible on framebuffer consoles
* (regular character consoles may have only one shared font anyway)
*/
#if defined(PIO_FONTX) && !defined(__sparc__)
{
struct consolefontdesc cfd;
@@ -93,12 +49,11 @@ static void do_loadfont(int fd, unsigned char *inbuf, int unit, int fontsize)
cfd.chardata = buf;
if (!ioctl_or_perror(fd, PIO_FONTX, &cfd, "PIO_FONTX ioctl failed (will try PIO_FONT)"))
goto ret; /* success */
goto ret; /* success */
}
#endif
xioctl(fd, PIO_FONT, buf);
ret:
#endif /* 0 */
free(buf);
}
@@ -200,7 +155,7 @@ int loadfont_main(int argc UNUSED_PARAM, char **argv)
* just read the entire file.
*/
len = 32*1024; // can't be larger
psfhdr = xmalloc_read(STDIN_FILENO, &len);
psfhdr = (struct psf_header *) xmalloc_read(STDIN_FILENO, &len);
// xmalloc_open_zipped_read_close(filename, &len);
if (!psfhdr)
bb_perror_msg_and_die("error reading input font");
@@ -211,159 +166,30 @@ int loadfont_main(int argc UNUSED_PARAM, char **argv)
#endif
#if ENABLE_SETFONT
/*
kbd-1.12:
setfont [-O font+umap.orig] [-o font.orig] [-om cmap.orig]
[-ou umap.orig] [-N] [font.new ...] [-m cmap] [-u umap] [-C console]
[-hNN] [-v] [-V]
-h NN Override font height
-o file
Save previous font in file
-O file
Save previous font and Unicode map in file
-om file
Store console map in file
-ou file
Save previous Unicode map in file
-m file
Load console map or Unicode console map from file
-u file
Load Unicode table describing the font from file
Example:
# cp866
0x00-0x7f idem
#
0x80 U+0410 # CYRILLIC CAPITAL LETTER A
0x81 U+0411 # CYRILLIC CAPITAL LETTER BE
0x82 U+0412 # CYRILLIC CAPITAL LETTER VE
-C console
Set the font for the indicated console
-v Verbose
-V Version
*/
#if ENABLE_FEATURE_SETFONT_TEXTUAL_MAP
static int ctoi(char *s)
{
if (s[0] == '\'' && s[1] != '\0' && s[2] == '\'' && s[3] == '\0')
return s[1];
// U+ means 0x
if (s[0] == 'U' && s[1] == '+') {
s[0] = '0';
s[1] = 'x';
}
if (!isdigit(s[0]))
return -1;
return xstrtoul(s, 0);
}
#endif
int setfont_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int setfont_main(int argc UNUSED_PARAM, char **argv)
{
size_t len;
unsigned opts;
int fd;
struct psf_header *psfhdr;
char *mapfilename;
const char *tty_name = CURRENT_TTY;
int fd;
opt_complementary = "=1";
opts = getopt32(argv, "m:C:", &mapfilename, &tty_name);
getopt32(argv, "m:", &mapfilename);
argv += optind;
fd = xopen(tty_name, O_NONBLOCK);
if (sizeof(CONFIG_DEFAULT_SETFONT_DIR) > 1) { // if not ""
if (*argv[0] != '/') {
// goto default fonts location. don't die if doesn't exist
chdir(CONFIG_DEFAULT_SETFONT_DIR "/consolefonts");
}
}
// load font
len = 32*1024; // can't be larger
psfhdr = xmalloc_open_zipped_read_close(*argv, &len);
if (!psfhdr)
bb_simple_perror_msg_and_die(*argv);
psfhdr = (struct psf_header *) xmalloc_open_zipped_read_close(*argv, &len);
fd = get_console_fd_or_die();
do_load(fd, psfhdr, len);
// load the screen map, if any
if (opts & 1) { // -m
unsigned mode = PIO_SCRNMAP;
void *map;
if (sizeof(CONFIG_DEFAULT_SETFONT_DIR) > 1) { // if not ""
if (mapfilename[0] != '/') {
// goto default keymaps location
chdir(CONFIG_DEFAULT_SETFONT_DIR "/consoletrans");
}
}
// fetch keymap
map = xmalloc_open_zipped_read_close(mapfilename, &len);
if (!map)
bb_simple_perror_msg_and_die(mapfilename);
// file size is 256 or 512 bytes? -> assume binary map
if (option_mask32 & 1) { // -m
void *map = xmalloc_open_zipped_read_close(mapfilename, &len);
if (len == E_TABSZ || len == 2*E_TABSZ) {
if (len == 2*E_TABSZ)
mode = PIO_UNISCRNMAP;
xioctl(fd, (len == 2*E_TABSZ) ? PIO_UNISCRNMAP : PIO_SCRNMAP, map);
}
#if ENABLE_FEATURE_SETFONT_TEXTUAL_MAP
// assume textual Unicode console maps:
// 0x00 U+0000 # NULL (NUL)
// 0x01 U+0001 # START OF HEADING (SOH)
// 0x02 U+0002 # START OF TEXT (STX)
// 0x03 U+0003 # END OF TEXT (ETX)
else {
int i;
char *token[2];
parser_t *parser;
if (ENABLE_FEATURE_CLEAN_UP)
free(map);
map = xmalloc(E_TABSZ * sizeof(unsigned short));
#define unicodes ((unsigned short *)map)
// fill vanilla map
for (i = 0; i < E_TABSZ; i++)
unicodes[i] = 0xf000 + i;
parser = config_open(mapfilename);
while (config_read(parser, token, 2, 2, "# \t", PARSE_NORMAL | PARSE_MIN_DIE)) {
// parse code/value pair
int a = ctoi(token[0]);
int b = ctoi(token[1]);
if (a < 0 || a >= E_TABSZ
|| b < 0 || b > 65535
) {
bb_error_msg_and_die("map format");
}
// patch map
unicodes[a] = b;
// unicode character is met?
if (b > 255)
mode = PIO_UNISCRNMAP;
}
if (ENABLE_FEATURE_CLEAN_UP)
config_close(parser);
if (mode != PIO_UNISCRNMAP) {
#define asciis ((unsigned char *)map)
for (i = 0; i < E_TABSZ; i++)
asciis[i] = unicodes[i];
#undef asciis
}
#undef unicodes
}
#endif // ENABLE_FEATURE_SETFONT_TEXTUAL_MAP
// do set screen map
xioctl(fd, mode, map);
if (ENABLE_FEATURE_CLEAN_UP)
free(map);
}
return EXIT_SUCCESS;
+4 -6
View File
@@ -5,7 +5,9 @@
* Copyright (C) 1998 Enrique Zanardi <ezanardi@ull.es>
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
*/
#include "libbb.h"
#define BINARY_KEYMAP_MAGIC "bkeymap"
@@ -29,15 +31,11 @@ int loadkmap_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
struct kbentry ke;
int i, j, fd;
uint16_t ibuff[NR_KEYS];
/* const char *tty_name = CURRENT_TTY; */
RESERVE_CONFIG_BUFFER(flags,MAX_NR_KEYMAPS);
/* bb_warn_ignoring_args(argc >= 2); */
/* bb_warn_ignoring_args(argc>=2);*/
fd = get_console_fd_or_die();
/* or maybe:
opt = getopt32(argv, "C:", &tty_name);
fd = xopen(tty_name, O_NONBLOCK);
*/
xread(STDIN_FILENO, flags, 7);
if (strncmp(flags, BINARY_KEYMAP_MAGIC, 7))
+1 -1
View File
@@ -2,7 +2,7 @@
/*
* resize - set terminal width and height.
*
* Copyright 2006 Bernhard Reutner-Fischer
* Copyright 2006 Bernhard Fischer
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
+1 -1
View File
@@ -3,7 +3,7 @@
* setconsole.c - redirect system console output
*
* Copyright (C) 2004,2005 Enrik Berkhan <Enrik.Berkhan@inka.de>
* Copyright (C) 2008 Bernhard Reutner-Fischer
* Copyright (C) 2008 Bernhard Fischer
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
+3 -3
View File
@@ -72,9 +72,9 @@ int showkey_main(int argc UNUSED_PARAM, char **argv)
// get keyboard settings
xioctl(STDIN_FILENO, KDGKBMODE, &kbmode);
printf("kb mode was %s\n\nPress any keys. Program terminates %s\n\n",
kbmode == K_RAW ? "RAW" :
(kbmode == K_XLATE ? "XLATE" :
(kbmode == K_MEDIUMRAW ? "MEDIUMRAW" :
kbmode == K_RAW ? "RAW" :
(kbmode == K_XLATE ? "XLATE" :
(kbmode == K_MEDIUMRAW ? "MEDIUMRAW" :
(kbmode == K_UNICODE ? "UNICODE" : "?UNKNOWN?")))
, (option_mask32 & OPT_a) ? "when CTRL+D pressed" : "10s after last keypress"
);
+5 -5
View File
@@ -136,12 +136,12 @@ config DF
df reports the amount of disk space used and available
on filesystems.
config FEATURE_DF_FANCY
bool "Enable -a, -i, -B"
config FEATURE_DF_INODE
bool "Enable -i (inode information)"
default n
depends on DF
help
This option enables -a, -i and -B.
This option enables support for df -i.
config DIRNAME
bool "dirname"
@@ -189,7 +189,7 @@ config ECHO
config FEATURE_FANCY_ECHO
bool "Enable echo options (-n and -e)"
default y
depends on ECHO || ASH_BUILTIN_ECHO
depends on ECHO
help
This adds options (-n and -e) to echo.
@@ -649,7 +649,7 @@ config TEST
config FEATURE_TEST_64
bool "Extend test to 64 bit"
default n
depends on TEST || ASH_BUILTIN_TEST
depends on TEST
help
Enable 64-bit support in test.
-1
View File
@@ -48,6 +48,5 @@ int basename_main(int argc, char **argv)
/* puts(s) will do, but we can do without stdio this way: */
s[m++] = '\n';
/* NB: != is correct here: */
return full_write(STDOUT_FILENO, s, m) != (ssize_t)m;
}
+5 -13
View File
@@ -13,7 +13,7 @@ int cksum_main(int argc UNUSED_PARAM, char **argv)
{
uint32_t *crc32_table = crc32_filltable(NULL, 1);
uint32_t crc;
off_t length, filesize;
long length, filesize;
int bytes_read;
uint8_t *cp;
@@ -44,19 +44,11 @@ int cksum_main(int argc UNUSED_PARAM, char **argv)
filesize = length;
while (length) {
crc = (crc << 8) ^ crc32_table[(uint8_t)(crc >> 24) ^ (uint8_t)length];
/* must ensure that shift is unsigned! */
if (sizeof(length) <= sizeof(unsigned))
length = (unsigned)length >> 8;
else if (sizeof(length) <= sizeof(unsigned long))
length = (unsigned long)length >> 8;
else
length = (unsigned long long)length >> 8;
}
crc = ~crc;
for (; length; length >>= 8)
crc = (crc << 8) ^ crc32_table[((crc >> 24) ^ length) & 0xff];
crc ^= 0xffffffffL;
printf((*argv ? "%"PRIu32" %"OFF_FMT"i %s\n" : "%"PRIu32" %"OFF_FMT"i\n"),
printf((*argv ? "%" PRIu32 " %li %s\n" : "%" PRIu32 " %li\n"),
crc, filesize, *argv);
} while (*argv && *++argv);
+1 -1
View File
@@ -4,7 +4,7 @@
*
* Copyright (C) 1999,2000,2001 by Lineo, inc.
* Written by Mark Whitley <markw@codepoet.org>
* debloated by Bernhard Reutner-Fischer
* debloated by Bernhard Fischer
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
+1 -1
View File
@@ -5,7 +5,7 @@
* by Matthew Grant <grantma@anathoth.gen.nz>
*
* iso-format handling added by Robert Griebl <griebl@gmx.de>
* bugfixes and cleanup by Bernhard Reutner-Fischer
* bugfixes and cleanup by Bernhard Fischer
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
+37 -60
View File
@@ -8,7 +8,7 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
/* BB_AUDIT SUSv3 _NOT_ compliant -- option -t missing. */
/* BB_AUDIT SUSv3 _NOT_ compliant -- options -P and -t missing. Also blocksize. */
/* http://www.opengroup.org/onlinepubs/007904975/utilities/df.html */
/* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org)
@@ -16,10 +16,6 @@
* Size reduction. Removed floating point dependency. Added error checking
* on output. Output stats on 0-sized filesystems if specifically listed on
* the command line. Properly round *-blocks, Used, and Available quantities.
*
* Aug 28, 2008 Bernhard Reutner-Fischer
*
* Implement -P and -B; better coreutils compat; cleanup
*/
#include <mntent.h>
@@ -38,73 +34,51 @@ int df_main(int argc, char **argv)
{
unsigned long blocks_used;
unsigned blocks_percent_used;
unsigned long df_disp_hr = 1024;
#if ENABLE_FEATURE_HUMAN_READABLE
unsigned df_disp_hr = 1024;
#endif
int status = EXIT_SUCCESS;
unsigned opt;
FILE *mount_table;
struct mntent *mount_entry;
struct statfs s;
static const char ignored_mounts[] ALIGN1 =
"rootfs\0";
/* default display is kilobytes */
const char *disp_units_hdr = "1k-blocks";
enum {
OPT_KILO = (1 << 0),
OPT_POSIX = (1 << 1),
OPT_ALL = (1 << 2) * ENABLE_FEATURE_DF_FANCY,
OPT_INODE = (1 << 3) * ENABLE_FEATURE_DF_FANCY,
OPT_BSIZE = (1 << 4) * ENABLE_FEATURE_DF_FANCY,
OPT_HUMAN = (1 << 5) * ENABLE_FEATURE_HUMAN_READABLE,
OPT_MEGA = (1 << 6) * ENABLE_FEATURE_HUMAN_READABLE,
OPT_ALL = (1 << 0),
OPT_INODE = (ENABLE_FEATURE_HUMAN_READABLE ? (1 << 4) : (1 << 2))
* ENABLE_FEATURE_DF_INODE
};
const char *disp_units_hdr = NULL;
char *chp;
#if ENABLE_FEATURE_HUMAN_READABLE && ENABLE_FEATURE_DF_FANCY
opt_complementary = "k-mB:m-Bk:B-km";
#elif ENABLE_FEATURE_HUMAN_READABLE
opt_complementary = "k-m:m-k";
#endif
opt = getopt32(argv, "kP"
USE_FEATURE_DF_FANCY("aiB:")
USE_FEATURE_HUMAN_READABLE("hm")
USE_FEATURE_DF_FANCY(, &chp));
if (opt & OPT_MEGA)
df_disp_hr = 1024*1024;
if (opt & OPT_BSIZE)
df_disp_hr = xatoul_range(chp, 1, ULONG_MAX); /* disallow 0 */
/* From the manpage of df from coreutils-6.10:
Disk space is shown in 1K blocks by default, unless the environment
variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used.
*/
if (getenv("POSIXLY_CORRECT")) /* TODO - a new libbb function? */
df_disp_hr = 512;
if (opt & OPT_HUMAN) {
#if ENABLE_FEATURE_HUMAN_READABLE
opt_complementary = "h-km:k-hm:m-hk";
opt = getopt32(argv, "ahmk" USE_FEATURE_DF_INODE("i"));
if (opt & (1 << 1)) { // -h
df_disp_hr = 0;
disp_units_hdr = " Size";
}
if (opt & OPT_INODE)
disp_units_hdr = " Inodes";
if (disp_units_hdr == NULL) {
#if ENABLE_FEATURE_HUMAN_READABLE
disp_units_hdr = xasprintf("%s-blocks",
make_human_readable_str(df_disp_hr, 0, !!(opt & OPT_POSIX)));
#else
disp_units_hdr = xasprintf("%lu-blocks", df_disp_hr);
#endif
if (opt & (1 << 2)) { // -m
df_disp_hr = 1024*1024;
disp_units_hdr = "1M-blocks";
}
printf("Filesystem %-15sUsed Available %s Mounted on\n",
disp_units_hdr, (opt & OPT_POSIX) ? "Capacity" : "Use%");
if (opt & OPT_INODE) {
disp_units_hdr = " Inodes";
}
#else
opt = getopt32(argv, "ak" USE_FEATURE_DF_INODE("i"));
#endif
printf("Filesystem %-15sUsed Available Use%% Mounted on\n",
disp_units_hdr);
mount_table = NULL;
argv += optind;
if (optind >= argc) {
mount_table = setmntent(bb_path_mtab_file, "r");
if (!mount_table)
if (!mount_table) {
bb_perror_msg_and_die(bb_path_mtab_file);
}
}
while (1) {
@@ -119,8 +93,9 @@ int df_main(int argc, char **argv)
}
} else {
mount_point = *argv++;
if (!mount_point)
if (!mount_point) {
break;
}
mount_entry = find_mount_point(mount_point, bb_path_mtab_file);
if (!mount_entry) {
bb_error_msg("%s: can't find mount point", mount_point);
@@ -143,9 +118,10 @@ int df_main(int argc, char **argv)
s.f_blocks = s.f_files;
s.f_bavail = s.f_bfree = s.f_ffree;
s.f_bsize = 1;
#if ENABLE_FEATURE_HUMAN_READABLE
if (df_disp_hr)
df_disp_hr = 1;
#endif
}
blocks_used = s.f_blocks - s.f_bfree;
blocks_percent_used = 0;
@@ -155,10 +131,11 @@ int df_main(int argc, char **argv)
) / (blocks_used + s.f_bavail);
}
/* GNU coreutils 6.10 skip certain mounts, try to be compatible. */
if (index_in_strings(device, ignored_mounts) != -1)
#ifdef WHY_IT_SHOULD_BE_HIDDEN
if (strcmp(device, "rootfs") == 0) {
continue;
}
#endif
#ifdef WHY_WE_DO_IT_FOR_DEV_ROOT_ONLY
/* ... and also this is the only user of find_block_device */
if (strcmp(device, "/dev/root") == 0) {
@@ -187,12 +164,12 @@ int df_main(int argc, char **argv)
#else
printf(" %9lu %9lu %9lu %3u%% %s\n",
kscale(s.f_blocks, s.f_bsize),
kscale(s.f_blocks - s.f_bfree, s.f_bsize),
kscale(s.f_blocks-s.f_bfree, s.f_bsize),
kscale(s.f_bavail, s.f_bsize),
blocks_percent_used, mount_point);
#endif
}
}
return status;
fflush_stdout_and_exit(status);
}
+80 -174
View File
@@ -3,218 +3,124 @@
* Mini id implementation for busybox
*
* Copyright (C) 2000 by Randolph Chung <tausq@debian.org>
* Copyright (C) 2008 by Tito Ragusa <farmatito@tiscali.it>
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
/* BB_AUDIT SUSv3 compliant. */
/* Hacked by Tito Ragusa (C) 2004 to handle usernames of whatever
* length and to be more similar to GNU id.
/* BB_AUDIT SUSv3 _NOT_ compliant -- option -G is not currently supported. */
/* 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 <ynakam@hitachisoft.jp>
* Added -G option Tito Ragusa (C) 2008 for SUSv3.
*/
#include "libbb.h"
#if !ENABLE_USE_BB_PWD_GRP
#if defined(__UCLIBC_MAJOR__) && (__UCLIBC_MAJOR__ == 0)
#if (__UCLIBC_MINOR__ < 9) || (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ < 30)
#error "Sorry, you need at least uClibc version 0.9.30 for id applet to build"
#endif
#endif
#endif
enum {
PRINT_REAL = (1 << 0),
NAME_NOT_NUMBER = (1 << 1),
JUST_USER = (1 << 2),
JUST_GROUP = (1 << 3),
JUST_ALL_GROUPS = (1 << 4),
#define PRINT_REAL 1
#define NAME_NOT_NUMBER 2
#define JUST_USER 4
#define JUST_GROUP 8
#if ENABLE_SELINUX
JUST_CONTEXT = (1 << 5),
#define JUST_CONTEXT 16
#endif
};
static int print_common(unsigned id,
char* FAST_FUNC bb_getXXXid(char *name, int bufsize, long uid),
const char *prefix)
static int printf_full(unsigned int id, const char *arg, const char prefix)
{
const char *name = bb_getXXXid(NULL, 0, id);
const char *fmt = "%cid=%u";
int status = EXIT_FAILURE;
if (prefix) {
printf("%s", prefix);
if (arg) {
fmt = "%cid=%u(%s)";
status = EXIT_SUCCESS;
}
if (!(option_mask32 & NAME_NOT_NUMBER) || !name) {
printf("%u", id);
}
if (!option_mask32 || (option_mask32 & NAME_NOT_NUMBER)) {
if (name) {
printf(option_mask32 ? "%s" : "(%s)", name);
} else {
/* Don't set error status flag in default mode */
if (option_mask32) {
if (ENABLE_DESKTOP)
bb_error_msg("unknown ID %u", id);
return EXIT_FAILURE;
}
}
}
return EXIT_SUCCESS;
}
static int print_group(gid_t id, const char *prefix)
{
return print_common(id, bb_getgrgid, prefix);
}
static int print_user(uid_t id, const char *prefix)
{
return print_common(id, bb_getpwuid, prefix);
}
/* On error set *n < 0 and return >= 0
* If *n is too small, update it and return < 0
* (ok to trash groups[] in both cases)
* Otherwise fill in groups[] and return >= 0
*/
static int get_groups(const char *username, gid_t rgid, gid_t *groups, int *n)
{
int m;
if (username) {
/* If the user is a member of more than
* *n groups, then -1 is returned. Otherwise >= 0.
* (and no defined way of detecting errors?!) */
m = getgrouplist(username, rgid, groups, n);
/* I guess *n < 0 might indicate error. Anyway,
* malloc'ing -1 bytes won't be good, so: */
//if (*n < 0)
// return 0;
//return m;
//commented out here, happens below anyway
} else {
/* On error -1 is returned, which ends up in *n */
int nn = getgroups(*n, groups);
/* 0: nn <= *n, groups[] was big enough; -1 otherwise */
m = - (nn > *n);
*n = nn;
}
if (*n < 0)
return 0; /* error, don't return < 0! */
return m;
printf(fmt, prefix, id, arg);
return status;
}
int id_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int id_main(int argc UNUSED_PARAM, char **argv)
{
uid_t ruid;
gid_t rgid;
uid_t euid;
gid_t egid;
unsigned opt;
int i;
int status = EXIT_SUCCESS;
const char *prefix;
const char *username;
struct passwd *p;
uid_t uid;
gid_t gid;
unsigned long flags;
short status;
#if ENABLE_SELINUX
security_context_t scontext = NULL;
security_context_t scontext;
#endif
/* Don't allow -n -r -nr -ug -rug -nug -rnug -uZ -gZ -GZ*/
/* Don't allow -n -r -nr -ug -rug -nug -rnug */
/* Don't allow more than one username */
opt_complementary = "?1:u--g:g--u:G--u:u--G:g--G:G--g:r?ugG:n?ugG"
USE_SELINUX(":u--Z:Z--u:g--Z:Z--g:G--Z:Z--G");
opt = getopt32(argv, "rnugG" USE_SELINUX("Z"));
opt_complementary = "?1:u--g:g--u:r?ug:n?ug" USE_SELINUX(":u--Z:Z--u:g--Z:Z--g");
flags = getopt32(argv, "rnug" USE_SELINUX("Z"));
username = argv[optind];
if (username) {
struct passwd *p = getpwnam(username);
if (!p)
bb_error_msg_and_die("unknown user %s", username);
euid = ruid = p->pw_uid;
egid = rgid = p->pw_gid;
} else {
egid = getegid();
rgid = getgid();
euid = geteuid();
ruid = getuid();
/* This values could be overwritten later */
uid = geteuid();
gid = getegid();
if (flags & PRINT_REAL) {
uid = getuid();
gid = getgid();
}
/* JUST_ALL_GROUPS ignores -r PRINT_REAL flag even if man page for */
/* id says: print the real ID instead of the effective ID, with -ugG */
/* in fact in this case egid is always printed if egid != rgid */
if (!opt || (opt & JUST_ALL_GROUPS)) {
gid_t *groups;
int n;
if (!opt) {
/* Default Mode */
status |= print_user(ruid, "uid=");
status |= print_group(rgid, " gid=");
if (euid != ruid)
status |= print_user(euid, " euid=");
if (egid != rgid)
status |= print_group(egid, " egid=");
if (argv[optind]) {
p = getpwnam(argv[optind]);
/* xuname2uid is needed because it exits on failure */
uid = xuname2uid(argv[optind]);
gid = p->pw_gid;
/* in this case PRINT_REAL is the same */
}
if (flags & (JUST_GROUP | JUST_USER USE_SELINUX(| JUST_CONTEXT))) {
/* JUST_GROUP and JUST_USER are mutually exclusive */
if (flags & NAME_NOT_NUMBER) {
/* bb_getXXXid(-1) exit on failure, puts cannot segfault */
puts((flags & JUST_USER) ? bb_getpwuid(NULL, -1, uid) : bb_getgrgid(NULL, -1, gid));
} else {
/* JUST_ALL_GROUPS */
status |= print_group(rgid, NULL);
if (egid != rgid)
status |= print_group(egid, " ");
}
/* We are supplying largish buffer, trying
* to not run get_groups() twice. That might be slow
* ("user database in remote SQL server" case) */
groups = xmalloc(64 * sizeof(gid_t));
n = 64;
if (get_groups(username, rgid, groups, &n) < 0) {
/* Need bigger buffer after all */
groups = xrealloc(groups, n * sizeof(gid_t));
get_groups(username, rgid, groups, &n);
}
if (n > 0) {
/* Print the list */
prefix = " groups=";
for (i = 0; i < n; i++) {
if (opt && (groups[i] == rgid || groups[i] == egid))
continue;
status |= print_group(groups[i], opt ? " " : prefix);
prefix = ",";
if (flags & JUST_USER) {
printf("%u\n", uid);
}
if (flags & JUST_GROUP) {
printf("%u\n", gid);
}
} else if (n < 0) { /* error in get_groups() */
if (!ENABLE_DESKTOP)
bb_error_msg_and_die("cannot get groups");
else
return EXIT_FAILURE;
}
if (ENABLE_FEATURE_CLEAN_UP)
free(groups);
#if ENABLE_SELINUX
if (is_selinux_enabled()) {
if (getcon(&scontext) == 0)
printf(" context=%s", scontext);
if (flags & JUST_CONTEXT) {
selinux_or_die();
if (argc - optind == 1) {
bb_error_msg_and_die("user name can't be passed with -Z");
}
if (getcon(&scontext)) {
bb_error_msg_and_die("can't get process context");
}
puts(scontext);
}
#endif
} else if (opt & PRINT_REAL) {
euid = ruid;
egid = rgid;
/* exit */
fflush_stdout_and_exit(EXIT_SUCCESS);
}
if (opt & JUST_USER)
status |= print_user(euid, NULL);
else if (opt & JUST_GROUP)
status |= print_group(egid, NULL);
/* Print full info like GNU id */
/* bb_getpwuid(0) doesn't exit on failure (returns NULL) */
status = printf_full(uid, bb_getpwuid(NULL, 0, uid), 'u');
bb_putchar(' ');
status |= printf_full(gid, bb_getgrgid(NULL, 0, gid), 'g');
#if ENABLE_SELINUX
else if (opt & JUST_CONTEXT) {
selinux_or_die();
if (username || getcon(&scontext)) {
bb_error_msg_and_die("can't get process context%s",
username ? " for a different user" : "");
if (is_selinux_enabled()) {
security_context_t mysid;
const char *context;
context = "unknown";
getcon(&mysid);
if (mysid) {
context = alloca(strlen(mysid) + 1);
strcpy((char*)context, mysid);
freecon(mysid);
}
fputs(scontext, stdout);
printf(" context=%s", context);
}
/* freecon(NULL) seems to be harmless */
if (ENABLE_FEATURE_CLEAN_UP)
freecon(scontext);
#endif
bb_putchar('\n');
fflush_stdout_and_exit(status);
}
-244
View File
@@ -1,244 +0,0 @@
#!/bin/bash
# Test script for busybox id vs. coreutils id.
# Needs root privileges for some tests.
cp /usr/bin/id .
BUSYBOX=./busybox
ID=./id
LIST=`awk -F: '{ printf "%s\n", $1 }' /etc/passwd`
FLAG_USER_EXISTS="no"
TEST_USER="f583ca884c1d93458fb61ed137ff44f6"
echo "test 1: id [options] nousername"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
$BUSYBOX id $OPTIONS >foo 2>/dev/null
RET1=$?
$ID $OPTIONS >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
done
echo "test 2: id [options] username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
for i in $LIST ; do
if test "$i" = "$TEST_USER"; then
FLAG_USER_EXISTS="yes"
fi
$BUSYBOX id $OPTIONS $i >foo 2>/dev/null
RET1=$?
$ID $OPTIONS $i >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
done
done
if test $FLAG_USER_EXISTS = "yes"; then
echo "test 3,4,5,6,7,8,9,10,11,12 skipped because test user $TEST_USER already exists"
rm -f foo bar
exit 1
fi
adduser -s /bin/true -g "" -H -D "$TEST_USER" || exit 1
chown $TEST_USER.$TEST_USER $BUSYBOX
chmod u+s $BUSYBOX 2>&1 /dev/null
chown $TEST_USER.$TEST_USER $ID
chmod u+s $ID 2>&1 /dev/null
echo "test 3 setuid, existing user: id [options] no username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
$BUSYBOX id $OPTIONS >foo 2>/dev/null
RET1=$?
$ID $OPTIONS >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
#done
done
echo "test 4 setuid, existing user: id [options] username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
for i in $LIST ; do
$BUSYBOX id $OPTIONS $i >foo 2>/dev/null
RET1=$?
$ID $OPTIONS $i >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
done
done
chown $TEST_USER.$TEST_USER $BUSYBOX
chmod g+s $BUSYBOX 2>&1 /dev/null
chown $TEST_USER.$TEST_USER $ID
chmod g+s $ID 2>&1 /dev/null
echo "test 5 setgid, existing user: id [options] no username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
$BUSYBOX id $OPTIONS >foo 2>/dev/null
RET1=$?
$ID $OPTIONS >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
#done
done
echo "test 6 setgid, existing user: id [options] username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
for i in $LIST ; do
$BUSYBOX id $OPTIONS $i >foo 2>/dev/null
RET1=$?
$ID $OPTIONS $i >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
done
done
chown $TEST_USER.$TEST_USER $BUSYBOX
chmod u+s,g+s $BUSYBOX 2>&1 /dev/null
chown $TEST_USER.$TEST_USER $ID
chmod u+s,g+s $ID 2>&1 /dev/null
echo "test 7 setuid, setgid, existing user: id [options] no username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
$BUSYBOX id $OPTIONS >foo 2>/dev/null
RET1=$?
$ID $OPTIONS >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
#done
done
echo "test 8 setuid, setgid, existing user: id [options] username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
for i in $LIST ; do
$BUSYBOX id $OPTIONS $i >foo 2>/dev/null
RET1=$?
$ID $OPTIONS $i >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
done
done
deluser $TEST_USER || exit 1
echo "test 9 setuid, setgid, not existing user: id [options] no username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
$BUSYBOX id $OPTIONS >foo 2>/dev/null
RET1=$?
$ID $OPTIONS >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
done
echo "test 10 setuid, setgid, not existing user: id [options] username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
for i in $LIST ; do
$BUSYBOX id $OPTIONS $i >foo 2>/dev/null
RET1=$?
$ID $OPTIONS $i >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
done
done
chown .root $BUSYBOX 2>&1 /dev/null
chown .root $ID 2>&1 /dev/null
chmod g+s $BUSYBOX 2>&1 /dev/null
chmod g+s $ID 2>&1 /dev/null
echo "test 11 setgid, not existing group: id [options] no username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
$BUSYBOX id $OPTIONS >foo 2>/dev/null
RET1=$?
$ID $OPTIONS >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
#done
done
echo "test 12 setgid, not existing group: id [options] username"
rm -f foo bar
for OPTIONS in "" "-u" "-un" "-unr" "-g" "-gn" "-gnr" "-G" "-Gn" "-Gnr"
do
#echo "$OPTIONS"
for i in $LIST ; do
$BUSYBOX id $OPTIONS $i >foo 2>/dev/null
RET1=$?
$ID $OPTIONS $i >bar 2>/dev/null
RET2=$?
if test "$RET1" != "$RET2"; then
echo "Return Values differ ($RET1 != $RET2): options $OPTIONS"
fi
diff foo bar
done
done
chown root.root $BUSYBOX 2>&1 /dev/null
chown root.root $ID 2>&1 /dev/null
rm -f $ID
rm -f foo bar
+27 -34
View File
@@ -4,6 +4,9 @@
* SELinux support: by Yuichi Nakamura <ynakam@hitachisoft.jp>
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
* TODO: -d option, need a way of recursively making directories and changing
* owner/group, will probably modify bb_make_directory(...)
*/
#include "libbb.h"
@@ -50,8 +53,7 @@ static void setdefaultfilecon(const char *path)
if (lsetfilecon(path, scontext) < 0) {
if (errno != ENOTSUP) {
bb_perror_msg("warning: failed to change context"
" of %s to %s", path, scontext);
bb_perror_msg("warning: failed to change context of %s to %s", path, scontext);
}
}
@@ -73,7 +75,7 @@ int install_main(int argc, char **argv)
const char *uid_str;
const char *mode_str;
int copy_flags = FILEUTILS_DEREFERENCE | FILEUTILS_FORCE;
int opts;
int flags;
int min_args = 1;
int ret = EXIT_SUCCESS;
int isdir = 0;
@@ -85,16 +87,15 @@ int install_main(int argc, char **argv)
OPT_c = 1 << 0,
OPT_v = 1 << 1,
OPT_b = 1 << 2,
OPT_MKDIR_LEADING = 1 << 3,
OPT_DIRECTORY = 1 << 4,
OPT_PRESERVE_TIME = 1 << 5,
OPT_STRIP = 1 << 6,
OPT_GROUP = 1 << 7,
OPT_MODE = 1 << 8,
OPT_OWNER = 1 << 9,
OPT_DIRECTORY = 1 << 3,
OPT_PRESERVE_TIME = 1 << 4,
OPT_STRIP = 1 << 5,
OPT_GROUP = 1 << 6,
OPT_MODE = 1 << 7,
OPT_OWNER = 1 << 8,
#if ENABLE_SELINUX
OPT_SET_SECURITY_CONTEXT = 1 << 10,
OPT_PRESERVE_SECURITY_CONTEXT = 1 << 11,
OPT_SET_SECURITY_CONTEXT = 1 << 9,
OPT_PRESERVE_SECURITY_CONTEXT = 1 << 10,
#endif
};
@@ -105,38 +106,37 @@ int install_main(int argc, char **argv)
/* -c exists for backwards compatibility, it's needed */
/* -v is ignored ("print name of each created directory") */
/* -b is ignored ("make a backup of each existing destination file") */
opts = getopt32(argv, "cvb" "Ddpsg:m:o:" USE_SELINUX("Z:"),
flags = getopt32(argv, "cvb" "dpsg:m:o:" USE_SELINUX("Z:"),
&gid_str, &mode_str, &uid_str USE_SELINUX(, &scontext));
argc -= optind;
argv += optind;
#if ENABLE_SELINUX
if (opts & (OPT_PRESERVE_SECURITY_CONTEXT|OPT_SET_SECURITY_CONTEXT)) {
if (flags & (OPT_PRESERVE_SECURITY_CONTEXT|OPT_SET_SECURITY_CONTEXT)) {
selinux_or_die();
use_default_selinux_context = 0;
if (opts & OPT_PRESERVE_SECURITY_CONTEXT) {
if (flags & OPT_PRESERVE_SECURITY_CONTEXT) {
copy_flags |= FILEUTILS_PRESERVE_SECURITY_CONTEXT;
}
if (opts & OPT_SET_SECURITY_CONTEXT) {
if (flags & OPT_SET_SECURITY_CONTEXT) {
setfscreatecon_or_die(scontext);
copy_flags |= FILEUTILS_SET_SECURITY_CONTEXT;
}
}
#endif
/* preserve access and modification time, this is GNU behaviour,
* BSD only preserves modification time */
if (opts & OPT_PRESERVE_TIME) {
/* preserve access and modification time, this is GNU behaviour, BSD only preserves modification time */
if (flags & OPT_PRESERVE_TIME) {
copy_flags |= FILEUTILS_PRESERVE_STATUS;
}
mode = 0666;
if (opts & OPT_MODE)
if (flags & OPT_MODE)
bb_parse_mode(mode_str, &mode);
uid = (opts & OPT_OWNER) ? get_ug_id(uid_str, xuname2uid) : getuid();
gid = (opts & OPT_GROUP) ? get_ug_id(gid_str, xgroup2gid) : getgid();
uid = (flags & OPT_OWNER) ? get_ug_id(uid_str, xuname2uid) : getuid();
gid = (flags & OPT_GROUP) ? get_ug_id(gid_str, xgroup2gid) : getgid();
last = argv[argc - 1];
if (!(opts & OPT_DIRECTORY)) {
if (!(flags & OPT_DIRECTORY)) {
argv[argc - 1] = NULL;
min_args++;
@@ -149,7 +149,7 @@ int install_main(int argc, char **argv)
while ((arg = *argv++) != NULL) {
char *dest = last;
if (opts & OPT_DIRECTORY) {
if (flags & OPT_DIRECTORY) {
dest = arg;
/* GNU coreutils 6.9 does not set uid:gid
* on intermediate created directories
@@ -159,13 +159,6 @@ int install_main(int argc, char **argv)
goto next;
}
} else {
if (opts & OPT_MKDIR_LEADING) {
char *ddir = xstrdup(dest);
bb_make_directory(dirname(ddir), 0755, FILEUTILS_RECUR);
/* errors are not checked. copy_file
* will fail if dir is not created. */
free(ddir);
}
if (isdir)
dest = concat_path_file(last, basename(arg));
if (copy_file(arg, dest, copy_flags)) {
@@ -176,7 +169,7 @@ int install_main(int argc, char **argv)
}
/* Set the file mode */
if ((opts & OPT_MODE) && chmod(dest, mode) == -1) {
if ((flags & OPT_MODE) && chmod(dest, mode) == -1) {
bb_perror_msg("can't change %s of %s", "permissions", dest);
ret = EXIT_FAILURE;
}
@@ -185,13 +178,13 @@ int install_main(int argc, char **argv)
setdefaultfilecon(dest);
#endif
/* Set the user and group id */
if ((opts & (OPT_OWNER|OPT_GROUP))
if ((flags & (OPT_OWNER|OPT_GROUP))
&& lchown(dest, uid, gid) == -1
) {
bb_perror_msg("can't change %s of %s", "ownership", dest);
ret = EXIT_FAILURE;
}
if (opts & OPT_STRIP) {
if (flags & OPT_STRIP) {
char *args[3];
args[0] = (char*)"strip";
args[1] = dest;
+1 -1
View File
@@ -5,7 +5,7 @@
* http://www.opengroup.org/onlinepubs/007904975/utilities/nohup.html
*
* Copyright 2006 Rob Landley <rob@landley.net>
* Copyright 2006 Bernhard Reutner-Fischer
* Copyright 2006 Bernhard Fischer
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
+1 -1
View File
@@ -1,7 +1,7 @@
/* vi: set sw=4 ts=4: */
/*
* split - split a file into pieces
* Copyright (c) 2007 Bernhard Reutner-Fischer
* Copyright (c) 2007 Bernhard Fischer
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* modified by Herbert Xu to be used as built-in in ash.
* modified by Erik Andersen <andersen@codepoet.org> to be used
* in busybox.
* modified by Bernhard Reutner-Fischer to be useable (i.e. a bit less bloaty).
* modified by Bernhard Fischer to be useable (i.e. a bit less bloaty).
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
-1
View File
@@ -64,7 +64,6 @@ config FEATURE_START_STOP_DAEMON_FANCY
Support additional arguments.
-o|--oknodo ignored since we exit with 0 anyway
-v|--verbose
-N|--nicelevel N
config FEATURE_START_STOP_DAEMON_LONG_OPTIONS
bool "Enable long options"
+1 -1
View File
@@ -2,7 +2,7 @@
/*
* Mini run-parts implementation for busybox
*
* Copyright (C) 2007 Bernhard Reutner-Fischer
* Copyright (C) 2007 Bernhard Fischer
*
* Based on a older version that was in busybox which was 1k big..
* Copyright (C) 2001 by Emanuele Aina <emanuele.aina@tiscali.it>
+4 -4
View File
@@ -349,11 +349,11 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv)
opt_complementary = "K:S:K--S:S--K:m?p:K?xpun:S?xa"
USE_FEATURE_START_STOP_DAEMON_FANCY("q-v");
opt = getopt32(argv, "KSbqtma:n:s:u:c:x:p:"
USE_FEATURE_START_STOP_DAEMON_FANCY("ovN:R:"),
USE_FEATURE_START_STOP_DAEMON_FANCY("ovN:"),
// USE_FEATURE_START_STOP_DAEMON_FANCY("ovN:R:"),
&startas, &cmdname, &signame, &userspec, &chuid, &execname, &pidfile
USE_FEATURE_START_STOP_DAEMON_FANCY(,&opt_N)
/* We accept and ignore -R <param> / --retry <param> */
USE_FEATURE_START_STOP_DAEMON_FANCY(,NULL)
// USE_FEATURE_START_STOP_DAEMON_FANCY(,&retry_arg)
);
if (opt & OPT_s) {
@@ -428,7 +428,7 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv)
write_pidfile(pidfile);
}
if (opt & OPT_c) {
struct bb_uidgid_t ugid = { -1, -1 };
struct bb_uidgid_t ugid;
parse_chown_usergroup_or_die(&ugid, chuid);
if (ugid.gid != (gid_t) -1) xsetgid(ugid.gid);
if (ugid.uid != (uid_t) -1) xsetuid(ugid.uid);
-424
View File
@@ -1,424 +0,0 @@
Downloaded from http://www.lafn.org/~dave/linux/Serial-Programming-HOWTO.txt
Seems to be somewhat old, but contains useful bits for getty.c hacking
============================================================================
The Linux Serial Programming HOWTO, Part 1 of 2
By Vernon C. Hoxie
v2.0 10 September 1999
This document describes how to program communications with devices
over a serial port on a Linux box.
______________________________________________________________________
Table of Contents
1. Copyright
2. Introduction
3. Opening
4. Commands
5. Changing Baud Rates
6. Additional Control Calls
6.1 Sending a "break".
6.2 Hardware flow control.
6.3 Flushing I/O buffers.
7. Modem control
8. Process Groups
8.1 Sessions
8.2 Process Groups
8.3 Controlling Terminal
8.3.1 Get the foreground group process id.
8.3.2 Set the foreground process group id of a terminal.
8.3.3 Get process group id.
9. Lockfiles
10. Additional Information
11. Feedback
______________________________________________________________________
1. Copyright
The Linux Serial-Programming-HOWTO is copyright (C) 1997 by Vernon
Hoxie. Linux HOWTO documents may be reproduced and distributed in
whole or in part, in any medium physical or electronic, as long as
this copyright notice is retained on all copies. Commercial
redistribution is allowed and encouraged; however, the author would
like to be notified of any such distributions.
All translations, derivative works, or aggregate works incorporating
this Linux HOWTO document must be covered under this copyright notice.
That is, you may not produce a derivative work from this HOWTO and
impose additional restrictions on its distribution.
This version is a complete rewrite of the previous Serial-Programming-
HOWTO by Peter H. Baumann, <mailto:Peter.Baumann@dlr.de>
2. Introduction
This HOWTO will attempt to give hints about how to write a program
which needs to access a serial port. Its principal focus will be on
the Linux implementation and what the meaning of the various library
functions available.
Someone asked about which of several sequences of operations was
right. There is no absolute right way to accomplish an outcome. The
options available are too numerous. If your sequences produces the
desired results, then that is the right way for you. Another
programmer may select another set of options and get the same results.
His method is right for him.
Neither of these methods may operate properly with some other
implementation of UNIX. It is strange that many of the concepts which
were implemented in the SYSV version have been dumped. Because UNIX
was developed by AT&T and much code has been generated on those
concepts, the AT&T version should be the standard to which others
should emulate.
Now the standard is POSIX.
It was once stated that the popularity of UNIX and C was that they
were created by programmers for programmers. Not by scholars who
insist on purity of style in deference to results and simplicity of
use. Not by committees with people who have diverse personal or
proprietary agenda. Now ANSI and POSIX have strayed from those
original clear and simply concepts.
3. Opening
The various serial devices are opened just as any other file.
Although, the fopen(3) command may be used, the plain open(2) is
preferred. This call returns the file descriptor which is required
for the various commands that configure the interface.
Open(2) has the format:
#include <fcntl.h>
int open(char *path, int flags, [int mode]);
In addition to the obvious O_RDWR, O_WRONLY and O_RDONLY, two
additional flags are available. These are O_NONBLOCK and O_NOCTTY.
Other flags listed in the open(2) manual page are not applicable to
serial devices.
Normally, a serial device opens in "blocking" mode. This means that
the open() will not return until the Carrier Detect line from the port
is active, e.g. modem, is active. When opened with the O_NONBLOCK
flag set, the open() will return immediately regardless of the status
of the DCD line. The "blocking" mode also affects the read() call.
The fcntl(2) command can be used to change the O_NONBLOCK flag anytime
after the device has been opened.
The device driver and the data passing through it are controlled
according to settings in the struct termios. This structure is
defined in "/usr/include/termios.h". In the Linux tree, further
reference is made to "/usr/include/asm/termbits.h".
In blocking mode, a read(2) will block until data is available or a
signal is received. It is still subject to state of the ICANON flag.
When the termios.c_lflag ICANON bit is set, input data is collected
into strings until a NL, EOF or EOL character is received. You can
define these in the termios.c_cc[] array. Also, ERASE and KILL
characters will operate on the incoming data before it is delivered to
the user.
In non-canonical mode, incoming data is quanitified by use of the
c_cc[VMIN and c_cc[VTIME] values in termios.c_cc[].
Some programmers use the select() call to detect the completion of a
read(). This is not the best way of checking for incoming data.
Select() is part of the SOCKETS scheme and too complex for most
applications.
A full explanation of the fields of the termios structure is contained
in termios(7) of the Users Manual. A version is included in Part 2 of
this HOWTO document.
4. Commands
Changes to the struct termios are made by retrieving the current
settings, making the desired changes and transmitting the modified
structure back to the kernel.
The historic means of communicating with the kernel was by use of the
ioctl(fd, COMMAND, arg) system call. Then the purists in the
computer industry decided that this was not genetically consistent.
Their argument was that the argument changed its stripes. Sometimes
it was an int, sometimes it was a pointer to int and other times it
was a pointer to struct termios. Then there were those times it was
empty or NULL. These variations are dependent upon the COMMAND.
As a alternative, the tc* series of functions were concocted.
These are:
int tcgetattr(int filedes, struct termios *termios_p);
int tcsetattr(int filedes, int optional_actions,
const struct termios *termios_p);
instead of:
int ioctl(int filedes, int command,
struct termios *termios_p);
where command is TCGETS or one of TCSETS, TCSETSW or TCSETSF.
The TCSETS command is comparable to the TCSANOW optional_action for
the tc* version. These direct the kernel to adopt the changes
immediately. Other pairs are:
command optional_action Meaning
TCSETSW TCSADRAIN Change after all output has drained.
TCSETSF TCSAFLUSH Change after all output has drained
then discard any input characters
not read.
Since the return code from either the ioctl(2) or the tcsetattr(2)
commands only indicate that the command was processed by the kernel.
These do not indicate whether or not the changes were actually
accomplished. Either of these commands should be followed by a call
to:
ioctl(fd, TCGETS, &new_termios);
or:
tcgetattr(fd, &new_termios);
A user function which makes changes to the termios structure should
define two struct termios variables. One of these variables should
contain the desired configuration. The other should contain a copy of
the kernels version. Then after the desired configuration has been
sent to the kernel, another call should be made to retrieve the
kernels version. Then the two compared.
Here is an example of how to add RTS/CTS flow control:
struct termios my_termios;
struct termios new_termios;
tcgetattr(fd, &my_termios);
my_termios.c_flag |= CRTSCTS;
tcsetattr(fd, TCSANOW, &my_termios);
tcgetattr(fd, &new_termios);
if (memcmp(my_termios, new_termios,
sizeof(my_termios)) != 0) {
/* do some error handling */
}
5. Changing Baud Rates
With Linux, the baud rate can be changed using a technique similar to
add/delete RTS/CTS.
struct termios my_termios;
struct termios new_termios;
tcgetattr(fd, &my_termios);
my_termios.c_flag &= ~CBAUD;
my_termios.c_flag |= B19200;
tcsetattr(fd, TCSANOW, &my_termios);
tcgetattr(fd, &new_termios);
if (memcmp(my_termios, new_termios,
sizeof(my_termios)) != 0) {
/* do some error handling */
}
POSIX adds another method. They define:
speed_t cfgetispeed(const struct termios *termios_p);
speed_t cfgetospeed(const struct termios *termios_p);
library calls to extract the current input or output speed from the
struct termios pointed to with *termio_p. This is a variable defined
in the calling process. In practice, the data contained in this
termios, should be obtained by the tcgetattr() call or an ioctl() call
using the TCGETS command.
The companion library calls are:
int cfsetispeed(struct termios *termios_p, speed_t speed);
int cfsetospeed(struct termios *termios_p, speed_t speed);
which are used to change the value of the baud rate in the locally
defined *termios_p. Following either of these calls, either a call to
tcsetattr() or ioctl() with one of TCSETS, TCSETSW or TCSETSF as the
command to transmit the change to the kernel.
The cf* commands are preferred for portability. Some weird Unices use
a considerably different format of termios.
Most implementations of Linux use only the input speed for both input
and output. These functions are defined in the application program by
reference to <termios.h>. In reality, they are in
/usr/include/asm/termbits.h.
6. Additional Control Calls
6.1. Sending a "break".
int ioctl(fd, TCSBRK, int arg);
int tcsendbreak(fd, int arg);
Send a break: Here the action differs between the conventional
ioctl() call and the POSIX call. For the conventional call, an arg of
'0' sets the break control line of the UART for 0.25 seconds. For the
POSIX command, the break line is set for arg times 0.1 seconds.
6.2. Hardware flow control.
int ioctl(fd, TCXONC, int action);
int tcflow(fd, int action);
The action flags are:
o TCOOFF 0 suspend output
o TCOON 1 restart output
o TCIOFF 2 transmit STOP character to suspend input
o TCION 3 transmit START character to restart input
6.3. Flushing I/O buffers.
int ioctl(fd, TCFLSH, queue_selector);
int tcflush(fd, queue_selector);
The queue_selector flags are:
o TCIFLUSH 0 flush any data not yet read from the input buffer
o TCOFLUSH 1 flush any data written to the output buffer but not
yet transmitted
o TCIOFLUSH 2 flush both buffers
7. Modem control
The hardware modem control lines can be monitored or modified by the
ioctl(2) system call. A set of comparable tc* calls apparently do not
exist. The form of this call is:
int ioctl(fd, COMMAND, (int *)flags);
The COMMANDS and their action are:
o TIOCMBIS turn on control lines depending upon which bits are set
in flags.
o TIOCMBIC turn off control lines depending upon which bits are
unset in flags.
o TIOCMGET the appropriate bits are set in flags according to the
current status
o TIOCMSET the state of the UART is changed according to which bits
are set/unset in 'flags'
The bit pattern of flags refer to the following control lines:
o TIOCM_LE Line enable
o TIOCM_DTR Data Terminal Ready
o TIOCM_RTS Request to send
o TIOCM_ST Secondary transmit
o TIOCM_SR Secondary receive
o TIOCM_CTS Clear to send
o TIOCM_CAR Carrier detect
o TIOCM_RNG Ring
o TIOCM_DSR Data set ready
It should be noted that some of these bits are controlled by the modem
and the UART cannot change them but their status can be sensed by
TIOCMGET. Also, most Personal Computers do not provide hardware for
secondary transmit and receive.
There are also a pair of ioctl() to monitor these lines. They are
undocumented as far as I have learned. The commands are TIOCMIWAIT
and TCIOGICOUNT. They also differ between versions of the Linux
kernel.
See the lines.c file in my "serial_suite" for an example of how these
can be used see <ftp://scicom.alphacd.com/pub/linux/serial_suite>
8. Process Groups
8.1. Sessions
8.2. Process Groups
Any newly created process inherits the Process Group of its creator.
The Process Group leader has the same PID as PGID.
8.3. Controlling Terminal
There are a series of ioctl(2) and tc*(2) calls which can be used to
monitor or to change the process group to which the device is
attached.
8.3.1. Get the foreground group process id.
If there is no foreground group, a number not representing an existing
process group is returned. On error, a -1 is returned and errno is
set.
int ioctl(fd, TIOCGPGRP, (pid_t *)pid);
int tcgetpgrp(fd, (pid_t *)pid);
8.3.2. Set the foreground process group id of a terminal.
The fd must be the controlling terminal and be associated with the
session of the calling process.
int ioctl(fd, TIOCSPGRP, (pid_t *)pid);
int tcsetpgrp(fd, (pid_t *)pid);
8.3.3. Get process group id.
int ioctl(fd, TIOCGPGRP, &(pid_t)pid);
int tcgetpgrp(fd, &(pid_t)pid);
9. Lockfiles
Any process which accesses a serial device should first check for the
existence of lock file for the desired device. If such a lock lock
file exists, this means that the device may be in use by another
process.
Check my "libdevlocks-x.x.tgz" at
<ftp://scicom.alphacdc.com/pub/linux> for an example of how these lock
files should be utilized.
10. Additional Information
Check out my "serial_suite.tgz" for more information about programming
the serial ports at <mailto:vern@zebra.alphacdc.com>. There some
examples and some blurbs about setting up modems and comments about
some general considerations.
11. Feedback
Please send me any corrections, questions, comments, suggestions, or
additional material. I would like to improve this HOWTO! Tell me
exactly what you don't understand, or what could be clearer. You can
reach me at <mailto:vern@zebra.alphacdc.com> via email. Please
include the version number of the Serial-Programming-HOWTO when
writing.
-4
View File
@@ -1,5 +1,4 @@
#!/usr/bin/perl -w
# vi: set sw=4 ts=4:
use strict;
use Getopt::Long;
@@ -37,7 +36,6 @@ sub beautify {
s/"\s*$//;
s/%/%%/g;
s/\$/\\\$/g;
s/\@/\\\@/g;
eval qq[ sprintf(qq{$_}) ]
} @line
);
@@ -50,13 +48,11 @@ sub pod_for_usage {
my $usage = shift;
# Sigh. Fixup the known odd-name applets.
# Perhaps we can use some of APPLET_ODDNAME from include/applets.h ?
$name =~ s/dpkg_deb/dpkg-deb/g;
$name =~ s/fsck_minix/fsck.minix/g;
$name =~ s/mkfs_minix/mkfs.minix/g;
$name =~ s/run_parts/run-parts/g;
$name =~ s/start_stop_daemon/start-stop-daemon/g;
$name =~ s/ether_wake/ether-wake/g;
# make options bold
my $trivial = $usage->{trivial};
+42 -45
View File
@@ -16,7 +16,7 @@ have additions to this FAQ document, we would love to add them,
<li><a href="#arch">Which architectures does BusyBox run on?</a></li>
<li><a href="#libc">Which C libraries are supported?</a></li>
<li><a href="#commercial">Can I include BusyBox as part of the software on my device?</a></li>
<li><a href="#external">Where can I find other small utilities since busybox does not include the features I want?</a></li>
<li><a href="#external">Where can I find other small utilities since busybox does not include the features I want?</a></li></li>
<li><a href="#demanding">I demand that you to add &lt;favorite feature&gt; right now! How come you don't answer all my questions on the mailing list instantly? I demand that you help me with all of my problems <em>Right Now</em>!</a></li>
<li><a href="#helpme">I need help with BusyBox! What should I do?</a></li>
<li><a href="#contracts">I need you to add &lt;favorite feature&gt;! Are the BusyBox developers willing to be paid in order to fix bugs or add in &lt;favorite feature&gt;? Are you willing to provide support contracts?</a></li>
@@ -40,26 +40,25 @@ have additions to this FAQ document, we would love to add them,
<ol>
<li><a href="#goals">What are the goals of busybox?</a></li>
<li><a href="#design">What is the design of busybox?</a></li>
<li><a href="#source">How is the source code organized?</a>
<ul>
<li><a href="#source">How is the source code organized?</a></li>
<ul>
<li><a href="#source_applets">The applet directories.</a></li>
<li><a href="#source_libbb">The busybox shared library (libbb)</a></li>
</ul>
</li>
</ul>
<li><a href="#optimize">I want to make busybox even smaller, how do I go about it?</a></li>
<li><a href="#adding">Adding an applet to busybox</a></li>
<li><a href="#standards">What standards does busybox adhere to?</a></li>
<li><a href="#portability">Portability.</a></li>
<li><a href="#tips">Tips and tricks.</a>
<ul>
<li><a href="#tips">Tips and tricks.</a></li>
<ul>
<li><a href="#tips_encrypted_passwords">Encrypted Passwords</a></li>
<li><a href="#tips_vfork">Fork and vfork</a></li>
<li><a href="#tips_short_read">Short reads and writes</a></li>
<li><a href="#tips_memory">Memory used by relocatable code, PIC, and static linking.</a></li>
<li><a href="#tips_kernel_headers">Including Linux kernel headers.</a></li>
</ul>
</li>
<li><a href="#who">Who are the BusyBox developers?</a></li>
</ul>
<li><a href="#who">Who are the BusyBox developers?</a></li>
</ul>
</ol>
@@ -180,19 +179,12 @@ within each applet. More build coverage testing.</p></li>
during compilation. Only gcc and related binutils executables
are prefixed with $(CROSS_COMPILE) in the makefiles.
CROSS_COMPILE can be set on the command line:
</p>
<pre>
make CROSS_COMPILE=arm-linux-uclibcgnueabi-
</pre>
<p>
Alternatively CROSS_COMPILE can be set in the environment.
Default value for CROSS_COMPILE is not to prefix executables.
</p>
<p>
To store the cross-compiler in your .config, set the variable
CONFIG_CROSS_COMPILER_PREFIX accordingly in menuconfig or by
editing the .config file.
</p>
<hr />
<h2><a name="build_system">How do I build a BusyBox-based system?</a></h2>
@@ -215,7 +207,7 @@ within each applet. More build coverage testing.</p></li>
</p>
<p>
To learn how to build a working Linux system entirely from source code,
the place to go is the <a href="http://www.linuxfromscratch.org/">Linux
the place to go is the <a href="http://www.linuxfromscratch.org">Linux
From Scratch</a> project. They have an entire book of step-by-step
instructions you can
<a href="http://www.linuxfromscratch.org/lfs/view/stable/">read online</a>
@@ -230,7 +222,7 @@ within each applet. More build coverage testing.</p></li>
<p>
If you want an automated yet customizable system builder which produces
a BusyBox and uClibc based system, try
<a href="http://buildroot.uclibc.org/">buildroot</a>, which is
<a href="http://buildroot.uclibc.org">buildroot</a>, which is
another project by the maintainer of the uClibc (Erik Andersen).
Download the tarball, extract it, unset CC, make.
For more instructions, see the website.
@@ -316,10 +308,9 @@ within each applet. More build coverage testing.</p></li>
BusyBox mailing list at busybox@busybox.net.</p>
<p> In addition to the mailing list, Erik Andersen (andersee), Manuel Nova
(mjn3), Rob Landley (landley), Mike Frysinger (SpanKY),
Bernhard Reutner-Fischer (blindvt), and other long-time BusyBox developers
are known to hang out on the uClibc IRC channel: #uclibc on
irc.freenode.net. There is a
(mjn3), Rob Landley (landley), Mike Frysinger (SpanKY), Bernhard Fischer
(blindvt), and other long-time BusyBox developers are known to hang out
on the uClibc IRC channel: #uclibc on irc.freenode.net. There is a
<a href="http://ibot.Rikers.org/%23uclibc/">web archive of
daily logs of the #uclibc IRC channel</a> going back to 2002.
</p>
@@ -348,6 +339,16 @@ within each applet. More build coverage testing.</p></li>
maintainer and ask them to recommend someone.
</p>
<p> If you prefer to deal with an organization rather than an individual, Rob
Landley (the current BusyBox maintainer) works for
<a http://www.timesys.com>TimeSys</a>, and Eric Andersen (the previous
busybox maintainer and current uClibc maintainer) owns
<a href="http://codepoet-consulting.com/">CodePoet Consulting</a>. Both
companies offer support contracts and handle new development, and there
are plenty of other companies that do the same.
</p>
<hr />
<h1>Troubleshooting</h1>
@@ -357,7 +358,7 @@ within each applet. More build coverage testing.</p></li>
<p>
If you simply need help with using or configuring BusyBox, please submit a
detailed description of your problem to the BusyBox mailing list at <a
href="mailto:busybox@busybox.net">busybox@busybox.net</a>.
href="mailto:busybox@busybox.net"> busybox@busybox.net</a>.
Please do not send email to individual developers asking
for private help unless you are planning on paying for consulting services.
When we answer questions on the BusyBox mailing list, it helps everyone,
@@ -385,7 +386,7 @@ within each applet. More build coverage testing.</p></li>
</p>
<hr />
<h2><a name="backporting">I'm using an ancient version from the dawn of time and something's broken. Can you backport fixes for free?</a></h2>
<h2><a name="backporting">I'm using an ancient version from the dawn of time and something's broken. Can you backport fixes for free?</h2>
<p>Variants of this one get asked a lot.</p>
@@ -394,7 +395,7 @@ and we're happy to respond to our users' needs. But if you're coming to the
list for free tech support we're going to ask you to upgrade to a current
version before we try to diagnose your problem.</p>
<p>If you're building BusyBox 0.50 with uClibc 0.9.19 and gcc 1.27 there's a
<p>If you're building BusyBox 0.50 with uClibc 0.9.19 and gcc 0.9.26 there's a
fairly large chance that whatever problem you're seeing has already been fixed.
To get that fix, all you have to do is upgrade to a newer version. If you
don't at least _try_ that, you're wasting our time.</p>
@@ -508,7 +509,7 @@ int main(int argc, char *argv)
<h2><a name="tz">How do I change the time zone in busybox?</a></h2>
<p>Busybox has nothing to do with the timezone. Please consult your libc
documentation. (<a href="http://google.com/search?q=uclibc+glibc+timezone">http://google.com/search?q=uclibc+glibc+timezone</a>).</p>
documentation. (<a href='http://google.com/search?q=uclibc+glibc+timezone'>http://google.com/search?q=uclibc+glibc+timezone</a>).</p>
<hr />
<h1>Development</h1>
@@ -784,9 +785,9 @@ successor to ibcs2: <a href="http://www.telly.org/86open/">the 86open
project</a>. That project disbanded in 1999 with the endorsement of an
existing standard: Linux ELF binaries. Since then, the major players at the
time (such as <a
href="http://www-03.ibm.com/servers/aix/products/aixos/linux/index.html">AIX</a>, <a
href="http://www.sun.com/software/solaris/ds/linux_interop.jsp#3">Solaris</a>, and
<a href="http://www.onlamp.com/pub/a/bsd/2000/03/17/linuxapps.html">FreeBSD</a>)
href=http://www-03.ibm.com/servers/aix/products/aixos/linux/index.html>AIX</a>, <a
href=http://www.sun.com/software/solaris/ds/linux_interop.jsp#3>Solaris</a>, and
<a href=http://www.onlamp.com/pub/a/bsd/2000/03/17/linuxapps.html>FreeBSD</a>)
have all either grown Linux support or folded.</p>
<p>The major exceptions are newcomer MacOS X, some embedded environments
@@ -809,7 +810,7 @@ file is at least worth a look. Special-case code in the body of an applet is
something we're trying to avoid.</p>
<hr />
<h2><a name="tips">Programming tips and tricks.</a></h2>
<h2><a name="tips" />Programming tips and tricks.</a></h2>
<p>Various things busybox uses that aren't particularly well documented
elsewhere.</p>
@@ -1047,8 +1048,7 @@ to measure).</p>
<hr />
<h2><a name="tips_kernel_headers"></a>Including kernel headers</h2>
<p>The &quot;linux&quot; or &quot;asm&quot; directories of /usr/include
contain Linux kernel
<p>The "linux" or "asm" directories of /usr/include contain Linux kernel
headers, so that the C library can talk directly to the Linux kernel. In
a perfect world, applications shouldn't include these headers directly, but
we don't live in a perfect world.</p>
@@ -1058,7 +1058,7 @@ we don't live in a perfect world.</p>
Attempts to cut and paste the information into a local busybox header file
proved incredibly painful, because portions of the loop_info structure vary by
architecture, namely the type __kernel_dev_t has different sizes on alpha,
arm, x86, and so on. Meaning we either #include &lt;linux/posix_types.h&gt; or
arm, x86, and so on. Meaning we either #include <linux/posix_types.h> or
we hardwire #ifdefs to check what platform we're building on and define this
type appropriately for every single hardware architecture supported by
Linux, which is simply unworkable.</p>
@@ -1066,8 +1066,7 @@ Linux, which is simply unworkable.</p>
<p>This is aside from the fact that the relevant type defined in
posix_types.h was renamed to __kernel_old_dev_t during the 2.5 series, so
to cut and paste the structure into our header we have to #include
&lt;linux/version.h&gt; to figure out which name to use. (What we actually
do is
<linux/version.h> to figure out which name to use. (What we actually do is
check if we're building on 2.6, and if so just use the new 64 bit structure
instead to avoid the rename entirely.) But we still need the version
check, since 2.4 didn't have the 64 bit structure.</p>
@@ -1076,9 +1075,8 @@ check, since 2.4 didn't have the 64 bit structure.</p>
out a clean way to do all this. There isn't one. The losetup in the
util-linux package from kernel.org isn't doing it cleanly either, they just
hide the ugliness by nesting #include files. Their mount/loop.h
#includes &quot;my_dev_t.h&quot;, which #includes &lt;linux/posix_types.h&gt;
and &lt;linux/version.h&gt; just like we do. There simply is no alternative.
</p>
#includes "my_dev_t.h", which #includes <linux/posix_types.h> and
<linux/version.h> just like we do. There simply is no alternative.</p>
<p>Just because directly #including kernel headers is sometimes
unavoidable doesn't me we should include them when there's a better
@@ -1089,18 +1087,18 @@ is not a better way.</p>
<h2><a name="who">Who are the BusyBox developers?</a></h2>
<p>The following login accounts currently exist on busybox.net. (I.E. these
people can commit <a href="http://busybox.net/downloads/patches/">patches</a>
people can commit <a href="http://busybox.net/downloads/patches">patches</a>
into subversion for the BusyBox, uClibc, and buildroot projects.)</p>
<pre>
aldot :Bernhard Reutner-Fischer
aldot :Bernhard Fischer
andersen :Erik Andersen - uClibc and BuildRoot maintainer.
bug1 :Glenn McGrath
davidm :David McCullough
gkajmowi :Garrett Kajmowicz - uClibc++ maintainer
jbglaw :Jan-Benedict Glaw
jocke :Joakim Tjernlund
landley :Rob Landley
landley :Rob Landley - BusyBox maintainer
lethal :Paul Mundt
mjn3 :Manuel Novoa III
osuadmin :osuadmin
@@ -1115,12 +1113,11 @@ solar :Ned Ludd
timr :Tim Riker
tobiasa :Tobias Anderberg
vapier :Mike Frysinger
vda :Denys Vlasenko - BusyBox maintainer
</pre>
<p>The following accounts used to exist on busybox.net, but don't anymore so
I can't ask /etc/passwd for their names. Rob Wentworth
&lt;robwen at gmail.com&gt; asked Google and recovered the names:</p>
I can't ask /etc/passwd for their names. Rob Wentworth <robwen@gmail.com>
asked Google and recovered the names:</p>
<pre>
aaronl :Aaron Lehmann
+1 -1
View File
@@ -18,7 +18,7 @@ nodes in /dev, a few configuration files in /etc, and a Linux kernel.</p>
<p>BusyBox is maintained by
<a href="mailto:vda.linux@googlemail.com">Denys Vlasenko</a>,
and licensed under the <a href="license.html">GNU GENERAL PUBLIC LICENSE</a>
and licensed under the <a href="/license.html">GNU GENERAL PUBLIC LICENSE</a>
version 2.</p>
<!--#include file="footer.html" -->
+16 -16
View File
@@ -14,29 +14,29 @@ Also there are patches on top of latest bug fix release.
<p>
Latest releases and patch directories for each branch:
<br>
<a href="http://busybox.net/downloads/busybox-1.10.1.tar.bz2">1.10.1</a>,
<a href="http://busybox.net/downloads/fixes-1.10.1/">patches</a>,
<a href=http://busybox.net/downloads/busybox-1.10.1.tar.bz2>1.10.1</a>,
<a href=http://busybox.net/downloads/fixes-1.10.1/>patches</a>,
<br>
<a href="http://busybox.net/downloads/busybox-1.9.2.tar.bz2">1.9.2</a>,
<a href="http://busybox.net/downloads/fixes-1.9.2/">patches</a>,
<a href=http://busybox.net/downloads/busybox-1.9.2.tar.bz2>1.9.2</a>,
<a href=http://busybox.net/downloads/fixes-1.9.2/>patches</a>,
<br>
<a href="http://busybox.net/downloads/busybox-1.8.3.tar.bz2">1.8.3</a>,
<a href="http://busybox.net/downloads/fixes-1.8.3/">patches</a>,
<a href=http://busybox.net/downloads/busybox-1.8.3.tar.bz2>1.8.3</a>,
<a href=http://busybox.net/downloads/fixes-1.8.3/>patches</a>,
<br>
<a href="http://busybox.net/downloads/busybox-1.7.5.tar.bz2">1.7.5</a>,
<a href="http://busybox.net/downloads/fixes-1.7.5/">patches</a>,
<a href=http://busybox.net/downloads/busybox-1.7.5.tar.bz2>1.7.5</a>,
<a href=http://busybox.net/downloads/fixes-1.7.5/>patches</a>,
<br>
<a href="http://busybox.net/downloads/busybox-1.6.2.tar.bz2">1.6.2</a>,
<a href="http://busybox.net/downloads/fixes-1.6.2/">patches</a>,
<a href=http://busybox.net/downloads/busybox-1.6.2.tar.bz2>1.6.2</a>,
<a href=http://busybox.net/downloads/fixes-1.6.2/>patches</a>,
<br>
<a href="http://busybox.net/downloads/busybox-1.5.2.tar.bz2">1.5.2</a>,
<a href="http://busybox.net/downloads/fixes-1.5.2/">patches</a>,
<a href=http://busybox.net/downloads/busybox-1.5.2.tar.bz2>1.5.2</a>,
<a href=http://busybox.net/downloads/fixes-1.5.2/>patches</a>,
<br>
<a href="http://busybox.net/downloads/busybox-1.4.2.tar.bz2">1.4.2</a>,
<a href="http://busybox.net/downloads/fixes-1.4.2/">patches</a>,
<a href=http://busybox.net/downloads/busybox-1.4.2.tar.bz2>1.4.2</a>,
<a href=http://busybox.net/downloads/fixes-1.4.2/>patches</a>,
<br>
<a href="http://busybox.net/downloads/busybox-1.3.2.tar.bz2">1.3.2</a>,
<a href="http://busybox.net/downloads/fixes-1.3.2/">patches</a>.
<a href=http://busybox.net/downloads/busybox-1.3.2.tar.bz2>1.3.2</a>,
<a href=http://busybox.net/downloads/fixes-1.3.2/>patches</a>.
<p>
You can also obtain <a href="downloads/snapshots/">Daily Snapshots</a> of
+1 -1
View File
@@ -5,7 +5,7 @@
<p> If you found a regression or severe bug in busybox, and you have a patch
for it, and you want to see it added to "hot fixes", please rediff your
patch against corresponding unmodified busybox source and send it to
<a href="mailto:busybox@busybox.net">the mailing list</a>.
<a href=mailto:busybox@busybox.net>the mailing list</a>.
</p>
<br>
+8 -12
View File
@@ -11,39 +11,35 @@
<table width="100%">
<tr>
<td width="60%">
<font face="arial, helvetica, sans-serif" size="-1">
<!--div style="font-family: arial, helvetica, sans-serif; font-size: 80%;" -->
<a href="/copyright.txt">Copyright &copy; 1999-2008 Erik Andersen</a>
<font face="arial, helvetica, sans-serif" size="-1">
<a href="/copyright.txt">Copyright &copy; 1999-2005 Erik Andersen</a>
<br>
Mail all comments, insults, suggestions and bribes to
<br>
Denys Vlasenko <a href="mailto:vda.linux@googlemail.com">vda.linux@googlemail.com</a><br>
</font>
<!--/div-->
</td>
<td>
<a href="http://www.vim.org/"><img border="0"
width="88" height="31"
<a href="http://www.vim.org/"><img border=0 width=88 height=31
src="images/written.in.vi.png"
alt="This site created with the vi editor" /></a>
alt="This site created with the vi editor"></a>
</td>
<td>
<a href="http://osuosl.org/"><img border="0"
width="114" height="63"
<a href="http://osuosl.org/"><img border=0 width=114 height=63
src="images/osuosl.png"
alt="This site is kindly hosted by OSL" /></a>
alt="This site is kindly hosted by OSL"></a>
</td>
<!--
<td>
<a href="http://validator.w3.org/check?uri=referer"><img
border="0" height="31" width="88"
src="images/valid-html401.png"
alt="Valid HTML" /></a>
alt="Valid HTML"></a>
</td>
-->
</tr>
</TR>
</table>
</body>
+26 -15
View File
@@ -8,8 +8,6 @@
body {
background-color: #DEE2DE;
color: #000000;
font-family: lucida, helvetica, arial;
font-size: 100%;
}
:link { color: #660000 }
:visited { color: #660000 }
@@ -20,9 +18,14 @@
</head>
<body>
<!--basefont face="lucida, helvetica, arial" size="3"-->
<basefont face="lucida, helvetica, arial" size="3">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<div class="c3">
@@ -33,13 +36,13 @@
</table>
</div>
<a href="/"><img src="images/busybox1.png" alt="BusyBox" border="0" /></a><br>
<a href="/"><IMG SRC="images/busybox1.png" alt="BusyBox" border="0"></a><BR>
</td>
</tr>
<tr>
<td valign="top">
<td valign="TOP">
<b>About</b>
<ul>
<li><a href="about.html">About BusyBox</a></li>
@@ -74,18 +77,26 @@
</ul>
<p><b>Developer Pages</b>
<ul>
<li><a href="http://busybox.net/~landley/">Rob</a></li>
<li><a href="http://busybox.net/~aldot/">Bernhard</a></li>
<li><a href="http://busybox.net/~vda/">Denys</a>
<br>- <a href="http://busybox.net/~vda/resume/denys_vlasenko.htm">resume</a>
<br>- <a href="http://busybox.net/~vda/mboot/">mboot</a>
<br>- <a href="http://busybox.net/~vda/linld/">linld</a>
<br>- <a href="http://busybox.net/~vda/init_vs_runsv.html">init must die</a>
<br>- <a href="http://busybox.net/~vda/no_ifup.txt">no ifup</a>
<br>- <a href="http://busybox.net/~vda/unscd/">unscd</a>
<li><a href="http://busybox.net/~landley">Rob</a></li>
<li><a href="http://busybox.net/~aldot">Bernhard</a></li>
<li><a href="http://busybox.net/~vda">Denys</a>
<br>- <a href=http://busybox.net/~vda/resume/denys_vlasenko.htm>resume</a>
<br>- <a href=http://busybox.net/~vda/mboot/>mboot</a>
<br>- <a href=http://busybox.net/~vda/linld/>linld</a>
<br>- <a href=http://busybox.net/~vda/init_vs_runsv.html>init must die</a>
<br>- <a href=http://busybox.net/~vda/no_ifup.txt>no ifup</a>
<br>- <a href=http://busybox.net/~vda/unscd/>unscd</a>
</li>
</ul>
<!--
<a href="http://validator.w3.org/check/referer"><img
src="/images/vh40.gif" height=31 width=88
align=left border=0 alt="Valid HTML 4.0!"></a>
-->
</td>
<td valign="top">
<td Valign="TOP">
+14 -16
View File
@@ -1,7 +1,7 @@
<!--#include file="header.html" -->
<p>
<h3><a name="license">BusyBox is licensed under the GNU General Public License, version 2</a></h3>
<h3>BusyBox is licensed under the GNU General Public License, version 2</h3>
<p>BusyBox is licensed under <a href="http://www.gnu.org/licenses/gpl.html#SEC1">the
GNU General Public License</a> version 2, which is often abbreviated as GPLv2.
@@ -11,7 +11,7 @@ familiar with it by now.)</p>
<p>A complete copy of the license text is included in the file LICENSE in
the BusyBox source code.</p>
<p><a href="products.html">Anyone thinking of shipping BusyBox as part of a
<p><a href="/products.html">Anyone thinking of shipping BusyBox as part of a
product</a> should be familiar with the licensing terms under which they are
allowed to use and distribute BusyBox. Read the full test of the GPL (either
through the above link, or in the file LICENSE in the busybox tarball), and
@@ -25,18 +25,17 @@ you violate the license terms, and thus infringe on the copyrights of BusyBox.
(This requirement applies whether or not you modified BusyBox; either way the
license terms still apply to you.) Read the license text for the details.</p>
<h3><a name="version">A note on GPL versions</a></h3>
<h3>A note on GPL versions</h3>
<p>Version 2 of the GPL is the only version of the GPL which current versions
of BusyBox may be distributed under. New code added to the tree is licensed
GPL version 2, and the project's license is GPL version 2.</p>
<p>Older versions of BusyBox (versions 1.2.2 and earlier, up through about svn
16112) included variants of the recommended
&quot;GPL version 2 or (at your option) later versions&quot; boilerplate
permission grant. Ancient versions of BusyBox
16112) included variants of the recommended "GPL version 2 or (at your option)
later versions" boilerplate permission grant. Ancient versions of BusyBox
(before svn 49) did not specify any version at all, and section 9 of GPLv2
(the most recent version at that time) says those old versions may be
(the most recent version at the time) says those old versions may be
redistributed under any version of GPL (including the obsolete V1). This was
conceptually similar to a dual license, except that the different licenses were
different versions of the GPL.</p>
@@ -44,8 +43,7 @@ different versions of the GPL.</p>
<p>However, BusyBox has apparently always contained chunks of code that were
licensed under GPL version 2 only. Examples include applets written by Linus
Torvalds (util-linux/mkfs_minix.c and util_linux/mkswap.c) which stated they
&quot;may be redistributed as per the Linux copyright&quot; (which Linus
clarified in the
"may be redistributed as per the Linux copyright" (which Linus clarified in the
2.4.0-pre8 release announcement in 2000 was GPLv2 only), and Linux kernel code
copied into libbb/loop.c (after Linus's announcement). There are probably
more, because all we used to check was that the code was GPL, not which
@@ -61,18 +59,18 @@ versions such as release 1.2.2 or SVN 16112, and do your own homework to
identify and remove any code that can't be licensed under the GPL version you
want to use. New development is all GPLv2.</p>
<h3><a name="enforce">License enforcement</a></h3>
<h3>License enforcement</h3>
<p>BusyBox's copyrights are enforced by the <a
href="http://www.softwarefreedom.org/">Software Freedom Law Center</a>
href="http://www.softwarefreedom.org">Software Freedom Law Center</a>
(you can contact them at gpl@busybox.net), which
&quot;accepts primary responsibility for enforcement of US copyrights on the
"accepts primary responsibility for enforcement of US copyrights on the
software... and coordinates international copyright enforcement efforts for
such works as necessary.&quot; If you distribute BusyBox in a way that doesn't
such works as necessary." If you distribute BusyBox in a way that doesn't
comply with the terms of the license BusyBox is distributed under, expect to
hear from these guys. Their entire reason for existing is to do pro-bono
legal work for free/open source software projects. (We used to list people who
violate the BusyBox license in <a href="shame.html">The Hall of Shame</a>,
violate the BusyBox license in <a href="/shame.html">The Hall of Shame</a>,
but these days we find it much more effective to hand them over to the
lawyers.)</p>
@@ -84,13 +82,13 @@ don't want monetary awards, injunctions, or to generate bad PR for a company,
unless that's the only way to get somebody that repeatedly ignores us to comply
with the license on our code.</p>
<h3><a name="good">A Good Example</a></h3>
<h3>A Good Example</h3>
<p>These days, <a href="http://www.linksys.com/">Linksys</a> is
doing a good job at complying with the GPL, they get to be an
example of how to do things right. Please take a moment and
check out what they do with
<a href="http://www.linksys.com/servlet/Satellite?c=L_Content_C1&amp;childpagename=US%2FLayout&amp;cid=1115416836002&amp;pagename=Linksys%2FCommon%2FVisitorWrapper">
<a href="http://www.linksys.com/servlet/Satellite?c=L_Content_C1&childpagename=US%2FLayout&cid=1115416836002&pagename=Linksys%2FCommon%2FVisitorWrapper">
distributing the firmware for their WRT54G Router.</a>
Following their example would be a fine way to ensure that you
have also fulfilled your licensing obligations.</p>
+2 -2
View File
@@ -4,12 +4,12 @@
<br><a href="http://uclibc.org/">uClibc.org</a>
<br><a href="http://cxx.uclibc.org/">uClibc++</a>
<!--br><a href="http://udhcp.busybox.net/">udhcp</a -->
<br><a href="http://udhcp.busybox.net/">udhcp</a>
<br><a href="http://buildroot.uclibc.org/">buildroot</a>
<br><a href="http://www.scratchbox.org/">Scratchbox</a>
<br><a href="http://openembedded.org/">OpenEmbedded</a>
<br><a href="http://www.ucdot.org/">uCdot</a>
<br><a href="http://www.linuxdevices.com/">LinuxDevices</a>
<br><a href="http://www.linuxdevices.com">LinuxDevices</a>
<br><a href="http://slashdot.org/">Slashdot</a>
<br><a href="http://freshmeat.net/">Freshmeat</a>
<br><a href="http://linuxtoday.com/">Linux Today</a>
+271 -184
View File
@@ -1,214 +1,301 @@
<!--#include file="header.html" -->
<ul>
<li>
<p>We want to thank the following companies which are providing support for the BusyBox project:
<ul>
<li>AOE media, a <a href="http://www.aoemedia.com/typo3-development.html">
TYPO3 development agency</a> contributes financially.</li>
<li><a href="http://www.analog.com/en/">Analog Devices, Inc.</a> provided
a <a href="http://docs.blackfin.uclinux.org/doku.php?id=bf537_quick_start">
Blackfin development board</a> free of charge.
<a href="http://www.analog.com/blackfin">Blackfin</a>
is a NOMMU processor, and its availability for testing is invaluable.
If you are an embedded device developer,
please note that Analog Devices has entire Linux distribution available
for download for this board. Visit
<a href="http://blackfin.uclinux.org/">http://blackfin.uclinux.org/</a>
for more information.
</li>
</ul>
</p>
</li>
<li><b>28 September 2008 -- BusyBox 1.12.1 (stable), BusyBox 1.11.3 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.12.1.tar.bz2">BusyBox 1.12.1</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_12_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.12.1/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.11.3.tar.bz2">BusyBox 1.11.3</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_11_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.11.3/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<li><b>12 July 2008 -- BusyBox 1.11.1 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.11.1.tar.bz2>BusyBox 1.11.1</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_11_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.11.1/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>
Bugfix-only releases for 1.11.x and 1.12.x branches.
Bugfix-only release for 1.11.x branch. It contains fixes for awk,
bunzip2, cpio, ifupdown, ip, man, start-stop-daemon, uname and vi.
</p>
</li>
<li><b>21 August 2008 -- BusyBox 1.12.0 (unstable), BusyBox 1.11.2 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.12.0.tar.bz2">BusyBox 1.12.0</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_12_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.12.0/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.11.2.tar.bz2">BusyBox 1.11.2</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_11_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.11.2/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<li><b>11 July 2008 -- HOWTO is updated</b>
<p>
<a href=http://busybox.net/~vda/HOWTO/i486-linux-uclibc/HOWTO.txt>
"How to build static busybox for i486-linux-uclibc"</a> is updated
and tested on a fresh Fedora 9 install. Please report if it doesn't
work for you.
</p>
<p>Sizes of busybox-1.11.2 and busybox-1.12.0 (with equivalent config, static uclibc build):<pre>
<li><b>25 June 2008 -- BusyBox 1.11.0 (unstable), BusyBox 1.10.4 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.11.0.tar.bz2>BusyBox 1.11.0</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_11_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.11.0/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.10.4.tar.bz2>BusyBox 1.10.4</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.10.4/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>Sizes of busybox-1.10.4 and busybox-1.11.0 (with equivalent config, static uclibc build):<pre>
text data bss dec hex filename
829687 617 7052 837356 cc6ec busybox-1.11.2/busybox
822961 594 6832 830387 cabb3 busybox-1.12.0/busybox
800675 636 7080 808391 c55c7 busybox-1.10.4
798392 611 6900 805903 c4c0f busybox-1.11.0
</pre>
<p>New applets: rdev (Grant Erickson), setfont, showkey (both by Vladimir)
<p>New applets: inotify (Vladimir Dronnikov), man (Ivana Varekova),
fbsplash (Michele Sanges), depmod (Bernhard Fischer)
<p>Most significant changes since previous release (please report any regression):
<p>Changes since previous release:
<ul>
<li>ash: bash compat: "shift $BIGNUM" is equivalent to "shift 1"</li>
<li>ash: dont allow e.g. exec &lt;&amp;10 to attach to script's fd! </li>
<li>ash: fix a bug where redirection fds were not closed afterwards. optimize close+fcntl(DUPFD) into dup2</li>
<li>ash: fix segfault in "command -v"</li>
<li>ash: fix very weak $RANDOM generator</li>
<li>ash: prevent exec NN&gt;&amp;- from closing fd used for script reading</li>
<li>ash: teach ash about 123&gt;file. It could take only 0..9 before</li>
<li>hush: fix a case where "$@" must expand to no word at all</li>
<li>hush: fix mishandling of a'b'c=fff as assignments. They are not</li>
<li>hush: fix non-detection of builtins and applets in "v=break; ...; $v; ..." case</li>
<li>hush: fix "while false; ..." exitcode; add testsuites</li>
<li>hush: support "case...esac" statements (~350 bytes of code)</li>
<li>hush: support "break [N]" and "continue [N]" statements</li>
<li>hush: support "for if in do done then; do echo $if; done" case</li>
<li>hush: support "for v; do ... done" syntax (implied 'in "$@"')</li>
<li>hush: support $_NUMBERS variable names</li>
<li>libbb: unified config parser (by Vladimir). This change affected many applets</li>
</ul>
<p>Other changes:
<ul>
<li>libbb: dump: do not use uninitialized memory (closes bug 4364)</li>
<li>libbb: fix bb_strtol[l]'s check for "-" (closes bug 4174)</li>
<li>libbb: fix --help to not affect "test --help"</li>
<li>libbb: fix mishandling of "all argv are opts" in getopt32()</li>
<li>libbb: getopt32() should not ever touch argv[0] (even read)</li>
<li>libbb: introduce and use xrealloc_vector</li>
<li>libbb: [x]fopen_for_{read,write} introduced and used (by Vladimir)</li>
<li>lineedit: fix use-after-free</li>
<li>libunarchive: refactor handling of archived files. "tar f file.tar.lzma" now works too</li>
<li>bb_strtoXXX: close bug 4174 (potential use of buf[-1])</li>
<li>open_transformer: don't leak file descriptor</li>
<li>open_transformer: fix bug of calling exit instead of _exit</li>
<li>arp: without -H type, assume "ether" (closes bug 4564)</li>
<li>ar: reuse existing ar unpacking code</li>
<li>awk: fix a case with multiple -f options. Simplify -f file reading. </li>
<li>build system: introduce and use FAST_FUNC: regparm on i386, otherwise no-op</li>
<li>bunzip2: fix an uncompression error (by Rob Landley rob AT landley.net)</li>
<li>b[un]zip2, g[un]zip: unlink destination if -f is given (closes bug 3854)</li>
<li>comm: almost total rewrite</li>
<li>cpio: fix -m to actually work as expected (by Pascal Bellard)</li>
<li>cpio: internalize archive_xread_all_eof, add a few paranoia checks for corrupted cpio files</li>
<li>cpio: make long opts depend only on ENABLE_GETOPT_LONG</li>
<li>cpio: on unpack, limit filename length to 8k</li>
<li>cpio: support some long options</li>
<li>crond: use execlp instead of execl</li>
<li>cut: fix buffer overflow (closes bug 4544)</li>
<li>envdir: fix "envdir" (no params at all) and "envdir dir" cases</li>
<li>findfs: make it use setuid-ness of busybox binary</li>
<li>fsck: use getmntent_r instead of open-coded parsing (by Vladimir)</li>
<li>fuser: a bit of safety in scanf</li>
<li>grep: option to use GNU regex matching instead of POSIX one. This fixes problems with NULs in files being scanned, but costs +800 bytes</li>
<li>halt: signal init regardless of ENABLE_INIT</li>
<li>httpd: add homedir directive specially for (and by) Walter Harms wharms AT bfs.de</li>
<li>ifupdown: /etc/network/interfaces can have comments with leading blanks</li>
<li>ifupdown: fixes for custom MAC address (by Wade Berrier wberrier AT gmail.com)</li>
<li>ifupdown: fixes for shutdown of DHCP-managed interfaces (by Wade Berrier wberrier AT gmail.com)</li>
<li>inetd: do not trash errno in signal handlers; in CHLD handler, stop looping through services when pid is found</li>
<li>insmod: users report that "|| defined(__powerpc__)" is missing</li>
<li>install: do not chown intermediate directories with install -d (by Natanael Copa)</li>
<li>install: fix long option not taking params (closes bug 4584)</li>
<li>lpd,lpr: send/receive ACKs after filenames, not only after file bodies</li>
<li>ls: fix a bug where we may use uninintialized variable</li>
<li>man: add handling of "man links", by Ivana Varekova varekova AT redhat.com</li>
<li>man: fix a case when a full pathname to manpage is given</li>
<li>man: fix inverted cat/man bool variable</li>
<li>man: fix missed NULL termination of an array</li>
<li>man: mimic "no manual entry for 'bogus'" message and exitcode</li>
<li>man: support cat pages too (by Jason Curl jcurlnews AT arcor.de)</li>
<li>man: teach it to use .lzma if requested by .config</li>
<li>mdev: check for "/block/" substring for block dev detection</li>
<li>mdev: do not complain if mdev.conf does not exist</li>
<li>mdev: if device was moved at creation, at removal correctly remove it from moved location and also remove symlinks to it</li>
<li>mdev: support for serializing hotplug</li>
<li>mdev, init: use shared code for fd sanitization</li>
<li>mkdir: fix "uname 0222; mkdir -p foo/bar" case (by Doug Graham dgraham AT nortel.com)</li>
<li>modprobe: support for /etc/modprobe.d (by Timo Teras)</li>
<li>modprobe: use buffering line reads (fgets()) instead of reads()</li>
<li>modutils: optional modprobe-small (by Vladimir), 15kb smaller than standard one</li>
<li>mount: support for "-o mand" and "[no]relatime"</li>
<li>mount: support nfs mount option "nordiplus" (by Octavian Purdila opurdila AT ixiacom.com)</li>
<li>mount: support "relatime" / "norelatime"</li>
<li>mount: testsuite for "-o mand"</li>
<li>msh: fix "while... continue; ..." (closes bug 3884)</li>
<li>mv: fix a case when we move dangling symlink across mountpoints</li>
<li>netstat: optional -p support (by L. Gabriel Somlo somlo AT cmu.edu)</li>
<li>nmeter: fix read past the end of a buffer (closes bug 4594)</li>
<li>od, hexdump: fix bug where xrealloc may move pointer, leaving other pointers dangling (closes bug 4104)</li>
<li>pidof/killall: allow find_pid_by_name to find running processes started as scripts_with_name_longer_than_15_bytes.sh (closes bug 4054)</li>
<li>printf: do not print garbage on "%Ld" (closes bug 4214)</li>
<li>printf: fix %b, fix several bugs in %*.*, fix compat issues with aborting too early, support %zd; expand testsuite</li>
<li>printf: protect against bogus format specifiers (closes bug 4184)</li>
<li>sendmail: updates from Vladimir:</li>
<li>sendmail: do not discard all headers</li>
<li>sendmail: do not ignore CC; accept to: and cc: case-insensitively. +20 bytes</li>
<li>sendmail: fixed mail recipient address</li>
<li>sendmail: fixed SEGV if sender address is missed</li>
<li>sendmail: use HOSTNAME instead of HOST when no server is explicitly specified</li>
<li>sleep: if FANCY &amp;&amp; DESKTOP, support fractional seconds, minutes, hours and so on (coreutils compat)</li>
<li>ssd: CLOSE_EXTRA_FDS in MMU case too</li>
<li>ssd: do not stat -x EXECUTABLE, it is not needed anymore</li>
<li>ssd: fix -a without -x case</li>
<li>ssd: use $PATH</li>
<li>tar: fix handling of tarballs with symlinks with size field != 0</li>
<li>tar: handle autodetection for tiny .tar.gz files too, simplify autodetection</li>
<li>taskset: fix some careless code in both fancy and non-fancy cases. -5 bytes for fancy, +5 for non-fancy</li>
<li>tee: fix infinite looping on open error (echo asd | tee "")</li>
<li>tee: "-" is a name for stdout, handle it that way</li>
<li>telnetd: fix issue file printing</li>
<li>test: fix parser to prefer binop over unop, as coreutils does</li>
<li>testsuite: uniformly use $ECHO with -n -e</li>
<li>time: don't segfault with no arguments</li>
<li>touch: support -r REF_FILE if ENABLE_DESKTOP (needed for blackfin compile)</li>
<li>tr: fix "access past the end of a string" bug 4354</li>
<li>tr: fix "tr [=" case (closes bug 4374)</li>
<li>tr: fix yet another access past the end of a string (closes bug 4374)</li>
<li>unlzma: fix memory leak (by Pascal Bellard)</li>
<li>vi: fix reversed checks for underflow</li>
<li>vi: using array data after it fell out of scope is stupid</li>
<li>xargs: fix -e default to match newer GNU xargs, add SUS mandated -E (closes bug 4414)</li>
<li>other fixes and code size reductions in many applets</li>
<li>build system: reinstate CONFIG_CROSS_COMPILE_PREFIX
<li>ash: optional bash compatibility features added; other fixes
<li>hush: lots and lots of fixes
<li>msh: fix the case where the file has exec bit but can't be run directly (runs "$SHELL file" instead)
<li>msh: fix exit codes when command is not found or can't be execed
<li>udhcpc: added workaround for buggy kernels
<li>mount: fix mishandling of proto=tcp/udp
<li>diff: make it work on non-seekable streams
<li>openvt: made more compatible with "standard" one
<li>mdev: fix block/char device detection
<li>ping: add -w, -W support (James Simmons)
<li>crond: add handling of "MAILTO=user" lines
<li>start-stop-daemon: make --exec follow symlinks (Joakim Tjernlund)
<li>date: make it accept ISO date format
<li>echo: fix echo -e -n "msg\n\0" (David Pinedo)
<li>httpd: fix several bugs triggered by relative path in -h DIR
<li>printf: fix printf -%s- foo, printf -- -%s- foo
<li>syslogd: do not error out on missing files to rotate
<li>ls: support Unicode in names
<li>ip: support for the LOWER_UP flag (Natanael Copa)
<li>mktemp: make argument optional (coreutil 6.12 compat)
<li>libiproute: fix option parsing, so that "ip -o link" works again
<li>other fixes and code size reductions in many applets
</ul>
<p>
The email address gpl@busybox.net is the recommended way to contact
the Software Freedom Law Center to report BusyBox license violations.
</p>
<li><b>12 July 2008 -- BusyBox 1.11.1 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.11.1.tar.bz2">BusyBox 1.11.1</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_11_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.11.1/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<li><b>12 June 2008 -- Sponsors!</b>
<p>We want to thank the following companies which are providing support
for BusyBox project:
<ul>
<li>AOE media, a <a href=http://www.aoemedia.com/typo3-development.html>
TYPO3 development agency</a> contributes financially.
<p>
<li><a href=http://www.analog.com/en/>Analog Devices, Inc.</a> provided
a <a href=http://docs.blackfin.uclinux.org/doku.php?id=bf537_quick_start>
Blackfin development board</a> free of charge.
<a href=http://www.analog.com/blackfin>Blackfin<a>
is a NOMMU processor, and its availability for testing is invaluable.
If you are an embedded device developer,
please note that Analog Devices has entire Linux distribution available
for download for this board. Visit
<a href=http://blackfin.uclinux.org/>http://blackfin.uclinux.org/</a>
for more information.
</ul>
</p>
<li><b>5 June 2008 -- BusyBox 1.10.3 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.10.3.tar.bz2>BusyBox 1.10.3</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.10.3/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>
Bugfix-only release for 1.11.x branch. It contains fixes for awk,
bunzip2, cpio, ifupdown, ip, man, start-stop-daemon, uname and vi.
Bugfix-only release for 1.10.x branch. It contains fixes for dnsd, fuser, hush,
ip, mdev and syslogd.
</p>
</li>
<li><b>11 July 2008 -- HOWTO is updated</b>
<li><b>8 May 2008 -- BusyBox 1.10.2 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.10.2.tar.bz2>BusyBox 1.10.2</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.10.2/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>
<a href="http://busybox.net/~vda/HOWTO/i486-linux-uclibc/HOWTO.txt">
"How to build static busybox for i486-linux-uclibc"</a> is updated
and tested on a fresh Fedora 9 install. Please report if it doesn't
work for you.
Bugfix-only release for 1.10.x branch. It contains fixes for echo, httpd, pidof,
start-stop-daemon, tar, taskset, tab completion in shells, build system.
<p>Please note that mdev was backported from current svn trunk. Please
report if you encounter any problems with it.
</p>
</li>
<li><b>19 April 2008 -- BusyBox 1.10.1 (stable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.10.1.tar.bz2>BusyBox 1.10.1</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.10.1/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>
Bugfix-only release for 1.10.x branch. It contains fixes for
fuser, init, less, nameif, tail, taskset, tcpudp, top, udhcp.
<li><b>21 March 2008 -- BusyBox 1.10.0 (unstable)</b>
<p><a href=http://busybox.net/downloads/busybox-1.10.0.tar.bz2>BusyBox 1.10.0</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.10.0/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<li><b>Old News</b><p>
Click here to read <a href="oldnews.html">older news</a>
<p>Sizes of busybox-1.9.2 and busybox-1.10.0 (with almost full config, static uclibc build):<pre>
text data bss dec hex filename
781405 679 7500 789584 c0c50 busybox-1.9.2
773551 640 7372 781563 becfb busybox-1.10.0
</pre>
<p>Top 10 stack users:<pre>
busybox-1.9.2: busybox-1.10.0:
echo_dg 4116 bb_full_fd_action 4112
bb_full_fd_action 4112 find_list_entry2 4096
discard_dg 4108 readlink_main 4096
discard_dg 4096 ipaddr_list_or_flush 3900
echo_stream 4096 iproute_list_or_flush 3680
discard_stream 4096 insmod_main 3152
find_list_entry2 4096 fallbackSort 2952
readlink_main 4096 do_iproute 2492
ipaddr_list_or_flush 3900 cal_main 2464
iproute_list_or_flush 3680 readhere 2308
</pre>
<p>New applets: brctl, chat (by Vladimir Dronnikov &lt;dronnikov AT gmail.com&gt;),
findfs, ifenslave (closes bug 115), lpd (by Vladimir Dronnikov &lt;dronnikov AT gmail.com&gt;),
lpr+lpq (by Walter Harms), script (by Pascal Bellard &lt;pascal.bellard AT ads-lu.com&gt;),
sendmail (Vladimir Dronnikov &lt;dronnikov AT gmail.com&gt;), tac, tftpd.
<p>Made NOMMU-compatible: crond, crontab, ifupdown, inetd, init, runsv, svlogd, tcpsvd, udpsvd.
<p>Changes since previous release:
<ul>
<li>globally: add -Wunused-parameter
<li>globally: add optimization barrier to all "G trick" locations
<li>adduser/addgroup: check username for invalid chars (by Tito &lt;farmatito AT tiscali.it&gt;)
<li>adduser: optional support for long options. Closes bug 2134
<li>ash: handle "A=1 A=2 B=$A; echo $B". Closes bug 947
<li>ash: make ash -c "if set -o barfoo 2&gt;/dev/null; then echo foo; else echo bar; fi" work. Closes bug 1142
<li>build system: don't use "gcc -o /dev/null", old gcc can delete /dev/null in this case
<li>build system: fixes for cross-compiling on an OS X host
<li>build system: make it do without "od -t"
<li>build system: pass CFLAGS to link stage too. Closes bug 1376
<li>build system: add CONFIG_NOMMU
<li>cp: add ENABLE_FEATURE_VERBOSE_CP_MESSAGE. Closes bug 1470
<li>crontab: almost complete rewrite
<li>dnsd: properly set _src_ IP:port on outgoing UDP packets
<li>dpkg: fix bug where existence check was reversed
<li>eject: add -s for SCSI- and USB-devices (Nico Erfurth)
<li>fdisk: fix a case where break was reached only for DOS labels
<li>fsck: don't kill pid -1! (Roy Marples &lt;roy at marples.name&gt;)
<li>fsck_minix: fix bug in map_block2: s/(blknr &gt;= 256 * 256)/(blknr &lt; 256 * 256)/
<li>fuser: substantial rewrite
<li>getopt: add support for "a+" specifier for nonnegative int parameters. By Vladimir Dronnikov &lt;dronnikov at gmail.com&gt;
<li>getty: don't try to detect parity on local lines (Joakim Tjernlund &lt;Joakim.Tjernlund at transmode.se&gt;)
<li>halt: write wtmp entry if wtmp support is enabled
<li>httpd: "HEAD" support. Closes bug 1530
<li>httpd: fix bug 2004: wrong argv when interpreter is invoked
<li>httpd: fix bug where we did chdir("") if CGI path had only one "/"
<li>httpd: fix for POST upload
<li>httpd: support for "I:index.xml" syntax (Peter Korsgaard &lt;jacmet AT uclibc.org&gt;)
<li>hush: fix a case where none of pipe members could be started because of fork failure
<li>hush: more correct handling of piping
<li>hush: reinstate `cmd` handling for NOMMU
<li>hush: report [v]fork failures
<li>hush: set CLOEXEC on script file being executed
<li>hush: try to add a bit more of vfork-friendliness
<li>inetd: make "udp nowait" work
<li>inetd: make inetd IPv6-capable
<li>init: add FEATURE_KILL_REMOVED (Eugene Bordenkircher &lt;eugebo AT gmail.com&gt;)
<li>init: allow last line of config file to be not terminated by "\n"
<li>init: do not die if "/dev/null" is missing
<li>init: fix bug 1111: restart actions were not splitting words
<li>init: wait for orphaned children too while waiting for sysinit-like processes (harald-tuxbox AT arcor.de)
<li>ip route: "ip route" was misbehaving (extra argv+1 ate 1st env var)
<li>last: do not go into endless loop on read error
<li>less,klogd,syslogd,nc,tcpudp: exit on signal by killing itself, not exit(1)
<li>less: "examine" command will not bomb out on bad file name now
<li>less: fix bug where backspace wasn't actually deleting chars
<li>less: make it a bit more resistant against status line corruption
<li>less: improve search when data is not supplied fast enough by stdin - now will try reading for 1-2 seconds before declaring that there is no match. This fixes a very common annoyance with long manpages
<li>less: update line input so that it doesn't interfere with screen update. Makes "man bash", [enter], [/], &lt;enter search pattern&gt;, [enter] more usable - manpage now draws even as you enter the pattern!
<li>libbb: filename completion matches dangling symlinks too
<li>libbb: fix getopt state corruption for NOFORK applets
<li>libbb: full_read/write now will report partial data counts prior to error
<li>libbb: intrduce and use safe_gethostname. By Tito &lt;farmatito AT tiscali.it&gt;
<li>libbb: introduce and use nonblock_safe_read(). Yay! Our shells are immune from this nasty O_NONBLOCK now!
<li>login,su: avoid clearing environment with some options, as was intended
<li>microcom: read more than 1 byte from device, if possible
<li>microcom: split -d (delay) option away from -t
<li>mktemp: support -p DIR (Timo Teras &lt;timo.teras at iki.fi&gt;)
<li>mount: #ifdef out MOUNT_LABEL code parts if it is not selected
<li>mount: add another mount helper call method
<li>mount: allow and ignore _netdev option
<li>mount: make -f work even without mtab support (Cristian Ionescu-Idbohrn &lt;cristian.ionescu-idbohrn at axis.com&gt;)
<li>mount: optional support for -vv verbosity
<li>mount: plug a hole where FEATURE_MOUNT_HELPERS could allow execution of arbitrary command
<li>mount: recognize "dirsync" (closes bug 835)
<li>mount: sanitize environment if called by non-root
<li>mount: support for mount by label. Closes bug 1143
<li>mount: with -vv -f, say what mount() calls we were going to make
<li>msh: create testsuite (based on hush one)
<li>msh: don't use floating point in "times" builtin
<li>msh: fix Ctrl-C handling with line editing
<li>msh: fix for bug 846 ("break" didn't work second time)
<li>msh: glob0/glob1/glob2/glob3 were just a sorting routine, removed
<li>msh: instead of fixing "ls | cd", "cd | ls" etc disallow builtins in pipes. They make no sense there anyway
<li>msh: stop trying to parse variables in "msh SCRIPT VAR=val param". They are passed as ordinary parameters
<li>netstat: print control chars as "^C" etc
<li>nmeter: fix bug where %[mf] behaves as %[mt]
<li>nohup: compat patch by Christoph Gysin &lt;mailinglist.cache at gmail.com&gt;
<li>od: handle /proc files (which have filesize 0) correctly
<li>patch: don't trash permissions of patched file
<li>ps: add conditional support for -o [e]time
<li>ps: fix COMMAND column adjustment; overflow in USER and VSZ columns
<li>reset: call "stty sane". Closes bug 1414
<li>rmdir: optional long options support for Debian users. By Roberto Gordo Saez &lt;roberto.gordo AT gmail.com&gt;
<li>run-parts: add --reverse
<li>script: correctly handle buffered "tail" of output
<li>sed: "n" command must reset "we had successful subst" flag. Closes bug 1214
<li>sort: -z outputs NUL terminated lines. Closes bug 1591
<li>stty: fix mishandling of control keywords (Ralf Friedl &lt;Ralf.Friedl AT online.de&gt;)
<li>switch_root: stop at first non-option. Closes bug 1425
<li>syslogd: avoid excessive time() system calls
<li>syslogd: don't die if remote host's IP cannot be resolved. Retry resolutions every two minutes instead
<li>syslogd: fix shmat error check
<li>syslogd: optional support for dropping dups. Closes bug 436
<li>syslogd: send "\n"-terminated messages over the network. Fully closes bug 1574
<li>syslogd: tighten up hostname handling
<li>tail: fix "tail -c 20 /dev/huge_disk" (was taking ages)
<li>tar: compat: handle tarballs with only one zero block at the end
<li>tar: autodetection of gz/bz2 compressed tarballs. Closes bug 992
<li>tar: real support for -p. By Natanael Copa &lt;natanael.copa at gmail.com&gt;
<li>tcpudp: narrow down time window where we have no wildcard socket
<li>telnetd: use login always, not "sometimes login, sometimes shell"
<li>test: fix mishandling of "test ! arg1 op arg2 more args"
<li>trylink: instead of build error, disable --gc-sections if GLIBC and STATIC are selected
<li>udhcp: make file paths configurable
<li>udhcp: optional support for non-standard DHCP ports
<li>udhcp: set correct op byte in the packet for DHCPDECLINE
<li>udhcpc: filter unwanted packets in kernel (Cristian Ionescu-Idbohrn &lt;cristian.ionescu-idbohrn AT axis.com&gt;)
<li>udhcpc: fix wrong options in decline and release packets (Jonas Danielsson &lt;jonas.danielsson AT axis.com&gt;)
<li>umount: do not complain several times about the same mountpoint
<li>umount: do not try to free loop device or erase mtab if remounted ro
<li>umount: instead of non-standard -D, use -d with opposite meaning. Closes bug 1604
<li>unlzma: shrink by Pascal Bellard &lt;pascal.bellard AT ads-lu.com&gt;
<li>unzip: do not try to read entire compressed stream at once (it can be huge)
<li>unzip: handle short reads correctly
<li>vi: many fixes
<li>zcip: don't chdir to root
<li>zcip: open ARP socket before openlog (else we can trash syslog socket)
</ul>
</p>
</li>
<li><b>21 March 2008 -- BusyBox old stable releases</b>
<p>
Bugfix-only releases for four past branches. Links to locations
for future hot patches are in parentheses.
<p>
<a href=http://busybox.net/downloads/busybox-1.9.2.tar.bz2>1.9.2</a>
(<a href=http://busybox.net/downloads/fixes-1.9.2/>patches</a>),
<a href=http://busybox.net/downloads/busybox-1.8.3.tar.bz2>1.8.3</a>
(<a href=http://busybox.net/downloads/fixes-1.8.3/>patches</a>),
<a href=http://busybox.net/downloads/busybox-1.7.5.tar.bz2>1.7.5</a>
(<a href=http://busybox.net/downloads/fixes-1.7.5/>patches</a>),
<a href=http://busybox.net/downloads/busybox-1.5.2.tar.bz2>1.5.2</a>
(<a href=http://busybox.net/downloads/fixes-1.5.2/>patches</a>).
<p>
<a href=http://busybox.net/fix.html>How to add a patch.</a>
</p>
<li><b>Old News</b><p>
<a href="/oldnews.html">Click here to read older news</a>
</p>
</li>
</ul>
+84 -359
View File
@@ -1,293 +1,12 @@
<!--#include file="header.html" -->
<h3>News archive</h3>
<ul>
<li><b>25 June 2008 -- BusyBox 1.11.0 (unstable), BusyBox 1.10.4 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.11.0.tar.bz2">BusyBox 1.11.0</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_11_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.11.0/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.10.4.tar.bz2">BusyBox 1.10.4</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.10.4/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>Sizes of busybox-1.10.4 and busybox-1.11.0 (with equivalent config, static uclibc build):<pre>
text data bss dec hex filename
800675 636 7080 808391 c55c7 busybox-1.10.4
798392 611 6900 805903 c4c0f busybox-1.11.0
</pre>
<p>New applets: inotify (Vladimir Dronnikov), man (Ivana Varekova),
fbsplash (Michele Sanges), depmod (Bernhard Reutner-Fischer)
<p>Changes since previous release:
<ul>
<li>build system: reinstate CONFIG_CROSS_COMPILE_PREFIX</li>
<li>ash: optional bash compatibility features added; other fixes</li>
<li>hush: lots and lots of fixes</li>
<li>msh: fix the case where the file has exec bit but can't be run directly (runs "$SHELL file" instead)</li>
<li>msh: fix exit codes when command is not found or can't be execed</li>
<li>udhcpc: added workaround for buggy kernels</li>
<li>mount: fix mishandling of proto=tcp/udp</li>
<li>diff: make it work on non-seekable streams</li>
<li>openvt: made more compatible with "standard" one</li>
<li>mdev: fix block/char device detection</li>
<li>ping: add -w, -W support (James Simmons)</li>
<li>crond: add handling of "MAILTO=user" lines</li>
<li>start-stop-daemon: make --exec follow symlinks (Joakim Tjernlund)</li>
<li>date: make it accept ISO date format</li>
<li>echo: fix echo -e -n "msg\n\0" (David Pinedo)</li>
<li>httpd: fix several bugs triggered by relative path in -h DIR</li>
<li>printf: fix printf -%s- foo, printf -- -%s- foo</li>
<li>syslogd: do not error out on missing files to rotate</li>
<li>ls: support Unicode in names</li>
<li>ip: support for the LOWER_UP flag (Natanael Copa)</li>
<li>mktemp: make argument optional (coreutil 6.12 compat)</li>
<li>libiproute: fix option parsing, so that "ip -o link" works again</li>
<li>other fixes and code size reductions in many applets</li>
</ul>
<p>
The email address gpl@busybox.net is the recommended way to contact
the Software Freedom Law Center to report BusyBox license violations.
</p>
</li>
<li><b>12 June 2008 -- Sponsors!</b>
<p>We want to thank the following companies which are providing support
for the BusyBox project:
</p>
<ul>
<li>AOE media, a <a href="http://www.aoemedia.com/typo3-development.html">
TYPO3 development agency</a> contributes financially.</li>
<li><a href="http://www.analog.com/en/">Analog Devices, Inc.</a> provided
a <a href="http://docs.blackfin.uclinux.org/doku.php?id=bf537_quick_start">
Blackfin development board</a> free of charge.
<a href="http://www.analog.com/blackfin">Blackfin</a>
is a NOMMU processor, and its availability for testing is invaluable.
If you are an embedded device developer,
please note that Analog Devices has entire Linux distribution available
for download for this board. Visit
<a href="http://blackfin.uclinux.org/">http://blackfin.uclinux.org/</a>
for more information.
</li>
</ul>
</li>
<li><b>5 June 2008 -- BusyBox 1.10.3 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.10.3.tar.bz2">BusyBox 1.10.3</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.10.3/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>
Bugfix-only release for 1.10.x branch. It contains fixes for dnsd, fuser, hush,
ip, mdev and syslogd.
</p>
</li>
<li><b>8 May 2008 -- BusyBox 1.10.2 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.10.2.tar.bz2">BusyBox 1.10.2</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.10.2/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>
Bugfix-only release for 1.10.x branch. It contains fixes for echo, httpd, pidof,
start-stop-daemon, tar, taskset, tab completion in shells, build system.
<p>Please note that mdev was backported from current svn trunk. Please
report if you encounter any problems with it.
</p>
</li>
<li><b>19 April 2008 -- BusyBox 1.10.1 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.10.1.tar.bz2">BusyBox 1.10.1</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.10.1/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>
Bugfix-only release for 1.10.x branch. It contains fixes for
fuser, init, less, nameif, tail, taskset, tcpudp, top, udhcp.
</li>
<li><b>21 March 2008 -- BusyBox 1.10.0 (unstable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.10.0.tar.bz2">BusyBox 1.10.0</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_10_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.10.0/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p>Sizes of busybox-1.9.2 and busybox-1.10.0 (with almost full config, static uclibc build):<pre>
text data bss dec hex filename
781405 679 7500 789584 c0c50 busybox-1.9.2
773551 640 7372 781563 becfb busybox-1.10.0
</pre>
<p>Top 10 stack users:<pre>
busybox-1.9.2: busybox-1.10.0:
echo_dg 4116 bb_full_fd_action 4112
bb_full_fd_action 4112 find_list_entry2 4096
discard_dg 4108 readlink_main 4096
discard_dg 4096 ipaddr_list_or_flush 3900
echo_stream 4096 iproute_list_or_flush 3680
discard_stream 4096 insmod_main 3152
find_list_entry2 4096 fallbackSort 2952
readlink_main 4096 do_iproute 2492
ipaddr_list_or_flush 3900 cal_main 2464
iproute_list_or_flush 3680 readhere 2308
</pre>
<p>New applets: brctl, chat (by Vladimir Dronnikov &lt;dronnikov AT gmail.com&gt;),
findfs, ifenslave (closes bug 115), lpd (by Vladimir Dronnikov &lt;dronnikov AT gmail.com&gt;),
lpr+lpq (by Walter Harms), script (by Pascal Bellard &lt;pascal.bellard AT ads-lu.com&gt;),
sendmail (Vladimir Dronnikov &lt;dronnikov AT gmail.com&gt;), tac, tftpd.
</p>
<p>Made NOMMU-compatible: crond, crontab, ifupdown, inetd, init, runsv, svlogd, tcpsvd, udpsvd.
</p>
<p>Changes since previous release:
</p>
<ul>
<li>globally: add -Wunused-parameter</li>
<li>globally: add optimization barrier to all "G trick" locations</li>
<li>adduser/addgroup: check username for invalid chars (by Tito &lt;farmatito AT tiscali.it&gt;)</li>
<li>adduser: optional support for long options. Closes bug 2134</li>
<li>ash: handle "A=1 A=2 B=$A; echo $B". Closes bug 947</li>
<li>ash: make ash -c "if set -o barfoo 2&gt;/dev/null; then echo foo; else echo bar; fi" work. Closes bug 1142</li>
<li>build system: don't use "gcc -o /dev/null", old gcc can delete /dev/null in this case</li>
<li>build system: fixes for cross-compiling on an OS X host</li>
<li>build system: make it do without "od -t"</li>
<li>build system: pass CFLAGS to link stage too. Closes bug 1376</li>
<li>build system: add CONFIG_NOMMU</li>
<li>cp: add ENABLE_FEATURE_VERBOSE_CP_MESSAGE. Closes bug 1470</li>
<li>crontab: almost complete rewrite</li>
<li>dnsd: properly set _src_ IP:port on outgoing UDP packets</li>
<li>dpkg: fix bug where existence check was reversed</li>
<li>eject: add -s for SCSI- and USB-devices (Nico Erfurth)</li>
<li>fdisk: fix a case where break was reached only for DOS labels</li>
<li>fsck: don't kill pid -1! (Roy Marples &lt;roy at marples.name&gt;)</li>
<li>fsck_minix: fix bug in map_block2: s/(blknr &gt;= 256 * 256)/(blknr &lt; 256 * 256)/</li>
<li>fuser: substantial rewrite</li>
<li>getopt: add support for "a+" specifier for nonnegative int parameters. By Vladimir Dronnikov &lt;dronnikov at gmail.com&gt;</li>
<li>getty: don't try to detect parity on local lines (Joakim Tjernlund &lt;Joakim.Tjernlund at transmode.se&gt;)</li>
<li>halt: write wtmp entry if wtmp support is enabled</li>
<li>httpd: "HEAD" support. Closes bug 1530</li>
<li>httpd: fix bug 2004: wrong argv when interpreter is invoked</li>
<li>httpd: fix bug where we did chdir("") if CGI path had only one "/"</li>
<li>httpd: fix for POST upload</li>
<li>httpd: support for "I:index.xml" syntax (Peter Korsgaard &lt;jacmet AT uclibc.org&gt;)</li>
<li>hush: fix a case where none of pipe members could be started because of fork failure</li>
<li>hush: more correct handling of piping</li>
<li>hush: reinstate `cmd` handling for NOMMU</li>
<li>hush: report [v]fork failures</li>
<li>hush: set CLOEXEC on script file being executed</li>
<li>hush: try to add a bit more of vfork-friendliness</li>
<li>inetd: make "udp nowait" work</li>
<li>inetd: make inetd IPv6-capable</li>
<li>init: add FEATURE_KILL_REMOVED (Eugene Bordenkircher &lt;eugebo AT gmail.com&gt;)</li>
<li>init: allow last line of config file to be not terminated by "\n"</li>
<li>init: do not die if "/dev/null" is missing</li>
<li>init: fix bug 1111: restart actions were not splitting words</li>
<li>init: wait for orphaned children too while waiting for sysinit-like processes (harald-tuxbox AT arcor.de)</li>
<li>ip route: "ip route" was misbehaving (extra argv+1 ate 1st env var)</li>
<li>last: do not go into endless loop on read error</li>
<li>less,klogd,syslogd,nc,tcpudp: exit on signal by killing itself, not exit(1)</li>
<li>less: "examine" command will not bomb out on bad file name now</li>
<li>less: fix bug where backspace wasn't actually deleting chars</li>
<li>less: make it a bit more resistant against status line corruption</li>
<li>less: improve search when data is not supplied fast enough by stdin - now will try reading for 1-2 seconds before declaring that there is no match. This fixes a very common annoyance with long manpages</li>
<li>less: update line input so that it doesn't interfere with screen update. Makes "man bash", [enter], [/], &lt;enter search pattern&gt;, [enter] more usable - manpage now draws even as you enter the pattern!</li>
<li>libbb: filename completion matches dangling symlinks too</li>
<li>libbb: fix getopt state corruption for NOFORK applets</li>
<li>libbb: full_read/write now will report partial data counts prior to error</li>
<li>libbb: intrduce and use safe_gethostname. By Tito &lt;farmatito AT tiscali.it&gt;</li>
<li>libbb: introduce and use nonblock_safe_read(). Yay! Our shells are immune from this nasty O_NONBLOCK now!</li>
<li>login,su: avoid clearing environment with some options, as was intended</li>
<li>microcom: read more than 1 byte from device, if possible</li>
<li>microcom: split -d (delay) option away from -t</li>
<li>mktemp: support -p DIR (Timo Teras &lt;timo.teras at iki.fi&gt;)</li>
<li>mount: #ifdef out MOUNT_LABEL code parts if it is not selected</li>
<li>mount: add another mount helper call method</li>
<li>mount: allow and ignore _netdev option</li>
<li>mount: make -f work even without mtab support (Cristian Ionescu-Idbohrn &lt;cristian.ionescu-idbohrn at axis.com&gt;)</li>
<li>mount: optional support for -vv verbosity</li>
<li>mount: plug a hole where FEATURE_MOUNT_HELPERS could allow execution of arbitrary command</li>
<li>mount: recognize "dirsync" (closes bug 835)</li>
<li>mount: sanitize environment if called by non-root</li>
<li>mount: support for mount by label. Closes bug 1143</li>
<li>mount: with -vv -f, say what mount() calls we were going to make</li>
<li>msh: create testsuite (based on hush one)</li>
<li>msh: don't use floating point in "times" builtin</li>
<li>msh: fix Ctrl-C handling with line editing</li>
<li>msh: fix for bug 846 ("break" didn't work second time)</li>
<li>msh: glob0/glob1/glob2/glob3 were just a sorting routine, removed</li>
<li>msh: instead of fixing "ls | cd", "cd | ls" etc disallow builtins in pipes. They make no sense there anyway</li>
<li>msh: stop trying to parse variables in "msh SCRIPT VAR=val param". They are passed as ordinary parameters</li>
<li>netstat: print control chars as "^C" etc</li>
<li>nmeter: fix bug where %[mf] behaves as %[mt]</li>
<li>nohup: compat patch by Christoph Gysin &lt;mailinglist.cache at gmail.com&gt;</li>
<li>od: handle /proc files (which have filesize 0) correctly</li>
<li>patch: don't trash permissions of patched file</li>
<li>ps: add conditional support for -o [e]time</li>
<li>ps: fix COMMAND column adjustment; overflow in USER and VSZ columns</li>
<li>reset: call "stty sane". Closes bug 1414</li>
<li>rmdir: optional long options support for Debian users. By Roberto Gordo Saez &lt;roberto.gordo AT gmail.com&gt;</li>
<li>run-parts: add --reverse</li>
<li>script: correctly handle buffered "tail" of output</li>
<li>sed: "n" command must reset "we had successful subst" flag. Closes bug 1214</li>
<li>sort: -z outputs NUL terminated lines. Closes bug 1591</li>
<li>stty: fix mishandling of control keywords (Ralf Friedl &lt;Ralf.Friedl AT online.de&gt;)</li>
<li>switch_root: stop at first non-option. Closes bug 1425</li>
<li>syslogd: avoid excessive time() system calls</li>
<li>syslogd: don't die if remote host's IP cannot be resolved. Retry resolutions every two minutes instead</li>
<li>syslogd: fix shmat error check</li>
<li>syslogd: optional support for dropping dups. Closes bug 436</li>
<li>syslogd: send "\n"-terminated messages over the network. Fully closes bug 1574</li>
<li>syslogd: tighten up hostname handling</li>
<li>tail: fix "tail -c 20 /dev/huge_disk" (was taking ages)</li>
<li>tar: compat: handle tarballs with only one zero block at the end</li>
<li>tar: autodetection of gz/bz2 compressed tarballs. Closes bug 992</li>
<li>tar: real support for -p. By Natanael Copa &lt;natanael.copa at gmail.com&gt;</li>
<li>tcpudp: narrow down time window where we have no wildcard socket</li>
<li>telnetd: use login always, not "sometimes login, sometimes shell"</li>
<li>test: fix mishandling of "test ! arg1 op arg2 more args"</li>
<li>trylink: instead of build error, disable --gc-sections if GLIBC and STATIC are selected</li>
<li>udhcp: make file paths configurable</li>
<li>udhcp: optional support for non-standard DHCP ports</li>
<li>udhcp: set correct op byte in the packet for DHCPDECLINE</li>
<li>udhcpc: filter unwanted packets in kernel (Cristian Ionescu-Idbohrn &lt;cristian.ionescu-idbohrn AT axis.com&gt;)</li>
<li>udhcpc: fix wrong options in decline and release packets (Jonas Danielsson &lt;jonas.danielsson AT axis.com&gt;)</li>
<li>umount: do not complain several times about the same mountpoint</li>
<li>umount: do not try to free loop device or erase mtab if remounted ro</li>
<li>umount: instead of non-standard -D, use -d with opposite meaning. Closes bug 1604</li>
<li>unlzma: shrink by Pascal Bellard &lt;pascal.bellard AT ads-lu.com&gt;</li>
<li>unzip: do not try to read entire compressed stream at once (it can be huge)</li>
<li>unzip: handle short reads correctly</li>
<li>vi: many fixes</li>
<li>zcip: don't chdir to root</li>
<li>zcip: open ARP socket before openlog (else we can trash syslog socket)</li>
</ul>
</li>
<li><b>21 March 2008 -- BusyBox old stable releases</b>
<p>
Bugfix-only releases for four past branches. Links to locations
for future hot patches are in parentheses.
<p>
<a href="http://busybox.net/downloads/busybox-1.9.2.tar.bz2">1.9.2</a>
(<a href="http://busybox.net/downloads/fixes-1.9.2/">patches</a>),
<a href="http://busybox.net/downloads/busybox-1.8.3.tar.bz2">1.8.3</a>
(<a href="http://busybox.net/downloads/fixes-1.8.3/">patches</a>),
<a href="http://busybox.net/downloads/busybox-1.7.5.tar.bz2">1.7.5</a>
(<a href="http://busybox.net/downloads/fixes-1.7.5/">patches</a>),
<a href="http://busybox.net/downloads/busybox-1.5.2.tar.bz2">1.5.2</a>
(<a href="http://busybox.net/downloads/fixes-1.5.2/">patches</a>).
<p>
<a href="http://busybox.net/fix.html">How to add a patch.</a>
</p>
<li><b>12 February 2008 -- BusyBox 1.9.1 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.9.1.tar.bz2">BusyBox 1.9.1</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_9_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.9.1/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.9.1.tar.bz2>BusyBox 1.9.1</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_9_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.9.1/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>This is a bugfix-only release, with fixes to fsck,
iproute, mdev, mkswap, msh, nameif, stty, test, zcip.</p>
@@ -297,10 +16,10 @@ iproute_list_or_flush 3680 readhere 2308
</li>
<li><b>24 December 2007 -- BusyBox 1.9.0 (unstable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.9.0.tar.bz2">BusyBox 1.9.0</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_9_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.9.0/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.9.0.tar.bz2>BusyBox 1.9.0</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_9_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.9.0/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>Sizes of busybox-1.8.2 and busybox-1.9.0 (with almost full config, static uclibc build):<pre>
text data bss dec hex filename
@@ -362,17 +81,17 @@ parse_prompt 4132 insmod_main 3152
<li>df: -i option (show inode info) (Pascal Bellard &lt;pascal.bellard at ads-lu.com&gt;)
<li>hexdump: -R option (Pascal Bellard &lt;pascal.bellard at ads-lu.com&gt;)
</ul>
</li>
</p>
<li><b>23 November 2007 -- BusyBox 1.8.2 (stable), BusyBox 1.7.4 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.8.2.tar.bz2">BusyBox 1.8.2</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_8_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.8.2/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href="http://busybox.net/downloads/busybox-1.7.4.tar.bz2">BusyBox 1.7.4</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.7.4/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.8.2.tar.bz2>BusyBox 1.8.2</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_8_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.8.2/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.7.4.tar.bz2>BusyBox 1.7.4</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.7.4/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>These are bugfix-only releases.
1.8.2 contains fixes for inetd, lash, tar, tr, and build system.
@@ -380,19 +99,19 @@ parse_prompt 4132 insmod_main 3152
</li>
<li><b>9 November 2007 -- BusyBox 1.8.1 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.8.1.tar.bz2">BusyBox 1.8.1</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_8_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.8.1/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.8.1.tar.bz2>BusyBox 1.8.1</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_8_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.8.1/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>This is a bugfix-only release, with fixes to login (PAM), modprobe, syslogd, telnetd, unzip.</p>
</li>
<li><b>4 November 2007 -- BusyBox 1.8.0 (unstable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.8.0.tar.bz2">BusyBox 1.8.0</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_8_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.8.0/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.8.0.tar.bz2>BusyBox 1.8.0</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_8_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.8.0/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>Note: this is probably the very last release with lash. It will be dropped. Please migrate to hush.
@@ -493,40 +212,42 @@ Equivalent .config, i386 uclibc static builds:
<li>watchdog: allow millisecond spec (-t 250ms)
<li>zcip: fix unaligned trap on ARM
</ul>
</p>
</li>
<li><b>4 November 2007 -- BusyBox 1.7.3 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.7.3.tar.bz2">BusyBox 1.7.3</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.7.3/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.7.3.tar.bz2>BusyBox 1.7.3</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.7.3/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>This is a bugfix-only release, with fixes to ash, httpd, inetd, iptun, logger, login, tail.</p>
</li>
<li><b>30 September 2007 -- BusyBox 1.7.2 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.7.2.tar.bz2">BusyBox 1.7.2</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.7.2/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.7.2.tar.bz2>BusyBox 1.7.2</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.7.2/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>This is a bugfix-only release, with fixes to install, find, login, httpd, runsvdir, chcon, setfiles, fdisk and line editing.</p>
</li>
<li><b>16 September 2007 -- BusyBox 1.7.1 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.7.1.tar.bz2">BusyBox 1.7.1</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.7.1/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.7.1.tar.bz2>BusyBox 1.7.1</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.7.1/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>This is a bugfix-only release, with fixes to cp, runsv, tar, busybox --install and build system.</p>
</li>
<li><b>24 August 2007 -- BusyBox 1.7.0 (unstable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.7.0.tar.bz2">BusyBox 1.7.0</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.7.0/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.7.0.tar.bz2>BusyBox 1.7.0</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_7_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.7.0/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>Applets which had many changes since 1.6.x:
<p>httpd:
@@ -667,22 +388,23 @@ Same .config built against static uclibc:
<li>wget: lift 256 chars limitation on terminal width
<li>wget, zcip: use monotonic_sec instead of gettimeofday
</ul>
</p>
</li>
<li><b>30 June 2007 -- BusyBox 1.6.1 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.6.1.tar.bz2">BusyBox 1.6.1</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_6_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.6.1/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.6.1.tar.bz2>BusyBox 1.6.1</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_6_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.6.1/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>This is a bugfix-only release, with fixes to echo, hush, and wget.</p>
</li>
<li><b>1 June 2007 -- BusyBox 1.6.0 (unstable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.6.0.tar.bz2">BusyBox 1.6.0</a>.
(<a href="http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_6_stable/">svn</a>,
<a href="http://busybox.net/downloads/fixes-1.6.0/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.6.0.tar.bz2>BusyBox 1.6.0</a>.
(<a href=http://busybox.net/cgi-bin/viewcvs.cgi/branches/busybox_1_6_stable/>svn</a>,
<a href=http://busybox.net/downloads/fixes-1.6.0/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>Since this is a x.x.0 release, it probably does not deserve "stable"
label. Please help making 1.6.1 stable by testing 1.6.0.</p>
@@ -691,7 +413,7 @@ Same .config built against static uclibc:
report any such cases.</p>
<p>lash users please note: lash is going to be deprecated in busybox 1.7.0
and removed in the more distant future. Please migrate to hush.</p>
<p><a href="http://busybox.net/~vda/mem_usage-1.6.0.txt">Memory usage has decreased, but we can do better still</a></p>
<p><a href=http://busybox.net/~vda/mem_usage-1.6.0.txt>Memory usage has decreased, but we can do better still</a></p>
<p>Other changes since previous release:
<ul>
<li>NOFORK: audit small applets and mark some of them as NOFORK. Put big scary warnings in relevant places
@@ -789,21 +511,22 @@ Same .config built against static uclibc:
<li>xargs: shrink code, ~80 bytes; simplify word list management
<li>zcip: make it work on NOMMU (+ improve NOMMU support machinery)
</ul>
</p>
</li>
<li><b>20 May 2007 -- BusyBox 1.5.1 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.5.1.tar.bz2">BusyBox 1.5.1</a>.
(<a href="http://busybox.net/downloads/fixes-1.5.1/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.5.1.tar.bz2>BusyBox 1.5.1</a>.
(<a href=http://busybox.net/downloads/fixes-1.5.1/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>This is a bugfix-only release, with fixes to hdparm, hush, ifupdown, ps
and sed.</p>
</li>
<li><b>23 March 2007 -- BusyBox 1.5.0 (unstable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.5.0.tar.bz2">BusyBox 1.5.0</a>.
(<a href="http://busybox.net/downloads/fixes-1.5.0/">patches</a>,
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.5.0.tar.bz2>BusyBox 1.5.0</a>.
(<a href=http://busybox.net/downloads/fixes-1.5.0/>patches</a>,
<a href=http://busybox.net/fix.html>how to add a patch</a>)</p>
<p>Since this is a x.x.0 release, it probably does not deserve "stable"
label. Please help making 1.5.1 stable by testing 1.5.0.</p>
@@ -837,10 +560,11 @@ Same .config built against static uclibc:
<li>Applets with code cleaned up: telnet, fdisk, fsck_minix, mkfs_minix,
syslogd, swapon, runsv, svlogd, klogd
</ul>
</p>
</li>
<li><b>18 March 2007 -- BusyBox 1.4.2 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.4.2.tar.bz2">BusyBox 1.4.2</a>.
<p><a href=http://busybox.net/downloads/busybox-1.4.2.tar.bz2>BusyBox 1.4.2</a>.
</p>
<p>This release includes only trivial fixes accumulated since 1.4.1.
@@ -848,16 +572,16 @@ Same .config built against static uclibc:
</li>
<li><b>25 January 2007 -- BusyBox 1.4.1 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.4.1.tar.bz2">BusyBox 1.4.1</a>.
(<a href="http://busybox.net/downloads/fixes-1.4.1/">patches</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.4.1.tar.bz2>BusyBox 1.4.1</a>.
(<a href=http://busybox.net/downloads/fixes-1.4.1/>patches</a>)</p>
<p>This release includes only trivial fixes accumulated since 1.4.0.
</p>
</li>
<li><b>20 January 2007 -- BusyBox 1.4.0 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.4.0.tar.bz2">BusyBox 1.4.0</a>.
(<a href="http://busybox.net/downloads/fixes-1.4.0/">patches</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.4.0.tar.bz2>BusyBox 1.4.0</a>.
(<a href=http://busybox.net/downloads/fixes-1.4.0/>patches</a>)</p>
<p>Since this is a x.x.0 release, it probably is a bit less "stable"
than usual.</p>
@@ -887,26 +611,27 @@ Same .config built against static uclibc:
<li>minor bugfixes to: passwd, date, tftp, start_stop_daemon, tar,
ps, ifupdown, time, su, stty, awk, ping[6], sort,...
</ul>
</p>
</li>
<li><b>20 January 2007 -- BusyBox 1.3.2 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.3.2.tar.bz2">BusyBox 1.3.2</a>.</p>
<p><a href=http://busybox.net/downloads/busybox-1.3.2.tar.bz2>BusyBox 1.3.2</a>.</p>
<p>This release includes only one trivial fix accumulated since 1.3.1
</p>
</li>
<li><b>27 December 2006 -- BusyBox 1.3.1 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.3.1.tar.bz2">BusyBox 1.3.1</a>.
(<a href="http://busybox.net/downloads/fixes-1.3.1/">patches</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.3.1.tar.bz2>BusyBox 1.3.1</a>.
(<a href=http://busybox.net/downloads/fixes-1.3.1/>patches</a>)</p>
<p>Closing 2006 with new release. It includes only trivial fixes accumulated since 1.3.0
</p>
</li>
<li><b>14 December 2006 -- BusyBox 1.3.0 (stable)</b>
<p><a href="http://busybox.net/downloads/busybox-1.3.0.tar.bz2">BusyBox 1.3.0</a>.
(<a href="http://busybox.net/downloads/fixes-1.3.0/">patches</a>)</p>
<p><a href=http://busybox.net/downloads/busybox-1.3.0.tar.bz2>BusyBox 1.3.0</a>.
(<a href=http://busybox.net/downloads/fixes-1.3.0/>patches</a>)</p>
<p>This release has CONFIG_DESKTOP option which enables features
needed for busybox usage on desktop machine. For example, find, chmod
@@ -941,7 +666,7 @@ Same .config built against static uclibc:
</li>
<li><b>29 October 2006 -- BusyBox 1.2.2.1 (fix)</b>
<p><a href="http://busybox.net/downloads/busybox-1.2.2.1.tar.bz2">BusyBox 1.2.2.1</a>.</p>
<p><a href=http://busybox.net/downloads/busybox-1.2.2.1.tar.bz2>BusyBox 1.2.2.1</a>.</p>
<p>Added compile-time warning that static linking against glibc
produces buggy executables.
@@ -949,7 +674,7 @@ Same .config built against static uclibc:
<li><b>24 October 2006 -- BusyBox 1.2.2 (stable)</b>
<p>It's a bit overdue, but
<a href="http://busybox.net/downloads/busybox-1.2.2.tar.bz2">here is
<a href=http://busybox.net/downloads/busybox-1.2.2.tar.bz2>here is
BusyBox 1.2.2</a>.</p>
<p>This release has dozens of fixes backported from the ongoing development
@@ -968,9 +693,9 @@ Same .config built against static uclibc:
gzip to save memory, fix sulogin -tNNN, a help text tweak, several warning
fixes and build fixes, fixup dnsd a bit, and a partridge in a pear tree.</p>
<p>As <a href="http://lwn.net/Articles/202106/">Linux Weekly News noted</a>,
<p>As <a href=http://lwn.net/Articles/202106/>Linux Weekly News noted</a>,
this is my (Rob's) last release of BusyBox. The new maintainer is Denis
Vlasenko, I'm off to do <a href="http://landley.net/code">other things</a>.
Vlasenko, I'm off to do <a href=http://landley.net/code>other things</a>.
</p>
</li>
@@ -1333,7 +1058,7 @@ Same .config built against static uclibc:
<p>
People who rely on the <a href="downloads/snapshots/">daily BusyBox snapshots</a>
People who rely on the <a href= "downloads/snapshots/">daily BusyBox snapshots</a>
should be aware that snapshots of the old busybox 0.60.x
series are no longer available. Daily snapshots are now
only available for the BusyBox 1.0.0 series and now use
@@ -1535,7 +1260,7 @@ Same .config built against static uclibc:
If you have submitted patches, and they are not in this release
and I have not emailed you explaining why your patch was
rejected, it is safe to say that I have lost your patch. That
happens sometimes. Please do <b>NOT</b> send all your patches,
happens sometimes. Please do <B>NOT</b> send all your patches,
support questions, etc, directly to Erik. I get hundreds of
emails every day (which is why I end up losing patches
sometimes in the flood)... The busybox mailing list is the
@@ -1623,12 +1348,12 @@ Same .config built against static uclibc:
<li><b>6 March 2002 -- busybox.net now has mirrors!</b><p>
Busybox.net is now much more available, thanks to
the fine folks at <a href="http://i-netinnovations.com/">http://i-netinnovations.com/</a>
the fine folks at <a href= "http://i-netinnovations.com/">http://i-netinnovations.com/</a>
who are providing hosting for busybox.net and
uclibc.org. In addition, we now have two mirrors:
<a href="http://busybox.linuxmagic.com/">http://busybox.linuxmagic.com/</a>
<a href= "http://busybox.linuxmagic.com/">http://busybox.linuxmagic.com/</a>
in Canada and
<a href="http://busybox.csservers.de/">http://busybox.csservers.de/</a>
<a href= "http://busybox.csservers.de/">http://busybox.csservers.de/</a>
in Germany. I hope this makes things much more
accessible for everyone!
@@ -1736,7 +1461,7 @@ Click here to help buy busybox.net!
<input type="hidden" name="item_name" value="Support Busybox">
<input type="hidden" name="image_url" value="https://busybox.net/images/busybox2.jpg">
<input type="hidden" name="no_shipping" value="1">
<input type="image" src="images/donate.png" name="submit" alt="Make donation using PayPal">
<input type="image" src="images/donate.png" border="0" name="submit" alt="Make donation using PayPal">
</form>
</center>
<!-- End PayPal Logo -->
@@ -1870,7 +1595,7 @@ would be wonderful!
<br>
The illustrious Larry Doolittle has made a PostScript chart of the growth
of the Busybox tarball size over time. It is available for downloading /
viewing <a href="busybox-growth.ps"> right here</a>.
viewing <a href= "busybox-growth.ps"> right here</a>.
<p> (Note that while the number of applets in Busybox has increased, you
can still configure Busybox to be as small as you want by selectively
@@ -1916,7 +1641,7 @@ image</a>. Here's how you use it:
<ol>
<li> <a href="downloads/busybox.floppy.img">
<li> <a href= "downloads/busybox.floppy.img">
Download the image</a>
<li> dd it onto a floppy like so: <tt> dd if=busybox.floppy.img
+90 -84
View File
@@ -7,7 +7,7 @@ Do you use BusyBox? I'd love to know about it and
I'd be happy to link to you.
<p>
I know of the following projects that use BusyBox --
I know of the following products and/or projects that use BusyBox --
listed in the order I happen to add them to the web page:
<ul>
@@ -19,121 +19,124 @@ by the uClibc developers.
<li><a href="http://openwrt.org">OpenWrt</a> a Linux distribution for embedded
devices, based on buildroot.
<li><a href="http://www.pengutronix.de/software/ptxdist_en.html">PTXdist</a>
<br>another configurable means for building your own busybox based systems.
<li><a href="http://www.pengutronix.de/software/ptxdist_en.html">PTXdist</a><br>another
configurable means for building your own busybox based system systems.
<li><a href=
</li><li><a href=
"http://cvs.debian.org/boot-floppies/">
Debian installer (boot floppies) project</a>
<li><a href="http://redhat.com/">Red Hat installer</a>
</li><li><a href="http://redhat.com/">Red Hat installer</a>
<li><a href=
</li><li><a href=
"http://distro.ibiblio.org/pub/Linux/distributions/slackware/slackware-current/source/rootdisks/">
Slackware Installer</a>
<li><a href="http://www.gentoo.org/">Gentoo Linux install/boot CDs</a>
<li><a href="http://www.mandriva.com/">The Mandriva installer</a>
</li><li><a href="http://www.gentoo.org/">Gentoo Linux install/boot CDs</a>
</li><li><a href="http://www.mandriva.com/">The Mandriva installer</a>
<li><a href="http://Leaf.SourceForge.net">Linux Embedded Appliance Firewall</a>
<br>The sucessor of the Linux Router Project, supporting all sorts
of embedded Linux gateways, routers, wireless routers, and firewalls.
</li><li><a href="http://Leaf.SourceForge.net">Linux Embedded Appliance Firewall</a><br>The sucessor of the Linux Router Project, supporting all sorts of embedded Linux gateways, routers, wireless routers, and firewalls.
<li><a href=
</li><li><a href=
"http://www.toms.net/rb/">tomsrtbt</a>
<li><a href="http://www.stormix.com/">Stormix Installer</a>
</li><li><a href="http://www.stormix.com/">Stormix
Installer</a>
<li><a href="http://www.emacinc.com/linux2_sbc.htm">EMAC Linux 2.0 SBC</a>
</li><li><a href=
"http://www.emacinc.com/linux2_sbc.htm">EMAC Linux
2.0 SBC</a>
<li><a href="http://www.trinux.org/">Trinux</a>
</li><li><a href="http://www.trinux.org/">Trinux</a>
<li><a href="http://oddas.sourceforge.net/">ODDAS project</a>
</li><li><a href="http://oddas.sourceforge.net/">ODDAS
project</a>
<li><a href="http://byld.sourceforge.net/">Build Your Linux Disk</a>
</li><li><a href="http://byld.sourceforge.net/">Build Your
Linux Disk</a>
<li><a href=
</li><li><a href=
"http://ibiblio.org/pub/Linux/system/recovery">Zdisk</a>
<li><a href="http://www.adtran.com">AdTran -
</li><li><a href="http://www.adtran.com">AdTran -
VPN/firewall VPN Linux Distribution</a>
<li><a href="http://mkcdrec.ota.be/">mkCDrec - make CD-ROM recovery</a>
</li><li><a href="http://mkcdrec.ota.be/">mkCDrec - make
CD-ROM recovery</a>
<li><a href="http://recycle.lbl.gov/~ldoolitt/bse/">Linux on nanoEngine</a>
</li><li><a href=
"http://recycle.lbl.gov/~ldoolitt/bse/">Linux on
nanoEngine</a>
<li><a href="http://www.zelow.no/floppyfw/">Floppyfw</a>
</li><li><a href=
"http://www.zelow.no/floppyfw/">Floppyfw</a>
<li><a href="http://www.ltsp.org/">Linux Terminal Server Project</a>
</li><li><a href="http://www.ltsp.org/">Linux Terminal
Server Project</a>
<li><a href="http://www.devil-linux.org/">Devil-Linux</a>
</li><li><a href="http://www.devil-linux.org/">Devil-Linux</a>
<li><a href="http://dutnux.sourceforge.net/">DutNux</a>
</li><li><a href="http://dutnux.sourceforge.net/">DutNux</a>
<li><a href="http://www.microwerks.net/~hugo/mindi/">Mindi</a>
</li><li><a href="http://www.microwerks.net/~hugo/mindi/">Mindi</a>
<li><a href="http://www.minimalinux.org/ttylinux/">ttylinux</a>
</li><li><a href="http://www.minimalinux.org/ttylinux/">ttylinux</a>
<li><a href="http://www.coyotelinux.com/">Coyote Linux</a>
</li><li><a href="http://www.coyotelinux.com/">Coyote Linux</a>
<li><a href="http://www.partimage.org/">Partition Image</a>
</li><li><a href="http://www.partimage.org/">Partition
Image</a>
<li><a href="http://www.fli4l.de/">fli4l the on(e)-disk-router</a>
</li><li><a href="http://www.fli4l.de/">fli4l the on(e)-disk-router</a>
<li><a href="http://tinfoilhat.cultists.net/">Tinfoil Hat Linux</a>
</li><li><a href="http://tinfoilhat.cultists.net/">Tinfoil
Hat Linux</a>
<li><a href="http://sourceforge.net/projects/gp32linux/">gp32linux</a>
<li><a href="http://familiar.handhelds.org/">Familiar Linux</a><br>A linux distribution for handheld computers
<li><a href="http://rescuecd.sourceforge.net/">Timo's Rescue CD Set</a>
<li><a href="http://sf.net/projects/netstation/">Netstation</a>
<li><a href="http://www.fiwix.org/">GNU/Fiwix Operating System</a>
<li><a href="http://www.softcraft.com/">Generations Linux</a>
<li><a href="http://systemimager.org/relatedprojects/">SystemImager / System Installation Suite</a>
<li><a href="http://www.bablokb.de/gendist/">GENDIST distribution generator</a>
<li><a href="http://diet-pc.sourceforge.net/">DIET-PC embedded Linux thin client distribution</a>
<li><a href="http://byzgl.sourceforge.net/">BYZantine Gnu/Linux</a>
<li><a href="http://dban.sourceforge.net/">Darik's Boot and Nuke</a>
<li><a href="http://www.timesys.com/">TimeSys real-time Linux</a>
<li><a href="http://movix.sf.net/">MoviX</a><br>Boots from CD and automatically plays every video file on the CD
<li><a href="http://katamaran.sourceforge.net">katamaran</a><br>Linux, X11, xfce windowmanager, based on BusyBox
<li><a href="http://www.sourceforge.net/projects/simplygnustep">Prometheus SimplyGNUstep</a>
<li><a href="http://www.renyi.hu/~ekho/lowlife/">lowlife</a><br>A documentation project on how to make your own uClibc-based systems and floppy.
<li><a href="http://metadistros.hispalinux.es/">Metadistros</a><br>a project to allow you easily make Live-CD distributions.
<li><a href="http://salvare.sourceforge.net/">Salvare</a><br>More Linux than tomsrtbt but less than Knoppix, aims to provide a useful workstation as well as a rescue disk.
<li><a href="http://www.stresslinux.org/">stresslinux</a><br>minimal linux distribution running from a bootable cdrom or via PXE.
<li><a href="http://thinstation.sourceforge.net/">thinstation</a><br>convert standard PCs into full-featured diskless thinclients.
<li><a href="http://www.uhulinux.hu/">UHU-Linux Hungary</a>
<li><a href="http://deep-water.berlios.de/">Deep-Water Linux</a>
<li><a href="http://www.freesco.org/">Freesco router</a>
<li><a href="http://Sentry.SourceForge.net/">Sentry Firewall CD</a>
</li><li><a href="http://sourceforge.net/projects/gp32linux/">gp32linux</a>
</li><li><a href="http://familiar.handhelds.org/">Familiar Linux</a><br>A linux distribution for handheld computers
</li><li><a href="http://rescuecd.sourceforge.net/">Timo's Rescue CD Set</a>
</li><li><a href="http://sf.net/projects/netstation/">Netstation</a>
</li><li><a href="http://www.fiwix.org/">GNU/Fiwix Operating System</a>
</li><li><a href="http://www.softcraft.com/">Generations Linux</a>
</li><li><a href="http://systemimager.org/relatedprojects/">SystemImager / System Installation Suite</a>
</li><li><a href="http://www.bablokb.de/gendist/">GENDIST distribution generator</a>
</li><li><a href="http://diet-pc.sourceforge.net/">DIET-PC embedded Linux thin client distribution</a>
</li><li><a href="http://byzgl.sourceforge.net/">BYZantine Gnu/Linux</a>
</li><li><a href="http://dban.sourceforge.net/">Darik's Boot and Nuke</a>
</li><li><a href="http://www.timesys.com/">TimeSys real-time Linux</a>
</li><li><a href="http://movix.sf.net/">MoviX</a><br>Boots from CD and automatically plays every video file on the CD
</li><li><a href="http://katamaran.sourceforge.net">katamaran</a><br>Linux, X11, xfce windowmanager, based on BusyBox
</li><li><a href="http://www.sourceforge.net/projects/simplygnustep">Prometheus SimplyGNUstep</a>
</li><li><a href="http://www.renyi.hu/~ekho/lowlife/">lowlife</a><br>A documentation project on how to make your own uClibc-based systems and floppy.
</li><li><a href="http://metadistros.hispalinux.es/">Metadistros</a><br>a project to allow you easily make Live-CD distributions.
</li><li><a href="http://salvare.sourceforge.net/">Salvare</a><br>More Linux than tomsrtbt but less than Knoppix, aims to provide a useful workstation as well as a rescue disk.
</li><li><a href="http://www.stresslinux.org/">stresslinux</a><br>minimal linux distribution running from a bootable cdrom or via PXE.
</li><li><a href="http://thinstation.sourceforge.net/">thinstation</a><br>convert standard PCs into full-featured diskless thinclients.
</li><li><a href="http://www.uhulinux.hu/">UHU-Linux Hungary</a>
</li><li><a href="http://deep-water.berlios.de/">Deep-Water Linux</a>
</li><li><a href="http://www.freesco.org/">Freesco router</a>
</li><li><a href="http://Sentry.SourceForge.net/">Sentry Firewall CD</a>
</ul>
<p>
And here are products that use BusyBox --
<ul>
<li><a href="http://www.elpa.it/eng/rd129gb.html">RD129 embedded board from ELPA</a>
<li>EMTEC MovieCube R700 uses Busybox 1.1.3.
<li><a href="http://tuxscreen.net">Tuxscreen Linux Phone</a>
<li><a href="http://www.kerbango.com/">The Kerbango Internet Radio</a>
<li><a href="http://www.linuxmagic.com/vpn/">LinuxMagic VPN Firewall</a>
<li><a href="http://www.isilver-inc.com/">I-Silver Linux appliance servers</a>
<li><a href="http://zaurus.sourceforge.net/">Sharp Zaurus PDA</a>
<li><a href="http://www.cyclades.com/">Cyclades-TS and other Cyclades products</a>
<li><a href="http://www.linksys.com/products/product.asp?prid=508">Linksys WRT54G - Wireless-G Broadband Router</a>
<li><a href="http://www.dell.com/us/en/biz/topics/sbtopic_005_truemobile.htm">Dell TrueMobile 1184</a>
<li><a href="http://actiontec.com/products/modems/dual_pcmodem/dpm_overview.html">Actiontec Dual PC Modem</a>
<li><a href="http://www.kiss-technology.com/">Kiss DP Series DVD players</a>
<li><a href="http://www.netgear.com/products/prod_details.asp?prodID=170">NetGear WG602 wireless router</a>
</li><li><a href="http://tuxscreen.net">Tuxscreen Linux Phone</a>
</li><li><a href="http://www.kerbango.com/">The Kerbango Internet Radio</a>
</li><li><a href="http://www.linuxmagic.com/vpn/">LinuxMagic VPN Firewall</a>
</li><li><a href="http://www.isilver-inc.com/">I-Silver Linux appliance servers</a>
</li><li><a href="http://zaurus.sourceforge.net/">Sharp Zaurus PDA</a>
</li><li><a href="http://www.cyclades.com/">Cyclades-TS and other Cyclades products</a>
</li><li><a href="http://www.linksys.com/products/product.asp?prid=508">Linksys WRT54G - Wireless-G Broadband Router</a>
</li><li><a href="http://www.dell.com/us/en/biz/topics/sbtopic_005_truemobile.htm">Dell TrueMobile 1184</a>
</li><li><a href="http://actiontec.com/products/modems/dual_pcmodem/dpm_overview.html">Actiontec Dual PC Modem</a>
</li><li><a href="http://www.kiss-technology.com/">Kiss DP Series DVD players</a>
</li><li><a href="http://www.netgear.com/products/prod_details.asp?prodID=170">NetGear WG602 wireless router</a>
<br>with sources <a href="http://www.netgear.com/support/support_details.asp?dnldID=453">here</a>
<li><a href="http://www.trendware.com/products/TEW-411BRP.htm">TRENDnet TEW-411BRP 802.11g Wireless AP/Router/Switch</a>
</li><li><a href="http://www.trendware.com/products/TEW-411BRP.htm">TRENDnet TEW-411BRP 802.11g Wireless AP/Router/Switch</a>
<br>Source for busybox and udhcp <a href="http://www.trendware.com/asp/download/fileinfo.asp?file_id=277&amp;B1=Search">here</a> though no kernel source is provided.
<li><a href="http://www.buffalo-technology.com/webcontent/products/wireless/wbr-g54.htm">Buffalo WBR-G54 wireless router</a>
<li><a href="http://www.asus.com/products/communication/wireless/wl-300g/overview.htm">ASUS WL-300g Wireless LAN Access Point</a>
</li><li><a href="http://www.buffalo-technology.com/webcontent/products/wireless/wbr-g54.htm">Buffalo WBR-G54 wireless router</a>
</li><li><a href="http://www.asus.com/products/communication/wireless/wl-300g/overview.htm">ASUS WL-300g Wireless LAN Access Point</a>
<br>with source<a href="http://www.asus.com.tw/support/download/item.aspx?ModelName=WL-300G">here</a>
<li><a href="http://catalog.belkin.com/IWCatProductPage.process?Merchant_Id=&amp;Section_Id=201522&amp;pcount=&amp;Product_Id=136493">Belkin 54g Wireless DSL/Cable Gateway Router</a>
</li><li><a href="http://catalog.belkin.com/IWCatProductPage.process?Merchant_Id=&amp;Section_Id=201522&amp;pcount=&amp;Product_Id=136493">Belkin 54g Wireless DSL/Cable Gateway Router</a>
<br>with source<a href="http://web.belkin.com/support/gpl.asp">here</a>
<li><a href="http://www.acronis.com/products/partitionexpert/">Acronis PartitionExpert 2003</a>
<br>includes a heavily modified BusyBox v0.60.5 with built in
@@ -141,24 +144,27 @@ And here are products that use BusyBox --
uClibc 0.9.26, a heavily patched up linux kernel, etc. Source
can only be obtained <a href="http://www.acronis.com/files/gpl/linux.tar.bz2">here</a>
<li><a href="http://www.usr.com/">U.S. Robotics Sureconnect 4-port ADSL router</a><br>
</li><li><a href="http://www.usr.com/">U.S. Robotics Sureconnect 4-port ADSL router</a><br>
with source <a href="http://www.usr.com/support/s-gpl-code.asp">here</a>
<li><a href="http://www.actiontec.com/products/broadband/54mbps_wireless_gateway_1p/index.html">
</li><li><a href="http://www.actiontec.com/products/broadband/54mbps_wireless_gateway_1p/index.html">
ActionTec GT701-WG Wireless Gateway/DSL Modem</a>
with source <a href="http://128.121.226.214/gtproducts/index.html">here</a>
<li><a href="http://smartlinux.sourceforge.net/">S.M.A.R.T. Linux</a>
<li><a href="http://www.dlink.com/">DLink - Model GSL-G604T, DSL-300T, and possibly other models</a>
</li><li><a href="http://smartlinux.sourceforge.net/">S.M.A.R.T. Linux</a>
</li><li><a href="http://www.dlink.com/">DLink - Model GSL-G604T, DSL-300T, and possibly other models</a>
with source <a href="ftp://ftp.dlink.co.uk/dsl_routers_modems/">here,</a>
with source <a href="ftp://ftp.dlink.de/dsl-products/">and here,</a>
and quite possibly other places as well. You may need to dig down a bit
to find the source, but it does seem to be there.
<li><a href="http://www.siemens-mobile.de/cds/frontdoor/0,2241,de_de_0_42931_rArNrNrNrN,00.html">Siemens SE515 DSL router</a>
</li><li><a href="http://www.siemens-mobile.de/cds/frontdoor/0,2241,de_de_0_42931_rArNrNrNrN,00.html">Siemens SE515 DSL router</a>
with source <a href="http://now-portal.c-lab.de/projects/gigaset/">here, I think...</a>
with some details <a href="http://heinz.hippenstiel.org/familie/hp/hobby/gigaset_se515dsl.html">here.</a>
<li><a href="http://freeterm.spb.ru/frwt/">Free Remote Windows Terminal</a>
</li><li><a href="http://freeterm.spb.ru/frwt/">Free Remote Windows Terminal</a>
<li><a href="http://www.zyxel.com/">ZyXEL Routers</a>
</li><li><a href="http://www.zyxel.com/">ZyXEL Routers</a>
</li>
</ul>
<!--#include file="footer.html" -->
+9 -9
View File
@@ -12,35 +12,35 @@ project, consider these fine companies!</p>
OSU OSL kindly provides hosting for BusyBox and uClibc.
</li>
<li><a href="http://www.codepoet-consulting.com/">Codepoet Consulting</a><br>
<li><a href="http://www.codepoet-consulting.com">Codepoet Consulting</a><br>
Custom Linux, embedded Linux, BusyBox, and uClibc development.
</li>
<li><a href="http://www.laptopcomputers.org/">Laptop Computers</a> contributes
<li><a href=http://www.laptopcomputers.org/>Laptop Computers</a> contributes
financially.
</li>
<li>AOE media, a <a href="http://www.aoemedia.com/typo3-development.html">
<li>AOE media, a <a href=http://www.aoemedia.com/typo3-development.html>
TYPO3 development agency</a> contributes financially.
</li>
<li><a href="http://www.analog.com/en/">Analog Devices, Inc.</a> provided
a <a href="http://docs.blackfin.uclinux.org/doku.php?id=bf537_quick_start">
<li><a href=http://www.analog.com/en/>Analog Devices, Inc.</a> provided
a <a href=http://docs.blackfin.uclinux.org/doku.php?id=bf537_quick_start>
Blackfin development board</a> free of charge.
<a href="http://www.analog.com/blackfin">Blackfin</a>
<a href=http://www.analog.com/blackfin>Blackfin<a>
is a NOMMU processor, and its availability for testing is invaluable.
If you are an embedded device developer,
please note that Analog Devices has entire Linux distribution available
for download for this board. Visit
<a href="http://blackfin.uclinux.org/">http://blackfin.uclinux.org/</a>
<a href=http://blackfin.uclinux.org/>http://blackfin.uclinux.org/</a>
for more information.
</li>
<li><a href="http://www.timesys.com/">TimeSys</a><br>
<li><a href="http://www.timesys.com">TimeSys</a><br>
Embedded Linux development, cross-compilers, real-time, KGDB, tsrpm and cygwin.
</li>
<li><a href="http://www.penguru.net/">Penguru Consulting</a><br>
<li><a href="http://www.penguru.net">Penguru Consulting</a><br>
Custom development for embedded Linux systems and multimedia platforms.
</li>
+2 -2
View File
@@ -6,7 +6,7 @@
<h3>Patches</h3>
<p>You can <a href="downloads/">download</a> fixes for particular releases
<p>You can <a href="/downloads/">download</a> fixes for particular releases
of busybox, e.g. downloads/fixes-<em>major</em>-<em>minor</em>-<em>patch</em>/
<h3>Anonymous Subversion Access</h3>
@@ -20,7 +20,7 @@ svn co svn://busybox.net/trunk/busybox</pre>
<p>
The current <em>stable branch</em> can be obtained with
<pre>
svn co svn://busybox.net/branches/busybox_1_12_stable
svn co svn://busybox.net/branches/busybox_1_9_stable
</pre>
<p>
+11 -11
View File
@@ -9,7 +9,7 @@ dev mailing list.
<br><br>
<table>
<table border=1>
<tr>
<th>Feature</th>
<th>Utilities</th>
@@ -44,42 +44,42 @@ version of links</a>.</p>
<h3>SCRIPTING LANGUAGES</h3>
<p>Although busybox has built-in support for shell scripts, plenty of other
small scripting languages are available on the net. A few examples:</p>
<table>
<table border=1>
<tr>
<th>language</th>
<th>description</th>
<th><language></th>
<th><description></th>
</tr>
<tr>
<td> <a href="http://www.foo.be/docs/tpj/issues/vol5_3/tpj0503-0003.html">microperl</a> </td>
<td> <a href=http://www.foo.be/docs/tpj/issues/vol5_3/tpj0503-0003.html>microperl</a> </td>
<td> A small standalone perl interpreter that can be built from the perl source
s via "make -f Makefile.micro". If you really feel the need for perl on an embe
dded system, this is where to start.
</tr>
<tr>
<td><a href="http://www.lua.org/pil/">Lua</a></td>
<td>If you just want a small embedded scripting language to write <em>new</em>
<td><a href=http://www.lua.org/pil/>Lua</a></td>
<td>If you just want a small embedded scripting language to write <em>new</en>
code in, this Brazilian import is lightweight, fairly popular, and has
a complete book about it online.</td>
</tr>
<tr>
<td><a href="http://www.star.le.ac.uk/%7Etjg/rc/">rc</a></td>
<td><a href= http://www.star.le.ac.uk/%7Etjg/rc/>rc</a></td>
<td>The PLAN9 shell. Not compatible with conventional bourne shell syntax,
but fairly lightweight and small.</td>
</tr>
</tr>
<tr>
<td><a href="http://www.forth.org/">forth</a></td>
<td><a href=http://www.forth.org>forth</a></td>
<td>A well known language for fast and small programs, decades old but still
in use for everything from OpenBIOS to computer controlled engine timing.</td>
</tr>
</table>
<p>For more information, you probably want to look at
<a href="http://buildroot.uclibc.org/">buildroot</a> and
<a href="http://gentoo-wiki.com/TinyGentoo">TinyGentoo</a>, which
<a href=http://buildroot.uclibc.org>buildroot</a> and
<a href=http://gentoo-wiki.com/TinyGentoo>TinyGentoo</a>, which
build and use tiny utilities for all sorts of things.</p>
<!--#include file="footer.html" -->
+5 -6
View File
@@ -6,9 +6,9 @@ BusyBox - The Swiss Army Knife of Embedded Linux
=head1 SYNTAX
busybox <applet> [arguments...] # or
BusyBox <function> [arguments...] # or
<applet> [arguments...] # if symlinked
<function> [arguments...] # if symlinked
=head1 DESCRIPTION
@@ -45,8 +45,7 @@ BusyBox is a multi-call binary. A multi-call binary is an executable program
that performs the same job as more than one utility program. That means there
is just a single BusyBox binary, but that single binary acts like a large
number of utilities. This allows BusyBox to be smaller since all the built-in
utility programs (we call them applets) can share code for many common
operations.
utility programs (we call them applets) can share code for many common operations.
You can also invoke BusyBox by issuing a command as an argument on the
command line. For example, entering
@@ -73,11 +72,11 @@ applets that have been compiled into your BusyBox binary.
=head1 COMMON OPTIONS
Most BusyBox applets support the B<--help> argument to provide a terse runtime
Most BusyBox commands support the B<--help> argument to provide a terse runtime
description of their behavior. If the CONFIG_FEATURE_VERBOSE_USAGE option has
been enabled, more detailed usage information will also be available.
=head1 COMMANDS
Currently available applets include:
Currently defined functions include:
+2 -4
View File
@@ -51,11 +51,9 @@ device nodes if your system needs something more than the default root/root
660 permissions.
The file has the format:
<device regex> <uid>:<gid> <octal permissions>
or @<maj[,min1[-min2]]> <uid>:<gid> <octal permissions>
<device regex> <uid>:<gid> <octal permissions>
For example:
hd[a-z][0-9]* 0:3 660
hd[a-z][0-9]* 0:3 660
The config file parsing stops at the first matching line. If no line is
matched, then the default of 0:0 660 is used. To set your own default, simply
+2 -2
View File
@@ -313,10 +313,10 @@ static void load_fs_info(const char *filename)
// Loop through entries
while (getmntent_r(fstab, &mte, bb_common_bufsiz1, COMMON_BUFSIZE)) {
//bb_info_msg("CREATE[%s][%s][%s][%s][%d]", mte.mnt_fsname, mte.mnt_dir,
// mte.mnt_type, mte.mnt_opts,
// mte.mnt_type, mte.mnt_opts,
// mte.mnt_passno);
fs = create_fs_device(mte.mnt_fsname, mte.mnt_dir,
mte.mnt_type, mte.mnt_opts,
mte.mnt_type, mte.mnt_opts,
mte.mnt_passno);
}
endmntent(fstab);
+9 -9
View File
@@ -192,10 +192,10 @@ struct buffer_head {
#define K_DEV_FS 1
#define K_DEV_JOURNAL 2
#define lock_buffer(bh) do {} while (0)
#define unlock_buffer(bh) do {} while (0)
#define lock_buffer(bh) do {} while(0)
#define unlock_buffer(bh) do {} while(0)
#define buffer_req(bh) 1
#define do_readahead(journal, start) do {} while (0)
#define do_readahead(journal, start) do {} while(0)
static e2fsck_t e2fsck_global_ctx; /* Try your very best not to use this! */
@@ -10014,7 +10014,7 @@ static int do_one_pass(journal_t *journal,
* all of the sequence number checks. What are we going
* to do with it? That depends on the pass... */
switch (blocktype) {
switch(blocktype) {
case JFS_DESCRIPTOR_BLOCK:
/* If it is a valid descriptor block, replay it
* in pass REPLAY; otherwise, just skip over the
@@ -11158,7 +11158,7 @@ int journal_init_revoke(journal_t *journal, int hash_size)
shift = 0;
tmp = hash_size;
while ((tmp >>= 1UL) != 0UL)
while((tmp >>= 1UL) != 0UL)
shift++;
journal->j_revoke->hash_shift = shift;
@@ -12251,7 +12251,7 @@ static int read_a_char(void)
int r;
int fail = 0;
while (1) {
while(1) {
if (e2fsck_global_ctx &&
(e2fsck_global_ctx->flags & E2F_FLAG_CANCEL)) {
return 3;
@@ -12281,7 +12281,7 @@ static int ask_yn(const char * string, int def)
tmp.c_lflag &= ~(ICANON | ECHO);
tmp.c_cc[VMIN] = 1;
tmp.c_cc[VTIME] = 0;
tcsetattr_stdin_TCSANOW(&tmp);
tcsetattr (0, TCSANOW, &tmp);
#endif
if (def == 1)
@@ -12297,7 +12297,7 @@ static int ask_yn(const char * string, int def)
break;
if (c == 3) {
#ifdef HAVE_TERMIOS_H
tcsetattr_stdin_TCSANOW(&termios);
tcsetattr (0, TCSANOW, &termios);
#endif
if (e2fsck_global_ctx &&
e2fsck_global_ctx->flags & E2F_FLAG_SETJMP_OK) {
@@ -12323,7 +12323,7 @@ static int ask_yn(const char * string, int def)
else
puts ("no\n");
#ifdef HAVE_TERMIOS_H
tcsetattr_stdin_TCSANOW(&termios);
tcsetattr (0, TCSANOW, &termios);
#endif
return def;
}
+1 -1
View File
@@ -42,7 +42,7 @@ static void TEA_transform(__u32 buf[4], __u32 const in[])
sum += DELTA;
b0 += ((b1 << 4)+a) ^ (b1+sum) ^ ((b1 >> 5)+b);
b1 += ((b0 << 4)+c) ^ (b0+sum) ^ ((b0 >> 5)+d);
} while (--n);
} while(--n);
buf[0] += b0;
buf[1] += b1;
+1 -1
View File
@@ -113,7 +113,7 @@ errcode_t ext2fs_create_resize_inode(ext2_filsys fs)
inode_size *= fs->blocksize;
inode.i_size = inode_size & 0xFFFFFFFF;
inode.i_size_high = (inode_size >> 32) & 0xFFFFFFFF;
if (inode.i_size_high) {
if(inode.i_size_high) {
sb->s_feature_ro_compat |=
EXT2_FEATURE_RO_COMPAT_LARGE_FILE;
}
+15 -15
View File
@@ -533,21 +533,21 @@ static struct fs_info *lookup(char *filesys)
/* Find fsck program for a given fs type. */
static char *find_fsck(char *type)
{
char *s;
const char *tpl;
char *p = string_copy(fsck_path);
struct stat st;
char *s;
const char *tpl;
char *p = string_copy(fsck_path);
struct stat st;
/* Are we looking for a program or just a type? */
tpl = (strncmp(type, "fsck.", 5) ? "%s/fsck.%s" : "%s/%s");
/* Are we looking for a program or just a type? */
tpl = (strncmp(type, "fsck.", 5) ? "%s/fsck.%s" : "%s/%s");
for (s = strtok(p, ":"); s; s = strtok(NULL, ":")) {
s = xasprintf(tpl, s, type);
if (stat(s, &st) == 0) break;
free(s);
}
free(p);
return s;
for(s = strtok(p, ":"); s; s = strtok(NULL, ":")) {
s = xasprintf(tpl, s, type);
if (stat(s, &st) == 0) break;
free(s);
}
free(p);
return s;
}
static int progress_active(void)
@@ -885,7 +885,7 @@ static void compile_fs_type(char *fs_type, struct fs_type_compile *cmp)
list = string_copy(fs_type);
num = 0;
s = strtok(list, ",");
while (s) {
while(s) {
negate = 0;
if (strncmp(s, "no", 2) == 0) {
s += 2;
@@ -930,7 +930,7 @@ static int opt_in_list(char *opt, char *optlist)
list = string_copy(optlist);
s = strtok(list, ",");
while (s) {
while(s) {
if (strcmp(s, opt) == 0) {
free(list);
return 1;
+2 -2
View File
@@ -676,7 +676,7 @@ static int set_os(struct ext2_super_block *sb, char *os)
return 1;
}
if ((sb->s_creator_os = e2p_string2os(os)) >= 0) {
if((sb->s_creator_os = e2p_string2os(os)) >= 0) {
return 1;
} else if (!strcasecmp("GNU", os)) {
sb->s_creator_os = EXT2_OS_HURD;
@@ -1187,7 +1187,7 @@ int mke2fs_main (int argc, char **argv)
if (ENABLE_FEATURE_CLEAN_UP)
atexit(mke2fs_clean_up);
if (!PRS(argc, argv))
if(!PRS(argc, argv))
return 0;
#ifdef CONFIG_TESTIO_DEBUG
+8 -8
View File
@@ -37,7 +37,7 @@ void check_plausibility(const char *device, int force)
val = stat(device, &s);
if (force)
return;
if (val == -1)
if(val == -1)
bb_perror_msg_and_die("cannot stat %s", device);
if (!S_ISBLK(s.st_mode)) {
printf("%s is not a block special device.\n", device);
@@ -220,13 +220,13 @@ void make_journal_device(char *journal_device, ext2_filsys fs, int quiet, int fo
fs->blocksize, io_ptr, &jfs);
if (retval)
bb_error_msg_and_die("cannot journal device %s", journal_device);
if (!quiet)
if(!quiet)
printf("Adding journal to device %s: ", journal_device);
fflush(stdout);
retval = ext2fs_add_journal_device(fs, jfs);
if (retval)
if(retval)
bb_error_msg_and_die("\nFailed to add journal to device %s", journal_device);
if (!quiet)
if(!quiet)
puts("done");
ext2fs_close(jfs);
}
@@ -242,14 +242,14 @@ void make_journal_blocks(ext2_filsys fs, int journal_size, int journal_flags, in
~EXT3_FEATURE_COMPAT_HAS_JOURNAL;
return;
}
if (!quiet)
if(!quiet)
printf("Creating journal (%ld blocks): ", journal_blocks);
fflush(stdout);
retval = ext2fs_add_journal_inode(fs, journal_blocks,
journal_flags);
if (retval)
if(retval)
bb_error_msg_and_die("cannot create journal");
if (!quiet)
if(!quiet)
puts("done");
}
@@ -262,6 +262,6 @@ char *e2fs_set_sbin_path(void)
oldpath = xasprintf("%s:%s", PATH_SET, oldpath);
else
oldpath = PATH_SET;
putenv(oldpath);
putenv (oldpath);
return oldpath;
}
+2 -2
View File
@@ -12,9 +12,9 @@ config AWK
Awk is used as a pattern scanning and processing language. This is
the BusyBox implementation of that programming language.
config FEATURE_AWK_LIBM
config FEATURE_AWK_MATH
bool "Enable math functions (requires libm)"
default n
default y
depends on AWK
help
Enable math functions of the Awk programming language.
+19 -39
View File
@@ -512,7 +512,7 @@ static const char EMSG_TOO_FEW_ARGS[] ALIGN1 = "Too few arguments for builtin";
static const char EMSG_NOT_ARRAY[] ALIGN1 = "Not an array";
static const char EMSG_POSSIBLE_ERROR[] ALIGN1 = "Possible syntax error";
static const char EMSG_UNDEF_FUNC[] ALIGN1 = "Call to undefined function";
#if !ENABLE_FEATURE_AWK_LIBM
#if !ENABLE_FEATURE_AWK_MATH
static const char EMSG_NO_MATH[] ALIGN1 = "Math support is not compiled in";
#endif
@@ -681,18 +681,6 @@ static ALWAYS_INLINE int isalnum_(int c)
return (isalnum(c) || c == '_');
}
static double my_strtod(char **pp)
{
#if ENABLE_DESKTOP
if ((*pp)[0] == '0'
&& ((((*pp)[1] | 0x20) == 'x') || isdigit((*pp)[1]))
) {
return strtoull(*pp, pp, 0);
}
#endif
return strtod(*pp, pp);
}
/* -------- working with variables (set/get/copy/etc) -------- */
static xhash *iamarray(var *v)
@@ -802,7 +790,7 @@ static double getvar_i(var *v)
v->number = 0;
s = v->string;
if (s && *s) {
v->number = my_strtod(&s);
v->number = strtod(s, &s);
if (v->type & VF_USER) {
skip_spaces(&s);
if (*s != '\0')
@@ -816,19 +804,6 @@ static double getvar_i(var *v)
return v->number;
}
/* Used for operands of bitwise ops */
static unsigned long getvar_i_int(var *v)
{
double d = getvar_i(v);
/* Casting doubles to longs is undefined for values outside
* of target type range. Try to widen it as much as possible */
if (d >= 0)
return (unsigned long)d;
/* Why? Think about d == -4294967295.0 (assuming 32bit longs) */
return - (long) (unsigned long) (-d);
}
static var *copyvar(var *dest, const var *src)
{
if (dest != src) {
@@ -998,7 +973,12 @@ static uint32_t next_token(uint32_t expected)
} else if (*p == '.' || isdigit(*p)) {
/* it's a number */
t_double = my_strtod(&p);
#if ENABLE_DESKTOP
if (p[0] == '0' && (p[1] | 0x20) == 'x')
t_double = strtoll(p, &p, 0);
else
#endif
t_double = strtod(p, &p);
if (*p == '.')
syntax_error(EMSG_UNEXP_TOKEN);
tc = TC_NUMBER;
@@ -2024,8 +2004,8 @@ static var *exec_builtin(node *op, var *res)
switch (info & OPNMASK) {
case B_a2:
#if ENABLE_FEATURE_AWK_LIBM
setvar_i(res, atan2(getvar_i(av[0]), getvar_i(av[1])));
#if ENABLE_FEATURE_AWK_MATH
setvar_i(res, atan2(getvar_i(av[i]), getvar_i(av[1])));
#else
syntax_error(EMSG_NO_MATH);
#endif
@@ -2042,7 +2022,7 @@ static var *exec_builtin(node *op, var *res)
n = awk_split(as[0], spl, &s);
s1 = s;
clear_array(iamarray(av[1]));
for (i = 1; i <= n; i++)
for (i=1; i<=n; i++)
setari_u(av[1], i, nextword(&s1));
free(s);
setvar_i(res, n);
@@ -2062,27 +2042,27 @@ static var *exec_builtin(node *op, var *res)
/* Bitwise ops must assume that operands are unsigned. GNU Awk 3.1.5:
* awk '{ print or(-1,1) }' gives "4.29497e+09", not "-2.xxxe+09" */
case B_an:
setvar_i(res, getvar_i_int(av[0]) & getvar_i_int(av[1]));
setvar_i(res, (unsigned long)getvar_i(av[0]) & (unsigned long)getvar_i(av[1]));
break;
case B_co:
setvar_i(res, ~getvar_i_int(av[0]));
setvar_i(res, ~(unsigned long)getvar_i(av[0]));
break;
case B_ls:
setvar_i(res, getvar_i_int(av[0]) << getvar_i_int(av[1]));
setvar_i(res, (unsigned long)getvar_i(av[0]) << (unsigned long)getvar_i(av[1]));
break;
case B_or:
setvar_i(res, getvar_i_int(av[0]) | getvar_i_int(av[1]));
setvar_i(res, (unsigned long)getvar_i(av[0]) | (unsigned long)getvar_i(av[1]));
break;
case B_rs:
setvar_i(res, getvar_i_int(av[0]) >> getvar_i_int(av[1]));
setvar_i(res, (unsigned long)getvar_i(av[0]) >> (unsigned long)getvar_i(av[1]));
break;
case B_xo:
setvar_i(res, getvar_i_int(av[0]) ^ getvar_i_int(av[1]));
setvar_i(res, (unsigned long)getvar_i(av[0]) ^ (unsigned long)getvar_i(av[1]));
break;
case B_lo:
@@ -2465,7 +2445,7 @@ static var *evaluate(node *op, var *res)
case F_rn:
R.d = (double)rand() / (double)RAND_MAX;
break;
#if ENABLE_FEATURE_AWK_LIBM
#if ENABLE_FEATURE_AWK_MATH
case F_co:
R.d = cos(L.d);
break;
@@ -2633,7 +2613,7 @@ static var *evaluate(node *op, var *res)
L.d /= R.d;
break;
case '&':
#if ENABLE_FEATURE_AWK_LIBM
#if ENABLE_FEATURE_AWK_MATH
L.d = pow(L.d, R.d);
#else
syntax_error(EMSG_NO_MATH);
+1 -1
View File
@@ -1189,7 +1189,7 @@ static char **get_recursive_dirlist(char *path)
recursive_action(path, ACTION_RECURSE|ACTION_FOLLOWLINKS,
add_to_dirlist, /* file_action */
NULL, /* dir_action */
(void*)(ptrdiff_t)(strlen(path) + 1),
(void*)(strlen(path) + 1),
0);
} else {
DIR *dp;
+228 -109
View File
@@ -57,6 +57,30 @@ enum {
MAX_SCR_ROWS = CONFIG_FEATURE_VI_MAX_LEN,
};
// Misc. non-Ascii keys that report an escape sequence
#define VI_K_UP (char)128 // cursor key Up
#define VI_K_DOWN (char)129 // cursor key Down
#define VI_K_RIGHT (char)130 // Cursor Key Right
#define VI_K_LEFT (char)131 // cursor key Left
#define VI_K_HOME (char)132 // Cursor Key Home
#define VI_K_END (char)133 // Cursor Key End
#define VI_K_INSERT (char)134 // Cursor Key Insert
#define VI_K_DELETE (char)135 // Cursor Key Insert
#define VI_K_PAGEUP (char)136 // Cursor Key Page Up
#define VI_K_PAGEDOWN (char)137 // Cursor Key Page Down
#define VI_K_FUN1 (char)138 // Function Key F1
#define VI_K_FUN2 (char)139 // Function Key F2
#define VI_K_FUN3 (char)140 // Function Key F3
#define VI_K_FUN4 (char)141 // Function Key F4
#define VI_K_FUN5 (char)142 // Function Key F5
#define VI_K_FUN6 (char)143 // Function Key F6
#define VI_K_FUN7 (char)144 // Function Key F7
#define VI_K_FUN8 (char)145 // Function Key F8
#define VI_K_FUN9 (char)146 // Function Key F9
#define VI_K_FUN10 (char)147 // Function Key F10
#define VI_K_FUN11 (char)148 // Function Key F11
#define VI_K_FUN12 (char)149 // Function Key F12
/* vt102 typical ESC sequence */
/* terminal standout start/normal ESC sequence */
static const char SOs[] ALIGN1 = "\033[7m";
@@ -72,12 +96,6 @@ static const char CMrc[] ALIGN1 = "\033[%d;%dH";
static const char CMup[] ALIGN1 = "\033[A";
static const char CMdown[] ALIGN1 = "\n";
#if ENABLE_FEATURE_VI_DOT_CMD || ENABLE_FEATURE_VI_YANKMARK
// cmds modifying text[]
// vda: removed "aAiIs" as they switch us into insert mode
// and remembering input for replay after them makes no sense
static const char modifying_cmds[] = "cCdDJoOpPrRxX<>~";
#endif
enum {
YANKONLY = FALSE,
@@ -147,11 +165,10 @@ struct globals {
char *screen; // pointer to the virtual screen buffer
int screensize; // and its size
int tabstop;
int last_forward_char; // last char searched for with 'f' (int because of Unicode)
char erase_char; // the users erase character
char last_input_char; // last char read from user
char last_forward_char; // last char searched for with 'f'
smalluint chars_to_parse;
#if ENABLE_FEATURE_VI_DOT_CMD
smallint adding2q; // are we currently adding user input to q
int lmc_len; // length of last_modifying_cmd
@@ -163,10 +180,13 @@ struct globals {
#if ENABLE_FEATURE_VI_USE_SIGNALS || ENABLE_FEATURE_VI_CRASHME
int my_pid;
#endif
#if ENABLE_FEATURE_VI_DOT_CMD || ENABLE_FEATURE_VI_YANKMARK
char *modifying_cmds; // cmds that modify text[]
#endif
#if ENABLE_FEATURE_VI_SEARCH
char *last_search_pattern; // last pattern from a '/' or '?' search
#endif
int chars_to_parse;
/* former statics */
#if ENABLE_FEATURE_VI_YANKMARK
char *edit_file__cur_line;
@@ -189,11 +209,11 @@ struct globals {
char *initial_cmds[3]; // currently 2 entries, NULL terminated
#endif
// Should be just enough to hold a key sequence,
// but CRASHME mode uses it as generated command buffer too
// but CRASME mode uses it as generated command buffer too
#if ENABLE_FEATURE_VI_CRASHME
char readbuffer[128];
#else
char readbuffer[KEYCODE_BUFFER_SIZE];
char readbuffer[32];
#endif
#define STATUS_BUFFER_LEN 200
char status_buffer[STATUS_BUFFER_LEN]; // messages to the user
@@ -232,10 +252,9 @@ struct globals {
#define screensize (G.screensize )
#define screenbegin (G.screenbegin )
#define tabstop (G.tabstop )
#define last_forward_char (G.last_forward_char )
#define erase_char (G.erase_char )
#define last_input_char (G.last_input_char )
#define chars_to_parse (G.chars_to_parse )
#define last_forward_char (G.last_forward_char )
#if ENABLE_FEATURE_VI_READONLY
#define readonly_mode (G.readonly_mode )
#else
@@ -247,7 +266,9 @@ struct globals {
#define ioq_start (G.ioq_start )
#define last_row (G.last_row )
#define my_pid (G.my_pid )
#define modifying_cmds (G.modifying_cmds )
#define last_search_pattern (G.last_search_pattern)
#define chars_to_parse (G.chars_to_parse )
#define edit_file__cur_line (G.edit_file__cur_line)
#define refresh__old_offset (G.refresh__old_offset)
@@ -270,14 +291,14 @@ struct globals {
#define INIT_G() do { \
SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
last_file_modified = -1; \
/* "" but has space for 2 chars: */ \
/* "" but has space for 2 chars */ \
USE_FEATURE_VI_SEARCH(last_search_pattern = xzalloc(2);) \
} while (0)
static int init_text_buffer(char *); // init from file or create new
static void edit_file(char *); // edit one file
static void do_cmd(int); // execute a command
static void do_cmd(char); // execute a command
static int next_tabstop(int);
static void sync_cursor(char *, int *, int *); // synchronize the screen cursor to dot
static char *begin_line(char *); // return pointer to cur line B-o-l
@@ -313,8 +334,8 @@ static void rawmode(void); // set "raw" mode on tty
static void cookmode(void); // return to "cooked" mode on tty
// sleep for 'h' 1/100 seconds, return 1/0 if stdin is (ready for read)/(not ready)
static int mysleep(int);
static int readit(void); // read (maybe cursor) key from stdin
static int get_one_char(void); // read 1 char from stdin
static char readit(void); // read (maybe cursor) key from stdin
static char get_one_char(void); // read 1 char from stdin
static int file_size(const char *); // what is the byte size of "fn"
#if ENABLE_FEATURE_VI_READONLY
static int file_insert(const char *, char *, int);
@@ -329,7 +350,6 @@ static void place_cursor(int, int, int);
static void screen_erase(void);
static void clear_to_eol(void);
static void clear_to_eos(void);
static void go_bottom_and_clear_to_eol(void);
static void standout_start(void); // send "start reverse video" sequence
static void standout_end(void); // send "end reverse video" sequence
static void flash(int); // flash the terminal screen
@@ -410,6 +430,10 @@ int vi_main(int argc, char **argv)
#endif
vi_setops = VI_AUTOINDENT | VI_SHOWMATCH | VI_IGNORECASE;
#if ENABLE_FEATURE_VI_DOT_CMD || ENABLE_FEATURE_VI_YANKMARK
modifying_cmds = (char *) "aAcCdDiIJoOpPrRsxX<>~"; // cmds modifying text[]
#endif
// 1- process $HOME/.exrc file (not inplemented yet)
// 2- process EXINIT variable from environment
// 3- process command line args
@@ -503,7 +527,7 @@ static void edit_file(char *fn)
#if ENABLE_FEATURE_VI_YANKMARK
#define cur_line edit_file__cur_line
#endif
int c;
char c;
int size;
#if ENABLE_FEATURE_VI_USE_SIGNALS
int sig;
@@ -601,21 +625,18 @@ static void edit_file(char *fn)
// These are commands that change text[].
// Remember the input for the "." command
if (!adding2q && ioq_start == NULL
&& cmd_mode == 0 // command mode
&& c > '\0' // exclude NUL and non-ASCII chars
&& c < 0x7f // (Unicode and such)
&& strchr(modifying_cmds, c)
&& c != '\0' && strchr(modifying_cmds, c)
) {
start_new_cmd_q(c);
}
#endif
do_cmd(c); // execute the user command
//
// poll to see if there is input already waiting. if we are
// not able to display output fast enough to keep up, skip
// the display update until we catch up with input.
if (!chars_to_parse && mysleep(0) == 0) {
// no input pending - so update output
if (mysleep(0) == 0) {
// no input pending- so update output
refresh(FALSE);
show_status_line();
}
@@ -626,7 +647,8 @@ static void edit_file(char *fn)
}
//-------------------------------------------------------------------
go_bottom_and_clear_to_eol();
place_cursor(rows - 1, 0, FALSE); // go to bottom of screen
clear_to_eol(); // erase to end of line
cookmode();
#undef cur_line
}
@@ -822,7 +844,8 @@ static void colon(char *buf)
else if (strncmp(cmd, "!", 1) == 0) { // run a cmd
int retcode;
// :!ls run the <cmd>
go_bottom_and_clear_to_eol();
place_cursor(rows - 1, 0, FALSE); // go to Status line
clear_to_eol(); // clear the line
cookmode();
retcode = system(orig_buf + 1); // run the cmd
if (retcode)
@@ -899,7 +922,8 @@ static void colon(char *buf)
}
} else if (strncasecmp(cmd, "features", i) == 0) { // what features are available
// print out values of all features
go_bottom_and_clear_to_eol();
place_cursor(rows - 1, 0, FALSE); // go to Status line, bottom of screen
clear_to_eol(); // clear the line
cookmode();
show_help();
rawmode();
@@ -909,7 +933,8 @@ static void colon(char *buf)
q = begin_line(dot); // assume .,. for the range
r = end_line(dot);
}
go_bottom_and_clear_to_eol();
place_cursor(rows - 1, 0, FALSE); // go to Status line, bottom of screen
clear_to_eol(); // clear the line
puts("\r");
for (; q <= r; q++) {
int c_is_no_print;
@@ -1009,7 +1034,8 @@ static void colon(char *buf)
// only blank is regarded as args delmiter. What about tab '\t' ?
if (!args[0] || strcasecmp(args, "all") == 0) {
// print out values of all options
go_bottom_and_clear_to_eol();
place_cursor(rows - 1, 0, FALSE); // go to Status line, bottom of screen
clear_to_eol(); // clear the line
printf("----------------------------------------\r\n");
#if ENABLE_FEATURE_VI_SETOPTS
if (!autoindent)
@@ -1179,7 +1205,7 @@ static void colon(char *buf)
static void Hit_Return(void)
{
int c;
char c;
standout_start();
write1("[Hit return to continue]");
@@ -2106,13 +2132,13 @@ static void rawmode(void)
term_vi.c_cc[VMIN] = 1;
term_vi.c_cc[VTIME] = 0;
erase_char = term_vi.c_cc[VERASE];
tcsetattr_stdin_TCSANOW(&term_vi);
tcsetattr(0, TCSANOW, &term_vi);
}
static void cookmode(void)
{
fflush(stdout);
tcsetattr_stdin_TCSANOW(&term_orig);
tcsetattr(0, TCSANOW, &term_orig);
}
//----- Come here when we get a window resize signal ---------
@@ -2145,7 +2171,8 @@ static void cont_sig(int sig UNUSED_PARAM)
//----- Come here when we get a Suspend signal -------------------
static void suspend_sig(int sig UNUSED_PARAM)
{
go_bottom_and_clear_to_eol();
place_cursor(rows - 1, 0, FALSE); // go to bottom of screen
clear_to_eol(); // erase to end of line
cookmode(); // terminal to "cooked"
signal(SIGCONT, cont_sig);
@@ -2172,24 +2199,120 @@ static int mysleep(int hund) // sleep for 'h' 1/100 seconds
}
//----- IO Routines --------------------------------------------
static int readit(void) // read (maybe cursor) key from stdin
static char readit(void) // read (maybe cursor) key from stdin
{
int c;
char c;
int n;
struct esc_cmds {
const char seq[4];
char val;
};
static const struct esc_cmds esccmds[] = {
{"OA" , VI_K_UP }, // cursor key Up
{"OB" , VI_K_DOWN }, // cursor key Down
{"OC" , VI_K_RIGHT }, // Cursor Key Right
{"OD" , VI_K_LEFT }, // cursor key Left
{"OH" , VI_K_HOME }, // Cursor Key Home
{"OF" , VI_K_END }, // Cursor Key End
{"[A" , VI_K_UP }, // cursor key Up
{"[B" , VI_K_DOWN }, // cursor key Down
{"[C" , VI_K_RIGHT }, // Cursor Key Right
{"[D" , VI_K_LEFT }, // cursor key Left
{"[H" , VI_K_HOME }, // Cursor Key Home
{"[F" , VI_K_END }, // Cursor Key End
{"[1~" , VI_K_HOME }, // Cursor Key Home
{"[2~" , VI_K_INSERT }, // Cursor Key Insert
{"[3~" , VI_K_DELETE }, // Cursor Key Delete
{"[4~" , VI_K_END }, // Cursor Key End
{"[5~" , VI_K_PAGEUP }, // Cursor Key Page Up
{"[6~" , VI_K_PAGEDOWN}, // Cursor Key Page Down
{"OP" , VI_K_FUN1 }, // Function Key F1
{"OQ" , VI_K_FUN2 }, // Function Key F2
{"OR" , VI_K_FUN3 }, // Function Key F3
{"OS" , VI_K_FUN4 }, // Function Key F4
// careful: these have no terminating NUL!
{"[11~", VI_K_FUN1 }, // Function Key F1
{"[12~", VI_K_FUN2 }, // Function Key F2
{"[13~", VI_K_FUN3 }, // Function Key F3
{"[14~", VI_K_FUN4 }, // Function Key F4
{"[15~", VI_K_FUN5 }, // Function Key F5
{"[17~", VI_K_FUN6 }, // Function Key F6
{"[18~", VI_K_FUN7 }, // Function Key F7
{"[19~", VI_K_FUN8 }, // Function Key F8
{"[20~", VI_K_FUN9 }, // Function Key F9
{"[21~", VI_K_FUN10 }, // Function Key F10
{"[23~", VI_K_FUN11 }, // Function Key F11
{"[24~", VI_K_FUN12 }, // Function Key F12
};
enum { ESCCMDS_COUNT = ARRAY_SIZE(esccmds) };
fflush(stdout);
c = read_key(STDIN_FILENO, &chars_to_parse, readbuffer);
if (c == -1) { // EOF/error
go_bottom_and_clear_to_eol();
cookmode(); // terminal to "cooked"
bb_error_msg_and_die("can't read user input");
n = chars_to_parse;
// get input from User - are there already input chars in Q?
if (n <= 0) {
// the Q is empty, wait for a typed char
again:
n = safe_read(STDIN_FILENO, readbuffer, sizeof(readbuffer));
if (n <= 0) {
place_cursor(rows - 1, 0, FALSE); // go to bottom of screen
clear_to_eol(); // erase to end of line
cookmode(); // terminal to "cooked"
bb_error_msg_and_die("can't read user input");
}
/* elsewhere we can get very confused by NULs */
if (readbuffer[0] == '\0')
goto again;
if (readbuffer[0] == 27) {
// This is an ESC char. Is this Esc sequence?
// Could be bare Esc key. See if there are any
// more chars to read after the ESC. This would
// be a Function or Cursor Key sequence.
struct pollfd pfd[1];
pfd[0].fd = 0;
pfd[0].events = POLLIN;
// keep reading while there are input chars, and room in buffer
// for a complete ESC sequence (assuming 8 chars is enough)
while ((safe_poll(pfd, 1, 0) > 0)
&& ((size_t)n <= (sizeof(readbuffer) - 8))
) {
// read the rest of the ESC string
int r = safe_read(STDIN_FILENO, readbuffer + n, sizeof(readbuffer) - n);
if (r > 0)
n += r;
}
}
chars_to_parse = n;
}
c = readbuffer[0];
if (c == 27 && n > 1) {
// Maybe cursor or function key?
const struct esc_cmds *eindex;
for (eindex = esccmds; eindex < &esccmds[ESCCMDS_COUNT]; eindex++) {
int cnt = strnlen(eindex->seq, 4);
if (n <= cnt)
continue;
if (strncmp(eindex->seq, readbuffer + 1, cnt) != 0)
continue;
c = eindex->val; // magic char value
n = cnt + 1; // squeeze out the ESC sequence
goto found;
}
// defined ESC sequence not found
}
n = 1;
found:
// remove key sequence from Q
chars_to_parse -= n;
memmove(readbuffer, readbuffer + n, sizeof(readbuffer) - n);
return c;
}
//----- IO Routines --------------------------------------------
static int get_one_char(void)
static char get_one_char(void)
{
int c;
char c;
#if ENABLE_FEATURE_VI_DOT_CMD
if (!adding2q) {
@@ -2200,8 +2323,7 @@ static int get_one_char(void)
c = readit(); // get the users input
} else {
// there is a queue to get chars from first
// careful with correct sign expansion!
c = (unsigned char)*ioq++;
c = *ioq++;
if (c == '\0') {
// the end of the q, read from STDIN
free(ioq_start);
@@ -2231,12 +2353,13 @@ static char *get_input_line(const char *prompt)
// char [MAX_INPUT_LEN]
#define buf get_input_line__buf
int c;
char c;
int i;
strcpy(buf, prompt);
last_status_cksum = 0; // force status update
go_bottom_and_clear_to_eol();
place_cursor(rows - 1, 0, FALSE); // go to Status line, bottom of screen
clear_to_eol(); // clear the line
write1(prompt); // write out the :, /, or ? prompt
i = strlen(buf);
@@ -2250,8 +2373,7 @@ static char *get_input_line(const char *prompt)
write1("\b \b"); // erase char on screen
if (i <= 0) // user backs up before b-o-l, exit
break;
} else if (c > 0 && c < 256) { // exclude Unicode
// (TODO: need to handle Unicode)
} else {
buf[i] = c;
buf[++i] = '\0';
bb_putchar(c);
@@ -2441,12 +2563,6 @@ static void clear_to_eol(void)
write1(Ceol); // Erase from cursor to end of line
}
static void go_bottom_and_clear_to_eol(void)
{
place_cursor(rows - 1, 0, FALSE); // go to bottom of screen
clear_to_eol(); // erase to end of line
}
//----- Erase from cursor to end of screen -----------------------
static void clear_to_eos(void)
{
@@ -2518,8 +2634,9 @@ static void show_status_line(void)
}
if (have_status_msg || ((cnt > 0 && last_status_cksum != cksum))) {
last_status_cksum = cksum; // remember if we have seen this line
go_bottom_and_clear_to_eol();
place_cursor(rows - 1, 0, FALSE); // put cursor on status line
write1(status_buffer);
clear_to_eol();
if (have_status_msg) {
if (((int)strlen(status_buffer) - (have_status_msg - 1)) >
(columns - 1) ) {
@@ -2854,14 +2971,13 @@ static void refresh(int full_screen)
//---------------------------------------------------------------------
//----- Execute a Vi Command -----------------------------------
static void do_cmd(int c)
static void do_cmd(char c)
{
const char *msg = msg; // for compiler
char *p, *q, *save_dot;
char c1, *p, *q, *save_dot;
char buf[12];
int dir;
int cnt, i, j;
int c1;
// c1 = c; // quiet the compiler
// cnt = yf = 0; // quiet the compiler
@@ -2872,21 +2988,20 @@ static void do_cmd(int c)
/* if this is a cursor key, skip these checks */
switch (c) {
case KEYCODE_UP:
case KEYCODE_DOWN:
case KEYCODE_LEFT:
case KEYCODE_RIGHT:
case KEYCODE_HOME:
case KEYCODE_END:
case KEYCODE_PAGEUP:
case KEYCODE_PAGEDOWN:
case KEYCODE_DELETE:
case VI_K_UP:
case VI_K_DOWN:
case VI_K_LEFT:
case VI_K_RIGHT:
case VI_K_HOME:
case VI_K_END:
case VI_K_PAGEUP:
case VI_K_PAGEDOWN:
goto key_cmd_mode;
}
if (cmd_mode == 2) {
// flip-flop Insert/Replace mode
if (c == KEYCODE_INSERT)
if (c == VI_K_INSERT)
goto dc_i;
// we are 'R'eplacing the current *dot with new char
if (*dot == '\n') {
@@ -2903,7 +3018,7 @@ static void do_cmd(int c)
}
if (cmd_mode == 1) {
// hitting "Insert" twice means "R" replace mode
if (c == KEYCODE_INSERT) goto dc5;
if (c == VI_K_INSERT) goto dc5;
// insert the char c at "dot"
if (1 <= c || Isprint(c)) {
dot = char_insert(dot, c);
@@ -2967,7 +3082,7 @@ static void do_cmd(int c)
case 0x00: // nul- ignore
break;
case 2: // ctrl-B scroll up full screen
case KEYCODE_PAGEUP: // Cursor Key Page Up
case VI_K_PAGEUP: // Cursor Key Page Up
dot_scroll(rows - 2, -1);
break;
case 4: // ctrl-D scroll down half screen
@@ -2977,14 +3092,14 @@ static void do_cmd(int c)
dot_scroll(1, 1);
break;
case 6: // ctrl-F scroll down full screen
case KEYCODE_PAGEDOWN: // Cursor Key Page Down
case VI_K_PAGEDOWN: // Cursor Key Page Down
dot_scroll(rows - 2, 1);
break;
case 7: // ctrl-G show current status
last_status_cksum = 0; // force status update
break;
case 'h': // h- move left
case KEYCODE_LEFT: // cursor key Left
case VI_K_LEFT: // cursor key Left
case 8: // ctrl-H- move left (This may be ERASE char)
case 0x7f: // DEL- move left (This may be ERASE char)
if (cmdcnt-- > 1) {
@@ -2994,7 +3109,7 @@ static void do_cmd(int c)
break;
case 10: // Newline ^J
case 'j': // j- goto next line, same col
case KEYCODE_DOWN: // cursor key Down
case VI_K_DOWN: // cursor key Down
if (cmdcnt-- > 1) {
do_cmd(c);
} // repeat cnt
@@ -3033,7 +3148,7 @@ static void do_cmd(int c)
break;
case ' ': // move right
case 'l': // move right
case KEYCODE_RIGHT: // Cursor Key Right
case VI_K_RIGHT: // Cursor Key Right
if (cmdcnt-- > 1) {
do_cmd(c);
} // repeat cnt
@@ -3041,18 +3156,21 @@ static void do_cmd(int c)
break;
#if ENABLE_FEATURE_VI_YANKMARK
case '"': // "- name a register to use for Delete/Yank
c1 = (get_one_char() | 0x20) - 'a'; // | 0x20 is tolower()
if ((unsigned)c1 <= 25) { // a-z?
YDreg = c1;
c1 = get_one_char();
c1 = tolower(c1);
if (islower(c1)) {
YDreg = c1 - 'a';
} else {
indicate_error(c);
}
break;
case '\'': // '- goto a specific mark
c1 = (get_one_char() | 0x20) - 'a';
if ((unsigned)c1 <= 25) { // a-z?
c1 = get_one_char();
c1 = tolower(c1);
if (islower(c1)) {
c1 = c1 - 'a';
// get the b-o-l
q = mark[c1];
q = mark[(unsigned char) c1];
if (text <= q && q < end) {
dot = q;
dot_begin(); // go to B-o-l
@@ -3071,10 +3189,12 @@ static void do_cmd(int c)
// between text[0] and dot then this mark will not point to the
// correct location! It could be off by many lines!
// Well..., at least its quick and dirty.
c1 = (get_one_char() | 0x20) - 'a';
if ((unsigned)c1 <= 25) { // a-z?
c1 = get_one_char();
c1 = tolower(c1);
if (islower(c1)) {
c1 = c1 - 'a';
// remember the line
mark[c1] = dot;
mark[(int) c1] = dot;
} else {
indicate_error(c);
}
@@ -3118,7 +3238,7 @@ static void do_cmd(int c)
break;
#endif /* FEATURE_VI_YANKMARK */
case '$': // $- goto end of line
case KEYCODE_END: // Cursor Key End
case VI_K_END: // Cursor Key End
if (cmdcnt-- > 1) {
do_cmd(c);
} // repeat cnt
@@ -3403,11 +3523,12 @@ static void do_cmd(int c)
end_cmd_q(); // stop adding to q
#endif
break;
case 'g': // 'gg' goto a line number (vim) (default: very first line)
case 'g': // 'gg' goto a line number (from vim)
// (default to first line in file)
c1 = get_one_char();
if (c1 != 'g') {
buf[0] = 'g';
buf[1] = c1; // TODO: if Unicode?
buf[1] = c1;
buf[2] = '\0';
not_implemented(buf);
break;
@@ -3437,7 +3558,7 @@ static void do_cmd(int c)
dot_skip_over_ws();
//**** fall through to ... 'i'
case 'i': // i- insert before current char
case KEYCODE_INSERT: // Cursor Key Insert
case VI_K_INSERT: // Cursor Key Insert
dc_i:
cmd_mode = 1; // start insrting
break;
@@ -3490,7 +3611,7 @@ static void do_cmd(int c)
dc5:
cmd_mode = 2;
break;
case KEYCODE_DELETE:
case VI_K_DELETE:
c = 'x';
// fall through
case 'X': // X- delete char before dot
@@ -3564,7 +3685,7 @@ static void do_cmd(int c)
case 'y': // y- yank something
case 'Y': // Y- Yank a line
#endif
{
{
int yf, ml, whole = 0;
yf = YANKDEL; // assume either "c" or "d"
#if ENABLE_FEATURE_VI_YANKMARK
@@ -3637,10 +3758,10 @@ static void do_cmd(int c)
#endif
end_cmd_q(); // stop adding to q
}
}
break;
}
case 'k': // k- goto prev line, same col
case KEYCODE_UP: // cursor key Up
case VI_K_UP: // cursor key Up
if (cmdcnt-- > 1) {
do_cmd(c);
} // repeat cnt
@@ -3660,7 +3781,7 @@ static void do_cmd(int c)
do_cmd(';');
if (*dot == last_forward_char)
dot_left();
last_forward_char = 0;
last_forward_char= 0;
break;
case 'w': // w- forward a word
if (cmdcnt-- > 1) {
@@ -3705,25 +3826,23 @@ static void do_cmd(int c)
end_cmd_q(); // stop adding to q
break;
//----- The Cursor and Function Keys -----------------------------
case KEYCODE_HOME: // Cursor Key Home
case VI_K_HOME: // Cursor Key Home
dot_begin();
break;
// The Fn keys could point to do_macro which could translate them
#if 0
case KEYCODE_FUN1: // Function Key F1
case KEYCODE_FUN2: // Function Key F2
case KEYCODE_FUN3: // Function Key F3
case KEYCODE_FUN4: // Function Key F4
case KEYCODE_FUN5: // Function Key F5
case KEYCODE_FUN6: // Function Key F6
case KEYCODE_FUN7: // Function Key F7
case KEYCODE_FUN8: // Function Key F8
case KEYCODE_FUN9: // Function Key F9
case KEYCODE_FUN10: // Function Key F10
case KEYCODE_FUN11: // Function Key F11
case KEYCODE_FUN12: // Function Key F12
case VI_K_FUN1: // Function Key F1
case VI_K_FUN2: // Function Key F2
case VI_K_FUN3: // Function Key F3
case VI_K_FUN4: // Function Key F4
case VI_K_FUN5: // Function Key F5
case VI_K_FUN6: // Function Key F6
case VI_K_FUN7: // Function Key F7
case VI_K_FUN8: // Function Key F8
case VI_K_FUN9: // Function Key F9
case VI_K_FUN10: // Function Key F10
case VI_K_FUN11: // Function Key F11
case VI_K_FUN12: // Function Key F12
break;
#endif
}
dc1:
+1 -1
View File
@@ -146,7 +146,7 @@ config FEATURE_FIND_DELETE
default n
depends on FIND && FEATURE_FIND_DEPTH
help
Support the 'find -delete' option for deleting files and directories.
Support the 'find -delete' option for deleting files and direcotries.
WARNING: This option can do much harm if used wrong. Busybox will not
try to protect the user from doing stupid things. Use with care.
+3 -8
View File
@@ -80,7 +80,6 @@ USE_AWK(APPLET_NOEXEC(awk, awk, _BB_DIR_USR_BIN, _BB_SUID_NEVER, awk))
USE_BASENAME(APPLET_NOFORK(basename, basename, _BB_DIR_USR_BIN, _BB_SUID_NEVER, basename))
USE_BBCONFIG(APPLET(bbconfig, _BB_DIR_BIN, _BB_SUID_NEVER))
//USE_BBSH(APPLET(bbsh, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_BLKID(APPLET(blkid, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_BRCTL(APPLET(brctl, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_BUNZIP2(APPLET(bunzip2, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_BUNZIP2(APPLET_ODDNAME(bzcat, bunzip2, _BB_DIR_USR_BIN, _BB_SUID_NEVER, bzcat))
@@ -119,7 +118,6 @@ USE_DELUSER(APPLET(deluser, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_DEPMOD(APPLET(depmod, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_MODPROBE_SMALL(APPLET_ODDNAME(depmod, modprobe, _BB_DIR_SBIN, _BB_SUID_NEVER, modprobe))
USE_DEVFSD(APPLET(devfsd, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_DEVMEM(APPLET(devmem, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_DF(APPLET(df, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_APP_DHCPRELAY(APPLET(dhcprelay, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_DIFF(APPLET(diff, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
@@ -151,6 +149,7 @@ USE_FBSPLASH(APPLET(fbsplash, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, _BB_DIR_BIN, _BB_SUID_NEVER, fdflush))
USE_FDFORMAT(APPLET(fdformat, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_FDISK(APPLET(fdisk, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_FETCHMAIL(APPLET_ODDNAME(fetchmail, sendgetmail, _BB_DIR_USR_BIN, _BB_SUID_NEVER, fetchmail))
USE_FEATURE_GREP_FGREP_ALIAS(APPLET_ODDNAME(fgrep, grep, _BB_DIR_BIN, _BB_SUID_NEVER, fgrep))
USE_FIND(APPLET_NOEXEC(find, find, _BB_DIR_USR_BIN, _BB_SUID_NEVER, find))
USE_FINDFS(APPLET(findfs, _BB_DIR_SBIN, _BB_SUID_MAYBE))
@@ -237,7 +236,6 @@ USE_LSMOD(APPLET(lsmod, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_MODPROBE_SMALL(APPLET_ODDNAME(lsmod, modprobe, _BB_DIR_SBIN, _BB_SUID_NEVER, modprobe))
USE_UNLZMA(APPLET_ODDNAME(lzmacat, unlzma, _BB_DIR_USR_BIN, _BB_SUID_NEVER, lzmacat))
USE_MAKEDEVS(APPLET(makedevs, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_MAKEMIME(APPLET(makemime, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_MAN(APPLET(man, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_MATCHPATHCON(APPLET(matchpathcon, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_MD5SUM(APPLET_ODDNAME(md5sum, md5_sha1_sum, _BB_DIR_USR_BIN, _BB_SUID_NEVER, md5sum))
@@ -270,7 +268,7 @@ USE_NOHUP(APPLET(nohup, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_NSLOOKUP(APPLET(nslookup, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_OD(APPLET(od, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_OPENVT(APPLET(openvt, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
//USE_PARSE(APPLET(parse, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_PARSE(APPLET(parse, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_PASSWD(APPLET(passwd, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS))
USE_PATCH(APPLET(patch, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_PGREP(APPLET(pgrep, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
@@ -280,7 +278,6 @@ USE_PING6(APPLET(ping6, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_PIPE_PROGRESS(APPLET(pipe_progress, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_PIVOT_ROOT(APPLET(pivot_root, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_PKILL(APPLET_ODDNAME(pkill, pgrep, _BB_DIR_USR_BIN, _BB_SUID_NEVER, pkill))
USE_POPMAILDIR(APPLET(popmaildir, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_HALT(APPLET_ODDNAME(poweroff, halt, _BB_DIR_SBIN, _BB_SUID_NEVER, poweroff))
USE_PRINTENV(APPLET(printenv, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_PRINTF(APPLET_NOFORK(printf, printf, _BB_DIR_USR_BIN, _BB_SUID_NEVER, printf))
@@ -295,7 +292,6 @@ USE_READLINK(APPLET(readlink, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_READPROFILE(APPLET(readprofile, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_REALPATH(APPLET(realpath, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_HALT(APPLET_ODDNAME(reboot, halt, _BB_DIR_SBIN, _BB_SUID_NEVER, reboot))
USE_REFORMIME(APPLET(reformime, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_RENICE(APPLET(renice, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_RESET(APPLET(reset, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_RESIZE(APPLET(resize, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
@@ -317,7 +313,7 @@ USE_RX(APPLET(rx, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_SCRIPT(APPLET(script, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_SED(APPLET(sed, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_SELINUXENABLED(APPLET(selinuxenabled, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_SENDMAIL(APPLET(sendmail, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_SENDMAIL(APPLET_ODDNAME(sendmail, sendgetmail, _BB_DIR_USR_SBIN, _BB_SUID_NEVER, sendmail))
USE_SEQ(APPLET_NOFORK(seq, seq, _BB_DIR_USR_BIN, _BB_SUID_NEVER, seq))
USE_SESTATUS(APPLET(sestatus, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_SETARCH(APPLET(setarch, _BB_DIR_BIN, _BB_SUID_NEVER))
@@ -359,7 +355,6 @@ USE_TAC(APPLET_NOEXEC(tac, tac, _BB_DIR_USR_BIN, _BB_SUID_NEVER, tac))
USE_TAIL(APPLET(tail, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_TAR(APPLET(tar, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_TASKSET(APPLET(taskset, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
/* USE_TC(APPLET(tc, _BB_DIR_SBIN, _BB_SUID_NEVER)) */
USE_TCPSVD(APPLET_ODDNAME(tcpsvd, tcpudpsvd, _BB_DIR_USR_BIN, _BB_SUID_NEVER, tcpsvd))
USE_TEE(APPLET(tee, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_TELNET(APPLET(telnet, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
+18 -12
View File
@@ -21,17 +21,21 @@
* POSIX Standard: 9.2.1 Group Database Access <grp.h>
*/
#ifndef BB_GRP_H
#define BB_GRP_H 1
#ifndef _GRP_H
#define _GRP_H 1
#if __GNUC_PREREQ(4,1)
# pragma GCC visibility push(hidden)
#endif
/* This file is #included after #include <grp.h>
* We will use libc-defined structures, but will #define function names
* so that function calls are directed to bb_internal_XXX replacements
*/
/* The group structure. */
struct group {
char *gr_name; /* Group name. */
char *gr_passwd; /* Password. */
gid_t gr_gid; /* Group ID. */
char **gr_mem; /* Member list. */
};
#define setgrent bb_internal_setgrent
#define endgrent bb_internal_endgrent
@@ -49,7 +53,9 @@
/* All function names below should be remapped by #defines above
* in order to not collide with libc names. */
* in order to not collide with libc names.
* In theory it isn't necessary, but I saw weird interactions at link time.
* Let's play safe */
/* Rewind the group-file stream. */
@@ -65,14 +71,14 @@ extern struct group *getgrent(void);
extern struct group *fgetgrent(FILE *__stream);
/* Write the given entry onto the given stream. */
extern int putgrent(const struct group *__restrict __p,
extern int putgrent(__const struct group *__restrict __p,
FILE *__restrict __f);
/* Search for an entry with a matching group ID. */
extern struct group *getgrgid(gid_t __gid);
/* Search for an entry with a matching group name. */
extern struct group *getgrnam(const char *__name);
extern struct group *getgrnam(__const char *__name);
/* Reentrant versions of some of the functions above.
@@ -92,7 +98,7 @@ extern int getgrgid_r(gid_t __gid, struct group *__restrict __resultbuf,
struct group **__restrict __result);
/* Search for an entry with a matching group name. */
extern int getgrnam_r(const char *__restrict __name,
extern int getgrnam_r(__const char *__restrict __name,
struct group *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct group **__restrict __result);
@@ -107,13 +113,13 @@ extern int fgetgrent_r(FILE *__restrict __stream,
/* Store at most *NGROUPS members of the group set for USER into
*GROUPS. Also include GROUP. The actual number of groups found is
returned in *NGROUPS. Return -1 if the if *NGROUPS is too small. */
extern int getgrouplist(const char *__user, gid_t __group,
extern int getgrouplist(__const char *__user, gid_t __group,
gid_t *__groups, int *__ngroups);
/* Initialize the group set for the current user
by reading the group database and using all groups
of which USER is a member. Also include GROUP. */
extern int initgroups(const char *__user, gid_t __group);
extern int initgroups(__const char *__user, gid_t __group);
#if __GNUC_PREREQ(4,1)
# pragma GCC visibility pop
+25 -64
View File
@@ -69,15 +69,21 @@
#include <dmalloc.h>
#endif
#include <pwd.h>
#include <grp.h>
#if !ENABLE_USE_BB_PWD_GRP
# include <pwd.h>
# include <grp.h>
#endif
#if ENABLE_FEATURE_SHADOWPASSWDS
# include <shadow.h>
# if !ENABLE_USE_BB_SHADOW
# include <shadow.h>
# endif
#endif
/* Some libc's forget to declare these, do it ourself */
extern char **environ;
/* Set the group set for the current user to GROUPS (N of them). */
int setgroups(size_t n, const gid_t *groups);
#if defined(__GLIBC__) && __GLIBC__ < 2
int vdprintf(int d, const char *format, va_list ap);
#endif
@@ -103,7 +109,7 @@ struct sysinfo {
unsigned long totalhigh; /* Total high memory size */
unsigned long freehigh; /* Available high memory size */
unsigned int mem_unit; /* Memory unit size in bytes */
char _f[20 - 2 * sizeof(long) - sizeof(int)]; /* Padding: libc5 uses this.. */
char _f[20 - 2*sizeof(long) - sizeof(int)]; /* Padding: libc5 uses this.. */
};
int sysinfo(struct sysinfo* info);
@@ -367,9 +373,6 @@ void sig_unblock(int sig) FAST_FUNC;
int sigaction_set(int sig, const struct sigaction *act) FAST_FUNC;
/* SIG_BLOCK/SIG_UNBLOCK all signals: */
int sigprocmask_allsigs(int how) FAST_FUNC;
/* Standard handler which just records signo */
extern smallint bb_got_signal;
void record_signo(int signo); /* not FAST_FUNC! */
void xsetgid(gid_t gid) FAST_FUNC;
@@ -437,7 +440,6 @@ ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to,
* Turn it on before you call bind(). */
void setsockopt_reuseaddr(int fd) FAST_FUNC; /* On Linux this never fails. */
int setsockopt_broadcast(int fd) FAST_FUNC;
int setsockopt_bindtodevice(int fd, const char *iface) FAST_FUNC;
/* NB: returns port in host byte order */
unsigned bb_lookup_port(const char *port, const char *protocol, unsigned default_port) FAST_FUNC;
typedef struct len_and_sockaddr {
@@ -744,7 +746,7 @@ int bb_execvp(const char *file, char *const argv[]) FAST_FUNC;
pid_t spawn(char **argv) FAST_FUNC;
pid_t xspawn(char **argv) FAST_FUNC;
pid_t safe_waitpid(pid_t pid, int *wstat, int options) FAST_FUNC;
int safe_waitpid(int pid, int *wstat, int options) FAST_FUNC;
/* Unlike waitpid, waits ONLY for one process.
* It's safe to pass negative 'pids' from failed [v]fork -
* wait4pid will return -1 (and will not clobber [v]fork's errno).
@@ -752,14 +754,14 @@ pid_t safe_waitpid(pid_t pid, int *wstat, int options) FAST_FUNC;
* if (rc < 0) bb_perror_msg("%s", argv[0]);
* if (rc > 0) bb_error_msg("exit code: %d", rc);
*/
int wait4pid(pid_t pid) FAST_FUNC;
pid_t wait_any_nohang(int *wstat) FAST_FUNC;
int wait4pid(int pid) FAST_FUNC;
int wait_any_nohang(int *wstat) FAST_FUNC;
#define wait_crashed(w) ((w) & 127)
#define wait_exitcode(w) ((w) >> 8)
#define wait_stopsig(w) ((w) >> 8)
#define wait_stopped(w) (((w) & 127) == 127)
/* wait4pid(spawn(argv)) + NOFORK/NOEXEC (if configured) */
pid_t spawn_and_wait(char **argv) FAST_FUNC;
int spawn_and_wait(char **argv) FAST_FUNC;
struct nofork_save_area {
jmp_buf die_jmp;
const char *applet_name;
@@ -790,7 +792,7 @@ int run_nofork_applet_prime(struct nofork_save_area *old, int applet_no, char **
*
* forkexit_or_rexec(argv) = bare-bones "fork + parent exits" on MMU,
* "vfork + re-exec ourself" on NOMMU. No fd redirection, no setsid().
* Currently used for setsid only. On MMU ignores argv.
* Currently used for openvt and setsid. On MMU ignores argv.
*
* Helper for network daemons in foreground mode:
*
@@ -913,47 +915,15 @@ int chown_main(int argc, char **argv) USE_CHOWN(MAIN_EXTERNALLY_VISIBLE);
/* Don't need USE_xxx() guard for these */
int gunzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int bunzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int bbunpack(char **argv,
char* (*make_new_name)(char *filename),
USE_DESKTOP(long long) int (*unpacker)(void)
) FAST_FUNC;
#if ENABLE_ROUTE
void bb_displayroutes(int noresolve, int netstatfmt) FAST_FUNC;
#endif
/* "Keycodes" that report an escape sequence.
* We use something which fits into signed char,
* yet doesn't represent any valid Unicode characher.
* 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,
#if 0
KEYCODE_FUN1 = -12,
KEYCODE_FUN2 = -13,
KEYCODE_FUN3 = -14,
KEYCODE_FUN4 = -15,
KEYCODE_FUN5 = -16,
KEYCODE_FUN6 = -17,
KEYCODE_FUN7 = -18,
KEYCODE_FUN8 = -19,
KEYCODE_FUN9 = -20,
KEYCODE_FUN10 = -21,
KEYCODE_FUN11 = -22,
KEYCODE_FUN12 = -23,
#endif
/* How long the longest ESC sequence we know? */
KEYCODE_BUFFER_SIZE = 4
};
int read_key(int fd, smalluint *nbuffered, char *buffer) FAST_FUNC;
/* Networking */
int create_icmp_socket(void) FAST_FUNC;
int create_icmp6_socket(void) FAST_FUNC;
@@ -1038,7 +1008,7 @@ enum {
PARSE_GREEDY = 0x00040000, // last token takes entire remainder of the line
PARSE_MIN_DIE = 0x00100000, // die if < min tokens found
// keep a copy of current line
PARSE_KEEP_COPY = 0x00200000 * ENABLE_FEATURE_CROND_D,
PARSE_KEEP_COPY = 0x00200000 * ENABLE_DEBUG_CROND_OPTION,
// PARSE_ESCAPE = 0x00400000, // process escape sequences in tokens
// NORMAL is:
// * remove leading and trailing delimiters and collapse
@@ -1143,8 +1113,6 @@ extern void print_login_prompt(void) FAST_FUNC;
/* NB: typically you want to pass fd 0, not 1. Think 'applet | grep something' */
int get_terminal_width_height(int fd, unsigned *width, unsigned *height) FAST_FUNC;
int tcsetattr_stdin_TCSANOW(const struct termios *tp) FAST_FUNC;
/* NB: "unsigned request" is crucial! "int request" will break some arches! */
int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))) FAST_FUNC;
int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))) FAST_FUNC;
@@ -1254,9 +1222,6 @@ typedef struct procps_status_t {
* by link target or interpreter name) */
char comm[COMM_LEN];
/* user/group? - use passwd/group parsing functions */
#if ENABLE_FEATURE_TOP_SMP_PROCESS
int last_seen_on_cpu;
#endif
} procps_status_t;
enum {
PSSCAN_PID = 1 << 0,
@@ -1278,16 +1243,12 @@ enum {
PSSCAN_ARGVN = (1 << 16) * (ENABLE_PGREP || ENABLE_PKILL || ENABLE_PIDOF),
USE_SELINUX(PSSCAN_CONTEXT = 1 << 17,)
PSSCAN_START_TIME = 1 << 18,
PSSCAN_CPU = 1 << 19,
/* These are all retrieved from proc/NN/stat in one go: */
PSSCAN_STAT = PSSCAN_PPID | PSSCAN_PGID | PSSCAN_SID
/**/ | PSSCAN_COMM | PSSCAN_STATE
/**/ | PSSCAN_VSZ | PSSCAN_RSS
/**/ | PSSCAN_STIME | PSSCAN_UTIME | PSSCAN_START_TIME
/**/ | PSSCAN_TTY
#if ENABLE_FEATURE_TOP_SMP_PROCESS
/**/ | PSSCAN_CPU
#endif
| PSSCAN_COMM | PSSCAN_STATE
| PSSCAN_VSZ | PSSCAN_RSS
| PSSCAN_STIME | PSSCAN_UTIME | PSSCAN_START_TIME
| PSSCAN_TTY,
};
//procps_status_t* alloc_procps_scan(void) FAST_FUNC;
void free_procps_scan(procps_status_t* sp) FAST_FUNC;
+1 -2
View File
@@ -1,6 +1,6 @@
/* vi: set sw=4 ts=4: */
/*
Copyright 2006, Bernhard Reutner-Fischer
Copyright 2006, Bernhard Fischer
Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
*/
@@ -132,7 +132,6 @@
# define BB_LITTLE_ENDIAN 1
#endif
/* SWAP_LEnn means "convert CPU<->little_endian by swapping bytes" */
#if BB_BIG_ENDIAN
#define SWAP_BE16(x) (x)
#define SWAP_BE32(x) (x)
+21 -12
View File
@@ -21,17 +21,24 @@
* POSIX Standard: 9.2.2 User Database Access <pwd.h>
*/
#ifndef BB_PWD_H
#define BB_PWD_H 1
#ifndef _PWD_H
#define _PWD_H 1
#if __GNUC_PREREQ(4,1)
# pragma GCC visibility push(hidden)
#endif
/* This file is #included after #include <pwd.h>
* We will use libc-defined structures, but will #define function names
* so that function calls are directed to bb_internal_XXX replacements
*/
/* The passwd structure. */
struct passwd {
char *pw_name; /* Username. */
char *pw_passwd; /* Password. */
uid_t pw_uid; /* User ID. */
gid_t pw_gid; /* Group ID. */
char *pw_gecos; /* Real name. */
char *pw_dir; /* Home directory. */
char *pw_shell; /* Shell program. */
};
#define setpwent bb_internal_setpwent
#define endpwent bb_internal_endpwent
@@ -44,11 +51,13 @@
#define getpwuid_r bb_internal_getpwuid_r
#define getpwnam_r bb_internal_getpwnam_r
#define fgetpwent_r bb_internal_fgetpwent_r
//#define getpw bb_internal_getpw
#define getpw bb_internal_getpw
/* All function names below should be remapped by #defines above
* in order to not collide with libc names. */
* in order to not collide with libc names.
* In theory it isn't necessary, but I saw weird interactions at link time.
* Let's play safe */
/* Rewind the password-file stream. */
@@ -64,14 +73,14 @@ extern struct passwd *getpwent(void);
extern struct passwd *fgetpwent(FILE *__stream);
/* Write the given entry onto the given stream. */
extern int putpwent(const struct passwd *__restrict __p,
extern int putpwent(__const struct passwd *__restrict __p,
FILE *__restrict __f);
/* Search for an entry with a matching user ID. */
extern struct passwd *getpwuid(uid_t __uid);
/* Search for an entry with a matching username. */
extern struct passwd *getpwnam(const char *__name);
extern struct passwd *getpwnam(__const char *__name);
/* Reentrant versions of some of the functions above.
@@ -90,7 +99,7 @@ extern int getpwuid_r(uid_t __uid,
char *__restrict __buffer, size_t __buflen,
struct passwd **__restrict __result);
extern int getpwnam_r(const char *__restrict __name,
extern int getpwnam_r(__const char *__restrict __name,
struct passwd *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
struct passwd **__restrict __result);
@@ -105,7 +114,7 @@ extern int fgetpwent_r(FILE *__restrict __stream,
/* Re-construct the password-file line for the given uid
in the given buffer. This knows the format that the caller
will expect, but this need not be the format of the password file. */
/* UNUSED extern int getpw(uid_t __uid, char *__buffer); */
extern int getpw(uid_t __uid, char *__buffer);
#if __GNUC_PREREQ(4,1)
# pragma GCC visibility pop
+2 -2
View File
@@ -4,8 +4,8 @@
* Licensed under the GPL-2 or later.
*/
#ifndef BB_RTC_H
#define BB_RTC_H
#ifndef _BB_RTC_H_
#define _BB_RTC_H_
#include "libbb.h"
+24 -13
View File
@@ -19,23 +19,32 @@
/* Declaration of types and functions for shadow password suite */
#ifndef BB_SHADOW_H
#define BB_SHADOW_H 1
#ifndef _SHADOW_H
#define _SHADOW_H 1
#if __GNUC_PREREQ(4,1)
# pragma GCC visibility push(hidden)
#endif
/* This file is #included after #include <shadow.h>
* We will use libc-defined structures, but will #define function names
* so that function calls are directed to bb_internal_XXX replacements
*/
/* Paths to the user database files */
#ifndef _PATH_SHADOW
#define _PATH_SHADOW "/etc/shadow"
#endif
/* Structure of the password file */
struct spwd {
char *sp_namp; /* Login name */
char *sp_pwdp; /* Encrypted password */
long sp_lstchg; /* Date of last change */
long sp_min; /* Minimum number of days between changes */
long sp_max; /* Maximum number of days between changes */
long sp_warn; /* Number of days to warn user to change the password */
long sp_inact; /* Number of days the account may be inactive */
long sp_expire; /* Number of days since 1970-01-01 until account expires */
unsigned long sp_flag; /* Reserved */
};
#define setspent bb_internal_setspent
#define endspent bb_internal_endspent
#define getspent bb_internal_getspent
@@ -52,7 +61,9 @@
/* All function names below should be remapped by #defines above
* in order to not collide with libc names. */
* in order to not collide with libc names.
* In theory it isn't necessary, but I saw weird interactions at link time.
* Let's play safe */
/* Open database for reading */
@@ -65,26 +76,26 @@ extern void endspent(void);
extern struct spwd *getspent(void);
/* Get shadow entry matching NAME */
extern struct spwd *getspnam(const char *__name);
extern struct spwd *getspnam(__const char *__name);
/* Read shadow entry from STRING */
extern struct spwd *sgetspent(const char *__string);
extern struct spwd *sgetspent(__const char *__string);
/* Read next shadow entry from STREAM */
extern struct spwd *fgetspent(FILE *__stream);
/* Write line containing shadow password entry to stream */
extern int putspent(const struct spwd *__p, FILE *__stream);
extern int putspent(__const struct spwd *__p, FILE *__stream);
/* Reentrant versions of some of the functions above */
extern int getspent_r(struct spwd *__result_buf, char *__buffer,
size_t __buflen, struct spwd **__result);
extern int getspnam_r(const char *__name, struct spwd *__result_buf,
extern int getspnam_r(__const char *__name, struct spwd *__result_buf,
char *__buffer, size_t __buflen,
struct spwd **__result);
extern int sgetspent_r(const char *__string, struct spwd *__result_buf,
extern int sgetspent_r(__const char *__string, struct spwd *__result_buf,
char *__buffer, size_t __buflen,
struct spwd **__result);
-11
View File
@@ -77,12 +77,6 @@ typedef struct archive_handle_t {
} archive_handle_t;
/* Info struct unpackers can fill out to inform users of thing like
* timestamps of unpacked files */
typedef struct unpack_info_t {
time_t mtime;
} unpack_info_t;
extern archive_handle_t *init_handle(void) FAST_FUNC;
extern char filter_accept_all(archive_handle_t *archive_handle) FAST_FUNC;
@@ -132,15 +126,10 @@ USE_DESKTOP(long long) int unpack_lzma_stream(int src_fd, int dst_fd) FAST_FUNC;
/* the rest wants 2 first bytes already skipped by the caller */
USE_DESKTOP(long long) int unpack_bz2_stream(int src_fd, int dst_fd) FAST_FUNC;
USE_DESKTOP(long long) int unpack_gz_stream(int src_fd, int dst_fd) FAST_FUNC;
USE_DESKTOP(long long) int unpack_gz_stream_with_info(int src_fd, int dst_fd, unpack_info_t *info) FAST_FUNC;
USE_DESKTOP(long long) int unpack_Z_stream(int fd_in, int fd_out) FAST_FUNC;
/* wrapper which checks first two bytes to be "BZ" */
USE_DESKTOP(long long) int unpack_bz2_stream_prime(int src_fd, int dst_fd) FAST_FUNC;
int bbunpack(char **argv,
char* (*make_new_name)(char *filename),
USE_DESKTOP(long long) int (*unpacker)(unpack_info_t *info)) FAST_FUNC;
#if BB_MMU
void open_transformer(int fd,
USE_DESKTOP(long long) int FAST_FUNC (*transformer)(int src_fd, int dst_fd)) FAST_FUNC;
+107 -232
View File
@@ -535,13 +535,13 @@
"\n F Input from file" \
#define crond_trivial_usage \
"-fbS -l N " USE_FEATURE_CROND_D("-d N ") "-L LOGFILE -c DIR"
"-fbS -l N " USE_DEBUG_CROND_OPTION("-d N ") "-L LOGFILE -c DIR"
#define crond_full_usage "\n\n" \
" -f Foreground" \
"\n -b Background (default)" \
"\n -S Log to syslog (default)" \
"\n -l Set log level. 0 is the most verbose, default 8" \
USE_FEATURE_CROND_D( \
USE_DEBUG_CROND_OPTION( \
"\n -d Set log level, log to stderr" \
) \
"\n -L Log to file" \
@@ -690,15 +690,6 @@
#define depmod_trivial_usage NOUSAGE_STR
#define depmod_full_usage ""
#define devmem_trivial_usage \
"ADDRESS [WIDTH [VALUE]]"
#define devmem_full_usage "\n\n" \
"Read/write from physical address\n" \
"\n ADDRESS Address to act upon" \
"\n WIDTH Width (8/16/...)" \
"\n VALUE Data to be written" \
#define devfsd_trivial_usage \
"mntpnt [-v]" USE_DEVFSD_FG_NP("[-fg][-np]")
#define devfsd_full_usage "\n\n" \
@@ -714,40 +705,36 @@
"\n do not poll for events" \
)
/* -k is accepted but ignored for !HUMAN_READABLE,
* but we won't mention this (unimportant) */
#if ENABLE_FEATURE_HUMAN_READABLE || ENABLE_FEATURE_DF_INODE
#define DF_HAS_OPTIONS(x) x
#else
#define DF_HAS_OPTIONS(x)
#endif
#define df_trivial_usage \
"[-Pk" \
USE_FEATURE_HUMAN_READABLE("mh") \
USE_FEATURE_DF_FANCY("ai] [-B SIZE") \
"] [FILESYSTEM...]"
DF_HAS_OPTIONS("[-") \
USE_FEATURE_HUMAN_READABLE("hmk") USE_FEATURE_DF_INODE("i") \
DF_HAS_OPTIONS("] ") "[FILESYSTEM...]"
#define df_full_usage "\n\n" \
"Print filesystem usage statistics\n" \
"\nOptions:" \
"\n -P POSIX output format" \
"\n -k 1024-byte blocks (default)" \
DF_HAS_OPTIONS("\nOptions:") \
USE_FEATURE_HUMAN_READABLE( \
"\n -m 1M-byte blocks" \
"\n -h Human readable (e.g. 1K 243M 2G)" \
"\n -m 1024*1024 blocks" \
"\n -k 1024 blocks" \
) \
USE_FEATURE_DF_FANCY( \
"\n -a Show all filesystems" \
USE_FEATURE_DF_INODE( \
"\n -i Inodes" \
"\n -B SIZE Blocksize" \
) \
)
#define df_example_usage \
"$ df\n" \
"Filesystem 1K-blocks Used Available Use% Mounted on\n" \
"Filesystem 1k-blocks Used Available Use% Mounted on\n" \
"/dev/sda3 8690864 8553540 137324 98% /\n" \
"/dev/sda1 64216 36364 27852 57% /boot\n" \
"$ df /dev/sda3\n" \
"Filesystem 1K-blocks Used Available Use% Mounted on\n" \
"/dev/sda3 8690864 8553540 137324 98% /\n" \
"$ POSIXLY_CORRECT=sure df /dev/sda3\n" \
"Filesystem 512B-blocks Used Available Use% Mounted on\n" \
"/dev/sda3 17381728 17107080 274648 98% /\n" \
"$ POSIXLY_CORRECT=yep df -P /dev/sda3\n" \
"Filesystem 512-blocks Used Available Capacity Mounted on\n" \
"/dev/sda3 17381728 17107080 274648 98% /\n"
"Filesystem 1k-blocks Used Available Use% Mounted on\n" \
"/dev/sda3 8690864 8553540 137324 98% /\n"
#define dhcprelay_trivial_usage \
"[client1,client2,...] [server_device]"
@@ -1095,10 +1082,17 @@
"\n -H HEADS\n" \
"\n -S SECTORS" \
#define blkid_trivial_usage \
""
#define blkid_full_usage "\n\n" \
"Print UUIDs of all filesystems."
#define fetchmail_trivial_usage \
"[-w timeout] [-H [user:pass@]server[:port]] [-S] [-t] [-z] maildir [prog]"
#define fetchmail_full_usage "\n\n" \
"Fetch content of remote mailbox to local maildir\n" \
"\nOptions:" \
"\n -w timeout Network timeout" \
"\n -H [user:pass@]server[:port] Server" \
"\n -S Use openssl connection helper for secure servers" \
"\n -t Get only headers" \
"\n -z Delete messages on server" \
"\n prog Run 'prog <message_file>' on message delivery" \
#define findfs_trivial_usage \
"LABEL=label or UUID=uuid"
@@ -1229,14 +1223,14 @@
#define ftpget_full_usage "\n\n" \
"Retrieve a remote file via FTP\n" \
"\nOptions:" \
USE_FEATURE_FTPGETPUT_LONG_OPTIONS( \
USE_GETOPT_LONG( \
"\n -c,--continue Continue previous transfer" \
"\n -v,--verbose Verbose" \
"\n -u,--username Username" \
"\n -p,--password Password" \
"\n -P,--port Port number" \
) \
SKIP_FEATURE_FTPGETPUT_LONG_OPTIONS( \
SKIP_GETOPT_LONG( \
"\n -c Continue previous transfer" \
"\n -v Verbose" \
"\n -u Username" \
@@ -1249,13 +1243,13 @@
#define ftpput_full_usage "\n\n" \
"Store a local file on a remote machine via FTP\n" \
"\nOptions:" \
USE_FEATURE_FTPGETPUT_LONG_OPTIONS( \
USE_GETOPT_LONG( \
"\n -v,--verbose Verbose" \
"\n -u,--username Username" \
"\n -p,--password Password" \
"\n -P,--port Port number" \
) \
SKIP_FEATURE_FTPGETPUT_LONG_OPTIONS( \
SKIP_GETOPT_LONG( \
"\n -v Verbose" \
"\n -u Username" \
"\n -p Password" \
@@ -1426,7 +1420,7 @@
"-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n"
#define halt_trivial_usage \
"[-d delay] [-n] [-f]" USE_FEATURE_WTMP(" [-w]")
"[-d delay] [-n] [-f]"
#define halt_full_usage "\n\n" \
"Halt the system\n" \
"\nOptions:" \
@@ -1578,12 +1572,12 @@
"\n -d STRING URL decode STRING" \
#define hwclock_trivial_usage \
USE_FEATURE_HWCLOCK_LONG_OPTIONS( \
USE_GETOPT_LONG( \
"[-r|--show] [-s|--hctosys] [-w|--systohc]" \
" [-l|--localtime] [-u|--utc]" \
" [-f FILE]" \
) \
SKIP_FEATURE_HWCLOCK_LONG_OPTIONS( \
SKIP_GETOPT_LONG( \
"[-r] [-s] [-w] [-l] [-u] [-f FILE]" \
)
#define hwclock_full_usage "\n\n" \
@@ -1604,9 +1598,8 @@
USE_SELINUX( \
"\n -Z Print the security context" \
) \
"\n -u Print user ID" \
"\n -g Print group ID" \
"\n -G Print supplementary group IDs" \
"\n -u Print user ID" \
"\n -n Print name instead of a number" \
"\n -r Print real user ID instead of effective ID" \
@@ -1875,22 +1868,20 @@
"\n -x Do not export externs" \
)
/* -v, -b, -c are ignored */
#define install_trivial_usage \
"[-cdDsp] [-o USER] [-g GRP] [-m MODE] [source] dest|directory"
"[-cgmops] [sources] dest|directory"
#define install_full_usage "\n\n" \
"Copy files and set attributes\n" \
"\nOptions:" \
"\n -c Just copy (default)" \
"\n -c Copy the file, default" \
"\n -d Create directories" \
"\n -D Create leading target directories" \
"\n -s Strip symbol table" \
"\n -g Set group ownership" \
"\n -m Set permissions" \
"\n -o Set ownership" \
"\n -p Preserve date" \
"\n -o USER Set ownership" \
"\n -g GRP Set group ownership" \
"\n -m MODE Set permissions" \
"\n -s Strip symbol tables" \
USE_SELINUX( \
"\n -Z Set security context" \
"\n -Z Set security context of copy" \
)
/* would need to make the " | " optional depending on more than one selected: */
@@ -1994,8 +1985,7 @@
" [oif STRING] [tos TOS]\n" \
"iproute { add | del | change | append | replace | monitor } ROUTE\n" \
" SELECTOR := [root PREFIX] [match PREFIX] [proto RTPROTO]\n" \
" ROUTE := [TYPE] PREFIX [tos TOS] [proto RTPROTO]\n" \
" [metric METRIC]" \
" ROUTE := [TYPE] PREFIX [tos TOS] [proto RTPROTO]" \
#define iprule_trivial_usage \
"{[list | add | del] RULE}"
@@ -2019,7 +2009,7 @@
" [ttl TTL] [tos TOS] [[no]pmtudisc] [dev PHYS_DEV]" \
#define kbd_mode_trivial_usage \
"[-a|k|s|u] [-C TTY]"
"[-a|k|s|u]"
#define kbd_mode_full_usage "\n\n" \
"Report or set the keyboard mode\n" \
"\nOptions set mode:" \
@@ -2027,15 +2017,13 @@
"\n -k Medium-raw (keyboard)" \
"\n -s Raw (scancode)" \
"\n -u Unicode (utf-8)" \
"\n -C TTY Affect TTY instead of /dev/tty" \
#define kill_trivial_usage \
"[-l] [-SIG] PID..."
"[-l] [-signal] process-id..."
#define kill_full_usage "\n\n" \
"Send a signal (default is TERM) to given PIDs\n" \
"Send a signal (default is TERM) to the specified process(es)\n" \
"\nOptions:" \
"\n -l List all signal names and numbers" \
/* "\n -s SIG Yet another way of specifying SIG" */ \
#define kill_example_usage \
"$ ps | grep apache\n" \
@@ -2048,24 +2036,22 @@
"$ kill 252\n"
#define killall_trivial_usage \
"[-l] [-q] [-SIG] process-name..."
"[-l] [-q] [-signal] process-name..."
#define killall_full_usage "\n\n" \
"Send a signal (default is TERM) to given processes\n" \
"Send a signal (default is TERM) to the specified process(es)\n" \
"\nOptions:" \
"\n -l List all signal names and numbers" \
/* "\n -s SIG Yet another way of specifying SIG" */ \
"\n -q Do not complain if no processes were killed" \
#define killall_example_usage \
"$ killall apache\n"
#define killall5_trivial_usage \
"[-l] [-SIG]"
"[-l] [-signal]"
#define killall5_full_usage "\n\n" \
"Send a signal (default is TERM) to all processes outside current session\n" \
"\nOptions:" \
"\n -l List all signal names and numbers" \
/* "\n -s SIG Yet another way of specifying SIG" */ \
#define klogd_trivial_usage \
"[-c N] [-n]"
@@ -2085,7 +2071,7 @@
"5\n"
#define less_trivial_usage \
"[-EMNmh~I?] [FILE...]"
"[-EMNmh~?] [FILE...]"
#define less_full_usage "\n\n" \
"View a file or list of files. The position within files can be\n" \
"changed, and files can be manipulated in various ways.\n" \
@@ -2094,7 +2080,6 @@
"\n -M,-m Display a status line containing the line numbers" \
"\n and percentage through the file" \
"\n -N Prefix line numbers to each line" \
"\n -I Ignore case in all searches" \
"\n -~ Suppress ~s displayed past the end of the file" \
#define linux32_trivial_usage NOUSAGE_STR
@@ -2130,23 +2115,20 @@
"lrwxrwxrwx 1 root root 7 Apr 12 18:39 ls -> BusyBox*\n"
#define load_policy_trivial_usage NOUSAGE_STR
#define load_policy_full_usage ""
#define loadfont_trivial_usage \
"< font"
#define loadfont_full_usage "\n\n" \
"Load a console font from standard input" \
/* "\n -C TTY Affect TTY instead of /dev/tty" */ \
"Load a console font from standard input"
#define loadfont_example_usage \
"$ loadfont < /etc/i18n/fontname\n"
#define loadkmap_trivial_usage \
"< keymap"
#define loadkmap_full_usage "\n\n" \
"Load a binary keyboard translation table from standard input\n" \
/* "\n -C TTY Affect TTY instead of /dev/tty" */ \
"Load a binary keyboard translation table from standard input"
#define loadkmap_example_usage \
"$ loadkmap < /etc/i18n/lang-keymap\n"
@@ -2247,21 +2229,21 @@
#define ls_full_usage "\n\n" \
"List directory contents\n" \
"\nOptions:" \
"\n -1 List in a single column" \
"\n -A Don't list . and .." \
"\n -a Don't hide entries starting with ." \
"\n -C List by columns" \
"\n -1 List files in a single column" \
"\n -A Do not list implied . and .." \
"\n -a Do not hide entries starting with ." \
"\n -C List entries by columns" \
USE_FEATURE_LS_TIMESTAMPS( \
"\n -c With -l: sort by ctime") \
"\n -c With -l: show ctime") \
USE_FEATURE_LS_COLOR( \
"\n --color[={always,never,auto}] Control coloring") \
"\n -d List directory entries instead of contents" \
USE_FEATURE_LS_TIMESTAMPS( \
"\n -e List full date and time") \
"\n -e List both full date and full time") \
USE_FEATURE_LS_FILETYPES( \
"\n -F Append indicator (one of */=@|) to entries") \
"\n -i List inode numbers" \
"\n -l Long listing format" \
"\n -i List the i-node for each file" \
"\n -l Use a long listing format" \
"\n -n List numeric UIDs and GIDs instead of names" \
USE_FEATURE_LS_FILETYPES( \
"\n -p Append indicator (one of /=@|) to entries") \
@@ -2270,31 +2252,31 @@
USE_FEATURE_LS_RECURSIVE( \
"\n -R List subdirectories recursively") \
USE_FEATURE_LS_SORTFILES( \
"\n -r Sort in reverse order") \
"\n -r Sort the listing in reverse order") \
USE_FEATURE_LS_SORTFILES( \
"\n -S Sort by file size") \
"\n -S Sort the listing by file size") \
"\n -s List the size of each file, in blocks" \
USE_FEATURE_AUTOWIDTH( \
"\n -T NUM Assume tabstop every NUM columns") \
"\n -T NUM Assume Tabstop every NUM columns") \
USE_FEATURE_LS_TIMESTAMPS( \
"\n -t With -l: sort by modification time") \
"\n -t With -l: show modification time") \
USE_FEATURE_LS_TIMESTAMPS( \
"\n -u With -l: sort by access time") \
"\n -u With -l: show access time") \
USE_FEATURE_LS_SORTFILES( \
"\n -v Sort by version") \
"\n -v Sort the listing by version") \
USE_FEATURE_AUTOWIDTH( \
"\n -w NUM Assume the terminal is NUM columns wide") \
"\n -x List by lines" \
"\n -x List entries by lines instead of by columns" \
USE_FEATURE_LS_SORTFILES( \
"\n -X Sort by extension") \
"\n -X Sort the listing by extension") \
USE_FEATURE_HUMAN_READABLE( \
"\n -h List sizes in human readable format (1K 243M 2G)") \
"\n -h Print sizes in human readable format (e.g., 1K 243M 2G)") \
USE_SELINUX( \
"\n -k List security context") \
"\n -k Print security context") \
USE_SELINUX( \
"\n -K List security context in long format") \
"\n -K Print security context in long format") \
USE_SELINUX( \
"\n -Z List security context and permission") \
"\n -Z Print security context and permission") \
#define lsattr_trivial_usage \
"[-Radlv] [files...]"
@@ -2304,7 +2286,7 @@
"\n -R Recursively list subdirectories" \
"\n -a Do not hide entries starting with ." \
"\n -d List directory entries instead of contents" \
"\n -l List long flag names" \
"\n -l Print long flag names" \
"\n -v List the file's version/generation number" \
#define lsmod_trivial_usage \
@@ -2370,16 +2352,6 @@
"/dev/hda[0-15]\n"
#endif
#define makemime_trivial_usage \
"[OPTION]... [FILE]..."
#define makemime_full_usage "\n\n" \
"Create MIME-encoded message\n" \
"\nOptions:" \
"\n -C Charset" \
"\n -e Tranfer encoding. Ignored. base64 is assumed" \
"\n" \
"\nOther options are silently ignored." \
#define man_trivial_usage \
"[OPTION]... [MANPAGE]..."
#define man_full_usage "\n\n" \
@@ -2590,17 +2562,12 @@
"[-knqrsv] MODULE [symbol=value...]"
#define modprobe_full_usage "\n\n" \
"Options:" \
USE_FEATURE_2_4_MODULES( \
"\n -k Make module autoclean-able" \
) \
"\n -n Dry run" \
"\n -q Quiet" \
"\n -r Remove module (stacks) or do autoclean" \
"\n -s Report via syslog instead of stderr" \
"\n -v Verbose" \
USE_FEATURE_MODPROBE_BLACKLIST( \
"\n -b Apply blacklist to module names too" \
)
#define modprobe_notes_usage \
"modprobe can (un)load a stack of modules, passing each module options (when\n" \
@@ -3097,33 +3064,6 @@
"\n -v Negate the matching" \
"\n -x Match whole name (not substring)" \
#define popmaildir_trivial_usage \
"[OPTIONS] Maildir [connection-helper ...]"
#define popmaildir_full_usage "\n\n" \
"Fetch content of remote mailbox to local maildir\n" \
"\nOptions:" \
"\n -b Binary mode. Ignored" \
"\n -d Debug. Ignored" \
"\n -m Show used memory. Ignored" \
"\n -V Show version. Ignored" \
"\n -c Use tcpclient. Ignored" \
"\n -a Use APOP protocol. Implied. If server supports APOP -> use it" \
"\n -s Skip authorization" \
"\n -T Get messages with TOP instead with RETR" \
"\n -k Keep retrieved messages on the server" \
"\n -t timeout Set network timeout" \
USE_FEATURE_POPMAILDIR_DELIVERY( \
"\n -F \"program arg1 arg2 ...\" Filter by program. May be multiple" \
"\n -M \"program arg1 arg2 ...\" Deliver by program" \
) \
"\n -R size Remove old messages on the server >= size (in bytes). Ignored" \
"\n -Z N1-N2 Remove messages from N1 to N2 (dangerous). Ignored" \
"\n -L size Do not retrieve new messages >= size (in bytes). Ignored" \
"\n -H lines Type specified number of lines of a message. Ignored"
#define popmaildir_example_usage \
"$ popmaildir -k ~/Maildir -- nc pop.drvv.ru 110 [<password_file]\n" \
"$ popmaildir ~/Maildir -- openssl s_client -quiet -connect pop.gmail.com:995 [<password_file]\n"
#define poweroff_trivial_usage \
"[-d delay] [-n] [-f]"
#define poweroff_full_usage "\n\n" \
@@ -3279,17 +3219,6 @@
"\n -n No call to sync()" \
"\n -f Force reboot (don't go through init)" \
#define reformime_trivial_usage \
"[OPTION]... [FILE]..."
#define reformime_full_usage "\n\n" \
"Parse MIME-encoded message\n" \
"\nOptions:" \
"\n -x prefix Extract content of MIME sections to files" \
"\n -X prog [args] Filter content of MIME sections through prog." \
"\n Must be the last option" \
"\n" \
"\nOther options are silently ignored." \
#define renice_trivial_usage \
"{{-n INCREMENT} | PRIORITY} [[-p | -g | -u] ID...]"
#define renice_full_usage "\n\n" \
@@ -3342,16 +3271,7 @@
#define rmdir_trivial_usage \
"[OPTION]... DIRECTORY..."
#define rmdir_full_usage "\n\n" \
"Remove the DIRECTORY, if it is empty.\n" \
"\nOptions:" \
USE_FEATURE_RMDIR_LONG_OPTIONS( \
"\n -p|--parents Include parents" \
"\n -ignore-fail-on-non-empty" \
) \
SKIP_FEATURE_RMDIR_LONG_OPTIONS( \
"\n -p Include parents" \
)
"Remove the DIRECTORY, if it is empty"
#define rmdir_example_usage \
"# rmdir /tmp/foo\n"
@@ -3360,8 +3280,6 @@
#define rmmod_full_usage "\n\n" \
"Unload the specified kernel modules from the kernel\n" \
"\nOptions:" \
"\n -w Wait until the module is no longer used" \
"\n -f Force unloading" \
"\n -a Remove all unused modules (recursively)" \
#define rmmod_example_usage \
@@ -3370,7 +3288,7 @@
#define route_trivial_usage \
"[{add|del|delete}]"
#define route_full_usage "\n\n" \
"Edit kernel routing tables\n" \
"Edit the kernel's routing tables\n" \
"\nOptions:" \
"\n -n Don't resolve names" \
"\n -e Display other/more information" \
@@ -3423,14 +3341,14 @@
#define runcon_full_usage "\n\n" \
"Run a program in a different security context\n" \
"\n CONTEXT Complete security context\n" \
USE_FEATURE_RUNCON_LONG_OPTIONS( \
USE_GETOPT_LONG( \
"\n -c,--compute Compute process transition context before modifying" \
"\n -t,--type=TYPE Type (for same role as parent)" \
"\n -u,--user=USER User identity" \
"\n -r,--role=ROLE Role" \
"\n -l,--range=RNG Levelrange" \
) \
SKIP_FEATURE_RUNCON_LONG_OPTIONS( \
SKIP_GETOPT_LONG( \
"\n -c Compute process transition context before modifying" \
"\n -t TYPE Type (for same role as parent)" \
"\n -u USER User identity" \
@@ -3480,11 +3398,9 @@
"Start and monitor a service and optionally an appendant log service"
#define runsvdir_trivial_usage \
"[-P] [-s SCRIPT] dir"
"[-P] dir"
#define runsvdir_full_usage "\n\n" \
"Start a runsv process for each subdirectory. If it exits, restart it.\n" \
"\n -P Put each runsv in a new session" \
"\n -s SCRIPT Run SCRIPT <signo> after signal is processed" \
"Start a runsv process for each subdirectory"
#define rx_trivial_usage \
"FILE"
@@ -3526,30 +3442,21 @@
#define selinuxenabled_full_usage ""
#define sendmail_trivial_usage \
"[OPTIONS] [rcpt]..."
"[-w timeout] [-H [user:pass@]server[:port]] [-S]\n" \
"[-c charset] [-N type] [-i] [-s subject] [-a attach]... [-t] [-f sender] [rcpt]..."
#define sendmail_full_usage "\n\n" \
"Send an email\n" \
"\nOptions:" \
"\n -w timeout Network timeout" \
"\n -H [user:pass@]server[:port] Server" \
"\n -S Use openssl connection helper for secure servers" \
"\n -c charset Assume charset for body and subject (utf-8)" \
"\n -N type Request delivery notification. Type is ignored" \
"\n -f sender Sender" \
"\n -F fullname Sender full name. Overrides $NAME" \
USE_FEATURE_SENDMAIL_MAILX( \
"\n -i Ignore single dots in mail body. Implied" \
"\n -s subject Subject" \
"\n -j charset Assume charset for body and subject (" CONFIG_FEATURE_MIME_CHARSET ")" \
"\n -a file File to attach. May be multiple" \
"\n -H \"prog args...\" Use external connection helper. E.g. openssl for secure servers" \
"\n -S server[:port] Server" \
) \
USE_FEATURE_SENDMAIL_MAILXX( \
"\n -c rcpt Cc: recipient. May be multiple" \
"\n -e rcpt Errors-To: recipient" \
)
"\n -t Read recipients and subject from body" \
"\n" \
"\nOther options are silently ignored; -oi is implied" \
"\n -f sender Sender" \
#define seq_trivial_usage \
"[first [increment]] last"
@@ -3603,13 +3510,11 @@
"\n -W Display warnings about entries that had no matching files" \
#define setfont_trivial_usage \
"FONT [-m MAPFILE] [-C TTY]"
"[-m mapfile] font"
#define setfont_full_usage "\n\n" \
"Load a console font\n" \
"\nOptions:" \
"\n -m MAPFILE Load console screen map" \
"\n -C TTY Affect TTY instead of /dev/tty" \
"\n -m mapfile Load console screen map from mapfile"
#define setfont_example_usage \
"$ setfont -m koi8-r /etc/i18n/fontname\n"
@@ -3774,7 +3679,7 @@
"Search for matching processes, and then\n" \
"-K: stop all matching processes.\n" \
"-S: start a process unless a matching process is found.\n" \
USE_FEATURE_START_STOP_DAEMON_LONG_OPTIONS( \
USE_GETOPT_LONG( \
"\nProcess matching:" \
"\n -u,--user USERNAME|UID Match only this user's processes" \
"\n -n,--name NAME Match processes with NAME" \
@@ -3798,11 +3703,11 @@
"\nOther:" \
USE_FEATURE_START_STOP_DAEMON_FANCY( \
"\n -o,--oknodo Exit with status 0 if nothing is done" \
"\n -v,--verbose Verbose" \
) \
"\n -q,--quiet Quiet" \
) \
SKIP_FEATURE_START_STOP_DAEMON_LONG_OPTIONS( \
"\n -v,--verbose Verbose" \
) \
SKIP_GETOPT_LONG( \
"\nProcess matching:" \
"\n -u USERNAME|UID Match only this user's processes" \
"\n -n NAME Match processes with NAME" \
@@ -3826,10 +3731,10 @@
"\nOther:" \
USE_FEATURE_START_STOP_DAEMON_FANCY( \
"\n -o Exit with status 0 if nothing is done" \
"\n -v Verbose" \
) \
"\n -q Quiet" \
) \
"\n -v Verbose" \
) \
#define stat_trivial_usage \
"[OPTION] FILE..."
@@ -4189,26 +4094,6 @@
"$ echo $?\n" \
"1\n"
#define tc_trivial_usage \
/*"[OPTIONS] "*/"OBJECT CMD [dev STRING]"
#define tc_full_usage "\n\n" \
"OBJECT: {qdisc|class|filter}\n" \
"CMD: {add|del|change|replace|show}\n" \
"\n" \
"qdisc [ handle QHANDLE ] [ root |"USE_FEATURE_TC_INGRESS(" ingress |")" parent CLASSID ]\n" \
/* "\t[ estimator INTERVAL TIME_CONSTANT ]\n" */ \
"\t[ [ QDISC_KIND ] [ help | OPTIONS ] ]\n" \
"\tQDISC_KIND := { [p|b]fifo | tbf | prio | cbq | red | etc. }\n" \
"qdisc show [ dev STRING ]"USE_FEATURE_TC_INGRESS(" [ingress]")"\n" \
"class [ classid CLASSID ] [ root | parent CLASSID ]\n" \
"\t[ [ QDISC_KIND ] [ help | OPTIONS ] ]\n" \
"class show [ dev STRING ] [ root | parent CLASSID ]\n" \
"filter [ pref PRIO ] [ protocol PROTO ]\n" \
/* "\t[ estimator INTERVAL TIME_CONSTANT ]\n" */ \
"\t[ root | classid CLASSID ] [ handle FILTERID ]\n" \
"\t[ [ FILTER_TYPE ] [ help | OPTIONS ] ]\n" \
"filter show [ dev STRING ] [ root | parent CLASSID ]"
#define tcpsvd_trivial_usage \
"[-hEv] [-c n] [-C n:msg] [-b n] [-u user] [-l name] ip port prog..."
/* with not-implemented options: */
@@ -4267,12 +4152,6 @@
"[-cr] [-u USER] [DIR]"
#define tftpd_full_usage "\n\n" \
"Transfer a file on tftp client's request.\n" \
"\n" \
"tftpd should be used as an inetd service.\n" \
"tftpd's line for inetd.conf:\n" \
" 69 dgram udp nowait root tftpd tftpd /files/to/serve\n" \
"It also can be ran from udpsvd:\n" \
" udpsvd -vE 0.0.0.0 69 tftpd /files/to/serve\n" \
"\nOptions:" \
"\n -r Prohibit upload" \
"\n -c Allow file creation via upload" \
@@ -4287,7 +4166,7 @@
"\n -v Verbose" \
#define top_trivial_usage \
"[-b] [-nCOUNT] [-dSECONDS]"
"[-b] [-n COUNT] [-d SECONDS]"
#define top_full_usage "\n\n" \
"Provide a view of process activity in real time.\n" \
"Read the status of all processes from /proc each SECONDS\n" \
@@ -4393,7 +4272,7 @@
"\n -C,--clientid-none Suppress default client identifier" \
"\n -p,--pidfile=file Create pidfile" \
"\n -r,--request=IP IP address to request" \
"\n -s,--script=file Run file at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")" \
"\n -s,--script=file Run file at DHCP events (default "CONFIG_DHCPC_DEFAULT_SCRIPT")" \
"\n -t,--retries=N Send up to N request packets" \
"\n -T,--timeout=N Try to get a lease for N seconds (default 3)" \
"\n -A,--tryagain=N Wait N seconds (default 20) after failure" \
@@ -4422,7 +4301,7 @@
"\n -C Suppress default client identifier" \
"\n -p file Create pidfile" \
"\n -r IP IP address to request" \
"\n -s file Run file at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")" \
"\n -s file Run file at DHCP events (default "CONFIG_DHCPC_DEFAULT_SCRIPT")" \
"\n -t N Send up to N request packets" \
"\n -T N Try to get a lease for N seconds (default 3)" \
"\n -A N Wait N seconds (default 20) after failure" \
@@ -4645,15 +4524,14 @@
"Mon Dec 17 10:31:44 GMT 2000"
#define watchdog_trivial_usage \
"[-t N[ms]] [-T N[ms]] [-F] DEV"
"[-t N[ms]] [-F] DEV"
#define watchdog_full_usage "\n\n" \
"Periodically write to watchdog device DEV\n" \
"\nOptions:" \
"\n -T N Reboot after N seconds if not reset (default 60)" \
"\n -t N Reset every N seconds (default 30)" \
"\n -t N Timer period (default 30)" \
"\n -F Run in foreground" \
"\n" \
"\nUse 500ms to specify period in milliseconds" \
"\nUse -t 500ms to specify period in milliseconds" \
#define wc_trivial_usage \
"[OPTION]... [FILE]..."
@@ -4671,12 +4549,12 @@
" 31 46 1365 /etc/passwd\n"
#define wget_trivial_usage \
USE_FEATURE_WGET_LONG_OPTIONS( \
USE_GETOPT_LONG( \
"[-c|--continue] [-s|--spider] [-q|--quiet] [-O|--output-document file]\n" \
" [--header 'header: value'] [-Y|--proxy on/off] [-P DIR]\n" \
" [-U|--user-agent agent] url" \
) \
SKIP_FEATURE_WGET_LONG_OPTIONS( \
SKIP_GETOPT_LONG( \
"[-csq] [-O file] [-Y on/off] [-P DIR] [-U agent] url" \
)
#define wget_full_usage "\n\n" \
@@ -4721,7 +4599,7 @@
USE_FEATURE_XARGS_SUPPORT_ZERO_TERM( \
"\n -0 Input is separated by NUL characters") \
"\n -t Print the command on stderr before execution" \
"\n -e[STR] STR stops input processing" \
"\n -e[STR] STR stops input processing (default _)" \
"\n -n N Pass no more than N args to COMMAND" \
"\n -s N Pass command line of no more than N bytes" \
USE_FEATURE_XARGS_SUPPORT_TERMOPT( \
@@ -4747,11 +4625,8 @@
"Manage a ZeroConf IPv4 link-local address\n" \
"\nOptions:" \
"\n -f Run in foreground" \
"\n -q Quit after obtaining address" \
"\n -q Quit after address (no daemon)" \
"\n -r 169.254.x.x Request this address first" \
"\n -v Verbose" \
"\n" \
"\nWith no -q, runs continuously monitoring for ARP conflicts," \
"\nexits only on I/O errors (link down etc)" \
#endif /* __BB_USAGE_H__ */
-1
View File
@@ -20,4 +20,3 @@
char *get_devname_from_label(const char *spec);
char *get_devname_from_uuid(const char *spec);
void display_uuid_cache(void);
+10
View File
@@ -12,6 +12,14 @@ config INIT
help
init is the first program run when the system boots.
config DEBUG_INIT
bool "Debugging aid"
default n
depends on INIT
help
Turn this on to disable all the dangerous
rebooting stuff when debugging.
config FEATURE_USE_INITTAB
bool "Support reading an inittab file"
default y
@@ -75,6 +83,8 @@ config FEATURE_INIT_COREDUMPS
core file sizes. If this option is disabled, processes
will not generate any core files.
config FEATURE_INITRD
bool "Support running init from within an initrd (not initramfs)"
default y
+35 -42
View File
@@ -13,11 +13,44 @@
#if ENABLE_FEATURE_WTMP
#include <sys/utsname.h>
#include <utmp.h>
#endif
static void write_wtmp(void)
int halt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int halt_main(int argc UNUSED_PARAM, char **argv)
{
static const int magic[] = {
#ifdef RB_HALT_SYSTEM
RB_HALT_SYSTEM,
#elif defined RB_HALT
RB_HALT,
#endif
#ifdef RB_POWER_OFF
RB_POWER_OFF,
#elif defined RB_POWERDOWN
RB_POWERDOWN,
#endif
RB_AUTOBOOT
};
static const smallint signals[] = { SIGUSR1, SIGUSR2, SIGTERM };
int delay = 0;
int which, flags, rc;
#if ENABLE_FEATURE_WTMP
struct utmp utmp;
struct utsname uts;
#endif
/* Figure out which applet we're running */
for (which = 0; "hpr"[which] != *applet_name; which++)
continue;
/* Parse and handle arguments */
opt_complementary = "d+"; /* -d N */
flags = getopt32(argv, "d:nfw", &delay);
sleep(delay);
#if ENABLE_FEATURE_WTMP
if (access(bb_path_wtmp_file, R_OK|W_OK) == -1) {
close(creat(bb_path_wtmp_file, 0664));
}
@@ -30,50 +63,10 @@ static void write_wtmp(void)
if (uname(&uts) == 0)
safe_strncpy(utmp.ut_host, uts.release, sizeof(utmp.ut_host));
updwtmp(bb_path_wtmp_file, &utmp);
}
#else
#define write_wtmp() ((void)0)
#endif
#ifndef RB_HALT_SYSTEM
#define RB_HALT_SYSTEM RB_HALT
#endif
#ifndef RB_POWER_OFF
#define RB_POWER_OFF RB_POWERDOWN
#endif
int halt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int halt_main(int argc UNUSED_PARAM, char **argv)
{
static const int magic[] = {
RB_HALT_SYSTEM,
RB_POWER_OFF,
RB_AUTOBOOT
};
static const smallint signals[] = { SIGUSR1, SIGUSR2, SIGTERM };
int delay = 0;
int which, flags, rc;
/* Figure out which applet we're running */
for (which = 0; "hpr"[which] != applet_name[0]; which++)
continue;
/* Parse and handle arguments */
opt_complementary = "d+"; /* -d N */
/* We support -w even if !ENABLE_FEATURE_WTMP, in order
* to not break scripts */
flags = getopt32(argv, "d:nfw", &delay);
sleep(delay);
write_wtmp();
#endif /* !ENABLE_FEATURE_WTMP */
if (flags & 8) /* -w */
return EXIT_SUCCESS;
if (!(flags & 2)) /* no -n */
sync();
+37 -33
View File
@@ -14,10 +14,6 @@
#include <paths.h>
#include <sys/reboot.h>
/* Was a CONFIG_xxx option. A lot of people were building
* not fully functional init by switching it on! */
#define DEBUG_INIT 0
#define COMMAND_SIZE 256
#define CONSOLE_NAME_SIZE 32
#define MAXENV 16 /* Number of env. vars */
@@ -60,6 +56,7 @@ struct init_action {
static struct init_action *init_action_list = NULL;
static const char *log_console = VC_5;
static sig_atomic_t got_cont = 0;
enum {
L_LOG = 0x1,
@@ -80,6 +77,14 @@ enum {
#endif
};
static const char *const environment[] = {
"HOME=/",
bb_PATH_root_path,
"SHELL=/bin/sh",
"USER=root",
NULL
};
/* Function prototypes */
static void halt_reboot_pwoff(int sig) NORETURN;
@@ -106,30 +111,29 @@ static void loop_forever(void)
* "where" may be bitwise-or'd from L_LOG | L_CONSOLE
* NB: careful, we can be called after vfork!
*/
#define messageD(...) do { if (DEBUG_INIT) message(__VA_ARGS__); } while (0)
#define messageD(...) do { if (ENABLE_DEBUG_INIT) message(__VA_ARGS__); } while (0)
static void message(int where, const char *fmt, ...)
__attribute__ ((format(printf, 2, 3)));
static void message(int where, const char *fmt, ...)
{
static int log_fd = -1;
va_list arguments;
unsigned l;
int l;
char msg[128];
msg[0] = '\r';
va_start(arguments, fmt);
l = 1 + vsnprintf(msg + 1, sizeof(msg) - 2, fmt, arguments);
if (l > sizeof(msg) - 1)
l = sizeof(msg) - 1;
msg[l] = '\0';
vsnprintf(msg + 1, sizeof(msg) - 2, fmt, arguments);
va_end(arguments);
msg[sizeof(msg) - 2] = '\0';
l = strlen(msg);
if (ENABLE_FEATURE_INIT_SYSLOG) {
/* Log the message to syslogd */
if (where & L_LOG) {
/* Log the message to syslogd */
openlog("init", 0, LOG_DAEMON);
/* don't print "\r" */
syslog(LOG_INFO, "%s", msg + 1);
/* don't print out "\r" */
openlog(applet_name, 0, LOG_DAEMON);
syslog(LOG_INFO, "init: %s", msg + 1);
closelog();
}
msg[l++] = '\n';
@@ -209,9 +213,6 @@ static void console_init(void)
/* Make sure fd 0,1,2 are not closed
* (so that they won't be used by future opens) */
bb_sanitize_stdio();
// Users report problems
// /* Make sure init can't be blocked by writing to stderr */
// fcntl(STDERR_FILENO, F_SETFL, fcntl(STDERR_FILENO, F_GETFL) | O_NONBLOCK);
}
s = getenv("TERM");
@@ -261,7 +262,7 @@ static void set_sane_term(void)
tty.c_lflag =
ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHOCTL | ECHOKE | IEXTEN;
tcsetattr_stdin_TCSANOW(&tty);
tcsetattr(STDIN_FILENO, TCSANOW, &tty);
}
/* Open the new terminal device.
@@ -279,7 +280,7 @@ static void open_stdio_to_tty(const char* tty_name, int exit_on_failure)
tty_name, strerror(errno));
if (exit_on_failure)
_exit(EXIT_FAILURE);
if (DEBUG_INIT)
if (ENABLE_DEBUG_INIT)
_exit(2);
/* NB: we don't reach this if we were called after vfork.
* Thus halt_reboot_pwoff() itself need not be vfork-safe. */
@@ -613,21 +614,24 @@ static void ctrlaltdel_signal(int sig UNUSED_PARAM)
run_actions(CTRLALTDEL);
}
/* The SIGCONT handler is set to record_signo().
* It just sets bb_got_signal = SIGCONT. */
/* The SIGSTOP & SIGTSTP handler */
static void stop_handler(int sig UNUSED_PARAM)
{
int saved_errno = errno;
bb_got_signal = 0;
while (bb_got_signal == 0)
got_cont = 0;
while (!got_cont)
pause();
errno = saved_errno;
}
/* The SIGCONT handler */
static void cont_handler(int sig UNUSED_PARAM)
{
got_cont = 1;
}
static void new_init_action(uint8_t action_type, const char *command, const char *cons)
{
struct init_action *a, *last;
@@ -789,7 +793,7 @@ int init_main(int argc UNUSED_PARAM, char **argv)
return kill(1, SIGHUP);
}
if (!DEBUG_INIT) {
if (!ENABLE_DEBUG_INIT) {
/* Expect to be invoked as init with PID=1 or be invoked as linuxrc */
if (getpid() != 1
&& (!ENABLE_FEATURE_INITRD || !strstr(applet_name, "linuxrc"))
@@ -805,7 +809,7 @@ int init_main(int argc UNUSED_PARAM, char **argv)
+ (1 << SIGTERM) /* reboot */
, halt_reboot_pwoff);
signal(SIGINT, ctrlaltdel_signal);
signal(SIGCONT, record_signo);
signal(SIGCONT, cont_handler);
bb_signals(0
+ (1 << SIGSTOP)
+ (1 << SIGTSTP)
@@ -821,15 +825,15 @@ int init_main(int argc UNUSED_PARAM, char **argv)
set_sane_term();
xchdir("/");
setsid();
/* Make sure environs is set to something sane */
putenv((char *) "HOME=/");
putenv((char *) bb_PATH_root_path);
putenv((char *) "SHELL=/bin/sh");
putenv((char *) "USER=root"); /* needed? why? */
{
const char *const *e;
/* Make sure environs is set to something sane */
for (e = environment; *e; e++)
putenv((char *) *e);
}
if (argv[1])
xsetenv("RUNLEVEL", argv[1]);
setenv("RUNLEVEL", argv[1], 1);
/* Hello world */
message(MAYBE_CONSOLE | L_LOG, "init started: %s", bb_banner);
-1
View File
@@ -75,7 +75,6 @@ lib-y += process_escape_sequence.o
lib-y += procps.o
lib-y += ptr_to_globals.o
lib-y += read.o
lib-y += read_key.o
lib-y += recursive_action.o
lib-y += remove_file.o
lib-y += restricted_shell.o
+2 -2
View File
@@ -37,7 +37,7 @@ char* FAST_FUNC bb_askpass(int timeout, const char *prompt)
tio = oldtio;
tio.c_iflag &= ~(IUCLC|IXON|IXOFF|IXANY);
tio.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|TOSTOP);
tcsetattr_stdin_TCSANOW(&tio);
tcsetattr(STDIN_FILENO, TCSANOW, &tio);
memset(&sa, 0, sizeof(sa));
/* sa.sa_flags = 0; - no SA_RESTART! */
@@ -70,7 +70,7 @@ char* FAST_FUNC bb_askpass(int timeout, const char *prompt)
}
sigaction_set(SIGINT, &oldsa);
tcsetattr_stdin_TCSANOW(&oldtio);
tcsetattr(STDIN_FILENO, TCSANOW, &oldtio);
bb_putchar('\n');
fflush(stdout);
return ret;
+1 -2
View File
@@ -17,8 +17,7 @@ double FAST_FUNC bb_strtod(const char *arg, char **endp)
double v;
char *endptr;
/* Allow .NN form. People want to use "sleep .15" etc */
if (arg[0] != '-' && arg[0] != '.' && NOT_DIGIT(arg[0]))
if (arg[0] != '-' && NOT_DIGIT(arg[0]))
goto err;
errno = 0;
v = strtod(arg, &endptr);
+2 -3
View File
@@ -298,7 +298,7 @@ static void rewrite(priv_dumper_t *dumper, FS *fs)
* if, rep count is greater than 1, no trailing whitespace
* gets output from the last iteration of the format unit.
*/
for (fu = fs->nextfu; fu; fu = fu->nextfu) {
for (fu = fs->nextfu;; fu = fu->nextfu) {
if (!fu->nextfu && fs->bcnt < dumper->blocksize
&& !(fu->flags & F_SETREP) && fu->bcnt
) {
@@ -723,8 +723,7 @@ void FAST_FUNC bb_dump_add(dumper_t* pub_dumper, const char *fmt)
nextfupp = &tfs->nextfu;
/* take the format string and break it up into format units */
p = fmt;
for (;;) {
for (p = fmt;;) {
p = skip_whitespace(p);
if (!*p) {
break;
+1 -1
View File
@@ -88,7 +88,7 @@ pid_t* FAST_FUNC find_pid_by_name(const char *procName)
if (comm_match(p, procName)
/* or we require argv0 to match (essential for matching reexeced /proc/self/exe)*/
|| (p->argv0 && strcmp(bb_basename(p->argv0), procName) == 0)
/* TODO: we can also try /proc/NUM/exe link, do we want that? */
/* TOOD: we can also try /proc/NUM/exe link, do we want that? */
) {
pidList = xrealloc_vector(pidList, 2, i);
pidList[i++] = p->pid;
+2
View File
@@ -13,6 +13,7 @@
/* From <linux/kd.h> */
enum { KDGKBTYPE = 0x4B33 }; /* get keyboard type */
static int open_a_console(const char *fnam)
{
int fd;
@@ -36,6 +37,7 @@ static int open_a_console(const char *fnam)
* We try several things because opening /dev/console will fail
* if someone else used X (which does a chown on /dev/console).
*/
int FAST_FUNC get_console_fd_or_die(void)
{
static const char *const console_names[] = {
+1 -1
View File
@@ -510,7 +510,7 @@ getopt32(char **argv, const char *applet_opts, ...)
*pargv = pp;
}
if (!(spec_flgs & ALL_ARGV_IS_OPTS))
break;
break;
pargv++;
}
}
+12 -21
View File
@@ -32,9 +32,7 @@ const char* FAST_FUNC make_human_readable_str(unsigned long long size,
unsigned long block_size, unsigned long display_unit)
{
/* The code will adjust for additional (appended) units */
static const char unit_chars[] ALIGN1 = {
'\0', 'K', 'M', 'G', 'T', 'P', 'E'
};
static const char zero_and_units[] ALIGN1 = { '0', 0, 'k', 'M', 'G', 'T' };
static const char fmt[] ALIGN1 = "%llu";
static const char fmt_tenths[] ALIGN1 = "%llu.%d%c";
@@ -44,33 +42,26 @@ const char* FAST_FUNC make_human_readable_str(unsigned long long size,
int frac;
const char *u;
const char *f;
smallint no_tenths;
if (size == 0)
return "0";
/* If block_size is 0 then do not print tenths */
no_tenths = 0;
if (block_size == 0) {
no_tenths = 1;
block_size = 1;
}
u = unit_chars;
val = size * block_size;
u = zero_and_units;
f = fmt;
frac = 0;
val = size * block_size;
if (val == 0) {
return u;
}
if (display_unit) {
val += display_unit/2; /* Deal with rounding */
val /= display_unit; /* Don't combine with the line above!!! */
/* will just print it as ulonglong (below) */
} else {
++u;
while ((val >= 1024)
&& (u < unit_chars + sizeof(unit_chars) - 1)
&& (u < zero_and_units + sizeof(zero_and_units) - 1)
) {
f = fmt_tenths;
u++;
++u;
frac = (((int)(val % 1024)) * 10 + 1024/2) / 1024;
val /= 1024;
}
@@ -78,9 +69,9 @@ const char* FAST_FUNC make_human_readable_str(unsigned long long size,
++val;
frac = 0;
}
#if 1
#if 0
/* Sample code to omit decimal point and tenths digit. */
if (no_tenths) {
if (/* no_tenths */ 1) {
if (frac >= 5) {
++val;
}
+3
View File
@@ -63,6 +63,9 @@ int FAST_FUNC INET_resolve(const char *name, struct sockaddr_in *s_in, int hostf
#ifdef DEBUG
res_init();
_res.options |= RES_DEBUG;
#endif
#ifdef DEBUG
bb_error_msg("gethostbyname(%s)", name);
#endif
hp = gethostbyname(name);
+2 -2
View File
@@ -1438,7 +1438,7 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li
#define _POSIX_VDISABLE '\0'
#endif
new_settings.c_cc[VINTR] = _POSIX_VDISABLE;
tcsetattr_stdin_TCSANOW(&new_settings);
tcsetattr(STDIN_FILENO, TCSANOW, &new_settings);
/* Now initialize things */
previous_SIGWINCH_handler = signal(SIGWINCH, win_changed);
@@ -1862,7 +1862,7 @@ int FAST_FUNC read_line_input(const char *prompt, char *command, int maxsize, li
#endif
/* restore initial_settings */
tcsetattr_stdin_TCSANOW(&initial_settings);
tcsetattr(STDIN_FILENO, TCSANOW, &initial_settings);
/* restore SIGWINCH handler */
signal(SIGWINCH, previous_SIGWINCH_handler);
fflush(stdout);
+3 -1
View File
@@ -4,7 +4,7 @@
*
* Copyright (C) 2003 Glenn McGrath
* Copyright (C) 2005 Vladimir Oleynik
* Copyright (C) 2005 Bernhard Reutner-Fischer
* Copyright (C) 2005 Bernhard Fischer
* Copyright (C) 2006 Rob Landley <rob@landley.net>
*
* Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
@@ -90,6 +90,7 @@ void FAST_FUNC llist_free(llist_t *elm, void (*freeit) (void *data))
}
}
#ifdef UNUSED
/* Reverse list order. */
llist_t* FAST_FUNC llist_rev(llist_t *list)
{
@@ -104,3 +105,4 @@ llist_t* FAST_FUNC llist_rev(llist_t *list)
}
return rev;
}
#endif
+1 -1
View File
@@ -71,7 +71,7 @@ int FAST_FUNC bb_make_directory(char *path, long mode, int flags)
}
/* Since the directory exists, don't attempt to change
* permissions if it was the full target. Note that
* this is not an error condition. */
* this is not an error conditon. */
if (!c) {
umask(mask);
return 0;
+1 -1
View File
@@ -9,7 +9,7 @@
#include "libbb.h"
#if defined ENABLE_PARSE && ENABLE_PARSE
#if ENABLE_PARSE
int parse_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int parse_main(int argc UNUSED_PARAM, char **argv)
{
+7 -10
View File
@@ -18,20 +18,17 @@
char FAST_FUNC bb_process_escape_sequence(const char **ptr)
{
/* bash builtin "echo -e '\ec'" interprets \e as ESC,
* but coreutils "/bin/echo -e '\ec'" does not.
* manpages tend to support coreutils way. */
static const char charmap[] ALIGN1 = {
'a', 'b', /*'e',*/ 'f', 'n', 'r', 't', 'v', '\\', 0,
'\a', '\b', /*27,*/ '\f', '\n', '\r', '\t', '\v', '\\', '\\' };
'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', 0,
'\a', '\b', '\f', '\n', '\r', '\t', '\v', '\\', '\\' };
const char *p;
const char *q;
unsigned num_digits;
unsigned r;
unsigned n;
unsigned d;
unsigned base;
unsigned int num_digits;
unsigned int r;
unsigned int n;
unsigned int d;
unsigned int base;
num_digits = n = 0;
base = 8;
Loaded 100 of 263 files, more files were not shown because too many files have changed in this diff. Show more