Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84641942e5 | ||
|
|
bacaff6e54 |
No files matched your search
@@ -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>
|
||||
|
||||
@@ -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,18 +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.
|
||||
|
||||
config EXTRA_CFLAGS
|
||||
string "Additional CFLAGS"
|
||||
default ""
|
||||
help
|
||||
Additional CFLAGS to pass to the compiler verbatim.
|
||||
"i386-uclibc-". Note that CROSS_COMPILE environment variable
|
||||
or "make CROSS_COMPILE=xxx ..." will override this selection.
|
||||
For native build leave it empty.
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -502,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
|
||||
|
||||
@@ -601,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
|
||||
@@ -1,5 +1,5 @@
|
||||
VERSION = 1
|
||||
PATCHLEVEL = 14
|
||||
PATCHLEVEL = 12
|
||||
SUBLEVEL = 2
|
||||
EXTRAVERSION =
|
||||
NAME = Unnamed
|
||||
@@ -168,7 +168,6 @@ ifeq ($(CROSS_COMPILE),)
|
||||
CROSS_COMPILE := $(shell grep ^CONFIG_CROSS_COMPILER_PREFIX .config 2>/dev/null)
|
||||
CROSS_COMPILE := $(subst CONFIG_CROSS_COMPILER_PREFIX=,,$(CROSS_COMPILE))
|
||||
CROSS_COMPILE := $(subst ",,$(CROSS_COMPILE))
|
||||
#")
|
||||
endif
|
||||
|
||||
# SUBARCH tells the usermode build what the underlying arch is. That is set
|
||||
@@ -457,7 +456,6 @@ libs-y := \
|
||||
libbb/ \
|
||||
libpwdgrp/ \
|
||||
loginutils/ \
|
||||
mailutils/ \
|
||||
miscutils/ \
|
||||
modutils/ \
|
||||
networking/ \
|
||||
@@ -507,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
|
||||
|
||||
@@ -968,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))
|
||||
|
||||
@@ -105,12 +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
|
||||
cmd_doc =
|
||||
quiet_cmd_doc = $(Q)echo " DOC $(@F)"
|
||||
silent_cmd_doc =
|
||||
disp_doc = $($(quiet)cmd_doc)
|
||||
|
||||
docs/busybox.pod: $(srctree)/docs/busybox_header.pod \
|
||||
$(srctree)/include/usage.h \
|
||||
$(srctree)/docs/busybox_footer.pod \
|
||||
|
||||
+3
-9
@@ -23,7 +23,6 @@ CFLAGS += $(call cc-option,-Wwrite-strings,)
|
||||
CFLAGS += $(call cc-option,-Wundef,)
|
||||
CFLAGS += $(call cc-option,-Wstrict-prototypes,)
|
||||
CFLAGS += $(call cc-option,-Wunused -Wunused-parameter,)
|
||||
CFLAGS += $(call cc-option,-Wunused-function -Wunused-value,)
|
||||
CFLAGS += $(call cc-option,-Wmissing-prototypes -Wmissing-declarations,)
|
||||
# warn about C99 declaration after statement
|
||||
CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
|
||||
@@ -82,11 +81,6 @@ CFLAGS_busybox += $(ARCH_PIE)
|
||||
CFLAGS += $(ARCH_FPIE)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_EXTRA_CFLAGS),)
|
||||
CFLAGS += $(strip $(subst ",,$(CONFIG_EXTRA_CFLAGS)))
|
||||
#"))
|
||||
endif
|
||||
|
||||
LDLIBS += m crypt
|
||||
|
||||
ifeq ($(CONFIG_PAM),y)
|
||||
@@ -105,12 +99,12 @@ ifeq ($(CONFIG_DMALLOC),y)
|
||||
LDLIBS += dmalloc
|
||||
endif
|
||||
|
||||
# If a flat binary should be built, CFLAGS_busybox="-elf2flt"
|
||||
# If a flat binary should be built, CFLAGS_busybox="-Wl,-elf2flt"
|
||||
# env var should be set for make invocation.
|
||||
# Here we check whether CFLAGS_busybox indeed contains that flag.
|
||||
# (For historical reasons, we also check LDFLAGS, which doesn't
|
||||
# seem to be entirely correct variable to put "-elf2flt" into).
|
||||
W_ELF2FLT = -elf2flt
|
||||
# seem to be entirely correct variable to put "-Wl,-elf2flt" into).
|
||||
W_ELF2FLT = -Wl,-elf2flt
|
||||
ifneq (,$(findstring $(W_ELF2FLT),$(LDFLAGS) $(CFLAGS_busybox)))
|
||||
SKIP_STRIP = y
|
||||
endif
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -78,7 +78,7 @@ Downloading the current source code:
|
||||
http://busybox.net/developer.html
|
||||
|
||||
The developers also have a bug and patch tracking system
|
||||
(https://bugs.busybox.net) although posting a bug/patch to the mailing list
|
||||
(http://bugs.busybox.net) although posting a bug/patch to the mailing list
|
||||
is generally a faster way of getting it fixed, and the complete archive of
|
||||
what happened is the subversion changelog.
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ Rob Landley suggested these:
|
||||
lash is phased out. hush can be configured down to be nearly as small,
|
||||
but less buggy :)
|
||||
init
|
||||
General cleanup (should use ENABLE_FEATURE_INIT_SYSLOG).
|
||||
General cleanup (should use ENABLE_FEATURE_INIT_SYSLOG and ENABLE_FEATURE_INIT_DEBUG).
|
||||
Do a SUSv3 audit
|
||||
Look at the full Single Unix Specification version 3 (available online at
|
||||
"http://www.opengroup.org/onlinepubs/009695399/nfindex.html") and
|
||||
@@ -99,10 +99,15 @@ 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
|
||||
-Wunused-parameter
|
||||
Facilitate applet PROTOTYPES to provide means for having applets that
|
||||
do a) not take any arguments b) need only one of argc or argv c) need
|
||||
both argc and argv. All of these three options should go for the most
|
||||
feature complete denominator.
|
||||
Collate BUFSIZ IOBUF_SIZE MY_BUF_SIZE PIPE_PROGRESS_SIZE BUFSIZE PIPESIZE
|
||||
make bb_common_bufsiz1 configurable, size wise.
|
||||
make pipesize configurable, size wise.
|
||||
@@ -127,6 +132,14 @@ patch
|
||||
And while we're at it, a new patch filename quoting format is apparently
|
||||
coming soon: http://marc.theaimsgroup.com/?l=git&m=112927316408690&w=2
|
||||
---
|
||||
man
|
||||
It would be nice to have a man command. Not one that handles troff or
|
||||
anything, just one that can handle preformatted ascii man pages, possibly
|
||||
compressed. This could probably be a script in the extras directory that
|
||||
calls cat/zcat/bzcat | less
|
||||
|
||||
(How doclifter might work into this is anybody's guess.)
|
||||
---
|
||||
ar
|
||||
Write support!
|
||||
---
|
||||
@@ -170,7 +183,8 @@ Unify archivers
|
||||
---
|
||||
Text buffer support.
|
||||
Several existing applets (sort, vi, less...) read
|
||||
a whole file into memory and act on it. Use open_read_close().
|
||||
a whole file into memory and act on it. There might be an opportunity
|
||||
for shared code in there that could be moved into libbb...
|
||||
---
|
||||
Memory Allocation
|
||||
We have a CONFIG_BUFFER mechanism that lets us select whether to do memory
|
||||
@@ -222,7 +236,7 @@ Switch CONFIG_SYMBOLS to ENABLE_SYMBOLS
|
||||
FEATURE_CLEAN_UP
|
||||
This is more an unresolved issue than a to-do item. More thought is needed.
|
||||
|
||||
Normally we rely on exit() to free memory, close files and unmap segments
|
||||
Normally we rely on exit() to free memory, close files, and unmap segments
|
||||
for us. This makes most calls to free(), close(), and unmap() optional in
|
||||
busybox applets that don't intend to run for very long, and optional stuff
|
||||
can be omitted to save size.
|
||||
@@ -273,7 +287,6 @@ Minor stuff:
|
||||
---
|
||||
in_ether duplicated in network/{interface,ifconfig}.c
|
||||
---
|
||||
unify progress_meter. wget, flash_eraseall, pipe_progress, fbsplash, setfiles.
|
||||
|
||||
|
||||
Code cleanup:
|
||||
|
||||
+74
-93
@@ -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
|
||||
@@ -110,7 +111,6 @@ CONFIG_BUNZIP2=y
|
||||
CONFIG_BZIP2=y
|
||||
CONFIG_CPIO=y
|
||||
CONFIG_FEATURE_CPIO_O=y
|
||||
CONFIG_FEATURE_CPIO_P=y
|
||||
CONFIG_DPKG=y
|
||||
CONFIG_DPKG_DEB=y
|
||||
CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY=y
|
||||
@@ -153,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
|
||||
@@ -283,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
|
||||
@@ -306,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
|
||||
@@ -369,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
|
||||
@@ -423,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
|
||||
@@ -557,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
|
||||
@@ -579,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
|
||||
@@ -631,9 +625,11 @@ CONFIG_HOSTNAME=y
|
||||
CONFIG_HTTPD=y
|
||||
CONFIG_FEATURE_HTTPD_RANGES=y
|
||||
CONFIG_FEATURE_HTTPD_USE_SENDFILE=y
|
||||
CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP=y
|
||||
CONFIG_FEATURE_HTTPD_SETUID=y
|
||||
CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
|
||||
CONFIG_FEATURE_HTTPD_AUTH_MD5=y
|
||||
CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES=y
|
||||
CONFIG_FEATURE_HTTPD_CGI=y
|
||||
CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR=y
|
||||
CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV=y
|
||||
@@ -693,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
|
||||
@@ -704,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
|
||||
@@ -717,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
|
||||
@@ -730,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
|
||||
#
|
||||
@@ -773,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
|
||||
@@ -870,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,9 +1,4 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* Copyright (C) 2008 Denys Vlasenko.
|
||||
*
|
||||
* Licensed under GPLv2, see file LICENSE in this tarball for details.
|
||||
*/
|
||||
#include <unistd.h>
|
||||
|
||||
/* Just #include "autoconf.h" doesn't work for builds in separate
|
||||
|
||||
@@ -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
-10
@@ -110,17 +110,9 @@ config FEATURE_CPIO_O
|
||||
This implementation of cpio can create cpio archives in the "newc"
|
||||
format only.
|
||||
|
||||
config FEATURE_CPIO_P
|
||||
bool "Support for passthrough mode"
|
||||
default n
|
||||
depends on FEATURE_CPIO_O
|
||||
help
|
||||
Passthrough mode. Rarely used.
|
||||
|
||||
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.
|
||||
@@ -131,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
@@ -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, ×);
|
||||
}
|
||||
|
||||
/* 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
@@ -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;
|
||||
|
||||
+93
-158
@@ -14,87 +14,6 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
/* GNU cpio 2.9 --help (abridged):
|
||||
|
||||
Modes:
|
||||
-t, --list List the archive
|
||||
-i, --extract Extract files from an archive
|
||||
-o, --create Create the archive
|
||||
-p, --pass-through Copy-pass mode [was ist das?!]
|
||||
|
||||
Options valid in any mode:
|
||||
--block-size=SIZE I/O block size = SIZE * 512 bytes
|
||||
-B I/O block size = 5120 bytes
|
||||
-c Use the old portable (ASCII) archive format
|
||||
-C, --io-size=NUMBER I/O block size in bytes
|
||||
-f, --nonmatching Only copy files that do not match given pattern
|
||||
-F, --file=FILE Use FILE instead of standard input or output
|
||||
-H, --format=FORMAT Use given archive FORMAT
|
||||
-M, --message=STRING Print STRING when the end of a volume of the
|
||||
backup media is reached
|
||||
-n, --numeric-uid-gid If -v, show numeric UID and GID
|
||||
--quiet Do not print the number of blocks copied
|
||||
--rsh-command=COMMAND Use remote COMMAND instead of rsh
|
||||
-v, --verbose Verbosely list the files processed
|
||||
-V, --dot Print a "." for each file processed
|
||||
-W, --warning=FLAG Control warning display: 'none','truncate','all';
|
||||
multiple options accumulate
|
||||
|
||||
Options valid only in --extract mode:
|
||||
-b, --swap Swap both halfwords of words and bytes of
|
||||
halfwords in the data (equivalent to -sS)
|
||||
-r, --rename Interactively rename files
|
||||
-s, --swap-bytes Swap the bytes of each halfword in the files
|
||||
-S, --swap-halfwords Swap the halfwords of each word (4 bytes)
|
||||
--to-stdout Extract files to standard output
|
||||
-E, --pattern-file=FILE Read additional patterns specifying filenames to
|
||||
extract or list from FILE
|
||||
--only-verify-crc Verify CRC's, don't actually extract the files
|
||||
|
||||
Options valid only in --create mode:
|
||||
-A, --append Append to an existing archive
|
||||
-O FILE File to use instead of standard output
|
||||
|
||||
Options valid only in --pass-through mode:
|
||||
-l, --link Link files instead of copying them, when possible
|
||||
|
||||
Options valid in --extract and --create modes:
|
||||
--absolute-filenames Do not strip file system prefix components from
|
||||
the file names
|
||||
--no-absolute-filenames Create all files relative to the current dir
|
||||
|
||||
Options valid in --create and --pass-through modes:
|
||||
-0, --null A list of filenames is terminated by a NUL
|
||||
-a, --reset-access-time Reset the access times of files after reading them
|
||||
-I FILE File to use instead of standard input
|
||||
-L, --dereference Dereference symbolic links (copy the files
|
||||
that they point to instead of copying the links)
|
||||
-R, --owner=[USER][:.][GROUP] Set owner of created files
|
||||
|
||||
Options valid in --extract and --pass-through modes:
|
||||
-d, --make-directories Create leading directories where needed
|
||||
-m, --preserve-modification-time Retain mtime when creating files
|
||||
--no-preserve-owner Do not change the ownership of the files
|
||||
--sparse Write files with blocks of zeros as sparse files
|
||||
-u, --unconditional Replace all files unconditionally
|
||||
*/
|
||||
enum {
|
||||
CPIO_OPT_EXTRACT = (1 << 0),
|
||||
CPIO_OPT_TEST = (1 << 1),
|
||||
CPIO_OPT_NUL_TERMINATED = (1 << 2),
|
||||
CPIO_OPT_UNCONDITIONAL = (1 << 3),
|
||||
CPIO_OPT_VERBOSE = (1 << 4),
|
||||
CPIO_OPT_CREATE_LEADING_DIR = (1 << 5),
|
||||
CPIO_OPT_PRESERVE_MTIME = (1 << 6),
|
||||
CPIO_OPT_DEREF = (1 << 7),
|
||||
CPIO_OPT_FILE = (1 << 8),
|
||||
CPIO_OPT_CREATE = (1 << 9) * ENABLE_FEATURE_CPIO_O,
|
||||
CPIO_OPT_FORMAT = (1 << 10) * ENABLE_FEATURE_CPIO_O,
|
||||
CPIO_OPT_PASSTHROUGH = (1 << 11) * ENABLE_FEATURE_CPIO_P,
|
||||
};
|
||||
|
||||
#define OPTION_STR "it0uvdmLF:"
|
||||
|
||||
#if ENABLE_FEATURE_CPIO_O
|
||||
static off_t cpio_pad4(off_t size)
|
||||
{
|
||||
@@ -111,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];
|
||||
@@ -130,9 +48,7 @@ static int cpio_o(void)
|
||||
char *line;
|
||||
struct stat st;
|
||||
|
||||
line = (option_mask32 & CPIO_OPT_NUL_TERMINATED)
|
||||
? bb_get_chunk_from_file(stdin, NULL)
|
||||
: xmalloc_fgetline(stdin);
|
||||
line = xmalloc_fgetline(stdin);
|
||||
|
||||
if (line) {
|
||||
/* Strip leading "./[./]..." from the filename */
|
||||
@@ -145,10 +61,7 @@ static int cpio_o(void)
|
||||
free(line);
|
||||
continue;
|
||||
}
|
||||
if ((option_mask32 & CPIO_OPT_DEREF)
|
||||
? stat(name, &st)
|
||||
: lstat(name, &st)
|
||||
) {
|
||||
if (lstat(name, &st)) {
|
||||
abort_cpio_o:
|
||||
bb_simple_perror_msg_and_die(name);
|
||||
}
|
||||
@@ -206,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));
|
||||
@@ -254,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;
|
||||
@@ -265,6 +178,71 @@ static int cpio_o(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* GNU cpio 2.9 --help (abridged):
|
||||
|
||||
Modes:
|
||||
-i, --extract Extract files from an archive
|
||||
-o, --create Create the archive
|
||||
-p, --pass-through Copy-pass mode [was ist das?!]
|
||||
-t, --list List the archive
|
||||
|
||||
Options valid in any mode:
|
||||
--block-size=SIZE I/O block size = SIZE * 512 bytes
|
||||
-B I/O block size = 5120 bytes
|
||||
-c Use the old portable (ASCII) archive format
|
||||
-C, --io-size=NUMBER I/O block size in bytes
|
||||
-f, --nonmatching Only copy files that do not match given pattern
|
||||
-F, --file=FILE Use FILE instead of standard input or output
|
||||
-H, --format=FORMAT Use given archive FORMAT
|
||||
-M, --message=STRING Print STRING when the end of a volume of the
|
||||
backup media is reached
|
||||
-n, --numeric-uid-gid If -v, show numeric UID and GID
|
||||
--quiet Do not print the number of blocks copied
|
||||
--rsh-command=COMMAND Use remote COMMAND instead of rsh
|
||||
-v, --verbose Verbosely list the files processed
|
||||
-V, --dot Print a "." for each file processed
|
||||
-W, --warning=FLAG Control warning display: 'none','truncate','all';
|
||||
multiple options accumulate
|
||||
|
||||
Options valid only in --extract mode:
|
||||
-b, --swap Swap both halfwords of words and bytes of
|
||||
halfwords in the data (equivalent to -sS)
|
||||
-r, --rename Interactively rename files
|
||||
-s, --swap-bytes Swap the bytes of each halfword in the files
|
||||
-S, --swap-halfwords Swap the halfwords of each word (4 bytes)
|
||||
--to-stdout Extract files to standard output
|
||||
-E, --pattern-file=FILE Read additional patterns specifying filenames to
|
||||
extract or list from FILE
|
||||
--only-verify-crc Verify CRC's, don't actually extract the files
|
||||
|
||||
Options valid only in --create mode:
|
||||
-A, --append Append to an existing archive
|
||||
-O FILE File to use instead of standard output
|
||||
|
||||
Options valid only in --pass-through mode:
|
||||
-l, --link Link files instead of copying them, when possible
|
||||
|
||||
Options valid in --extract and --create modes:
|
||||
--absolute-filenames Do not strip file system prefix components from
|
||||
the file names
|
||||
--no-absolute-filenames Create all files relative to the current dir
|
||||
|
||||
Options valid in --create and --pass-through modes:
|
||||
-0, --null A list of filenames is terminated by a NUL
|
||||
-a, --reset-access-time Reset the access times of files after reading them
|
||||
-I FILE File to use instead of standard input
|
||||
-L, --dereference Dereference symbolic links (copy the files
|
||||
that they point to instead of copying the links)
|
||||
-R, --owner=[USER][:.][GROUP] Set owner of created files
|
||||
|
||||
Options valid in --extract and --pass-through modes:
|
||||
-d, --make-directories Create leading directories where needed
|
||||
-m, --preserve-modification-time Retain mtime when creating files
|
||||
--no-preserve-owner Do not change the ownership of the files
|
||||
--sparse Write files with blocks of zeros as sparse files
|
||||
-u, --unconditional Replace all files unconditionally
|
||||
*/
|
||||
|
||||
int cpio_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int cpio_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
@@ -272,6 +250,17 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
|
||||
char *cpio_filename;
|
||||
USE_FEATURE_CPIO_O(const char *cpio_fmt = "";)
|
||||
unsigned opt;
|
||||
enum {
|
||||
CPIO_OPT_EXTRACT = (1 << 0),
|
||||
CPIO_OPT_TEST = (1 << 1),
|
||||
CPIO_OPT_UNCONDITIONAL = (1 << 2),
|
||||
CPIO_OPT_VERBOSE = (1 << 3),
|
||||
CPIO_OPT_FILE = (1 << 4),
|
||||
CPIO_OPT_CREATE_LEADING_DIR = (1 << 5),
|
||||
CPIO_OPT_PRESERVE_MTIME = (1 << 6),
|
||||
CPIO_OPT_CREATE = (1 << 7),
|
||||
CPIO_OPT_FORMAT = (1 << 8),
|
||||
};
|
||||
|
||||
#if ENABLE_GETOPT_LONG
|
||||
applet_long_options =
|
||||
@@ -280,67 +269,21 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
|
||||
#if ENABLE_FEATURE_CPIO_O
|
||||
"create\0" No_argument "o"
|
||||
"format\0" Required_argument "H"
|
||||
#if ENABLE_FEATURE_CPIO_P
|
||||
"pass-through\0" No_argument "p"
|
||||
#endif
|
||||
#endif
|
||||
;
|
||||
#endif
|
||||
|
||||
/* As of now we do not enforce this: */
|
||||
/* -i,-t,-o,-p are mutually exclusive */
|
||||
/* -u,-d,-m make sense only with -i or -p */
|
||||
/* -L makes sense only with -o or -p */
|
||||
/* Initialize */
|
||||
archive_handle = init_handle();
|
||||
archive_handle->src_fd = STDIN_FILENO;
|
||||
archive_handle->seek = seek_by_read;
|
||||
archive_handle->ah_flags = ARCHIVE_EXTRACT_NEWER;
|
||||
|
||||
#if !ENABLE_FEATURE_CPIO_O
|
||||
opt = getopt32(argv, OPTION_STR, &cpio_filename);
|
||||
#else
|
||||
opt = getopt32(argv, OPTION_STR "oH:" USE_FEATURE_CPIO_P("p"), &cpio_filename, &cpio_fmt);
|
||||
if (opt & CPIO_OPT_PASSTHROUGH) {
|
||||
pid_t pid;
|
||||
struct fd_pair pp;
|
||||
#if ENABLE_FEATURE_CPIO_O
|
||||
opt = getopt32(argv, "ituvF:dmoH:", &cpio_filename, &cpio_fmt);
|
||||
|
||||
if (argv[optind] == NULL)
|
||||
bb_show_usage();
|
||||
if (opt & CPIO_OPT_CREATE_LEADING_DIR)
|
||||
mkdir(argv[optind], 0777);
|
||||
/* Crude existence check:
|
||||
* close(xopen(argv[optind], O_RDONLY | O_DIRECTORY));
|
||||
* We can also xopen, fstat, IS_DIR, later fchdir.
|
||||
* This would check for existence earlier and cleaner.
|
||||
* As it stands now, if we fail xchdir later,
|
||||
* child dies on EPIPE, unless it caught
|
||||
* a diffrerent problem earlier.
|
||||
* This is good enough for now.
|
||||
*/
|
||||
#if !BB_MMU
|
||||
pp.rd = 3;
|
||||
pp.wr = 4;
|
||||
if (!re_execed) {
|
||||
close(3);
|
||||
close(4);
|
||||
xpiped_pair(pp);
|
||||
}
|
||||
#else
|
||||
xpiped_pair(pp);
|
||||
#endif
|
||||
pid = fork_or_rexec(argv);
|
||||
if (pid == 0) { /* child */
|
||||
close(pp.rd);
|
||||
xmove_fd(pp.wr, STDOUT_FILENO);
|
||||
goto dump;
|
||||
}
|
||||
/* parent */
|
||||
xchdir(argv[optind++]);
|
||||
close(pp.wr);
|
||||
xmove_fd(pp.rd, STDIN_FILENO);
|
||||
opt &= ~CPIO_OPT_PASSTHROUGH;
|
||||
opt |= CPIO_OPT_EXTRACT;
|
||||
goto skip;
|
||||
}
|
||||
/* -o */
|
||||
if (opt & CPIO_OPT_CREATE) {
|
||||
if (*cpio_fmt != 'n') /* we _require_ "-H newc" */
|
||||
if (*cpio_fmt != 'n')
|
||||
bb_show_usage();
|
||||
if (opt & CPIO_OPT_FILE) {
|
||||
fclose(stdout);
|
||||
@@ -348,18 +291,13 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
|
||||
/* Paranoia: I don't trust libc that much */
|
||||
xdup2(fileno(stdout), STDOUT_FILENO);
|
||||
}
|
||||
dump:
|
||||
return cpio_o();
|
||||
}
|
||||
skip:
|
||||
#else
|
||||
opt = getopt32(argv, "ituvF:dm", &cpio_filename);
|
||||
#endif
|
||||
argv += optind;
|
||||
|
||||
archive_handle = init_handle();
|
||||
archive_handle->src_fd = STDIN_FILENO;
|
||||
archive_handle->seek = seek_by_read;
|
||||
archive_handle->ah_flags = ARCHIVE_EXTRACT_NEWER;
|
||||
|
||||
/* One of either extract or test options must be given */
|
||||
if ((opt & (CPIO_OPT_TEST | CPIO_OPT_EXTRACT)) == 0) {
|
||||
bb_show_usage();
|
||||
@@ -367,7 +305,9 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
|
||||
|
||||
if (opt & CPIO_OPT_TEST) {
|
||||
/* if both extract and test options are given, ignore extract option */
|
||||
opt &= ~CPIO_OPT_EXTRACT;
|
||||
if (opt & CPIO_OPT_EXTRACT) {
|
||||
opt &= ~CPIO_OPT_EXTRACT;
|
||||
}
|
||||
archive_handle->action_header = header_list;
|
||||
}
|
||||
if (opt & CPIO_OPT_EXTRACT) {
|
||||
@@ -401,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;
|
||||
}
|
||||
+69
-64
@@ -6,10 +6,6 @@
|
||||
* written by glenn mcgrath with the help of others
|
||||
* copyright (c) 2001 by glenn mcgrath
|
||||
*
|
||||
* parts of the version comparison code is plucked from the real dpkg
|
||||
* application which is licensed GPLv2 and
|
||||
* copyright (c) 1995 Ian Jackson <ian@chiark.greenend.org.uk>
|
||||
*
|
||||
* started life as a busybox implementation of udpkg
|
||||
*
|
||||
* licensed under gplv2 or later, see file license in this tarball for details.
|
||||
@@ -29,7 +25,6 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include <fnmatch.h>
|
||||
#include "unarchive.h"
|
||||
|
||||
/* note: if you vary hash_prime sizes be aware,
|
||||
@@ -139,7 +134,7 @@ static void make_hash(const char *key, unsigned *start, unsigned *decrement, con
|
||||
/* shifts the ascii based value and adds it to previous value
|
||||
* shift amount is mod 24 because long int is 32 bit and data
|
||||
* to be shifted is 8, don't want to shift data to where it has
|
||||
* no effect */
|
||||
* no effect*/
|
||||
hash_num += (key[i] + key[i-1]) << ((key[i] * i) % 24);
|
||||
}
|
||||
*start = (unsigned) hash_num % hash_prime;
|
||||
@@ -187,52 +182,60 @@ static unsigned search_status_hashtable(const char *key)
|
||||
return probe_address;
|
||||
}
|
||||
|
||||
static int order(char x)
|
||||
/* Need to rethink version comparison, maybe the official dpkg has something i can use ? */
|
||||
static int version_compare_part(const char *version1, const char *version2)
|
||||
{
|
||||
return (x == '~' ? -1
|
||||
: x == '\0' ? 0
|
||||
: isdigit(x) ? 0
|
||||
: isalpha(x) ? x
|
||||
: (unsigned char)x + 256
|
||||
);
|
||||
}
|
||||
int upstream_len1 = 0;
|
||||
int upstream_len2 = 0;
|
||||
char *name1_char;
|
||||
char *name2_char;
|
||||
int len1 = 0;
|
||||
int len2 = 0;
|
||||
int tmp_int;
|
||||
int ver_num1;
|
||||
int ver_num2;
|
||||
|
||||
/* This code is taken from dpkg and modified slightly to work with busybox */
|
||||
static int version_compare_part(const char *val, const char *ref)
|
||||
{
|
||||
if (!val) val = "";
|
||||
if (!ref) ref = "";
|
||||
if (version1 == NULL) {
|
||||
version1 = xstrdup("");
|
||||
}
|
||||
if (version2 == NULL) {
|
||||
version2 = xstrdup("");
|
||||
}
|
||||
upstream_len1 = strlen(version1);
|
||||
upstream_len2 = strlen(version2);
|
||||
|
||||
while (*val || *ref) {
|
||||
int first_diff;
|
||||
|
||||
while ((*val && !isdigit(*val)) || (*ref && !isdigit(*ref))) {
|
||||
int vc = order(*val);
|
||||
int rc = order(*ref);
|
||||
if (vc != rc)
|
||||
return vc - rc;
|
||||
val++;
|
||||
ref++;
|
||||
while ((len1 < upstream_len1) || (len2 < upstream_len2)) {
|
||||
/* Compare non-digit section */
|
||||
tmp_int = strcspn(&version1[len1], "0123456789");
|
||||
name1_char = xstrndup(&version1[len1], tmp_int);
|
||||
len1 += tmp_int;
|
||||
tmp_int = strcspn(&version2[len2], "0123456789");
|
||||
name2_char = xstrndup(&version2[len2], tmp_int);
|
||||
len2 += tmp_int;
|
||||
tmp_int = strcmp(name1_char, name2_char);
|
||||
free(name1_char);
|
||||
free(name2_char);
|
||||
if (tmp_int != 0) {
|
||||
return tmp_int;
|
||||
}
|
||||
|
||||
while (*val == '0')
|
||||
val++;
|
||||
while (*ref == '0')
|
||||
ref++;
|
||||
|
||||
first_diff = 0;
|
||||
while (isdigit(*val) && isdigit(*ref)) {
|
||||
if (first_diff == 0)
|
||||
first_diff = *val - *ref;
|
||||
val++;
|
||||
ref++;
|
||||
}
|
||||
if (isdigit(*val))
|
||||
return 1;
|
||||
if (isdigit(*ref))
|
||||
/* Compare digits */
|
||||
tmp_int = strspn(&version1[len1], "0123456789");
|
||||
name1_char = xstrndup(&version1[len1], tmp_int);
|
||||
len1 += tmp_int;
|
||||
tmp_int = strspn(&version2[len2], "0123456789");
|
||||
name2_char = xstrndup(&version2[len2], tmp_int);
|
||||
len2 += tmp_int;
|
||||
ver_num1 = atoi(name1_char);
|
||||
ver_num2 = atoi(name2_char);
|
||||
free(name1_char);
|
||||
free(name2_char);
|
||||
if (ver_num1 < ver_num2) {
|
||||
return -1;
|
||||
if (first_diff)
|
||||
return first_diff;
|
||||
}
|
||||
if (ver_num1 > ver_num2) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -245,34 +248,39 @@ static int version_compare(const unsigned ver1, const unsigned ver2)
|
||||
{
|
||||
char *ch_ver1 = name_hashtable[ver1];
|
||||
char *ch_ver2 = name_hashtable[ver2];
|
||||
unsigned long epoch1 = 0, epoch2 = 0;
|
||||
char *colon;
|
||||
|
||||
char epoch1, epoch2;
|
||||
char *deb_ver1, *deb_ver2;
|
||||
char *ver1_ptr, *ver2_ptr;
|
||||
char *upstream_ver1;
|
||||
char *upstream_ver2;
|
||||
int result;
|
||||
|
||||
/* Compare epoch */
|
||||
colon = strchr(ch_ver1, ':');
|
||||
if (colon) {
|
||||
epoch1 = atoi(ch_ver1);
|
||||
ch_ver1 = colon + 1;
|
||||
if (ch_ver1[1] == ':') {
|
||||
epoch1 = ch_ver1[0];
|
||||
ver1_ptr = strchr(ch_ver1, ':') + 1;
|
||||
} else {
|
||||
epoch1 = '0';
|
||||
ver1_ptr = ch_ver1;
|
||||
}
|
||||
colon = strchr(ch_ver2, ':');
|
||||
if (colon) {
|
||||
epoch2 = atoi(ch_ver2);
|
||||
ch_ver2 = colon + 1;
|
||||
if (ch_ver2[1] == ':') {
|
||||
epoch2 = ch_ver2[0];
|
||||
ver2_ptr = strchr(ch_ver2, ':') + 1;
|
||||
} else {
|
||||
epoch2 = '0';
|
||||
ver2_ptr = ch_ver2;
|
||||
}
|
||||
if (epoch1 < epoch2) {
|
||||
return -1;
|
||||
}
|
||||
if (epoch1 > epoch2) {
|
||||
else if (epoch1 > epoch2) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Compare upstream version */
|
||||
upstream_ver1 = xstrdup(ch_ver1);
|
||||
upstream_ver2 = xstrdup(ch_ver2);
|
||||
upstream_ver1 = xstrdup(ver1_ptr);
|
||||
upstream_ver2 = xstrdup(ver2_ptr);
|
||||
|
||||
/* Chop off debian version, and store for later use */
|
||||
deb_ver1 = strrchr(upstream_ver1, '-');
|
||||
@@ -1285,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;
|
||||
|
||||
@@ -1306,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';
|
||||
|
||||
@@ -1621,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;
|
||||
}
|
||||
|
||||
|
||||
+38
-33
@@ -40,7 +40,6 @@ aa: 85.1% -- replaced with aa.gz
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
|
||||
/* ===========================================================================
|
||||
@@ -388,6 +387,19 @@ static void put_32bit(ulg n)
|
||||
put_16bit(n >> 16);
|
||||
}
|
||||
|
||||
/* ===========================================================================
|
||||
* Clear input and output buffers
|
||||
*/
|
||||
static void clear_bufs(void)
|
||||
{
|
||||
G1.outcnt = 0;
|
||||
#ifdef DEBUG
|
||||
G1.insize = 0;
|
||||
#endif
|
||||
G1.isize = 0;
|
||||
}
|
||||
|
||||
|
||||
/* ===========================================================================
|
||||
* Run a set of bytes through the crc shift register. If s is a NULL
|
||||
* pointer, then initialize the crc shift register contents instead.
|
||||
@@ -2002,41 +2014,11 @@ 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;
|
||||
|
||||
/* Clear input and output buffers */
|
||||
G1.outcnt = 0;
|
||||
#ifdef DEBUG
|
||||
G1.insize = 0;
|
||||
#endif
|
||||
G1.isize = 0;
|
||||
|
||||
/* Reinit G2.xxx */
|
||||
memset(&G2, 0, sizeof(G2));
|
||||
G2.l_desc.dyn_tree = G2.dyn_ltree;
|
||||
G2.l_desc.static_tree = G2.static_ltree;
|
||||
G2.l_desc.extra_bits = extra_lbits;
|
||||
G2.l_desc.extra_base = LITERALS + 1;
|
||||
G2.l_desc.elems = L_CODES;
|
||||
G2.l_desc.max_length = MAX_BITS;
|
||||
//G2.l_desc.max_code = 0;
|
||||
G2.d_desc.dyn_tree = G2.dyn_dtree;
|
||||
G2.d_desc.static_tree = G2.static_dtree;
|
||||
G2.d_desc.extra_bits = extra_dbits;
|
||||
//G2.d_desc.extra_base = 0;
|
||||
G2.d_desc.elems = D_CODES;
|
||||
G2.d_desc.max_length = MAX_BITS;
|
||||
//G2.d_desc.max_code = 0;
|
||||
G2.bl_desc.dyn_tree = G2.bl_tree;
|
||||
//G2.bl_desc.static_tree = NULL;
|
||||
G2.bl_desc.extra_bits = extra_blbits,
|
||||
//G2.bl_desc.extra_base = 0;
|
||||
G2.bl_desc.elems = BL_CODES;
|
||||
G2.bl_desc.max_length = MAX_BL_BITS;
|
||||
//G2.bl_desc.max_code = 0;
|
||||
|
||||
clear_bufs();
|
||||
s.st_ctime = 0;
|
||||
fstat(STDIN_FILENO, &s);
|
||||
zip(s.st_ctime);
|
||||
@@ -2081,6 +2063,29 @@ int gzip_main(int argc UNUSED_PARAM, char **argv)
|
||||
SET_PTR_TO_GLOBALS(xzalloc(sizeof(struct globals) + sizeof(struct globals2))
|
||||
+ sizeof(struct globals));
|
||||
barrier();
|
||||
G2.l_desc.dyn_tree = G2.dyn_ltree;
|
||||
G2.l_desc.static_tree = G2.static_ltree;
|
||||
G2.l_desc.extra_bits = extra_lbits;
|
||||
G2.l_desc.extra_base = LITERALS + 1;
|
||||
G2.l_desc.elems = L_CODES;
|
||||
G2.l_desc.max_length = MAX_BITS;
|
||||
//G2.l_desc.max_code = 0;
|
||||
|
||||
G2.d_desc.dyn_tree = G2.dyn_dtree;
|
||||
G2.d_desc.static_tree = G2.static_dtree;
|
||||
G2.d_desc.extra_bits = extra_dbits;
|
||||
//G2.d_desc.extra_base = 0;
|
||||
G2.d_desc.elems = D_CODES;
|
||||
G2.d_desc.max_length = MAX_BITS;
|
||||
//G2.d_desc.max_code = 0;
|
||||
|
||||
G2.bl_desc.dyn_tree = G2.bl_tree;
|
||||
//G2.bl_desc.static_tree = NULL;
|
||||
G2.bl_desc.extra_bits = extra_blbits,
|
||||
//G2.bl_desc.extra_base = 0;
|
||||
G2.bl_desc.elems = BL_CODES;
|
||||
G2.bl_desc.max_length = MAX_BL_BITS;
|
||||
//G2.bl_desc.max_code = 0;
|
||||
|
||||
/* Allocate all global buffers (for DYN_ALLOC option) */
|
||||
ALLOC(uch, G1.l_buf, INBUFSIZ);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1083,7 +1083,8 @@ static uint16_t buffer_read_le_u16(STATE_PARAM_ONLY)
|
||||
{
|
||||
uint16_t res;
|
||||
#if BB_LITTLE_ENDIAN
|
||||
move_from_unaligned16(res, &bytebuffer[bytebuffer_offset]);
|
||||
/* gcc 4.2.1 is very clever */
|
||||
memcpy(&res, &bytebuffer[bytebuffer_offset], 2);
|
||||
#else
|
||||
res = bytebuffer[bytebuffer_offset];
|
||||
res |= bytebuffer[bytebuffer_offset + 1] << 8;
|
||||
@@ -1096,7 +1097,7 @@ static uint32_t buffer_read_le_u32(STATE_PARAM_ONLY)
|
||||
{
|
||||
uint32_t res;
|
||||
#if BB_LITTLE_ENDIAN
|
||||
move_from_unaligned32(res, &bytebuffer[bytebuffer_offset]);
|
||||
memcpy(&res, &bytebuffer[bytebuffer_offset], 4);
|
||||
#else
|
||||
res = bytebuffer[bytebuffer_offset];
|
||||
res |= bytebuffer[bytebuffer_offset + 1] << 8;
|
||||
@@ -1107,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
|
||||
@@ -1169,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))
|
||||
@@ -1182,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;
|
||||
@@ -1197,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;
|
||||
@@ -1244,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);
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,74 +14,6 @@
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
/*
|
||||
* GNU tar uses "base-256 encoding" for very large numbers (>8 billion).
|
||||
* Encoding is binary, with highest bit always set as a marker
|
||||
* and sign in next-highest bit:
|
||||
* 80 00 .. 00 - zero
|
||||
* bf ff .. ff - largest positive number
|
||||
* ff ff .. ff - minus 1
|
||||
* c0 00 .. 00 - smallest negative number
|
||||
*
|
||||
* We expect it only in size field, where negative numbers don't make sense.
|
||||
*/
|
||||
static off_t getBase256_len12(const char *str)
|
||||
{
|
||||
off_t value;
|
||||
int len;
|
||||
|
||||
/* if (*str & 0x40) error; - caller prevents this */
|
||||
|
||||
if (sizeof(off_t) >= 12) {
|
||||
/* Probably 128-bit (16 byte) off_t. Can be optimized. */
|
||||
len = 12;
|
||||
value = *str++ & 0x3f;
|
||||
while (--len)
|
||||
value = (value << 8) + (unsigned char) *str++;
|
||||
return value;
|
||||
}
|
||||
|
||||
#ifdef CHECK_FOR_OVERFLOW
|
||||
/* Can be optimized to eat 32-bit chunks */
|
||||
char c = *str++ & 0x3f;
|
||||
len = 12;
|
||||
while (1) {
|
||||
if (c)
|
||||
bb_error_msg_and_die("overflow in base-256 encoded file size");
|
||||
if (--len == sizeof(off_t))
|
||||
break;
|
||||
c = *str++;
|
||||
}
|
||||
#else
|
||||
str += (12 - sizeof(off_t));
|
||||
#endif
|
||||
|
||||
/* Now str points to sizeof(off_t) least significant bytes.
|
||||
*
|
||||
* Example of tar file with 8914993153 (0x213600001) byte file.
|
||||
* Field starts at offset 7c:
|
||||
* 00070 30 30 30 00 30 30 30 30 30 30 30 00 80 00 00 00 |000.0000000.....|
|
||||
* 00080 00 00 00 02 13 60 00 01 31 31 31 32 30 33 33 36 |.....`..11120336|
|
||||
*
|
||||
* str is at offset 80 or 84 now (64-bit or 32-bit off_t).
|
||||
* We (ab)use the fact that value happens to be aligned,
|
||||
* and fetch it in one go:
|
||||
*/
|
||||
if (sizeof(off_t) == 8) {
|
||||
value = *(off_t*)str;
|
||||
value = SWAP_BE64(value);
|
||||
} else if (sizeof(off_t) == 4) {
|
||||
value = *(off_t*)str;
|
||||
value = SWAP_BE32(value);
|
||||
} else {
|
||||
value = 0;
|
||||
len = sizeof(off_t);
|
||||
while (--len)
|
||||
value = (value << 8) + (unsigned char) *str++;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/* NB: _DESTROYS_ str[len] character! */
|
||||
static unsigned long long getOctal(char *str, int len)
|
||||
{
|
||||
@@ -159,7 +91,7 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
|
||||
|
||||
again_after_align:
|
||||
|
||||
#if ENABLE_DESKTOP || ENABLE_FEATURE_TAR_AUTODETECT
|
||||
#if ENABLE_DESKTOP
|
||||
/* to prevent misdetection of bz2 sig */
|
||||
*(uint32_t*)(&tar) = 0;
|
||||
i = full_read(archive_handle->src_fd, &tar, 512);
|
||||
@@ -210,7 +142,7 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
|
||||
#if ENABLE_FEATURE_TAR_AUTODETECT
|
||||
char FAST_FUNC (*get_header_ptr)(archive_handle_t *);
|
||||
|
||||
autodetect:
|
||||
USE_DESKTOP(autodetect:)
|
||||
/* tar gz/bz autodetect: check for gz/bz2 magic.
|
||||
* If we see the magic, and it is the very first block,
|
||||
* we can switch to get_header_tar_gz/bz2/lzma().
|
||||
@@ -302,10 +234,7 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
|
||||
file_header->gname = tar.gname[0] ? xstrndup(tar.gname, sizeof(tar.gname)) : NULL;
|
||||
#endif
|
||||
file_header->mtime = GET_OCTAL(tar.mtime);
|
||||
/* Size field: handle GNU tar's "base256 encoding" */
|
||||
file_header->size = (*tar.size & 0xc0) == 0x80 /* positive base256? */
|
||||
? getBase256_len12(tar.size)
|
||||
: GET_OCTAL(tar.size);
|
||||
file_header->size = GET_OCTAL(tar.size);
|
||||
file_header->gid = GET_OCTAL(tar.gid);
|
||||
file_header->uid = GET_OCTAL(tar.uid);
|
||||
/* Set bits 0-11 of the files mode */
|
||||
|
||||
@@ -24,11 +24,11 @@ void FAST_FUNC header_verbose_list(const file_header_t *file_header)
|
||||
snprintf(gid, sizeof(gid), "%u", (unsigned)file_header->gid);
|
||||
group = gid;
|
||||
}
|
||||
printf("%s %s/%s %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s",
|
||||
printf("%s %s/%s %9u %4u-%02u-%02u %02u:%02u:%02u %s",
|
||||
bb_mode_string(file_header->mode),
|
||||
user,
|
||||
group,
|
||||
file_header->size,
|
||||
(unsigned int) file_header->size,
|
||||
1900 + mtime->tm_year,
|
||||
1 + mtime->tm_mon,
|
||||
mtime->tm_mday,
|
||||
|
||||
+10
-20
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+3
-6
@@ -357,8 +357,7 @@ static int writeTarHeader(struct TarBallInfo *tbInfo,
|
||||
if (tbInfo->verboseFlag) {
|
||||
FILE *vbFd = stdout;
|
||||
|
||||
/* If archive goes to stdout, verbose goes to stderr */
|
||||
if (tbInfo->tarFd == STDOUT_FILENO)
|
||||
if (tbInfo->tarFd == STDOUT_FILENO) /* If the archive goes to stdout, verbose to stderr */
|
||||
vbFd = stderr;
|
||||
/* GNU "tar cvvf" prints "extended" listing a-la "ls -l" */
|
||||
/* We don't have such excesses here: for us "v" == "vv" */
|
||||
@@ -592,6 +591,8 @@ static NOINLINE int writeTarFile(int tar_fd, int verboseFlag,
|
||||
struct TarBallInfo tbInfo;
|
||||
|
||||
tbInfo.hlInfoHead = NULL;
|
||||
|
||||
fchmod(tar_fd, 0644);
|
||||
tbInfo.tarFd = tar_fd;
|
||||
tbInfo.verboseFlag = verboseFlag;
|
||||
|
||||
@@ -817,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
@@ -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_LE32((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.
@@ -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
@@ -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
-186
@@ -6,34 +6,10 @@
|
||||
*
|
||||
* Loads the console font, and possibly the corresponding screen map(s).
|
||||
* (Adapted for busybox by Matej Vela.)
|
||||
*
|
||||
* Licensed under GPLv2, see file LICENSE in this tarball for details.
|
||||
*/
|
||||
#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,
|
||||
@@ -41,7 +17,7 @@ enum {
|
||||
PSF_MODE512 = 0x01,
|
||||
PSF_MODEHASTAB = 0x02,
|
||||
PSF_MAXMODE = 0x03,
|
||||
PSF_SEPARATOR = 0xffff
|
||||
PSF_SEPARATOR = 0xFFFF
|
||||
};
|
||||
|
||||
struct psf_header {
|
||||
@@ -64,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;
|
||||
@@ -95,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);
|
||||
}
|
||||
|
||||
@@ -202,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");
|
||||
@@ -213,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;
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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"
|
||||
);
|
||||
|
||||
+6
-18
@@ -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 || HUSH
|
||||
depends on ECHO
|
||||
help
|
||||
This adds options (-n and -e) to echo.
|
||||
|
||||
@@ -509,18 +509,6 @@ config SHA1SUM
|
||||
help
|
||||
Compute and check SHA1 message digest
|
||||
|
||||
config SHA256SUM
|
||||
bool "sha256sum"
|
||||
default n
|
||||
help
|
||||
Compute and check SHA256 message digest
|
||||
|
||||
config SHA512SUM
|
||||
bool "sha512sum"
|
||||
default n
|
||||
help
|
||||
Compute and check SHA512 message digest
|
||||
|
||||
config SLEEP
|
||||
bool "sleep"
|
||||
default n
|
||||
@@ -661,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.
|
||||
|
||||
@@ -766,7 +754,7 @@ config FEATURE_WC_LARGE
|
||||
default n
|
||||
depends on WC
|
||||
help
|
||||
Use "unsigned long long" in wc for counter variables.
|
||||
Use "unsigned long long" in wc for count variables.
|
||||
|
||||
config WHO
|
||||
bool "who"
|
||||
|
||||
@@ -44,7 +44,6 @@ lib-$(CONFIG_LENGTH) += length.o
|
||||
lib-$(CONFIG_LN) += ln.o
|
||||
lib-$(CONFIG_LOGNAME) += logname.o
|
||||
lib-$(CONFIG_LS) += ls.o
|
||||
lib-$(CONFIG_FTPD) += ls.o
|
||||
lib-$(CONFIG_MD5SUM) += md5_sha1_sum.o
|
||||
lib-$(CONFIG_MKDIR) += mkdir.o
|
||||
lib-$(CONFIG_MKFIFO) += mkfifo.o
|
||||
@@ -63,8 +62,6 @@ lib-$(CONFIG_RM) += rm.o
|
||||
lib-$(CONFIG_RMDIR) += rmdir.o
|
||||
lib-$(CONFIG_SEQ) += seq.o
|
||||
lib-$(CONFIG_SHA1SUM) += md5_sha1_sum.o
|
||||
lib-$(CONFIG_SHA256SUM) += md5_sha1_sum.o
|
||||
lib-$(CONFIG_SHA512SUM) += md5_sha1_sum.o
|
||||
lib-$(CONFIG_SLEEP) += sleep.o
|
||||
lib-$(CONFIG_SPLIT) += split.o
|
||||
lib-$(CONFIG_SORT) += sort.o
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
+7
-18
@@ -13,9 +13,8 @@ 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;
|
||||
int exit_code = EXIT_SUCCESS;
|
||||
uint8_t *cp;
|
||||
|
||||
#if ENABLE_DESKTOP
|
||||
@@ -28,10 +27,8 @@ int cksum_main(int argc UNUSED_PARAM, char **argv)
|
||||
do {
|
||||
int fd = open_or_warn_stdin(*argv ? *argv : bb_msg_standard_input);
|
||||
|
||||
if (fd < 0) {
|
||||
exit_code = EXIT_FAILURE;
|
||||
if (fd < 0)
|
||||
continue;
|
||||
}
|
||||
crc = 0;
|
||||
length = 0;
|
||||
|
||||
@@ -47,21 +44,13 @@ 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);
|
||||
|
||||
fflush_stdout_and_exit(exit_code);
|
||||
fflush_stdout_and_exit(EXIT_SUCCESS);
|
||||
}
|
||||
+1
-49
@@ -46,55 +46,7 @@ int cp_main(int argc, char **argv)
|
||||
// -R (and therefore -r) turns on -d (coreutils does this)
|
||||
// -a = -pdR
|
||||
opt_complementary = "-2:l--s:s--l:Pd:rRd:Rd:apdR:HL";
|
||||
// -v (--verbose) is ignored
|
||||
flags = getopt32(argv, FILEUTILS_CP_OPTSTR "arPHv");
|
||||
/* Options of cp from GNU coreutils 6.10:
|
||||
* -a, --archive
|
||||
* -f, --force
|
||||
* -i, --interactive
|
||||
* -l, --link
|
||||
* -L, --dereference
|
||||
* -P, --no-dereference
|
||||
* -R, -r, --recursive
|
||||
* -s, --symbolic-link
|
||||
* -v, --verbose
|
||||
* -H follow command-line symbolic links in SOURCE
|
||||
* -d same as --no-dereference --preserve=links
|
||||
* -p same as --preserve=mode,ownership,timestamps
|
||||
* -c same as --preserve=context
|
||||
* NOT SUPPORTED IN BBOX:
|
||||
* long options are not supported (even those above).
|
||||
* --backup[=CONTROL]
|
||||
* make a backup of each existing destination file
|
||||
* -b like --backup but does not accept an argument
|
||||
* --copy-contents
|
||||
* copy contents of special files when recursive
|
||||
* --preserve[=ATTR_LIST]
|
||||
* preserve attributes (default: mode,ownership,timestamps),
|
||||
* if possible additional attributes: security context,links,all
|
||||
* --no-preserve=ATTR_LIST
|
||||
* --parents
|
||||
* use full source file name under DIRECTORY
|
||||
* --remove-destination
|
||||
* remove each existing destination file before attempting to open
|
||||
* --sparse=WHEN
|
||||
* control creation of sparse files
|
||||
* --strip-trailing-slashes
|
||||
* remove any trailing slashes from each SOURCE argument
|
||||
* -S, --suffix=SUFFIX
|
||||
* override the usual backup suffix
|
||||
* -t, --target-directory=DIRECTORY
|
||||
* copy all SOURCE arguments into DIRECTORY
|
||||
* -T, --no-target-directory
|
||||
* treat DEST as a normal file
|
||||
* -u, --update
|
||||
* copy only when the SOURCE file is newer than the destination
|
||||
* file or when the destination file is missing
|
||||
* -x, --one-file-system
|
||||
* stay on this file system
|
||||
* -Z, --context=CONTEXT
|
||||
* (SELinux) set SELinux security context of copy to CONTEXT
|
||||
*/
|
||||
flags = getopt32(argv, FILEUTILS_CP_OPTSTR "arPH");
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
flags ^= FILEUTILS_DEREFERENCE; /* the sense of this flag was reversed */
|
||||
|
||||
+1
-1
@@ -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
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
||||
*/
|
||||
|
||||
#include <signal.h> /* For FEATURE_DD_SIGNAL_HANDLING */
|
||||
#include "libbb.h"
|
||||
|
||||
/* This is a NOEXEC applet. Be very careful! */
|
||||
|
||||
+40
-62
@@ -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,72 +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 << (2 + 3*ENABLE_FEATURE_DF_FANCY)) * ENABLE_FEATURE_HUMAN_READABLE,
|
||||
OPT_MEGA = (1 << (3 + 3*ENABLE_FEATURE_DF_FANCY)) * 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) {
|
||||
@@ -118,12 +93,13 @@ 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);
|
||||
set_error:
|
||||
SET_ERROR:
|
||||
status = EXIT_FAILURE;
|
||||
continue;
|
||||
}
|
||||
@@ -134,7 +110,7 @@ int df_main(int argc, char **argv)
|
||||
|
||||
if (statfs(mount_point, &s) != 0) {
|
||||
bb_simple_perror_msg(mount_point);
|
||||
goto set_error;
|
||||
goto SET_ERROR;
|
||||
}
|
||||
|
||||
if ((s.f_blocks > 0) || !mount_table || (opt & OPT_ALL)) {
|
||||
@@ -142,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;
|
||||
@@ -154,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) {
|
||||
@@ -165,7 +143,7 @@ int df_main(int argc, char **argv)
|
||||
* or leaves device alone if it can't find it */
|
||||
device = find_block_device("/");
|
||||
if (!device) {
|
||||
goto set_error;
|
||||
goto SET_ERROR;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -186,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);
|
||||
}
|
||||
+47
-35
@@ -25,28 +25,19 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
enum {
|
||||
OPT_a_files_too = (1 << 0),
|
||||
OPT_H_follow_links = (1 << 1),
|
||||
OPT_k_kbytes = (1 << 2),
|
||||
OPT_L_follow_links = (1 << 3),
|
||||
OPT_s_total_norecurse = (1 << 4),
|
||||
OPT_x_one_FS = (1 << 5),
|
||||
OPT_d_maxdepth = (1 << 6),
|
||||
OPT_l_hardlinks = (1 << 7),
|
||||
OPT_c_total = (1 << 8),
|
||||
OPT_h_for_humans = (1 << 9),
|
||||
OPT_m_mbytes = (1 << 10),
|
||||
};
|
||||
|
||||
struct globals {
|
||||
#if ENABLE_FEATURE_HUMAN_READABLE
|
||||
unsigned long disp_hr;
|
||||
#else
|
||||
unsigned disp_k;
|
||||
#endif
|
||||
|
||||
int max_print_depth;
|
||||
nlink_t count_hardlinks;
|
||||
|
||||
bool status;
|
||||
bool one_file_system;
|
||||
int print_files;
|
||||
int slink_depth;
|
||||
int du_depth;
|
||||
dev_t dir_dev;
|
||||
@@ -81,7 +72,7 @@ static unsigned long du(const char *filename)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (option_mask32 & OPT_x_one_FS) {
|
||||
if (G.one_file_system) {
|
||||
if (G.du_depth == 0) {
|
||||
G.dir_dev = statbuf.st_dev;
|
||||
} else if (G.dir_dev != statbuf.st_dev) {
|
||||
@@ -92,7 +83,7 @@ static unsigned long du(const char *filename)
|
||||
sum = statbuf.st_blocks;
|
||||
|
||||
if (S_ISLNK(statbuf.st_mode)) {
|
||||
if (G.slink_depth > G.du_depth) { /* -H or -L */
|
||||
if (G.slink_depth > G.du_depth) { /* -H or -L */
|
||||
if (stat(filename, &statbuf) != 0) {
|
||||
bb_simple_perror_msg(filename);
|
||||
G.status = EXIT_FAILURE;
|
||||
@@ -100,15 +91,12 @@ static unsigned long du(const char *filename)
|
||||
}
|
||||
sum = statbuf.st_blocks;
|
||||
if (G.slink_depth == 1) {
|
||||
/* Convert -H to -L */
|
||||
G.slink_depth = INT_MAX;
|
||||
G.slink_depth = INT_MAX; /* Convert -H to -L. */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!(option_mask32 & OPT_l_hardlinks)
|
||||
&& statbuf.st_nlink > 1
|
||||
) {
|
||||
if (statbuf.st_nlink > G.count_hardlinks) {
|
||||
/* Add files/directories with links only once */
|
||||
if (is_in_ino_dev_hashtable(&statbuf)) {
|
||||
return 0;
|
||||
@@ -127,8 +115,14 @@ static unsigned long du(const char *filename)
|
||||
return sum;
|
||||
}
|
||||
|
||||
newfile = last_char_is(filename, '/');
|
||||
if (newfile)
|
||||
*newfile = '\0';
|
||||
|
||||
while ((entry = readdir(dir))) {
|
||||
newfile = concat_subpath_file(filename, entry->d_name);
|
||||
char *name = entry->d_name;
|
||||
|
||||
newfile = concat_subpath_file(filename, name);
|
||||
if (newfile == NULL)
|
||||
continue;
|
||||
++G.du_depth;
|
||||
@@ -137,9 +131,8 @@ static unsigned long du(const char *filename)
|
||||
free(newfile);
|
||||
}
|
||||
closedir(dir);
|
||||
} else {
|
||||
if (!(option_mask32 & OPT_a_files_too) && G.du_depth != 0)
|
||||
return sum;
|
||||
} else if (G.du_depth > G.print_files) {
|
||||
return sum;
|
||||
}
|
||||
if (G.du_depth <= G.max_print_depth) {
|
||||
print(sum, filename);
|
||||
@@ -152,6 +145,7 @@ int du_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
unsigned long total;
|
||||
int slink_depth_save;
|
||||
bool print_final_total;
|
||||
unsigned opt;
|
||||
|
||||
#if ENABLE_FEATURE_HUMAN_READABLE
|
||||
@@ -164,6 +158,7 @@ int du_main(int argc UNUSED_PARAM, char **argv)
|
||||
/* SKIP_FEATURE_DU_DEFAULT_BLOCKSIZE_1K(G.disp_k = 0;) - G is pre-zeroed */
|
||||
#endif
|
||||
G.max_print_depth = INT_MAX;
|
||||
G.count_hardlinks = 1;
|
||||
|
||||
/* Note: SUSv3 specifies that -a and -s options cannot be used together
|
||||
* in strictly conforming applications. However, it also says that some
|
||||
@@ -175,13 +170,16 @@ int du_main(int argc UNUSED_PARAM, char **argv)
|
||||
opt_complementary = "h-km:k-hm:m-hk:H-L:L-H:s-d:d-s:d+";
|
||||
opt = getopt32(argv, "aHkLsx" "d:" "lc" "hm", &G.max_print_depth);
|
||||
argv += optind;
|
||||
if (opt & OPT_h_for_humans) {
|
||||
if (opt & (1 << 9)) {
|
||||
/* -h opt */
|
||||
G.disp_hr = 0;
|
||||
}
|
||||
if (opt & OPT_m_mbytes) {
|
||||
if (opt & (1 << 10)) {
|
||||
/* -m opt */
|
||||
G.disp_hr = 1024*1024;
|
||||
}
|
||||
if (opt & OPT_k_kbytes) {
|
||||
if (opt & (1 << 2)) {
|
||||
/* -k opt */
|
||||
G.disp_hr = 1024;
|
||||
}
|
||||
#else
|
||||
@@ -189,20 +187,34 @@ int du_main(int argc UNUSED_PARAM, char **argv)
|
||||
opt = getopt32(argv, "aHkLsx" "d:" "lc", &G.max_print_depth);
|
||||
argv += optind;
|
||||
#if !ENABLE_FEATURE_DU_DEFAULT_BLOCKSIZE_1K
|
||||
if (opt & OPT_k_kbytes) {
|
||||
if (opt & (1 << 2)) {
|
||||
/* -k opt */
|
||||
G.disp_k = 1;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
if (opt & OPT_H_follow_links) {
|
||||
if (opt & (1 << 0)) {
|
||||
/* -a opt */
|
||||
G.print_files = INT_MAX;
|
||||
}
|
||||
if (opt & (1 << 1)) {
|
||||
/* -H opt */
|
||||
G.slink_depth = 1;
|
||||
}
|
||||
if (opt & OPT_L_follow_links) {
|
||||
if (opt & (1 << 3)) {
|
||||
/* -L opt */
|
||||
G.slink_depth = INT_MAX;
|
||||
}
|
||||
if (opt & OPT_s_total_norecurse) {
|
||||
if (opt & (1 << 4)) {
|
||||
/* -s opt */
|
||||
G.max_print_depth = 0;
|
||||
}
|
||||
G.one_file_system = opt & (1 << 5); /* -x opt */
|
||||
if (opt & (1 << 7)) {
|
||||
/* -l opt */
|
||||
G.count_hardlinks = MAXINT(nlink_t);
|
||||
}
|
||||
print_final_total = opt & (1 << 8); /* -c opt */
|
||||
|
||||
/* go through remaining args (if any) */
|
||||
if (!*argv) {
|
||||
@@ -216,12 +228,12 @@ int du_main(int argc UNUSED_PARAM, char **argv)
|
||||
total = 0;
|
||||
do {
|
||||
total += du(*argv);
|
||||
/* otherwise du /dir /dir won't show /dir twice: */
|
||||
reset_ino_dev_hashtable();
|
||||
G.slink_depth = slink_depth_save;
|
||||
} while (*++argv);
|
||||
|
||||
if (opt & OPT_c_total)
|
||||
if (ENABLE_FEATURE_CLEAN_UP)
|
||||
reset_ino_dev_hashtable();
|
||||
if (print_final_total)
|
||||
print(total, "total");
|
||||
|
||||
fflush_stdout_and_exit(G.status);
|
||||
|
||||
+8
-10
@@ -43,6 +43,8 @@ static const char env_longopts[] ALIGN1 =
|
||||
int env_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int env_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
/* cleanenv was static - why? */
|
||||
char *cleanenv[1];
|
||||
char **ep;
|
||||
unsigned opt;
|
||||
llist_t *unset_env = NULL;
|
||||
@@ -58,16 +60,12 @@ int env_main(int argc UNUSED_PARAM, char **argv)
|
||||
++argv;
|
||||
}
|
||||
if (opt & 1) {
|
||||
clearenv();
|
||||
}
|
||||
while (unset_env) {
|
||||
char *var = llist_pop(&unset_env);
|
||||
/* This does not handle -uVAR=VAL
|
||||
* (coreutils _sets_ the variable in that case): */
|
||||
/*unsetenv(var);*/
|
||||
/* This does, but uses somewhan undocumented feature that
|
||||
* putenv("name_without_equal_sign") unsets the variable: */
|
||||
putenv(var);
|
||||
cleanenv[0] = NULL;
|
||||
environ = cleanenv;
|
||||
} else {
|
||||
while (unset_env) {
|
||||
unsetenv(llist_pop(&unset_env));
|
||||
}
|
||||
}
|
||||
|
||||
while (*argv && (strchr(*argv, '=') != NULL)) {
|
||||
|
||||
+70
-50
@@ -29,78 +29,98 @@ enum {
|
||||
OPT_ALL = 1 << 2,
|
||||
};
|
||||
|
||||
static void xputchar(char c)
|
||||
{
|
||||
if (putchar(c) < 0)
|
||||
bb_error_msg_and_die(bb_msg_write_error);
|
||||
}
|
||||
|
||||
#if ENABLE_EXPAND
|
||||
static void expand(FILE *file, int tab_size, unsigned opt)
|
||||
static void expand(FILE *file, unsigned tab_size, unsigned opt)
|
||||
{
|
||||
char *line;
|
||||
char *ptr;
|
||||
int convert;
|
||||
unsigned pos;
|
||||
|
||||
tab_size = -tab_size;
|
||||
/* Increment tab_size by 1 locally.*/
|
||||
tab_size++;
|
||||
|
||||
while ((line = xmalloc_fgets(file)) != NULL) {
|
||||
int pos;
|
||||
unsigned char c;
|
||||
char *ptr = line;
|
||||
|
||||
goto start;
|
||||
while ((c = *ptr) != '\0') {
|
||||
if ((opt & OPT_INITIAL) && !isblank(c)) {
|
||||
fputs(ptr, stdout);
|
||||
break;
|
||||
convert = 1;
|
||||
pos = 0;
|
||||
ptr = line;
|
||||
while (*line) {
|
||||
pos++;
|
||||
if (*line == '\t' && convert) {
|
||||
for (; pos < tab_size; pos++) {
|
||||
xputchar(' ');
|
||||
}
|
||||
} else {
|
||||
if ((opt & OPT_INITIAL) && !isblank(*line)) {
|
||||
convert = 0;
|
||||
}
|
||||
xputchar(*line);
|
||||
}
|
||||
ptr++;
|
||||
if (c == '\t') {
|
||||
c = ' ';
|
||||
while (++pos < 0)
|
||||
bb_putchar(c);
|
||||
}
|
||||
bb_putchar(c);
|
||||
if (++pos >= 0) {
|
||||
start:
|
||||
pos = tab_size;
|
||||
if (pos == tab_size) {
|
||||
pos = 0;
|
||||
}
|
||||
line++;
|
||||
}
|
||||
free(line);
|
||||
free(ptr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLE_UNEXPAND
|
||||
static void unexpand(FILE *file, unsigned tab_size, unsigned opt)
|
||||
static void unexpand(FILE *file, unsigned int tab_size, unsigned opt)
|
||||
{
|
||||
char *line;
|
||||
char *ptr;
|
||||
int convert;
|
||||
int pos;
|
||||
int i = 0;
|
||||
unsigned column = 0;
|
||||
|
||||
while ((line = xmalloc_fgets(file)) != NULL) {
|
||||
char *ptr = line;
|
||||
unsigned column = 0;
|
||||
|
||||
while (*ptr) {
|
||||
unsigned n;
|
||||
|
||||
while (*ptr == ' ') {
|
||||
convert = 1;
|
||||
pos = 0;
|
||||
ptr = line;
|
||||
while (*line) {
|
||||
while ((*line == ' ' || *line == '\t') && convert) {
|
||||
pos += (*line == ' ') ? 1 : tab_size;
|
||||
line++;
|
||||
column++;
|
||||
ptr++;
|
||||
if ((opt & OPT_ALL) && column == tab_size) {
|
||||
column = 0;
|
||||
goto put_tab;
|
||||
}
|
||||
}
|
||||
if (*ptr == '\t') {
|
||||
column += tab_size - (column % tab_size);
|
||||
ptr++;
|
||||
continue;
|
||||
if (pos) {
|
||||
i = pos / tab_size;
|
||||
if (i) {
|
||||
for (; i > 0; i--) {
|
||||
put_tab:
|
||||
xputchar('\t');
|
||||
}
|
||||
} else {
|
||||
for (i = pos % tab_size; i > 0; i--) {
|
||||
xputchar(' ');
|
||||
}
|
||||
}
|
||||
pos = 0;
|
||||
} else {
|
||||
if (opt & OPT_INITIAL) {
|
||||
convert = 0;
|
||||
}
|
||||
if (opt & OPT_ALL) {
|
||||
column++;
|
||||
}
|
||||
xputchar(*line);
|
||||
line++;
|
||||
}
|
||||
|
||||
n = column / tab_size;
|
||||
column = column % tab_size;
|
||||
while (n--)
|
||||
putchar('\t');
|
||||
|
||||
if ((opt & OPT_INITIAL) && ptr != line) {
|
||||
printf("%*s%s", column, "", ptr);
|
||||
break;
|
||||
}
|
||||
n = strcspn(ptr, "\t ");
|
||||
printf("%*s%.*s", column, "", n, ptr);
|
||||
ptr += n;
|
||||
column = (column + n) % tab_size;
|
||||
}
|
||||
free(line);
|
||||
free(ptr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
+13
-10
@@ -223,13 +223,13 @@ static VALUE *docolon(VALUE *sv, VALUE *pv)
|
||||
tostring(pv);
|
||||
|
||||
if (pv->u.s[0] == '^') {
|
||||
bb_error_msg(
|
||||
"warning: '%s': using '^' as the first character\n"
|
||||
"of a basic regular expression is not portable; it is ignored", pv->u.s);
|
||||
bb_error_msg("\
|
||||
warning: unportable BRE: `%s': using `^' as the first character\n\
|
||||
of a basic regular expression is not portable; it is being ignored", pv->u.s);
|
||||
}
|
||||
|
||||
memset(&re_buffer, 0, sizeof(re_buffer));
|
||||
memset(re_regs, 0, sizeof(re_regs));
|
||||
memset(re_regs, 0, sizeof(*re_regs));
|
||||
xregcomp(&re_buffer, pv->u.s, 0);
|
||||
|
||||
/* expr uses an anchored pattern match, so check that there was a
|
||||
@@ -238,7 +238,7 @@ static VALUE *docolon(VALUE *sv, VALUE *pv)
|
||||
&& re_regs[0].rm_so == 0
|
||||
) {
|
||||
/* Were \(...\) used? */
|
||||
if (re_buffer.re_nsub > 0 && re_regs[1].rm_so >= 0) {
|
||||
if (re_buffer.re_nsub > 0) {
|
||||
sv->u.s[re_regs[1].rm_eo] = '\0';
|
||||
v = str_value(sv->u.s + re_regs[1].rm_so);
|
||||
} else {
|
||||
@@ -251,7 +251,7 @@ static VALUE *docolon(VALUE *sv, VALUE *pv)
|
||||
else
|
||||
v = int_value(0);
|
||||
}
|
||||
regfree(&re_buffer);
|
||||
//FIXME: sounds like here is a bit missing: regfree(&re_buffer);
|
||||
return v;
|
||||
}
|
||||
|
||||
@@ -481,21 +481,24 @@ static VALUE *eval(void)
|
||||
}
|
||||
|
||||
int expr_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int expr_main(int argc UNUSED_PARAM, char **argv)
|
||||
int expr_main(int argc, char **argv)
|
||||
{
|
||||
VALUE *v;
|
||||
|
||||
xfunc_error_retval = 2; /* coreutils compat */
|
||||
G.args = argv + 1;
|
||||
if (*G.args == NULL) {
|
||||
if (argc == 1) {
|
||||
bb_error_msg_and_die("too few arguments");
|
||||
}
|
||||
|
||||
G.args = argv + 1;
|
||||
|
||||
v = eval();
|
||||
if (*G.args)
|
||||
bb_error_msg_and_die("syntax error");
|
||||
|
||||
if (v->type == INTEGER)
|
||||
printf("%" PF_REZ "d\n", PF_REZ_TYPE v->u.i);
|
||||
else
|
||||
puts(v->u.s);
|
||||
|
||||
fflush_stdout_and_exit(null(v));
|
||||
}
|
||||
+4
-4
@@ -40,6 +40,7 @@ int head_main(int argc, char **argv)
|
||||
int count_bytes = 0;
|
||||
int header_threshhold = 1;
|
||||
#endif
|
||||
|
||||
FILE *fp;
|
||||
const char *fmt;
|
||||
char *p;
|
||||
@@ -49,7 +50,7 @@ int head_main(int argc, char **argv)
|
||||
|
||||
#if ENABLE_INCLUDE_SUSv2 || ENABLE_FEATURE_FANCY_HEAD
|
||||
/* Allow legacy syntax of an initial numeric option without -n. */
|
||||
if (argv[1] && argv[1][0] == '-'
|
||||
if (argc > 1 && argv[1][0] == '-'
|
||||
&& isdigit(argv[1][1])
|
||||
) {
|
||||
--argc;
|
||||
@@ -78,6 +79,7 @@ int head_main(int argc, char **argv)
|
||||
#if ENABLE_INCLUDE_SUSv2 || ENABLE_FEATURE_FANCY_HEAD
|
||||
GET_COUNT:
|
||||
#endif
|
||||
|
||||
#if !ENABLE_FEATURE_FANCY_HEAD
|
||||
count = xatoul(p);
|
||||
#else
|
||||
@@ -126,12 +128,10 @@ int head_main(int argc, char **argv)
|
||||
putchar(c);
|
||||
}
|
||||
if (fclose_if_not_stdin(fp)) {
|
||||
bb_simple_perror_msg(*argv);
|
||||
bb_simple_perror_msg(*argv); /* Avoid multibyte problems. */
|
||||
retval = EXIT_FAILURE;
|
||||
}
|
||||
die_if_ferror_stdout();
|
||||
} else {
|
||||
retval = EXIT_FAILURE;
|
||||
}
|
||||
fmt = header_fmt_str;
|
||||
} while (*++argv);
|
||||
|
||||
+80
-168
@@ -3,212 +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, const char *name, const char *prefix)
|
||||
static int printf_full(unsigned int id, const char *arg, const char prefix)
|
||||
{
|
||||
if (prefix) {
|
||||
printf("%s", prefix);
|
||||
}
|
||||
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;
|
||||
}
|
||||
const char *fmt = "%cid=%u";
|
||||
int status = EXIT_FAILURE;
|
||||
|
||||
static int print_group(gid_t id, const char *prefix)
|
||||
{
|
||||
return print_common(id, gid2group(id), prefix);
|
||||
}
|
||||
|
||||
static int print_user(uid_t id, const char *prefix)
|
||||
{
|
||||
return print_common(id, uid2uname(id), 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 (arg) {
|
||||
fmt = "%cid=%u(%s)";
|
||||
status = EXIT_SUCCESS;
|
||||
}
|
||||
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 = xgetpwnam(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);
|
||||
}
|
||||
@@ -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
@@ -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,7 +1,4 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* Licensed under GPLv2, see file LICENSE in this tarball for details.
|
||||
*/
|
||||
|
||||
/* BB_AUDIT SUSv3 N/A -- Apparently a busybox (obsolete?) extension. */
|
||||
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
*/
|
||||
|
||||
#ifndef COREUTILS_H
|
||||
#define COREUTILS_H 1
|
||||
#define COREUTILS_H 1
|
||||
|
||||
PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
|
||||
#if __GNUC_PREREQ(4,1)
|
||||
# pragma GCC visibility push(hidden)
|
||||
#endif
|
||||
|
||||
typedef int (*stat_func)(const char *fn, struct stat *ps);
|
||||
|
||||
@@ -15,6 +17,8 @@ int cp_mv_stat(const char *fn, struct stat *fn_stat) FAST_FUNC;
|
||||
|
||||
mode_t getopt_mk_fifo_nod(char **argv) FAST_FUNC;
|
||||
|
||||
POP_SAVED_FUNCTION_VISIBILITY
|
||||
#if __GNUC_PREREQ(4,1)
|
||||
# pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+210
-284
@@ -6,7 +6,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
||||
*/
|
||||
|
||||
/* [date unknown. Perhaps before year 2000]
|
||||
/*
|
||||
* To achieve a small memory footprint, this version of 'ls' doesn't do any
|
||||
* file sorting, and only has the most essential command line switches
|
||||
* (i.e., the ones I couldn't live without :-) All features which involve
|
||||
@@ -18,7 +18,8 @@
|
||||
*
|
||||
* KNOWN BUGS:
|
||||
* 1. ls -l of a directory doesn't give "total <blocks>" header
|
||||
* 2. hidden files can make column width too large
|
||||
* 2. ls of a symlink to a directory doesn't list directory contents
|
||||
* 3. hidden files can make column width too large
|
||||
*
|
||||
* NON-OPTIMAL BEHAVIOUR:
|
||||
* 1. autowidth reads directories twice
|
||||
@@ -26,9 +27,6 @@
|
||||
* appended, there's no need to stat each one
|
||||
* PORTABILITY:
|
||||
* 1. requires lstat (BSD) - how do you do it without?
|
||||
*
|
||||
* [2009-03]
|
||||
* ls sorts listing now, and supports almost all options.
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
@@ -40,21 +38,6 @@
|
||||
/* This is a NOEXEC applet. Be very careful! */
|
||||
|
||||
|
||||
#if ENABLE_FTPD
|
||||
/* ftpd uses ls, and without timestamps Mozilla won't understand
|
||||
* ftpd's LIST output.
|
||||
*/
|
||||
# undef CONFIG_FEATURE_LS_TIMESTAMPS
|
||||
# undef ENABLE_FEATURE_LS_TIMESTAMPS
|
||||
# undef USE_FEATURE_LS_TIMESTAMPS
|
||||
# undef SKIP_FEATURE_LS_TIMESTAMPS
|
||||
# define CONFIG_FEATURE_LS_TIMESTAMPS 1
|
||||
# define ENABLE_FEATURE_LS_TIMESTAMPS 1
|
||||
# define USE_FEATURE_LS_TIMESTAMPS(...) __VA_ARGS__
|
||||
# define SKIP_FEATURE_LS_TIMESTAMPS(...)
|
||||
#endif
|
||||
|
||||
|
||||
enum {
|
||||
|
||||
TERMINAL_WIDTH = 80, /* use 79 if terminal has linefold bug */
|
||||
@@ -76,7 +59,7 @@ LIST_ID_NAME = 1 << 4,
|
||||
LIST_ID_NUMERIC = 1 << 5,
|
||||
LIST_CONTEXT = 1 << 6,
|
||||
LIST_SIZE = 1 << 7,
|
||||
//LIST_DEV = 1 << 8, - unused, synonym to LIST_SIZE
|
||||
LIST_DEV = 1 << 8,
|
||||
LIST_DATE_TIME = 1 << 9,
|
||||
LIST_FULLTIME = 1 << 10,
|
||||
LIST_FILENAME = 1 << 11,
|
||||
@@ -127,102 +110,13 @@ SPLIT_SUBDIR = 2,
|
||||
|
||||
};
|
||||
|
||||
/* "[-]Cadil1", POSIX mandated options, busybox always supports */
|
||||
/* "[-]gnsx", POSIX non-mandated options, busybox always supports */
|
||||
/* "[-]Q" GNU option? busybox always supports */
|
||||
/* "[-]Ak" GNU options, busybox always supports */
|
||||
/* "[-]FLRctur", POSIX mandated options, busybox optionally supports */
|
||||
/* "[-]p", POSIX non-mandated options, busybox optionally supports */
|
||||
/* "[-]SXvThw", GNU options, busybox optionally supports */
|
||||
/* "[-]K", SELinux mandated options, busybox optionally supports */
|
||||
/* "[-]e", I think we made this one up */
|
||||
static const char ls_options[] ALIGN1 =
|
||||
"Cadil1gnsxQAk" /* 13 opts, total 13 */
|
||||
USE_FEATURE_LS_TIMESTAMPS("cetu") /* 4, 17 */
|
||||
USE_FEATURE_LS_SORTFILES("SXrv") /* 4, 21 */
|
||||
USE_FEATURE_LS_FILETYPES("Fp") /* 2, 23 */
|
||||
USE_FEATURE_LS_FOLLOWLINKS("L") /* 1, 24 */
|
||||
USE_FEATURE_LS_RECURSIVE("R") /* 1, 25 */
|
||||
USE_FEATURE_HUMAN_READABLE("h") /* 1, 26 */
|
||||
USE_SELINUX("K") /* 1, 27 */
|
||||
USE_SELINUX("Z") /* 1, 28 */
|
||||
USE_FEATURE_AUTOWIDTH("T:w:") /* 2, 30 */
|
||||
;
|
||||
enum {
|
||||
//OPT_C = (1 << 0),
|
||||
//OPT_a = (1 << 1),
|
||||
//OPT_d = (1 << 2),
|
||||
//OPT_i = (1 << 3),
|
||||
//OPT_l = (1 << 4),
|
||||
//OPT_1 = (1 << 5),
|
||||
OPT_g = (1 << 6),
|
||||
//OPT_n = (1 << 7),
|
||||
//OPT_s = (1 << 8),
|
||||
//OPT_x = (1 << 9),
|
||||
OPT_Q = (1 << 10),
|
||||
//OPT_A = (1 << 11),
|
||||
//OPT_k = (1 << 12),
|
||||
};
|
||||
|
||||
enum {
|
||||
LIST_MASK_TRIGGER = 0,
|
||||
STYLE_MASK_TRIGGER = STYLE_MASK,
|
||||
DISP_MASK_TRIGGER = DISP_ROWS,
|
||||
SORT_MASK_TRIGGER = SORT_MASK,
|
||||
};
|
||||
|
||||
/* TODO: simple toggles may be stored as OPT_xxx bits instead */
|
||||
static const unsigned opt_flags[] = {
|
||||
LIST_SHORT | STYLE_COLUMNS, /* C */
|
||||
DISP_HIDDEN | DISP_DOT, /* a */
|
||||
DISP_NOLIST, /* d */
|
||||
LIST_INO, /* i */
|
||||
LIST_LONG | STYLE_LONG, /* l - remember LS_DISP_HR in mask! */
|
||||
LIST_SHORT | STYLE_SINGLE, /* 1 */
|
||||
0, /* g (don't show group) - handled via OPT_g */
|
||||
LIST_ID_NUMERIC, /* n */
|
||||
LIST_BLOCKS, /* s */
|
||||
DISP_ROWS, /* x */
|
||||
0, /* Q (quote filename) - handled via OPT_Q */
|
||||
DISP_HIDDEN, /* A */
|
||||
ENABLE_SELINUX * LIST_CONTEXT, /* k (ignored if !SELINUX) */
|
||||
#if ENABLE_FEATURE_LS_TIMESTAMPS
|
||||
TIME_CHANGE | (ENABLE_FEATURE_LS_SORTFILES * SORT_CTIME), /* c */
|
||||
LIST_FULLTIME, /* e */
|
||||
ENABLE_FEATURE_LS_SORTFILES * SORT_MTIME, /* t */
|
||||
TIME_ACCESS | (ENABLE_FEATURE_LS_SORTFILES * SORT_ATIME), /* u */
|
||||
#endif
|
||||
#if ENABLE_FEATURE_LS_SORTFILES
|
||||
SORT_SIZE, /* S */
|
||||
SORT_EXT, /* X */
|
||||
SORT_REVERSE, /* r */
|
||||
SORT_VERSION, /* v */
|
||||
#endif
|
||||
#if ENABLE_FEATURE_LS_FILETYPES
|
||||
LIST_FILETYPE | LIST_EXEC, /* F */
|
||||
LIST_FILETYPE, /* p */
|
||||
#endif
|
||||
#if ENABLE_FEATURE_LS_FOLLOWLINKS
|
||||
FOLLOW_LINKS, /* L */
|
||||
#endif
|
||||
#if ENABLE_FEATURE_LS_RECURSIVE
|
||||
DISP_RECURSIVE, /* R */
|
||||
#endif
|
||||
#if ENABLE_FEATURE_HUMAN_READABLE
|
||||
LS_DISP_HR, /* h */
|
||||
#endif
|
||||
#if ENABLE_SELINUX
|
||||
LIST_MODEBITS|LIST_NLINKS|LIST_CONTEXT|LIST_SIZE|LIST_DATE_TIME, /* K */
|
||||
#endif
|
||||
#if ENABLE_SELINUX
|
||||
LIST_MODEBITS|LIST_ID_NAME|LIST_CONTEXT, /* Z */
|
||||
#endif
|
||||
(1U<<31)
|
||||
/* options after Z are not processed through opt_flags:
|
||||
* T, w - ignored
|
||||
*/
|
||||
};
|
||||
|
||||
#define TYPEINDEX(mode) (((mode) >> 12) & 0x0f)
|
||||
#define TYPECHAR(mode) ("0pcCd?bB-?l?s???" [TYPEINDEX(mode)])
|
||||
#define APPCHAR(mode) ("\0|\0\0/\0\0\0\0\0@\0=\0\0\0" [TYPEINDEX(mode)])
|
||||
#define COLOR(mode) ("\000\043\043\043\042\000\043\043"\
|
||||
"\000\000\044\000\043\000\000\040" [TYPEINDEX(mode)])
|
||||
#define ATTR(mode) ("\00\00\01\00\01\00\01\00"\
|
||||
"\00\00\01\00\01\00\00\01" [TYPEINDEX(mode)])
|
||||
|
||||
/*
|
||||
* a directory entry and its stat info are stored here
|
||||
@@ -336,46 +230,18 @@ static struct dnode *my_stat(const char *fullname, const char *name, int force_f
|
||||
return cur;
|
||||
}
|
||||
|
||||
|
||||
/* FYI type values: 1:fifo 2:char 4:dir 6:blk 8:file 10:link 12:socket
|
||||
* (various wacky OSes: 13:Sun door 14:BSD whiteout 5:XENIX named file
|
||||
* 3/7:multiplexed char/block device)
|
||||
* and we use 0 for unknown and 15 for executables (see below) */
|
||||
#define TYPEINDEX(mode) (((mode) >> 12) & 0x0f)
|
||||
#define TYPECHAR(mode) ("0pcCd?bB-?l?s???" [TYPEINDEX(mode)])
|
||||
#define APPCHAR(mode) ("\0|\0\0/\0\0\0\0\0@\0=\0\0\0" [TYPEINDEX(mode)])
|
||||
/* 036 black foreground 050 black background
|
||||
037 red foreground 051 red background
|
||||
040 green foreground 052 green background
|
||||
041 brown foreground 053 brown background
|
||||
042 blue foreground 054 blue background
|
||||
043 magenta (purple) foreground 055 magenta background
|
||||
044 cyan (light blue) foreground 056 cyan background
|
||||
045 gray foreground 057 white background
|
||||
*/
|
||||
#define COLOR(mode) ( \
|
||||
/*un fi chr dir blk file link sock exe */ \
|
||||
"\037\043\043\045\042\045\043\043\000\045\044\045\043\045\045\040" \
|
||||
[TYPEINDEX(mode)])
|
||||
/* Select normal (0) [actually "reset all"] or bold (1)
|
||||
* (other attributes are 2:dim 4:underline 5:blink 7:reverse,
|
||||
* let's use 7 for "impossible" types, just for fun)
|
||||
* Note: coreutils 6.9 uses inverted red for setuid binaries.
|
||||
*/
|
||||
#define ATTR(mode) ( \
|
||||
/*un fi chr dir blk file link sock exe */ \
|
||||
"\01\00\01\07\01\07\01\07\00\07\01\07\01\07\07\01" \
|
||||
[TYPEINDEX(mode)])
|
||||
|
||||
#if ENABLE_FEATURE_LS_COLOR
|
||||
/* mode of zero is interpreted as "unknown" (stat failed) */
|
||||
static char fgcolor(mode_t mode)
|
||||
{
|
||||
/* Check wheter the file is existing (if so, color it red!) */
|
||||
if (errno == ENOENT)
|
||||
return '\037';
|
||||
if (S_ISREG(mode) && (mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
|
||||
return COLOR(0xF000); /* File is executable ... */
|
||||
return COLOR(mode);
|
||||
}
|
||||
static char bold(mode_t mode)
|
||||
|
||||
static char bgcolor(mode_t mode)
|
||||
{
|
||||
if (S_ISREG(mode) && (mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
|
||||
return ATTR(0xF000); /* File is executable ... */
|
||||
@@ -398,7 +264,6 @@ static char append_char(mode_t mode)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#define countdirs(A, B) count_dirs((A), (B), 1)
|
||||
#define countsubdirs(A, B) count_dirs((A), (B), 0)
|
||||
static int count_dirs(struct dnode **dn, int nfiles, int notsubdirs)
|
||||
@@ -708,41 +573,10 @@ static struct dnode **list_dir(const char *path)
|
||||
}
|
||||
|
||||
|
||||
static int print_name(const char *name)
|
||||
{
|
||||
if (option_mask32 & OPT_Q) {
|
||||
#if ENABLE_FEATURE_ASSUME_UNICODE
|
||||
int len = 2 + mbstrlen(name);
|
||||
#else
|
||||
int len = 2;
|
||||
#endif
|
||||
putchar('"');
|
||||
while (*name) {
|
||||
if (*name == '"') {
|
||||
putchar('\\');
|
||||
len++;
|
||||
}
|
||||
putchar(*name++);
|
||||
if (!ENABLE_FEATURE_ASSUME_UNICODE)
|
||||
len++;
|
||||
}
|
||||
putchar('"');
|
||||
return len;
|
||||
}
|
||||
/* No -Q: */
|
||||
#if ENABLE_FEATURE_ASSUME_UNICODE
|
||||
fputs(name, stdout);
|
||||
return mbstrlen(name);
|
||||
#else
|
||||
return printf("%s", name);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static int list_single(const struct dnode *dn)
|
||||
{
|
||||
int column = 0;
|
||||
char *lpath = lpath; /* for compiler */
|
||||
int i, column = 0;
|
||||
|
||||
#if ENABLE_FEATURE_LS_TIMESTAMPS
|
||||
char *filetime;
|
||||
time_t ttime, age;
|
||||
@@ -767,128 +601,219 @@ static int list_single(const struct dnode *dn)
|
||||
append = append_char(dn->dstat.st_mode);
|
||||
#endif
|
||||
|
||||
/* Do readlink early, so that if it fails, error message
|
||||
* does not appear *inside* of the "ls -l" line */
|
||||
if (all_fmt & LIST_SYMLINK)
|
||||
if (S_ISLNK(dn->dstat.st_mode))
|
||||
lpath = xmalloc_readlink_or_warn(dn->fullname);
|
||||
|
||||
if (all_fmt & LIST_INO)
|
||||
column += printf("%7lu ", (long) dn->dstat.st_ino);
|
||||
if (all_fmt & LIST_BLOCKS)
|
||||
column += printf("%4"OFF_FMT"u ", (off_t) dn->dstat.st_blocks >> 1);
|
||||
if (all_fmt & LIST_MODEBITS)
|
||||
column += printf("%-10s ", (char *) bb_mode_string(dn->dstat.st_mode));
|
||||
if (all_fmt & LIST_NLINKS)
|
||||
column += printf("%4lu ", (long) dn->dstat.st_nlink);
|
||||
for (i = 0; i <= 31; i++) {
|
||||
switch (all_fmt & (1 << i)) {
|
||||
case LIST_INO:
|
||||
column += printf("%7ld ", (long) dn->dstat.st_ino);
|
||||
break;
|
||||
case LIST_BLOCKS:
|
||||
column += printf("%4"OFF_FMT"d ", (off_t) dn->dstat.st_blocks >> 1);
|
||||
break;
|
||||
case LIST_MODEBITS:
|
||||
column += printf("%-10s ", (char *) bb_mode_string(dn->dstat.st_mode));
|
||||
break;
|
||||
case LIST_NLINKS:
|
||||
column += printf("%4ld ", (long) dn->dstat.st_nlink);
|
||||
break;
|
||||
case LIST_ID_NAME:
|
||||
#if ENABLE_FEATURE_LS_USERNAME
|
||||
if (all_fmt & LIST_ID_NAME) {
|
||||
if (option_mask32 & OPT_g) {
|
||||
column += printf("%-8.8s",
|
||||
get_cached_username(dn->dstat.st_uid));
|
||||
} else {
|
||||
column += printf("%-8.8s %-8.8s",
|
||||
printf("%-8.8s %-8.8s",
|
||||
get_cached_username(dn->dstat.st_uid),
|
||||
get_cached_groupname(dn->dstat.st_gid));
|
||||
}
|
||||
}
|
||||
column += 17;
|
||||
break;
|
||||
#endif
|
||||
if (all_fmt & LIST_ID_NUMERIC) {
|
||||
if (option_mask32 & OPT_g)
|
||||
column += printf("%-8u", (int) dn->dstat.st_uid);
|
||||
else
|
||||
column += printf("%-8u %-8u",
|
||||
(int) dn->dstat.st_uid,
|
||||
(int) dn->dstat.st_gid);
|
||||
}
|
||||
if (all_fmt & (LIST_SIZE /*|LIST_DEV*/ )) {
|
||||
if (S_ISBLK(dn->dstat.st_mode) || S_ISCHR(dn->dstat.st_mode)) {
|
||||
column += printf("%4u, %3u ",
|
||||
(int) major(dn->dstat.st_rdev),
|
||||
(int) minor(dn->dstat.st_rdev));
|
||||
} else {
|
||||
if (all_fmt & LS_DISP_HR) {
|
||||
column += printf("%9s ",
|
||||
make_human_readable_str(dn->dstat.st_size, 1, 0));
|
||||
case LIST_ID_NUMERIC:
|
||||
column += printf("%-8d %-8d", dn->dstat.st_uid, dn->dstat.st_gid);
|
||||
break;
|
||||
case LIST_SIZE:
|
||||
case LIST_DEV:
|
||||
if (S_ISBLK(dn->dstat.st_mode) || S_ISCHR(dn->dstat.st_mode)) {
|
||||
column += printf("%4d, %3d ", (int) major(dn->dstat.st_rdev),
|
||||
(int) minor(dn->dstat.st_rdev));
|
||||
} else {
|
||||
column += printf("%9"OFF_FMT"u ", (off_t) dn->dstat.st_size);
|
||||
if (all_fmt & LS_DISP_HR) {
|
||||
column += printf("%9s ",
|
||||
make_human_readable_str(dn->dstat.st_size, 1, 0));
|
||||
} else {
|
||||
column += printf("%9"OFF_FMT"d ", (off_t) dn->dstat.st_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
#if ENABLE_FEATURE_LS_TIMESTAMPS
|
||||
if (all_fmt & LIST_FULLTIME)
|
||||
column += printf("%24.24s ", filetime);
|
||||
if (all_fmt & LIST_DATE_TIME)
|
||||
if ((all_fmt & LIST_FULLTIME) == 0) {
|
||||
/* current_time_t ~== time(NULL) */
|
||||
age = current_time_t - ttime;
|
||||
printf("%6.6s ", filetime + 4);
|
||||
if (age < 3600L * 24 * 365 / 2 && age > -15 * 60) {
|
||||
/* hh:mm if less than 6 months old */
|
||||
printf("%5.5s ", filetime + 11);
|
||||
} else {
|
||||
printf(" %4.4s ", filetime + 20);
|
||||
case LIST_FULLTIME:
|
||||
printf("%24.24s ", filetime);
|
||||
column += 25;
|
||||
break;
|
||||
case LIST_DATE_TIME:
|
||||
if ((all_fmt & LIST_FULLTIME) == 0) {
|
||||
/* current_time_t ~== time(NULL) */
|
||||
age = current_time_t - ttime;
|
||||
printf("%6.6s ", filetime + 4);
|
||||
if (age < 3600L * 24 * 365 / 2 && age > -15 * 60) {
|
||||
/* hh:mm if less than 6 months old */
|
||||
printf("%5.5s ", filetime + 11);
|
||||
} else {
|
||||
printf(" %4.4s ", filetime + 20);
|
||||
}
|
||||
column += 13;
|
||||
}
|
||||
column += 13;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#if ENABLE_SELINUX
|
||||
if (all_fmt & LIST_CONTEXT) {
|
||||
column += printf("%-32s ", dn->sid ? dn->sid : "unknown");
|
||||
freecon(dn->sid);
|
||||
}
|
||||
case LIST_CONTEXT:
|
||||
{
|
||||
char context[80];
|
||||
int len = 0;
|
||||
|
||||
if (dn->sid) {
|
||||
/* I assume sid initilized with NULL */
|
||||
len = strlen(dn->sid) + 1;
|
||||
safe_strncpy(context, dn->sid, len);
|
||||
freecon(dn->sid);
|
||||
} else {
|
||||
safe_strncpy(context, "unknown", 8);
|
||||
}
|
||||
printf("%-32s ", context);
|
||||
column += MAX(33, len);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
if (all_fmt & LIST_FILENAME) {
|
||||
case LIST_FILENAME:
|
||||
errno = 0;
|
||||
#if ENABLE_FEATURE_LS_COLOR
|
||||
if (show_color) {
|
||||
info.st_mode = 0; /* for fgcolor() */
|
||||
lstat(dn->fullname, &info);
|
||||
printf("\033[%u;%um", bold(info.st_mode),
|
||||
fgcolor(info.st_mode));
|
||||
}
|
||||
#endif
|
||||
column += print_name(dn->name);
|
||||
if (show_color) {
|
||||
printf("\033[0m");
|
||||
}
|
||||
}
|
||||
if (all_fmt & LIST_SYMLINK) {
|
||||
if (S_ISLNK(dn->dstat.st_mode) && lpath) {
|
||||
printf(" -> ");
|
||||
#if ENABLE_FEATURE_LS_FILETYPES || ENABLE_FEATURE_LS_COLOR
|
||||
#if ENABLE_FEATURE_LS_COLOR
|
||||
info.st_mode = 0; /* for fgcolor() */
|
||||
#endif
|
||||
if (stat(dn->fullname, &info) == 0) {
|
||||
append = append_char(info.st_mode);
|
||||
if (show_color && !lstat(dn->fullname, &info)) {
|
||||
printf("\033[%d;%dm", bgcolor(info.st_mode),
|
||||
fgcolor(info.st_mode));
|
||||
}
|
||||
#endif
|
||||
#if ENABLE_FEATURE_LS_COLOR
|
||||
if (show_color) {
|
||||
printf("\033[%u;%um", bold(info.st_mode),
|
||||
fgcolor(info.st_mode));
|
||||
}
|
||||
#if ENABLE_FEATURE_ASSUME_UNICODE
|
||||
printf("%s", dn->name);
|
||||
column += mbstrlen(dn->name);
|
||||
#else
|
||||
column += printf("%s", dn->name);
|
||||
#endif
|
||||
column += print_name(lpath) + 4;
|
||||
if (show_color) {
|
||||
printf("\033[0m");
|
||||
}
|
||||
free(lpath);
|
||||
}
|
||||
}
|
||||
#if ENABLE_FEATURE_LS_FILETYPES
|
||||
if (all_fmt & LIST_FILETYPE) {
|
||||
if (append) {
|
||||
putchar(append);
|
||||
column++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case LIST_SYMLINK:
|
||||
if (S_ISLNK(dn->dstat.st_mode)) {
|
||||
char *lpath = xmalloc_readlink_or_warn(dn->fullname);
|
||||
if (!lpath) break;
|
||||
printf(" -> ");
|
||||
#if ENABLE_FEATURE_LS_FILETYPES || ENABLE_FEATURE_LS_COLOR
|
||||
if (!stat(dn->fullname, &info)) {
|
||||
append = append_char(info.st_mode);
|
||||
}
|
||||
#endif
|
||||
#if ENABLE_FEATURE_LS_COLOR
|
||||
if (show_color) {
|
||||
errno = 0;
|
||||
printf("\033[%d;%dm", bgcolor(info.st_mode),
|
||||
fgcolor(info.st_mode));
|
||||
}
|
||||
#endif
|
||||
column += printf("%s", lpath) + 4;
|
||||
if (show_color) {
|
||||
printf("\033[0m");
|
||||
}
|
||||
free(lpath);
|
||||
}
|
||||
break;
|
||||
#if ENABLE_FEATURE_LS_FILETYPES
|
||||
case LIST_FILETYPE:
|
||||
if (append) {
|
||||
putchar(append);
|
||||
column++;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return column;
|
||||
}
|
||||
|
||||
|
||||
/* "[-]Cadil1", POSIX mandated options, busybox always supports */
|
||||
/* "[-]gnsx", POSIX non-mandated options, busybox always supports */
|
||||
/* "[-]Ak" GNU options, busybox always supports */
|
||||
/* "[-]FLRctur", POSIX mandated options, busybox optionally supports */
|
||||
/* "[-]p", POSIX non-mandated options, busybox optionally supports */
|
||||
/* "[-]SXvThw", GNU options, busybox optionally supports */
|
||||
/* "[-]K", SELinux mandated options, busybox optionally supports */
|
||||
/* "[-]e", I think we made this one up */
|
||||
static const char ls_options[] ALIGN1 =
|
||||
"Cadil1gnsxAk"
|
||||
USE_FEATURE_LS_TIMESTAMPS("cetu")
|
||||
USE_FEATURE_LS_SORTFILES("SXrv")
|
||||
USE_FEATURE_LS_FILETYPES("Fp")
|
||||
USE_FEATURE_LS_FOLLOWLINKS("L")
|
||||
USE_FEATURE_LS_RECURSIVE("R")
|
||||
USE_FEATURE_HUMAN_READABLE("h")
|
||||
USE_SELINUX("K")
|
||||
USE_FEATURE_AUTOWIDTH("T:w:")
|
||||
USE_SELINUX("Z");
|
||||
|
||||
enum {
|
||||
LIST_MASK_TRIGGER = 0,
|
||||
STYLE_MASK_TRIGGER = STYLE_MASK,
|
||||
DISP_MASK_TRIGGER = DISP_ROWS,
|
||||
SORT_MASK_TRIGGER = SORT_MASK,
|
||||
};
|
||||
|
||||
static const unsigned opt_flags[] = {
|
||||
LIST_SHORT | STYLE_COLUMNS, /* C */
|
||||
DISP_HIDDEN | DISP_DOT, /* a */
|
||||
DISP_NOLIST, /* d */
|
||||
LIST_INO, /* i */
|
||||
LIST_LONG | STYLE_LONG, /* l - remember LS_DISP_HR in mask! */
|
||||
LIST_SHORT | STYLE_SINGLE, /* 1 */
|
||||
0, /* g - ingored */
|
||||
LIST_ID_NUMERIC, /* n */
|
||||
LIST_BLOCKS, /* s */
|
||||
DISP_ROWS, /* x */
|
||||
DISP_HIDDEN, /* A */
|
||||
ENABLE_SELINUX * LIST_CONTEXT, /* k (ignored if !SELINUX) */
|
||||
#if ENABLE_FEATURE_LS_TIMESTAMPS
|
||||
TIME_CHANGE | (ENABLE_FEATURE_LS_SORTFILES * SORT_CTIME), /* c */
|
||||
LIST_FULLTIME, /* e */
|
||||
ENABLE_FEATURE_LS_SORTFILES * SORT_MTIME, /* t */
|
||||
TIME_ACCESS | (ENABLE_FEATURE_LS_SORTFILES * SORT_ATIME), /* u */
|
||||
#endif
|
||||
#if ENABLE_FEATURE_LS_SORTFILES
|
||||
SORT_SIZE, /* S */
|
||||
SORT_EXT, /* X */
|
||||
SORT_REVERSE, /* r */
|
||||
SORT_VERSION, /* v */
|
||||
#endif
|
||||
#if ENABLE_FEATURE_LS_FILETYPES
|
||||
LIST_FILETYPE | LIST_EXEC, /* F */
|
||||
LIST_FILETYPE, /* p */
|
||||
#endif
|
||||
#if ENABLE_FEATURE_LS_FOLLOWLINKS
|
||||
FOLLOW_LINKS, /* L */
|
||||
#endif
|
||||
#if ENABLE_FEATURE_LS_RECURSIVE
|
||||
DISP_RECURSIVE, /* R */
|
||||
#endif
|
||||
#if ENABLE_FEATURE_HUMAN_READABLE
|
||||
LS_DISP_HR, /* h */
|
||||
#endif
|
||||
#if ENABLE_SELINUX
|
||||
LIST_MODEBITS|LIST_NLINKS|LIST_CONTEXT|LIST_SIZE|LIST_DATE_TIME, /* K */
|
||||
#endif
|
||||
#if ENABLE_FEATURE_AUTOWIDTH
|
||||
0, 0, /* T, w - ignored */
|
||||
#endif
|
||||
#if ENABLE_SELINUX
|
||||
LIST_MODEBITS|LIST_ID_NAME|LIST_CONTEXT, /* Z */
|
||||
#endif
|
||||
(1U<<31)
|
||||
};
|
||||
|
||||
|
||||
/* colored LS support by JaWi, janwillem.janssen@lxtreme.nl */
|
||||
#if ENABLE_FEATURE_LS_COLOR
|
||||
/* long option entry used only for --color, which has no short option
|
||||
@@ -899,6 +824,7 @@ static const char ls_color_opt[] ALIGN1 =
|
||||
#endif
|
||||
|
||||
|
||||
int ls_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int ls_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
struct dnode **dnd;
|
||||
@@ -1006,8 +932,8 @@ int ls_main(int argc UNUSED_PARAM, char **argv)
|
||||
dn = NULL;
|
||||
nfiles = 0;
|
||||
do {
|
||||
/* NB: follow links on command line unless -l or -s */
|
||||
cur = my_stat(*argv, *argv, !(all_fmt & (STYLE_LONG|LIST_BLOCKS)));
|
||||
/* ls w/o -l follows links on command line */
|
||||
cur = my_stat(*argv, *argv, !(all_fmt & STYLE_LONG));
|
||||
argv++;
|
||||
if (!cur)
|
||||
continue;
|
||||
|
||||
@@ -8,13 +8,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
typedef enum {
|
||||
/* 4th letter of applet_name is... */
|
||||
HASH_MD5 = 's', /* "md5>s<um" */
|
||||
HASH_SHA1 = '1',
|
||||
HASH_SHA256 = '2',
|
||||
HASH_SHA512 = '5',
|
||||
} hash_algo_t;
|
||||
typedef enum { HASH_SHA1, HASH_MD5 } hash_algo_t;
|
||||
|
||||
#define FLAG_SILENT 1
|
||||
#define FLAG_CHECK 2
|
||||
@@ -30,12 +24,10 @@ static unsigned char *hash_bin_to_hex(unsigned char *hash_value,
|
||||
return (unsigned char *)hex_value;
|
||||
}
|
||||
|
||||
static uint8_t *hash_file(const char *filename /*, hash_algo_t hash_algo*/)
|
||||
static uint8_t *hash_file(const char *filename, hash_algo_t hash_algo)
|
||||
{
|
||||
int src_fd, hash_len, count;
|
||||
union _ctx_ {
|
||||
sha512_ctx_t sha512;
|
||||
sha256_ctx_t sha256;
|
||||
sha1_ctx_t sha1;
|
||||
md5_ctx_t md5;
|
||||
} context;
|
||||
@@ -43,7 +35,6 @@ static uint8_t *hash_file(const char *filename /*, hash_algo_t hash_algo*/)
|
||||
RESERVE_CONFIG_UBUFFER(in_buf, 4096);
|
||||
void FAST_FUNC (*update)(const void*, size_t, void*);
|
||||
void FAST_FUNC (*final)(void*, void*);
|
||||
hash_algo_t hash_algo = applet_name[3];
|
||||
|
||||
src_fd = open_or_warn_stdin(filename);
|
||||
if (src_fd < 0) {
|
||||
@@ -51,26 +42,16 @@ static uint8_t *hash_file(const char *filename /*, hash_algo_t hash_algo*/)
|
||||
}
|
||||
|
||||
/* figure specific hash algorithims */
|
||||
if (ENABLE_MD5SUM && hash_algo == HASH_MD5) {
|
||||
if (ENABLE_MD5SUM && hash_algo==HASH_MD5) {
|
||||
md5_begin(&context.md5);
|
||||
update = (void*)md5_hash;
|
||||
final = (void*)md5_end;
|
||||
hash_len = 16;
|
||||
} else if (ENABLE_SHA1SUM && hash_algo == HASH_SHA1) {
|
||||
} else if (ENABLE_SHA1SUM && hash_algo==HASH_SHA1) {
|
||||
sha1_begin(&context.sha1);
|
||||
update = (void*)sha1_hash;
|
||||
final = (void*)sha1_end;
|
||||
hash_len = 20;
|
||||
} else if (ENABLE_SHA256SUM && hash_algo == HASH_SHA256) {
|
||||
sha256_begin(&context.sha256);
|
||||
update = (void*)sha256_hash;
|
||||
final = (void*)sha256_end;
|
||||
hash_len = 32;
|
||||
} else if (ENABLE_SHA512SUM && hash_algo == HASH_SHA512) {
|
||||
sha512_begin(&context.sha512);
|
||||
update = (void*)sha512_hash;
|
||||
final = (void*)sha512_end;
|
||||
hash_len = 64;
|
||||
} else {
|
||||
bb_error_msg_and_die("algorithm not supported");
|
||||
}
|
||||
@@ -99,7 +80,9 @@ int md5_sha1_sum_main(int argc UNUSED_PARAM, char **argv)
|
||||
int return_value = EXIT_SUCCESS;
|
||||
uint8_t *hash_value;
|
||||
unsigned flags;
|
||||
/*hash_algo_t hash_algo = applet_name[3];*/
|
||||
hash_algo_t hash_algo = ENABLE_MD5SUM
|
||||
? (ENABLE_SHA1SUM ? (applet_name[0] == 'm' ? HASH_MD5 : HASH_SHA1) : HASH_MD5)
|
||||
: HASH_SHA1;
|
||||
|
||||
if (ENABLE_FEATURE_MD5_SHA1_SUM_CHECK)
|
||||
flags = getopt32(argv, "scw");
|
||||
@@ -153,7 +136,7 @@ int md5_sha1_sum_main(int argc UNUSED_PARAM, char **argv)
|
||||
*filename_ptr = '\0';
|
||||
filename_ptr += 2;
|
||||
|
||||
hash_value = hash_file(filename_ptr /*, hash_algo*/);
|
||||
hash_value = hash_file(filename_ptr, hash_algo);
|
||||
|
||||
if (hash_value && (strcmp((char*)hash_value, line) == 0)) {
|
||||
if (!(flags & FLAG_SILENT))
|
||||
@@ -179,7 +162,7 @@ int md5_sha1_sum_main(int argc UNUSED_PARAM, char **argv)
|
||||
*/
|
||||
} else {
|
||||
do {
|
||||
hash_value = hash_file(*argv/*, hash_algo*/);
|
||||
hash_value = hash_file(*argv, hash_algo);
|
||||
if (hash_value == NULL) {
|
||||
return_value = EXIT_FAILURE;
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
int printenv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int printenv_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
int exit_code = EXIT_SUCCESS;
|
||||
|
||||
/* no variables specified, show whole env */
|
||||
if (!argv[1]) {
|
||||
int e = 0;
|
||||
@@ -28,10 +26,8 @@ int printenv_main(int argc UNUSED_PARAM, char **argv)
|
||||
env = getenv(arg);
|
||||
if (env)
|
||||
puts(env);
|
||||
else
|
||||
exit_code = EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
fflush_stdout_and_exit(exit_code);
|
||||
fflush_stdout_and_exit(EXIT_SUCCESS);
|
||||
}
|
||||
+57
-76
@@ -75,13 +75,13 @@ static int multiconvert(const char *arg, void *result, converter convert)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void FAST_FUNC conv_strtoull(const char *arg, void *result)
|
||||
static void FAST_FUNC conv_strtoul(const char *arg, void *result)
|
||||
{
|
||||
*(unsigned long long*)result = bb_strtoull(arg, NULL, 0);
|
||||
*(unsigned long*)result = bb_strtoul(arg, NULL, 0);
|
||||
}
|
||||
static void FAST_FUNC conv_strtoll(const char *arg, void *result)
|
||||
static void FAST_FUNC conv_strtol(const char *arg, void *result)
|
||||
{
|
||||
*(long long*)result = bb_strtoll(arg, NULL, 0);
|
||||
*(long*)result = bb_strtol(arg, NULL, 0);
|
||||
}
|
||||
static void FAST_FUNC conv_strtod(const char *arg, void *result)
|
||||
{
|
||||
@@ -96,17 +96,17 @@ static void FAST_FUNC conv_strtod(const char *arg, void *result)
|
||||
}
|
||||
|
||||
/* Callers should check errno to detect errors */
|
||||
static unsigned long long my_xstrtoull(const char *arg)
|
||||
static unsigned long my_xstrtoul(const char *arg)
|
||||
{
|
||||
unsigned long long result;
|
||||
if (multiconvert(arg, &result, conv_strtoull))
|
||||
unsigned long result;
|
||||
if (multiconvert(arg, &result, conv_strtoul))
|
||||
result = 0;
|
||||
return result;
|
||||
}
|
||||
static long long my_xstrtoll(const char *arg)
|
||||
static long my_xstrtol(const char *arg)
|
||||
{
|
||||
long long result;
|
||||
if (multiconvert(arg, &result, conv_strtoll))
|
||||
long result;
|
||||
if (multiconvert(arg, &result, conv_strtol))
|
||||
result = 0;
|
||||
return result;
|
||||
}
|
||||
@@ -134,63 +134,61 @@ static void print_direc(char *format, unsigned fmt_length,
|
||||
int field_width, int precision,
|
||||
const char *argument)
|
||||
{
|
||||
long long llv;
|
||||
long lv;
|
||||
double dv;
|
||||
char saved;
|
||||
char *have_prec, *have_width;
|
||||
|
||||
saved = format[fmt_length];
|
||||
format[fmt_length] = '\0';
|
||||
|
||||
have_prec = strstr(format, ".*");
|
||||
have_width = strchr(format, '*');
|
||||
if (have_width - 1 == have_prec)
|
||||
have_width = NULL;
|
||||
|
||||
saved = format[fmt_length];
|
||||
format[fmt_length] = '\0';
|
||||
|
||||
switch (format[fmt_length - 1]) {
|
||||
case 'c':
|
||||
printf(format, *argument);
|
||||
break;
|
||||
case 'd':
|
||||
case 'i':
|
||||
llv = my_xstrtoll(argument);
|
||||
lv = my_xstrtol(argument);
|
||||
print_long:
|
||||
/* if (errno) return; - see comment at the top */
|
||||
if (!have_width) {
|
||||
if (!have_prec)
|
||||
printf(format, llv);
|
||||
printf(format, lv);
|
||||
else
|
||||
printf(format, precision, llv);
|
||||
printf(format, precision, lv);
|
||||
} else {
|
||||
if (!have_prec)
|
||||
printf(format, field_width, llv);
|
||||
printf(format, field_width, lv);
|
||||
else
|
||||
printf(format, field_width, precision, llv);
|
||||
printf(format, field_width, precision, lv);
|
||||
}
|
||||
break;
|
||||
case 'o':
|
||||
case 'u':
|
||||
case 'x':
|
||||
case 'X':
|
||||
llv = my_xstrtoull(argument);
|
||||
lv = my_xstrtoul(argument);
|
||||
/* cheat: unsigned long and long have same width, so... */
|
||||
goto print_long;
|
||||
case 's':
|
||||
/* Are char* and long long the same? */
|
||||
if (sizeof(argument) == sizeof(llv)) {
|
||||
llv = (long long)(ptrdiff_t)argument;
|
||||
/* Are char* and long the same? (true for most arches) */
|
||||
if (sizeof(argument) == sizeof(lv)) {
|
||||
lv = (long)(ptrdiff_t)argument;
|
||||
goto print_long;
|
||||
} else {
|
||||
/* Hope compiler will optimize it out by moving call
|
||||
* instruction after the ifs... */
|
||||
} else { /* Hope compiler will optimize it out */
|
||||
if (!have_width) {
|
||||
if (!have_prec)
|
||||
printf(format, argument, /*unused:*/ argument, argument);
|
||||
printf(format, argument);
|
||||
else
|
||||
printf(format, precision, argument, /*unused:*/ argument);
|
||||
printf(format, precision, argument);
|
||||
} else {
|
||||
if (!have_prec)
|
||||
printf(format, field_width, argument, /*unused:*/ argument);
|
||||
printf(format, field_width, argument);
|
||||
else
|
||||
printf(format, field_width, precision, argument);
|
||||
}
|
||||
@@ -288,48 +286,38 @@ static char **print_formatted(char *f, char **argv)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove "lLhz" size modifiers, repeatedly.
|
||||
* bash does not like "%lld", but coreutils
|
||||
* would happily take even "%Llllhhzhhzd"!
|
||||
* We will be permissive like coreutils */
|
||||
while ((*f | 0x20) == 'l' || *f == 'h' || *f == 'z') {
|
||||
/* Remove size modifiers - "%Ld" would try to printf
|
||||
* long long, we pass long, and it spews garbage */
|
||||
if ((*f | 0x20) == 'l' || *f == 'h' || *f == 'z') {
|
||||
overlapping_strcpy(f, f + 1);
|
||||
}
|
||||
/* Add "ll" if integer modifier, then print */
|
||||
{
|
||||
static const char format_chars[] ALIGN1 = "diouxXfeEgGcs";
|
||||
char *p = strchr(format_chars, *f);
|
||||
/* needed - try "printf %" without it */
|
||||
if (p == NULL) {
|
||||
bb_error_msg("%s: invalid format", direc_start);
|
||||
/* causes main() to exit with error */
|
||||
return saved_argv - 1;
|
||||
}
|
||||
++direc_length;
|
||||
if (p - format_chars <= 5) {
|
||||
/* it is one of "diouxX" */
|
||||
p = xmalloc(direc_length + 3);
|
||||
memcpy(p, direc_start, direc_length);
|
||||
p[direc_length + 1] = p[direc_length - 1];
|
||||
p[direc_length - 1] = 'l';
|
||||
p[direc_length] = 'l';
|
||||
//bb_error_msg("<%s>", p);
|
||||
direc_length += 2;
|
||||
direc_start = p;
|
||||
} else {
|
||||
p = NULL;
|
||||
}
|
||||
if (*argv) {
|
||||
print_direc(direc_start, direc_length, field_width,
|
||||
precision, *argv);
|
||||
++argv;
|
||||
} else {
|
||||
print_direc(direc_start, direc_length, field_width,
|
||||
precision, "");
|
||||
}
|
||||
free(p);
|
||||
//FIXME: actually, the same happens with bare "%d":
|
||||
//it printfs an int, but we pass long!
|
||||
//What saves us is that on most arches stack slot
|
||||
//is pointer-sized -> long-sized -> ints are promoted to longs
|
||||
// for variadic functions -> printf("%d", int_v) is in reality
|
||||
// indistinqushable from printf("%d", long_v) ->
|
||||
// since printf("%d", int_v) works, printf("%d", long_v) has to work.
|
||||
//But "clean" solution would be to add "l" to d,i,o,x,X.
|
||||
//Probably makes sense to go all the way to "ll" then.
|
||||
//Coreutils support long long-sized arguments.
|
||||
|
||||
/* needed - try "printf %" without it */
|
||||
if (!strchr("diouxXfeEgGcs", *f)) {
|
||||
bb_error_msg("%s: invalid format", direc_start);
|
||||
/* causes main() to exit with error */
|
||||
return saved_argv - 1;
|
||||
}
|
||||
++direc_length;
|
||||
if (*argv) {
|
||||
print_direc(direc_start, direc_length, field_width,
|
||||
precision, *argv);
|
||||
++argv;
|
||||
} else {
|
||||
print_direc(direc_start, direc_length, field_width,
|
||||
precision, "");
|
||||
}
|
||||
/* if (errno) return saved_argv - 1; */
|
||||
break;
|
||||
case '\\':
|
||||
if (*++f == 'c') {
|
||||
@@ -371,15 +359,8 @@ int printf_main(int argc UNUSED_PARAM, char **argv)
|
||||
* We will mimic coreutils. */
|
||||
if (argv[1] && argv[1][0] == '-' && argv[1][1] == '-' && !argv[1][2])
|
||||
argv++;
|
||||
if (!argv[1]) {
|
||||
if (ENABLE_ASH_BUILTIN_PRINTF
|
||||
&& applet_name[0] != 'p'
|
||||
) {
|
||||
bb_error_msg("usage: printf FORMAT [ARGUMENT...]");
|
||||
return 2; /* bash compat */
|
||||
}
|
||||
if (!argv[1])
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
format = argv[1];
|
||||
argv2 = argv + 2;
|
||||
|
||||
+5
-28
@@ -6,30 +6,8 @@
|
||||
*
|
||||
* Licensed under GPL v2 or later, see file LICENSE in this tarball for details.
|
||||
*/
|
||||
#include "libbb.h"
|
||||
|
||||
/*
|
||||
* # readlink --version
|
||||
* readlink (GNU coreutils) 6.10
|
||||
* # readlink --help
|
||||
* -f, --canonicalize
|
||||
* canonicalize by following every symlink in
|
||||
* every component of the given name recursively;
|
||||
* all but the last component must exist
|
||||
* -e, --canonicalize-existing
|
||||
* canonicalize by following every symlink in
|
||||
* every component of the given name recursively,
|
||||
* all components must exist
|
||||
* -m, --canonicalize-missing
|
||||
* canonicalize by following every symlink in
|
||||
* every component of the given name recursively,
|
||||
* without requirements on components existence
|
||||
* -n, --no-newline do not output the trailing newline
|
||||
* -q, --quiet, -s, --silent suppress most error messages
|
||||
* -v, --verbose report error messages
|
||||
*
|
||||
* bbox supports: -f -n -v (fully), -q -s (accepts but ignores)
|
||||
*/
|
||||
#include "libbb.h"
|
||||
|
||||
int readlink_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int readlink_main(int argc UNUSED_PARAM, char **argv)
|
||||
@@ -42,7 +20,7 @@ int readlink_main(int argc UNUSED_PARAM, char **argv)
|
||||
unsigned opt;
|
||||
/* We need exactly one non-option argument. */
|
||||
opt_complementary = "=1";
|
||||
opt = getopt32(argv, "fnvsq");
|
||||
opt = getopt32(argv, "f");
|
||||
fname = argv[optind];
|
||||
)
|
||||
SKIP_FEATURE_READLINK_FOLLOW(
|
||||
@@ -52,10 +30,9 @@ int readlink_main(int argc UNUSED_PARAM, char **argv)
|
||||
)
|
||||
|
||||
/* compat: coreutils readlink reports errors silently via exit code */
|
||||
if (!(opt & 4)) /* not -v */
|
||||
logmode = LOGMODE_NONE;
|
||||
logmode = LOGMODE_NONE;
|
||||
|
||||
if (opt & 1) { /* -f */
|
||||
if (opt) {
|
||||
buf = realpath(fname, pathbuf);
|
||||
} else {
|
||||
buf = xmalloc_readlink_or_warn(fname);
|
||||
@@ -63,7 +40,7 @@ int readlink_main(int argc UNUSED_PARAM, char **argv)
|
||||
|
||||
if (!buf)
|
||||
return EXIT_FAILURE;
|
||||
printf((opt & 2) ? "%s" : "%s\n", buf);
|
||||
puts(buf);
|
||||
|
||||
if (ENABLE_FEATURE_CLEAN_UP && !opt)
|
||||
free(buf);
|
||||
|
||||
+2
-3
@@ -27,14 +27,13 @@ int rm_main(int argc UNUSED_PARAM, char **argv)
|
||||
unsigned opt;
|
||||
|
||||
opt_complementary = "f-i:i-f";
|
||||
/* -v (verbose) is ignored */
|
||||
opt = getopt32(argv, "fiRrv");
|
||||
opt = getopt32(argv, "fiRr");
|
||||
argv += optind;
|
||||
if (opt & 1)
|
||||
flags |= FILEUTILS_FORCE;
|
||||
if (opt & 2)
|
||||
flags |= FILEUTILS_INTERACTIVE;
|
||||
if (opt & (8|4))
|
||||
if (opt & 12)
|
||||
flags |= FILEUTILS_RECUR;
|
||||
|
||||
if (*argv != NULL) {
|
||||
|
||||
+5
-18
@@ -15,39 +15,26 @@
|
||||
int seq_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int seq_main(int argc, char **argv)
|
||||
{
|
||||
enum {
|
||||
OPT_w = (1 << 0),
|
||||
OPT_s = (1 << 1),
|
||||
};
|
||||
double last, increment, i;
|
||||
const char *sep, *opt_s = "\n";
|
||||
unsigned opt = getopt32(argv, "+ws:", &opt_s);
|
||||
unsigned width = 0;
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
i = increment = 1;
|
||||
switch (argc) {
|
||||
case 4:
|
||||
increment = atof(argv[2]);
|
||||
case 3:
|
||||
increment = atof(argv[1]);
|
||||
i = atof(argv[1]);
|
||||
case 2:
|
||||
i = atof(*argv);
|
||||
case 1:
|
||||
last = atof(argv[argc-1]);
|
||||
break;
|
||||
default:
|
||||
bb_show_usage();
|
||||
}
|
||||
if (opt & OPT_w) /* Pad to length of start or last */
|
||||
width = MAX(strlen(*argv), strlen(argv[argc-1]));
|
||||
|
||||
/* You should note that this is pos-5.0.91 semantics, -- FK. */
|
||||
sep = "";
|
||||
while ((increment > 0 && i <= last) || (increment < 0 && i >= last)) {
|
||||
printf("%s%0*g", sep, width, i);
|
||||
sep = opt_s;
|
||||
printf("%g\n", i);
|
||||
i += increment;
|
||||
}
|
||||
bb_putchar('\n');
|
||||
|
||||
return fflush(stdout);
|
||||
}
|
||||
+1
-1
@@ -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.
|
||||
*/
|
||||
|
||||
+6
-21
@@ -125,20 +125,6 @@ static const char *human_fstype(uint32_t f_type)
|
||||
return humantypes[i].fs;
|
||||
}
|
||||
|
||||
/* "man statfs" says that statfsbuf->f_fsid is a mess */
|
||||
/* coreutils treats it as an array of ints, most significant first */
|
||||
static unsigned long long get_f_fsid(const struct statfs *statfsbuf)
|
||||
{
|
||||
const unsigned *p = (const void*) &statfsbuf->f_fsid;
|
||||
unsigned sz = sizeof(statfsbuf->f_fsid) / sizeof(unsigned);
|
||||
unsigned long long r = 0;
|
||||
|
||||
do
|
||||
r = (r << (sizeof(unsigned)*8)) | *p++;
|
||||
while (--sz > 0);
|
||||
return r;
|
||||
}
|
||||
|
||||
#if ENABLE_FEATURE_STAT_FORMAT
|
||||
static void strcatc(char *str, char c)
|
||||
{
|
||||
@@ -162,11 +148,11 @@ static void print_statfs(char *pformat, const char m,
|
||||
if (m == 'n') {
|
||||
printfs(pformat, filename);
|
||||
} else if (m == 'i') {
|
||||
strcat(pformat, "llx");
|
||||
printf(pformat, get_f_fsid(statfsbuf));
|
||||
strcat(pformat, "Lx");
|
||||
printf(pformat, statfsbuf->f_fsid);
|
||||
} else if (m == 'l') {
|
||||
strcat(pformat, "lu");
|
||||
printf(pformat, (unsigned long) (statfsbuf->f_namelen));
|
||||
printf(pformat, statfsbuf->f_namelen);
|
||||
} else if (m == 't') {
|
||||
strcat(pformat, "lx");
|
||||
printf(pformat, (unsigned long) (statfsbuf->f_type)); /* no equiv */
|
||||
@@ -363,11 +349,10 @@ static void print_it(const char *masterformat, const char *filename,
|
||||
#endif
|
||||
static bool do_statfs(const char *filename, const char *format)
|
||||
{
|
||||
struct statfs statfsbuf;
|
||||
|
||||
#if !ENABLE_FEATURE_STAT_FORMAT
|
||||
const char *format;
|
||||
#endif
|
||||
struct statfs statfsbuf;
|
||||
#if ENABLE_SELINUX
|
||||
security_context_t scontext = NULL;
|
||||
|
||||
@@ -421,10 +406,10 @@ static bool do_statfs(const char *filename, const char *format)
|
||||
format = (option_mask32 & OPT_TERSE
|
||||
? "%s %llx %lu "
|
||||
: " File: \"%s\"\n"
|
||||
" ID: %-8llx Namelen: %-7lu ");
|
||||
" ID: %-8Lx Namelen: %-7lu ");
|
||||
printf(format,
|
||||
filename,
|
||||
get_f_fsid(&statfsbuf),
|
||||
statfsbuf.f_fsid,
|
||||
statfsbuf.f_namelen);
|
||||
|
||||
if (option_mask32 & OPT_TERSE)
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ int tail_main(int argc, char **argv)
|
||||
if (argv[1] && (argv[1][0] == '+' || argv[1][0] == '-')
|
||||
&& isdigit(argv[1][1])
|
||||
) {
|
||||
count = eat_num(argv[1]);
|
||||
count = eat_num(&argv[1][1]);
|
||||
argv++;
|
||||
argc--;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
/* http://www.opengroup.org/onlinepubs/007904975/utilities/tee.html */
|
||||
|
||||
#include "libbb.h"
|
||||
#include <signal.h>
|
||||
|
||||
int tee_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int tee_main(int argc, char **argv)
|
||||
|
||||
+1
-1
@@ -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.
|
||||
*
|
||||
|
||||
+3
-17
@@ -41,13 +41,6 @@ int touch_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int touch_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
#if ENABLE_DESKTOP
|
||||
#if ENABLE_GETOPT_LONG
|
||||
static const char longopts[] ALIGN1 =
|
||||
/* name, has_arg, val */
|
||||
"no-create\0" No_argument "c"
|
||||
"reference\0" Required_argument "r"
|
||||
;
|
||||
#endif
|
||||
struct utimbuf timebuf;
|
||||
char *reference_file = NULL;
|
||||
#else
|
||||
@@ -56,18 +49,11 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
|
||||
#endif
|
||||
int fd;
|
||||
int status = EXIT_SUCCESS;
|
||||
int opts;
|
||||
|
||||
#if ENABLE_DESKTOP
|
||||
#if ENABLE_GETOPT_LONG
|
||||
applet_long_options = longopts;
|
||||
#endif
|
||||
#endif
|
||||
opts = getopt32(argv, "c" USE_DESKTOP("r:")
|
||||
int flags = getopt32(argv, "c" USE_DESKTOP("r:")
|
||||
/*ignored:*/ "fma"
|
||||
USE_DESKTOP(, &reference_file));
|
||||
|
||||
opts &= 1; /* only -c bit is left */
|
||||
flags &= 1; /* only -c bit is left */
|
||||
argv += optind;
|
||||
if (!*argv) {
|
||||
bb_show_usage();
|
||||
@@ -83,7 +69,7 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
|
||||
do {
|
||||
if (utime(*argv, reference_file ? &timebuf : NULL)) {
|
||||
if (errno == ENOENT) { /* no such file */
|
||||
if (opts) { /* creation is disabled, so ignore */
|
||||
if (flags) { /* creation is disabled, so ignore */
|
||||
continue;
|
||||
}
|
||||
/* Try to create the file. */
|
||||
|
||||
+124
-173
@@ -16,284 +16,235 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
||||
*/
|
||||
/* http://www.opengroup.org/onlinepubs/009695399/utilities/tr.html
|
||||
* TODO: graph, print
|
||||
* TODO: xdigit, graph, print
|
||||
*/
|
||||
#include "libbb.h"
|
||||
|
||||
enum {
|
||||
ASCII = 256,
|
||||
/* string buffer needs to be at least as big as the whole "alphabet".
|
||||
* BUFSIZ == ASCII is ok, but we will realloc in expand
|
||||
* even for smallest patterns, let's avoid that by using *2:
|
||||
*/
|
||||
TR_BUFSIZ = (BUFSIZ > ASCII*2) ? BUFSIZ : ASCII*2,
|
||||
};
|
||||
#define ASCII 0377
|
||||
|
||||
static void map(char *pvector,
|
||||
char *string1, unsigned string1_len,
|
||||
char *string2, unsigned string2_len)
|
||||
unsigned char *string1, unsigned int string1_len,
|
||||
unsigned char *string2, unsigned int string2_len)
|
||||
{
|
||||
char last = '0';
|
||||
unsigned i, j;
|
||||
unsigned int i, j;
|
||||
|
||||
for (j = 0, i = 0; i < string1_len; i++) {
|
||||
if (string2_len <= j)
|
||||
pvector[(unsigned char)(string1[i])] = last;
|
||||
pvector[string1[i]] = last;
|
||||
else
|
||||
pvector[(unsigned char)(string1[i])] = last = string2[j++];
|
||||
pvector[string1[i]] = last = string2[j++];
|
||||
}
|
||||
}
|
||||
|
||||
/* supported constructs:
|
||||
* Ranges, e.g., 0-9 ==> 0123456789
|
||||
* Ranges, e.g., [0-9] ==> 0123456789
|
||||
* Escapes, e.g., \a ==> Control-G
|
||||
* Character classes, e.g. [:upper:] ==> A...Z
|
||||
* Equiv classess, e.g. [=A=] ==> A (hmmmmmmm?)
|
||||
* not supported:
|
||||
* \ooo-\ooo - octal ranges
|
||||
* [x*N] - repeat char x N times
|
||||
* [x*] - repeat char x until it fills STRING2:
|
||||
* # echo qwe123 | /usr/bin/tr 123456789 '[d]'
|
||||
* qwe[d]
|
||||
* # echo qwe123 | /usr/bin/tr 123456789 '[d*]'
|
||||
* qweddd
|
||||
*/
|
||||
static unsigned expand(const char *arg, char **buffer_p)
|
||||
static unsigned int expand(const char *arg, char *buffer)
|
||||
{
|
||||
char *buffer = *buffer_p;
|
||||
unsigned pos = 0;
|
||||
unsigned size = TR_BUFSIZ;
|
||||
char *buffer_start = buffer;
|
||||
unsigned i; /* can't be unsigned char: must be able to hold 256 */
|
||||
unsigned char ac;
|
||||
|
||||
while (*arg) {
|
||||
if (pos + ASCII > size) {
|
||||
size += ASCII;
|
||||
*buffer_p = buffer = xrealloc(buffer, size);
|
||||
}
|
||||
if (*arg == '\\') {
|
||||
arg++;
|
||||
buffer[pos++] = bb_process_escape_sequence(&arg);
|
||||
*buffer++ = bb_process_escape_sequence(&arg);
|
||||
continue;
|
||||
}
|
||||
if (arg[1] == '-') { /* "0-9..." */
|
||||
ac = arg[2];
|
||||
if (ac == '\0') { /* "0-": copy verbatim */
|
||||
buffer[pos++] = *arg++; /* copy '0' */
|
||||
*buffer++ = *arg++; /* copy '0' */
|
||||
continue; /* next iter will copy '-' and stop */
|
||||
}
|
||||
i = (unsigned char) *arg;
|
||||
i = *arg;
|
||||
while (i <= ac) /* ok: i is unsigned _int_ */
|
||||
buffer[pos++] = i++;
|
||||
*buffer++ = i++;
|
||||
arg += 3; /* skip 0-9 */
|
||||
continue;
|
||||
}
|
||||
if ((ENABLE_FEATURE_TR_CLASSES || ENABLE_FEATURE_TR_EQUIV)
|
||||
&& *arg == '['
|
||||
) {
|
||||
if (*arg == '[') { /* "[xyz..." */
|
||||
arg++;
|
||||
i = (unsigned char) *arg++;
|
||||
/* "[xyz...". i=x, arg points to y */
|
||||
if (ENABLE_FEATURE_TR_CLASSES && i == ':') { /* [:class:] */
|
||||
i = *arg++;
|
||||
/* "[xyz...", i=x, arg points to y */
|
||||
if (ENABLE_FEATURE_TR_CLASSES && i == ':') {
|
||||
#define CLO ":]\0"
|
||||
static const char classes[] ALIGN1 =
|
||||
"alpha"CLO "alnum"CLO "digit"CLO
|
||||
"lower"CLO "upper"CLO "space"CLO
|
||||
"blank"CLO "punct"CLO "cntrl"CLO
|
||||
"xdigit"CLO;
|
||||
enum {
|
||||
CLASS_invalid = 0, /* we increment the retval */
|
||||
CLASS_alpha = 1,
|
||||
CLASS_alnum = 2,
|
||||
CLASS_digit = 3,
|
||||
CLASS_lower = 4,
|
||||
CLASS_upper = 5,
|
||||
CLASS_space = 6,
|
||||
CLASS_blank = 7,
|
||||
CLASS_punct = 8,
|
||||
CLASS_cntrl = 9,
|
||||
CLASS_xdigit = 10,
|
||||
//CLASS_graph = 11,
|
||||
//CLASS_print = 12,
|
||||
};
|
||||
"blank"CLO "punct"CLO "cntrl"CLO;
|
||||
#define CLASS_invalid 0 /* we increment the retval */
|
||||
#define CLASS_alpha 1
|
||||
#define CLASS_alnum 2
|
||||
#define CLASS_digit 3
|
||||
#define CLASS_lower 4
|
||||
#define CLASS_upper 5
|
||||
#define CLASS_space 6
|
||||
#define CLASS_blank 7
|
||||
#define CLASS_punct 8
|
||||
#define CLASS_cntrl 9
|
||||
//#define CLASS_xdigit 10
|
||||
//#define CLASS_graph 11
|
||||
//#define CLASS_print 12
|
||||
smalluint j;
|
||||
char *tmp;
|
||||
|
||||
/* xdigit needs 8, not 7 */
|
||||
i = 7 + (arg[0] == 'x');
|
||||
tmp = xstrndup(arg, i);
|
||||
j = index_in_strings(classes, tmp) + 1;
|
||||
free(tmp);
|
||||
|
||||
if (j == CLASS_invalid)
|
||||
goto skip_bracket;
|
||||
|
||||
arg += i;
|
||||
if (j == CLASS_alnum || j == CLASS_digit || j == CLASS_xdigit) {
|
||||
{ /* not really pretty.. */
|
||||
char *tmp = xstrndup(arg, 7); // warning: xdigit would need 8, not 7
|
||||
j = index_in_strings(classes, tmp) + 1;
|
||||
free(tmp);
|
||||
}
|
||||
if (j == CLASS_alnum || j == CLASS_digit) {
|
||||
for (i = '0'; i <= '9'; i++)
|
||||
buffer[pos++] = i;
|
||||
*buffer++ = i;
|
||||
}
|
||||
if (j == CLASS_alpha || j == CLASS_alnum || j == CLASS_upper) {
|
||||
for (i = 'A'; i <= 'Z'; i++)
|
||||
buffer[pos++] = i;
|
||||
*buffer++ = i;
|
||||
}
|
||||
if (j == CLASS_alpha || j == CLASS_alnum || j == CLASS_lower) {
|
||||
for (i = 'a'; i <= 'z'; i++)
|
||||
buffer[pos++] = i;
|
||||
*buffer++ = i;
|
||||
}
|
||||
if (j == CLASS_space || j == CLASS_blank) {
|
||||
buffer[pos++] = '\t';
|
||||
*buffer++ = '\t';
|
||||
if (j == CLASS_space) {
|
||||
buffer[pos++] = '\n';
|
||||
buffer[pos++] = '\v';
|
||||
buffer[pos++] = '\f';
|
||||
buffer[pos++] = '\r';
|
||||
*buffer++ = '\n';
|
||||
*buffer++ = '\v';
|
||||
*buffer++ = '\f';
|
||||
*buffer++ = '\r';
|
||||
}
|
||||
buffer[pos++] = ' ';
|
||||
*buffer++ = ' ';
|
||||
}
|
||||
if (j == CLASS_punct || j == CLASS_cntrl) {
|
||||
for (i = '\0'; i < ASCII; i++) {
|
||||
for (i = '\0'; i <= ASCII; i++)
|
||||
if ((j == CLASS_punct && isprint(i) && !isalnum(i) && !isspace(i))
|
||||
|| (j == CLASS_cntrl && iscntrl(i))
|
||||
) {
|
||||
buffer[pos++] = i;
|
||||
}
|
||||
}
|
||||
|| (j == CLASS_cntrl && iscntrl(i)))
|
||||
*buffer++ = i;
|
||||
}
|
||||
if (j == CLASS_xdigit) {
|
||||
for (i = 'A'; i <= 'F'; i++) {
|
||||
buffer[pos + 6] = i | 0x20;
|
||||
buffer[pos++] = i;
|
||||
}
|
||||
pos += 6;
|
||||
if (j == CLASS_invalid) {
|
||||
*buffer++ = '[';
|
||||
*buffer++ = ':';
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
/* "[xyz...", i=x, arg points to y */
|
||||
if (ENABLE_FEATURE_TR_EQUIV && i == '=') { /* [=CHAR=] */
|
||||
buffer[pos++] = *arg; /* copy CHAR */
|
||||
if (!arg[0] || arg[1] != '=' || arg[2] != ']')
|
||||
*buffer++ = *arg; /* copy CHAR */
|
||||
if (!*arg || arg[1] != '=' || arg[2] != ']')
|
||||
bb_show_usage();
|
||||
arg += 3; /* skip CHAR=] */
|
||||
continue;
|
||||
}
|
||||
/* The rest of "[xyz..." cases is treated as normal
|
||||
* string, "[" has no special meaning here:
|
||||
* tr "[a-z]" "[A-Z]" can be written as tr "a-z" "A-Z",
|
||||
* also try tr "[a-z]" "_A-Z+" and you'll see that
|
||||
* [] is not special here.
|
||||
*/
|
||||
skip_bracket:
|
||||
arg -= 2; /* points to "[" in "[xyz..." */
|
||||
if (i == '\0' || *arg != '-') { /* not [x-...] - copy verbatim */
|
||||
*buffer++ = '[';
|
||||
arg--; /* points to x */
|
||||
continue; /* copy all, including eventual ']' */
|
||||
}
|
||||
/* [x-z] */
|
||||
arg++; /* skip - */
|
||||
if (arg[0] == '\0' || arg[1] != ']')
|
||||
bb_show_usage();
|
||||
ac = *arg++;
|
||||
while (i <= ac)
|
||||
*buffer++ = i++;
|
||||
arg++; /* skip ] */
|
||||
continue;
|
||||
}
|
||||
buffer[pos++] = *arg++;
|
||||
*buffer++ = *arg++;
|
||||
}
|
||||
return pos;
|
||||
return (buffer - buffer_start);
|
||||
}
|
||||
|
||||
/* NB: buffer is guaranteed to be at least TR_BUFSIZE
|
||||
* (which is >= ASCII) big.
|
||||
*/
|
||||
static int complement(char *buffer, int buffer_len)
|
||||
{
|
||||
int len;
|
||||
char conv[ASCII];
|
||||
unsigned char ch;
|
||||
int i, j, ix;
|
||||
char conv[ASCII + 2];
|
||||
|
||||
len = 0;
|
||||
ch = '\0';
|
||||
while (1) {
|
||||
if (memchr(buffer, ch, buffer_len) == NULL)
|
||||
conv[len++] = ch;
|
||||
if (++ch == '\0')
|
||||
break;
|
||||
ix = 0;
|
||||
for (i = '\0'; i <= ASCII; i++) {
|
||||
for (j = 0; j < buffer_len; j++)
|
||||
if (buffer[j] == i)
|
||||
break;
|
||||
if (j == buffer_len)
|
||||
conv[ix++] = i & ASCII;
|
||||
}
|
||||
memcpy(buffer, conv, len);
|
||||
return len;
|
||||
memcpy(buffer, conv, ix);
|
||||
return ix;
|
||||
}
|
||||
|
||||
int tr_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int tr_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
int output_length = 0, input_length;
|
||||
int i;
|
||||
smalluint opts;
|
||||
ssize_t read_chars;
|
||||
size_t in_index, out_index;
|
||||
smalluint flags;
|
||||
ssize_t read_chars = 0;
|
||||
size_t in_index = 0, out_index = 0;
|
||||
unsigned last = UCHAR_MAX + 1; /* not equal to any char */
|
||||
unsigned char coded, c;
|
||||
char *str1 = xmalloc(TR_BUFSIZ);
|
||||
char *str2 = xmalloc(TR_BUFSIZ);
|
||||
int str2_length;
|
||||
int str1_length;
|
||||
char *vector = xzalloc(ASCII * 3);
|
||||
char *invec = vector + ASCII;
|
||||
char *outvec = vector + ASCII * 2;
|
||||
unsigned char *output = xmalloc(BUFSIZ);
|
||||
char *vector = xzalloc((ASCII+1) * 3);
|
||||
char *invec = vector + (ASCII+1);
|
||||
char *outvec = vector + (ASCII+1) * 2;
|
||||
|
||||
#define TR_OPT_complement (3 << 0)
|
||||
#define TR_OPT_delete (1 << 2)
|
||||
#define TR_OPT_squeeze_reps (1 << 3)
|
||||
#define TR_OPT_complement (1 << 0)
|
||||
#define TR_OPT_delete (1 << 1)
|
||||
#define TR_OPT_squeeze_reps (1 << 2)
|
||||
|
||||
for (i = 0; i < ASCII; i++) {
|
||||
flags = getopt32(argv, "+cds"); /* '+': stop at first non-option */
|
||||
argv += optind;
|
||||
|
||||
for (i = 0; i <= ASCII; i++) {
|
||||
vector[i] = i;
|
||||
/*invec[i] = outvec[i] = FALSE; - done by xzalloc */
|
||||
}
|
||||
|
||||
/* -C/-c difference is that -C complements "characters",
|
||||
* and -c complements "values" (binary bytes I guess).
|
||||
* In POSIX locale, these are the same.
|
||||
*/
|
||||
|
||||
opt_complementary = "-1";
|
||||
opts = getopt32(argv, "+Ccds"); /* '+': stop at first non-option */
|
||||
argv += optind;
|
||||
|
||||
str1_length = expand(*argv++, &str1);
|
||||
str2_length = 0;
|
||||
if (opts & TR_OPT_complement)
|
||||
str1_length = complement(str1, str1_length);
|
||||
if (*argv) {
|
||||
if (argv[0][0] == '\0')
|
||||
bb_error_msg_and_die("STRING2 cannot be empty");
|
||||
str2_length = expand(*argv, &str2);
|
||||
map(vector, str1, str1_length,
|
||||
str2, str2_length);
|
||||
#define tr_buf bb_common_bufsiz1
|
||||
if (*argv != NULL) {
|
||||
input_length = expand(*argv++, tr_buf);
|
||||
if (flags & TR_OPT_complement)
|
||||
input_length = complement(tr_buf, input_length);
|
||||
if (*argv) {
|
||||
if (argv[0][0] == '\0')
|
||||
bb_error_msg_and_die("STRING2 cannot be empty");
|
||||
output_length = expand(*argv, (char *)output);
|
||||
map(vector, (unsigned char *)tr_buf, input_length, output, output_length);
|
||||
}
|
||||
for (i = 0; i < input_length; i++)
|
||||
invec[(unsigned char)tr_buf[i]] = TRUE;
|
||||
for (i = 0; i < output_length; i++)
|
||||
outvec[output[i]] = TRUE;
|
||||
}
|
||||
for (i = 0; i < str1_length; i++)
|
||||
invec[(unsigned char)(str1[i])] = TRUE;
|
||||
for (i = 0; i < str2_length; i++)
|
||||
outvec[(unsigned char)(str2[i])] = TRUE;
|
||||
|
||||
goto start_from;
|
||||
|
||||
/* In this loop, str1 space is reused as input buffer,
|
||||
* str2 - as output one. */
|
||||
for (;;) {
|
||||
/* If we're out of input, flush output and read more input. */
|
||||
if ((ssize_t)in_index == read_chars) {
|
||||
if (out_index) {
|
||||
xwrite(STDOUT_FILENO, str2, out_index);
|
||||
start_from:
|
||||
xwrite(STDOUT_FILENO, (char *)output, out_index);
|
||||
out_index = 0;
|
||||
}
|
||||
read_chars = safe_read(STDIN_FILENO, str1, TR_BUFSIZ);
|
||||
read_chars = safe_read(STDIN_FILENO, tr_buf, BUFSIZ);
|
||||
if (read_chars <= 0) {
|
||||
if (read_chars < 0)
|
||||
bb_perror_msg_and_die(bb_msg_read_error);
|
||||
break;
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
in_index = 0;
|
||||
}
|
||||
c = str1[in_index++];
|
||||
if ((opts & TR_OPT_delete) && invec[c])
|
||||
continue;
|
||||
c = tr_buf[in_index++];
|
||||
coded = vector[c];
|
||||
if ((opts & TR_OPT_squeeze_reps) && last == coded
|
||||
&& (invec[c] || outvec[coded])
|
||||
) {
|
||||
if ((flags & TR_OPT_delete) && invec[c])
|
||||
continue;
|
||||
}
|
||||
str2[out_index++] = last = coded;
|
||||
if ((flags & TR_OPT_squeeze_reps) && last == coded
|
||||
&& (invec[c] || outvec[coded]))
|
||||
continue;
|
||||
output[out_index++] = last = coded;
|
||||
}
|
||||
|
||||
/* NOTREACHED */
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
+1
-1
@@ -30,7 +30,7 @@ int tty_main(int argc, char **argv SKIP_INCLUDE_SUSv2(UNUSED_PARAM))
|
||||
|
||||
retval = 0;
|
||||
|
||||
s = xmalloc_ttyname(0);
|
||||
s = ttyname(0);
|
||||
if (s == NULL) {
|
||||
/* According to SUSv3, ttyname can fail with EBADF or ENOTTY.
|
||||
* We know the file descriptor is good, so failure means not a tty. */
|
||||
|
||||
+34
-89
@@ -9,43 +9,25 @@
|
||||
/* http://www.opengroup.org/onlinepubs/007904975/utilities/uname.html */
|
||||
|
||||
/* Option Example
|
||||
* -s, --sysname SunOS
|
||||
* -n, --nodename rocky8
|
||||
* -r, --release 4.0
|
||||
* -v, --version
|
||||
* -m, --machine sun
|
||||
* -a, --all SunOS rocky8 4.0 sun
|
||||
*
|
||||
* The default behavior is equivalent to '-s'.
|
||||
*
|
||||
* David MacKenzie <djm@gnu.ai.mit.edu>
|
||||
*
|
||||
* GNU coreutils 6.10:
|
||||
* Option: struct Example(s):
|
||||
* utsname
|
||||
* field:
|
||||
* -s, --kernel-name sysname Linux
|
||||
* -n, --nodename nodename localhost.localdomain
|
||||
* -r, --kernel-release release 2.6.29
|
||||
* -v, --kernel-version version #1 SMP Sun Jan 11 20:52:37 EST 2009
|
||||
* -m, --machine machine x86_64 i686
|
||||
* -p, --processor (none) x86_64 i686
|
||||
* -i, --hardware-platform (none) x86_64 i386
|
||||
* NB: vanilla coreutils reports "unknown" -p and -i,
|
||||
* x86_64 and i686/i386 shown above are Fedora's inventions.
|
||||
* -o, --operating-system (none) GNU/Linux
|
||||
* -a, --all: all of the above, in the order shown.
|
||||
* If -p or -i is not known, don't show them
|
||||
*/
|
||||
|
||||
/* Busyboxed by Erik Andersen
|
||||
-s, --sysname SunOS
|
||||
-n, --nodename rocky8
|
||||
-r, --release 4.0
|
||||
-v, --version
|
||||
-m, --machine sun
|
||||
-a, --all SunOS rocky8 4.0 sun
|
||||
|
||||
The default behavior is equivalent to '-s'.
|
||||
|
||||
David MacKenzie <djm@gnu.ai.mit.edu> */
|
||||
|
||||
/* Busyboxed by Erik Andersen */
|
||||
|
||||
/* Further size reductions by Glenn McGrath and Manuel Novoa III. */
|
||||
|
||||
/* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org)
|
||||
*
|
||||
* Before 2003: Glenn McGrath and Manuel Novoa III
|
||||
* Further size reductions.
|
||||
* Mar 16, 2003: Manuel Novoa III (mjn3@codepoet.org)
|
||||
* Now does proper error checking on i/o. Plus some further space savings.
|
||||
* Jan 2009:
|
||||
* Fix handling of -a to not print "unknown", add -o and -i support.
|
||||
* Now does proper error checking on i/o. Plus some further space savings.
|
||||
*/
|
||||
|
||||
#include <sys/utsname.h>
|
||||
@@ -53,60 +35,37 @@
|
||||
|
||||
typedef struct {
|
||||
struct utsname name;
|
||||
char processor[sizeof(((struct utsname*)NULL)->machine)];
|
||||
char platform[sizeof(((struct utsname*)NULL)->machine)];
|
||||
char os[sizeof("GNU/Linux")];
|
||||
char processor[8]; /* for "unknown" */
|
||||
} uname_info_t;
|
||||
|
||||
static const char options[] ALIGN1 = "snrvmpioa";
|
||||
static const char options[] ALIGN1 = "snrvmpa";
|
||||
static const unsigned short utsname_offset[] = {
|
||||
offsetof(uname_info_t, name.sysname), /* -s */
|
||||
offsetof(uname_info_t, name.nodename), /* -n */
|
||||
offsetof(uname_info_t, name.release), /* -r */
|
||||
offsetof(uname_info_t, name.version), /* -v */
|
||||
offsetof(uname_info_t, name.machine), /* -m */
|
||||
offsetof(uname_info_t, processor), /* -p */
|
||||
offsetof(uname_info_t, platform), /* -i */
|
||||
offsetof(uname_info_t, os), /* -o */
|
||||
offsetof(uname_info_t, name.sysname),
|
||||
offsetof(uname_info_t, name.nodename),
|
||||
offsetof(uname_info_t, name.release),
|
||||
offsetof(uname_info_t, name.version),
|
||||
offsetof(uname_info_t, name.machine),
|
||||
offsetof(uname_info_t, processor)
|
||||
};
|
||||
|
||||
int uname_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int uname_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
#if ENABLE_GETOPT_LONG
|
||||
static const char longopts[] ALIGN1 =
|
||||
/* name, has_arg, val */
|
||||
"all\0" No_argument "a"
|
||||
"kernel-name\0" No_argument "s"
|
||||
"nodename\0" No_argument "n"
|
||||
"kernel-release\0" No_argument "r"
|
||||
"release\0" No_argument "r"
|
||||
"kernel-version\0" No_argument "v"
|
||||
"machine\0" No_argument "m"
|
||||
"processor\0" No_argument "p"
|
||||
"hardware-platform\0" No_argument "i"
|
||||
"operating-system\0" No_argument "o"
|
||||
;
|
||||
#endif
|
||||
uname_info_t uname_info;
|
||||
#if defined(__sparc__) && defined(__linux__)
|
||||
char *fake_sparc = getenv("FAKE_SPARC");
|
||||
#endif
|
||||
const char *unknown_str = "unknown";
|
||||
const char *fmt;
|
||||
const unsigned short *delta;
|
||||
unsigned toprint;
|
||||
char toprint;
|
||||
|
||||
USE_GETOPT_LONG(applet_long_options = longopts);
|
||||
toprint = getopt32(argv, options);
|
||||
|
||||
if (argv[optind]) { /* coreutils-6.9 compat */
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
if (toprint & (1 << 8)) { /* -a => all opts on */
|
||||
toprint = (1 << 8) - 1;
|
||||
unknown_str = ""; /* -a does not print unknown fields */
|
||||
if (toprint & (1 << 6)) { /* -a => all opts on */
|
||||
toprint = 0x3f;
|
||||
}
|
||||
|
||||
if (toprint == 0) { /* no opts => -s (sysname) */
|
||||
@@ -120,30 +79,16 @@ int uname_main(int argc UNUSED_PARAM, char **argv)
|
||||
strcpy(uname_info.name.machine, "sparc");
|
||||
}
|
||||
#endif
|
||||
strcpy(uname_info.processor, unknown_str);
|
||||
strcpy(uname_info.platform, unknown_str);
|
||||
strcpy(uname_info.os, "GNU/Linux");
|
||||
#if 0
|
||||
/* Fedora does something like this */
|
||||
strcpy(uname_info.processor, uname_info.name.machine);
|
||||
strcpy(uname_info.platform, uname_info.name.machine);
|
||||
if (uname_info.platform[0] == 'i'
|
||||
&& uname_info.platform[1]
|
||||
&& uname_info.platform[2] == '8'
|
||||
&& uname_info.platform[3] == '6'
|
||||
) {
|
||||
uname_info.platform[1] = '3';
|
||||
}
|
||||
#endif
|
||||
|
||||
strcpy(uname_info.processor, "unknown");
|
||||
|
||||
delta = utsname_offset;
|
||||
fmt = " %s" + 1;
|
||||
do {
|
||||
if (toprint & 1) {
|
||||
const char *p = (char *)(&uname_info) + *delta;
|
||||
if (p[0]) {
|
||||
printf(fmt, p);
|
||||
fmt = " %s";
|
||||
/* printf would not be safe here */
|
||||
fputs((char *)(&uname_info) + *delta, stdout);
|
||||
if (toprint > 1) {
|
||||
bb_putchar(' ');
|
||||
}
|
||||
}
|
||||
++delta;
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ int uniq_main(int argc UNUSED_PARAM, char **argv)
|
||||
};
|
||||
|
||||
skip_fields = skip_chars = 0;
|
||||
max_chars = INT_MAX;
|
||||
max_chars = -1;
|
||||
|
||||
opt_complementary = "f+:s+:w+";
|
||||
opt = getopt32(argv, "cduf:s:w:", &skip_fields, &skip_chars, &max_chars);
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
#include <utmp.h>
|
||||
#include <time.h>
|
||||
|
||||
static void idle_string(char *str6, time_t t)
|
||||
{
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ int whoami_main(int argc, char **argv UNUSED_PARAM)
|
||||
bb_show_usage();
|
||||
|
||||
/* Will complain and die if username not found */
|
||||
puts(xuid2uname(geteuid()));
|
||||
puts(bb_getpwuid(NULL, -1, geteuid()));
|
||||
|
||||
return fflush(stdout);
|
||||
}
|
||||
@@ -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"
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
@@ -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};
|
||||
|
||||
+43
-46
@@ -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 <favorite feature> 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 <favorite feature>! Are the BusyBox developers willing to be paid in order to fix bugs or add in <favorite feature>? 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,
|
||||
@@ -370,7 +371,7 @@ within each applet. More build coverage testing.</p></li>
|
||||
only so much they can keep in their brains at a time. You can post a
|
||||
polite reminder after 2-3 days without offending anybody. If that doesn't
|
||||
result in a solution, please use the
|
||||
<a href="https://bugs.busybox.net/">BusyBox Bug
|
||||
<a href="http://bugs.busybox.net/">BusyBox Bug
|
||||
and Patch Tracking System</a> to submit a detailed explanation and we'll
|
||||
get to it as soon as we can.
|
||||
</p>
|
||||
@@ -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 "linux" or "asm" 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 <linux/posix_types.h> 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
|
||||
<linux/version.h> 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 "my_dev_t.h", which #includes <linux/posix_types.h>
|
||||
and <linux/version.h> 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
|
||||
<robwen at gmail.com> 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
|
||||
|
||||
@@ -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" -->
|
||||
@@ -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
|
||||
@@ -44,7 +44,7 @@ the latest development source tree for those wishing to follow BusyBox developme
|
||||
but cannot or do not wish to use Subversion (svn).
|
||||
|
||||
<ul>
|
||||
<li> Click here to <a href="http://sources.busybox.net/index.py/trunk/busybox/">browse the source tree</a>.
|
||||
<li> Click here to <a href="/cgi-bin/viewcvs.cgi/trunk/busybox/">browse the source tree</a>.
|
||||
</li>
|
||||
|
||||
<li>Anonymous <a href="subversion.html">Subversion access</a> is available.
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 © 1999-2008 Erik Andersen</a>
|
||||
<font face="arial, helvetica, sans-serif" size="-1">
|
||||
<a href="/copyright.txt">Copyright © 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>
|
||||
|
||||
@@ -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>
|
||||
@@ -60,11 +63,11 @@
|
||||
</ul>
|
||||
<b>Development</b>
|
||||
<ul>
|
||||
<li><a href="http://sources.busybox.net/index.py/trunk/busybox/">Browse Source</a></li>
|
||||
<li><a href="/cgi-bin/viewcvs.cgi/trunk/busybox/">Browse Source</a></li>
|
||||
<li><a href="subversion.html">Source Control</a></li>
|
||||
<!--li><a href="/downloads/patches/recent.html">Recent Changes</a></li-->
|
||||
<li><a href="lists.html">Mailing Lists</a></li>
|
||||
<li><a href="https://bugs.busybox.net/">Bug Tracking</a></li>
|
||||
<li><a href="http://bugs.busybox.net/">Bug Tracking</a></li>
|
||||
</ul>
|
||||
<p><b>Links</b>
|
||||
<ul>
|
||||
@@ -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">
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 70 KiB |
@@ -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
|
||||
"GPL version 2 or (at your option) later versions" 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
|
||||
"may be redistributed as per the Linux copyright" (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
|
||||
"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." 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&childpagename=US%2FLayout&cid=1115416836002&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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<h3>Mailing List Information</h3>
|
||||
BusyBox has a <a href="/lists/busybox/">mailing list</a> for discussion and
|
||||
development. You can subscribe by visiting
|
||||
<a href="http://lists.busybox.net/mailman/listinfo/busybox">this page</a>.
|
||||
<a href="http://busybox.net/mailman/listinfo/busybox">this page</a>.
|
||||
Only subscribers to the BusyBox mailing list are allowed to post
|
||||
to this list.
|
||||
|
||||
@@ -14,7 +14,7 @@ to this list.
|
||||
There is also a mailing list for <a href="/lists/busybox-cvs/">active developers</a>
|
||||
wishing to read the complete diff of each and every change to busybox -- not for the
|
||||
faint of heart. Active developers can subscribe by visiting
|
||||
<a href="http://lists.busybox.net/mailman/listinfo/busybox-cvs">this page</a>.
|
||||
<a href="http://busybox.net/mailman/listinfo/busybox-cvs">this page</a>.
|
||||
The Subversion server is the only one permtted to post to this list. And yes,
|
||||
this list name uses the word 'cvs' even though we don't use that anymore...
|
||||
|
||||
|
||||
+263
-464
@@ -1,502 +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>
|
||||
<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 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>15 April 2009 -- BusyBox 1.14.0 (unstable), BusyBox 1.13.4 (stable)</b>
|
||||
<p><a href="http://busybox.net/downloads/busybox-1.14.0.tar.bz2">BusyBox 1.14.0</a>.
|
||||
(<a href="http://sources.busybox.net/index.py/branches/busybox_1_14_stable/">svn</a>,
|
||||
<a href="http://busybox.net/downloads/fixes-1.14.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.13.4.tar.bz2">BusyBox 1.13.4</a>.
|
||||
(<a href="http://sources.busybox.net/index.py/branches/busybox_1_13_stable/">svn</a>,
|
||||
<a href="http://busybox.net/downloads/fixes-1.13.4/">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.13.4 and busybox-1.14.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
|
||||
785501 483 7036 793020 c19bc busybox.1.13.4/busybox
|
||||
788380 467 6960 795807 c249f busybox.1.14.0/busybox
|
||||
15361 0 0 15361 3c01 busybox.1.13.4/shell/hush.o
|
||||
20724 0 0 20724 50f4 busybox.1.14.0/shell/hush.o
|
||||
</pre>
|
||||
<p>Most of growth is in hush. The rest shrank a bit.
|
||||
|
||||
<p>New applets:
|
||||
<ul>
|
||||
<li>flash_eraseall: by Sebastian Andrzej Siewior (bigeasy AT linutronix.de)</li>
|
||||
<li>acpid, mkdosfs, tunctl: by Vladimir</li>
|
||||
<li>ftpd: by Adam Tkac (vonsch AT gmail.com)</li>
|
||||
<li>timeout: by Roberto Foglietta</li>
|
||||
<li>ionice: adapted from Linux kernel example by Walter Harms</li>
|
||||
<li>mkpasswd: synonym to cryptpw. mkpasswd is in Debian, OTOH cryptpw was added to busybox earlier. Trying to make both camps happy by making those two applets just aliases. They are command-line compatible</li>
|
||||
</ul>
|
||||
|
||||
<p>Changes since previous release:
|
||||
|
||||
<p>lash and msh are deprecated, please migrate to hush.
|
||||
|
||||
<p>hush had many, many fixes and features added: here documents, arithmetic evaluation, function support, and all this works on NOMMU too, safely, including 100kb-sized `command` and here documents. Here document support, arithmetic evaluation, improved ${var} operations, other fixes are by Mike Frysinger (vapier AT gentoo.org).
|
||||
|
||||
<p>Other changes:
|
||||
<ul>
|
||||
<li>libbb: unify concurrent-safe update of /etc/{passwd,group,[g]shadow}. By Tito (farmatito AT tiscali.it)</li>
|
||||
<li>libbb/sha{1,256,512}: major code shrink</li>
|
||||
<li>libbb/lineedit: make history saving/loading concurrent-safe</li>
|
||||
<li>libbb: shrink linked list ops. By xmaks AT email.cz</li>
|
||||
<li>libbb: str2sockaddr should accept [IPv6] addr without port - wget 'ftp://[::1]/file' needs that to work</li>
|
||||
<li>libbb: make bb_info_msg do atomic, unbuffered writes</li>
|
||||
<li>util-linux/volumeid: abort early on read failures. Should help with probing missing fdd's</li>
|
||||
<li>util-linux/volumeid: fix bug 249 "findfs finds the wrong partition"</li>
|
||||
<li>adduser: allow adding to group 0; don't _create_ /etc/shadow, only append data if it exists</li>
|
||||
<li>ash: fix mishandled ^C and SIGINT (several cases)</li>
|
||||
<li>ash: fix "ash -c 'exec 1>&0'" complaining that fd 0 is busy</li>
|
||||
<li>ash: fix $IFS handling in read. Closes bug 235</li>
|
||||
<li>ash: fix a case where we were closing wrong descriptor</li>
|
||||
<li>ash: fix bad interaction between ash -c '....&' and bash compat</li>
|
||||
<li>ash: fix miscalculation of memory needed for eval tree. Found by Timo Teras (timo.teras AT iki.fi)</li>
|
||||
<li>ash: make dot command search current directory first, as bash does</li>
|
||||
<li>ash: printf builtin with no arguments should not exit</li>
|
||||
<li>awk: fix long field separators case. By Ian Wienand (ianw AT vmware.com)</li>
|
||||
<li>awk: in BEGIN section $0 should be "", not "0"</li>
|
||||
<li>awk: make "struct global" hack more robust wrt alignment. Closes bug 131</li>
|
||||
<li>brctl: fix compilation on 2.4.x kernels</li>
|
||||
<li>chat: treat timeout more correctly</li>
|
||||
<li>chat: recognize RECORD directive</li>
|
||||
<li>cksum, head, printenv: report errors via exitcode</li>
|
||||
<li>cpio: add -p, -0 and -L options</li>
|
||||
<li>crond, crontab: make cron directory location configurable</li>
|
||||
<li>crond: correct more of logfile to 0666 (as usual, umask allows user to remove unwanted bits)</li>
|
||||
<li>crond: put tasks in separate process groups</li>
|
||||
<li>dc: fix the "base 2" patch omission of base not being set</li>
|
||||
<li>depmod: accept and ignore -r. Linux kernel build needs this</li>
|
||||
<li>depmod: fix -b option. By timo.teras AT iki.fi</li>
|
||||
<li>udhcpc: fix a problem where we don't open listening socket fast enough</li>
|
||||
<li>udhcpc: stop filtering environment passed to the script</li>
|
||||
<li>udhcpd: disable option to have absolute lease times in lease file (that does not work with dumpleases)</li>
|
||||
<li>udhcpd: write 64-bit current time in lease file. Without it, determination of remaining lease time is unreliable</li>
|
||||
<li>udhcpd: remember hostnames of clients</li>
|
||||
<li>dumpleases: fix -a option, use recorded current time in lease file, show hostnames</li>
|
||||
<li>dnsd: fix a number of bugs. Ideas by Ming-Ching Tiew (mctiew AT yahoo.com)</li>
|
||||
<li>dpkg: better and shorter code to compare versions. Taken from "official" dpkg by Eugene T. Bordenkircher (eugebo AT gmail.com)</li>
|
||||
<li>du: fix "du /dir /dir" case</li>
|
||||
<li>env: support -uVAR=VAL</li>
|
||||
<li>expand, unexpand: fix incorrect expansion in some cases</li>
|
||||
<li>expr: a bit more robust handling of regexps with groups. Closes bug 87</li>
|
||||
<li>find: support --mindepth</li>
|
||||
<li>getty: make speed 0 mean "don't change speed", stop using non-portable way of setting speeds</li>
|
||||
<li>grep: support -z</li>
|
||||
<li>gzip: fix gzip -dc bug caused by using stale getopt state</li>
|
||||
<li>httpd: set $HOST to Host: header value. By Tobias Poschwatta (tp AT fonz.de)</li>
|
||||
<li>ifupdown: allow options to udhcpc to be configurable from .config</li>
|
||||
<li>init: do not eat last char in messages; do not print duplicate "init:" prefix to syslog</li>
|
||||
<li>init: fix a bug where on reload order of entries might be wrong</li>
|
||||
<li>init: major improvement in documentation and signal handling. Lots of nasty, but hard to trip, races are fixed</li>
|
||||
<li>init: reinstate proper handling of !ENABLE_FEATURE_USE_INITTAB</li>
|
||||
<li>init: remove wait loop on restart, it may be dangerous</li>
|
||||
<li>init: test for vt terminal with VT_OPENQRY, assume that anything else is TERM=vt102, not TERM=linux. Closes bug 195</li>
|
||||
<li>inotifyd: add x, o, and u events</li>
|
||||
<li>inotifyd: fix buffer overflow and "unreaped zombies" problem</li>
|
||||
<li>inotifyd: conserve resourses by closing unused inotify descriptors</li>
|
||||
<li>insmod/modprobe: do not pass NULL to kernel as module parameter</li>
|
||||
<li>ip: in "ip rule add from all table 1", "all" is taken as 0.0.0.0/32, whereas "any" and "default" would be 0.0.0.0/0. They must be all 0.0.0.0/0. Closes bug 57</li>
|
||||
<li>iproute: fix ipXXX utilities trying to parse their applet name as their 1st parameter</li>
|
||||
<li>klogctl: fix a problem where we don't terminate read data with '\0' and then misinterpret it</li>
|
||||
<li>ls: do not follow links with -s. Closes bug 33</li>
|
||||
<li>ls: implement -Q and -g (-g was accepted but ignored)</li>
|
||||
<li>ls: make readlink error to not disrupt output (try ls -l /proc/self/fd)</li>
|
||||
<li>man: better check for duplicated MANPATH</li>
|
||||
<li>mdev: add support for - ("dont stop here") char</li>
|
||||
<li>mdev: if /sys/class/block exists, don't scan /sys/block</li>
|
||||
<li>mdev: ignore events with "$SUBSYSTEM" == "firmware" && "$ACTION" == "remove"</li>
|
||||
<li>mdev: provide $SUBSYSTEM. By Vladimir</li>
|
||||
<li>modprobe/insmod for 2.4: support compressed modules. By Guenter (lists AT gknw.net)</li>
|
||||
<li>modprobe: rework/speedup by Timo Teras (timo.teras AT iki.fi)</li>
|
||||
<li>modutils-24: fix bad interaction of xzalloc with xrealloc_vector</li>
|
||||
<li>mount: support "-O option", stop trying to mount swap partitions, fix CIFS support</li>
|
||||
<li>mountpoint: add -n option. By Vladimir</li>
|
||||
<li>nslookup: allow usage of IPv6 addresses or hostnames for DNS server name; allow for port specification. Tested to work on uclibc svn: "nslookup google.com [::1]:5353". glibc + IPv6 address of DNS server still does not work</li>
|
||||
<li>popmaildir: fix several grave bugs with using memory past end of malloc block</li>
|
||||
<li>printf: fix 1.12.0 breakage (from %*d fix), it was misinterpreting "*"</li>
|
||||
<li>printf: make integer format strings print long long-sized values</li>
|
||||
<li>rmmod: fix bug 263 "modutils/rmmod can't remove modules with dash in name on 2.4 kernels"</li>
|
||||
<li>sendmail: document and fix usage of fd #4, fix check for helper failure</li>
|
||||
<li>sendmail: update by Vladimir</li>
|
||||
<li>seq: add -w support. By Natanael Copa</li>
|
||||
<li>seq: add support for "-s separator"</li>
|
||||
<li>stat: make stat -f show filesystem "ID:" as coreutils does</li>
|
||||
<li>sysctl: fix another corner case with "dots and slashes"</li>
|
||||
<li>sysctl: fix broken -p [file]. Closes bug 231</li>
|
||||
<li>sysctl: support recursing if name is a directory: "sysctl net.ipv4.conf". Patch by xmaks AT email.cz</li>
|
||||
<li>syslogd: make signal handling syncronous</li>
|
||||
<li>syslogd: create logfile with 0666 (affected by umask as usual), not 0600</li>
|
||||
<li>tail: fix tail +N syntax not working. Closes bug 221</li>
|
||||
<li>tar: do not change new tarfile's mode, GNU tar doesn't do it</li>
|
||||
<li>tar: support GNU tar's "base256" encoding</li>
|
||||
<li>telnetd: correctly output 0xff char</li>
|
||||
<li>telnetd: do not advertise TELNET_LFLOW, we do not support it properly</li>
|
||||
<li>tftp: when we infer local name from remote (-r [/]path/path/file), strip path. This mimics wget and is generally more intuitive</li>
|
||||
<li>timeout: fix parsing of -t NUM on MMU</li>
|
||||
<li>top: make it work again on 2.4 kernels. Closes bug 125</li>
|
||||
<li>tr: fix overflow in expand and complement, fix stop after [:class:], fix handling of ranges and [x]'s</li>
|
||||
<li>tr: support -C as synonym to -c, support [:xdigit:]</li>
|
||||
<li>traceroute: rewrite. Do not emit raw IP packets, instead send UDP or ICMP packets and rely on the kernel to form IP headers, select source IP and interface</li>
|
||||
<li>uname: add support for -i and -o, fix printing of unknown -p value with -a option, support long options</li>
|
||||
<li>unzip: fix thinko with le/be conv and size. Closes bug 129</li>
|
||||
<li>vi: fix several instances of major goof: when text grows, text[] might get reallocated! We were keeping around pointers to old place</li>
|
||||
<li>vi: speedup and code shrink. By Walter Harms</li>
|
||||
<li>wget: --post-data support. By Harald Kuthe (harald-tuxbox AT arcor.de)</li>
|
||||
<li>wget: fix --header handling, more robust EINTR detection</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<li><b>8 March 2009 -- BusyBox 1.13.3 (stable)</b>
|
||||
<p><a href="http://busybox.net/downloads/busybox-1.13.3.tar.bz2">BusyBox 1.13.3</a>.
|
||||
(<a href="http://sources.busybox.net/index.py/branches/busybox_1_13_stable/">svn</a>,
|
||||
<a href="http://busybox.net/downloads/fixes-1.13.3/">patches</a>,
|
||||
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
|
||||
|
||||
<p>1.13.3 is a bug fix release. It has fixes for awk, depmod, init, killall, mdev,
|
||||
modprobe, printf, syslogd, tar, top, unzip, wget.
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><b>31 December 2008 -- BusyBox 1.13.2 (stable), BusyBox 1.12.4 (stable)</b>
|
||||
<p><a href="http://busybox.net/downloads/busybox-1.13.2.tar.bz2">BusyBox 1.13.2</a>.
|
||||
(<a href="http://sources.busybox.net/index.py/branches/busybox_1_13_stable/">svn</a>,
|
||||
<a href="http://busybox.net/downloads/fixes-1.13.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.12.4.tar.bz2">BusyBox 1.12.4</a>.
|
||||
(<a href="http://sources.busybox.net/index.py/branches/busybox_1_12_stable/">svn</a>,
|
||||
<a href="http://busybox.net/downloads/fixes-1.12.4/">patches</a>,
|
||||
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
|
||||
|
||||
<p>Bug fix releases. 1.13.2 has fixes for crond, dc, init, ip, printf.
|
||||
1.12.4 has fixes for ip and printf.
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><b>29 November 2008 -- BusyBox 1.13.1 (stable), BusyBox 1.12.3 (stable)</b>
|
||||
<p><a href="http://busybox.net/downloads/busybox-1.13.1.tar.bz2">BusyBox 1.13.1</a>.
|
||||
(<a href="http://sources.busybox.net/index.py/branches/busybox_1_13_stable/">svn</a>,
|
||||
<a href="http://busybox.net/downloads/fixes-1.13.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.12.3.tar.bz2">BusyBox 1.12.3</a>.
|
||||
(<a href="http://sources.busybox.net/index.py/branches/busybox_1_12_stable/">svn</a>,
|
||||
<a href="http://busybox.net/downloads/fixes-1.12.3/">patches</a>,
|
||||
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
|
||||
|
||||
<p>Bug fix releases. 1.13.1 has fixes for ash, option parsing, id, init,
|
||||
inotifyd, klogd, line editing and modprobe. 1.12.3 has fixes
|
||||
for option parsing and line editing.
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><b>10 November 2008 -- BusyBox 1.13.0 (unstable), BusyBox 1.12.2 (stable)</b>
|
||||
<p><a href="http://busybox.net/downloads/busybox-1.13.0.tar.bz2">BusyBox 1.13.0</a>.
|
||||
(<a href="http://sources.busybox.net/index.py/branches/busybox_1_13_stable/">svn</a>,
|
||||
<a href="http://busybox.net/downloads/fixes-1.13.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.12.2.tar.bz2">BusyBox 1.12.2</a>.
|
||||
(<a href="http://sources.busybox.net/index.py/branches/busybox_1_12_stable/">svn</a>,
|
||||
<a href="http://busybox.net/downloads/fixes-1.12.2/">patches</a>,
|
||||
<a href="http://busybox.net/fix.html">how to add a patch</a>)</p>
|
||||
|
||||
<p>Sizes of busybox-1.12.2 and busybox-1.13.0 (with equivalent config, static uclibc build):<pre>
|
||||
text data bss dec hex filename
|
||||
778291 551 7856 786698 c010a busybox-1.12.2/busybox
|
||||
778981 551 7852 787384 c03b8 busybox-1.13.0/busybox
|
||||
800675 636 7080 808391 c55c7 busybox-1.10.4
|
||||
798392 611 6900 805903 c4c0f busybox-1.11.0
|
||||
</pre>
|
||||
|
||||
<p>New applets: blkid, devmem
|
||||
<p>New applets: inotify (Vladimir Dronnikov), man (Ivana Varekova),
|
||||
fbsplash (Michele Sanges), depmod (Bernhard Fischer)
|
||||
|
||||
<p>Changes since previous release:
|
||||
<ul>
|
||||
<li>mail applets: total overhaul. Vladimir as usual</li>
|
||||
<li>ash: fix "while kill -0 $child; do true; done" looping forever</li>
|
||||
<li>ash: fix NOEXEC mode - we were forgetting to pass environment</li>
|
||||
<li>ash: fix a bug in standalone mode (corrupted getopt state)</li>
|
||||
<li>ash: optionally support ">&file" and "&>file" redirections</li>
|
||||
<li>awk: bitwise ops cast oprands and results to unsigned long, not signed. closes bug 4774</li>
|
||||
<li>awk: fix typo in atan2 code. closes bug 5594</li>
|
||||
<li>awk: improve handling of negative numbers in bitwise ops; fix handling of octal costants</li>
|
||||
<li>awk: support hex constants</li>
|
||||
<li>basename: fix error code (again)</li>
|
||||
<li>cpio: emit TRAILER even when hard links were found. By Pascal Bellard (pascal.bellard AT ads-lu.com)</li>
|
||||
<li>crontab: do not destroy STDIN_FILENO, editor may need it (crontab -e)</li>
|
||||
<li>dc: support for bases 2 and 8, by Nate Case (ncase AT xes-inc.com)</li>
|
||||
<li>dhcpc: treat "discover...select...discover..." loop the same way as "discover...discover...discover..."</li>
|
||||
<li>dpkg: add dpkg -l PACKAGE_PATTERN. By Peter Korsgaard</li>
|
||||
<li>fbset: fix mode matching code: original code may trigger false positive.</li>
|
||||
<li>findfs: fix LUKS and FAT detection routines; do not exit if corrupted FAT fs makes us try to seek past the end</li>
|
||||
<li>grep: fix 'echo aaa | grep -o a' + ENABLE_EXTRA_COMPAT case. By Natanael Copa</li>
|
||||
<li>grep: fix EXTRA_COMPAT grep to honor -E and -i</li>
|
||||
<li>gunzip: restore mtime</li>
|
||||
<li>halt: reinstate -w even if !FEATURE_WTMP</li>
|
||||
<li>hexdump: fix SEGV in hexdump -e ""</li>
|
||||
<li>httpd: pass "Accept:" and "Accept-Language:" header to CGI scripts (Alina Friedrichsen)</li>
|
||||
<li>hush: fix environment and memory leaks</li>
|
||||
<li>hush: fix trashing of environment by local env vars: a=a; a=b cmd; - a was unset</li>
|
||||
<li>id: improve compatibility with coreutils. By Tito Ragusa</li>
|
||||
<li>inetd: fix a case when we have zero services</li>
|
||||
<li>inetd: use config parser. by Vladimir</li>
|
||||
<li>init: set stderr to NONBLOCK</li>
|
||||
<li>insmod: fix detection of open failure</li>
|
||||
<li>install: support -D</li>
|
||||
<li>ip: fix ip route rejecting dotted quads as prefix</li>
|
||||
<li>ip: route metric support (Natanael Copa)</li>
|
||||
<li>iplink: accept shorthands for "address" keyword: "ip link set address 00:11:22:33:44:55"</li>
|
||||
<li>kbd_mode: support -C TTY</li>
|
||||
<li>kill[all[5]]: accept -s SIG too. By Steve Bennett (steveb AT workware.net.au)</li>
|
||||
<li>klogd: handle many lines at once. By Steve Bennett (steveb AT workware.net.au)</li>
|
||||
<li>less: support -I to be able to search case-insensitively</li>
|
||||
<li>less: add optional line number toggle and resizing on window resize</li>
|
||||
<li>libbb: do not reject floating point strings like ".15"</li>
|
||||
<li>lineedit: fix bug 5824 "since rev 23530 fdisk and ed don't work any more"</li>
|
||||
<li>lineedit: fix problems with empty commands in history</li>
|
||||
<li>login: fix /etc/nologin handling</li>
|
||||
<li>man: fix inconsistencies in handling $MANPATH</li>
|
||||
<li>mdev: support match by major,minor. See bug 4714</li>
|
||||
<li>modprobe-small: make insmod command line compatible</li>
|
||||
<li>modprobe-small: support "blacklist" keyword in /etc/modules/MODULE_NAME</li>
|
||||
<li>modprobe: fix a segfault when modprobe is called with no arguments at all</li>
|
||||
<li>modutils/*: rewrite by Timo Teras (timo.teras AT iki.fi)</li>
|
||||
<li>mount: fix "-o parm1 -o parm2" not accumulating</li>
|
||||
<li>nmeter: 4k buffers are too small for /proc files, make them dynamically sized with 16k upper limit</li>
|
||||
<li>ping: SO_RCVBUF must be bigger than packet size, otherwise large ping packets might fail to be received</li>
|
||||
<li>route: fix for 64-bit BE machines by Seonghun Lim (wariua AT gmail.com)</li>
|
||||
<li>rpm: fix incompatibilities which prevented rpm -i foo.src.rpm</li>
|
||||
<li>runsvdir: support runsvdir-as-init</li>
|
||||
<li>setarch: do not try to use non-existent data in argv[]</li>
|
||||
<li>setfont: support -m and -C, support -m TEXTUAL_MAP (by Vladimir)</li>
|
||||
<li>setup_environment: cd $HOME regardless of clear_env value</li>
|
||||
<li>slattach: preserve speed in non-raw mode. By Matthieu Castet (matthieu.castet AT parrot.com)</li>
|
||||
<li>start_stop_daemon: accept (and ignore) -R PARAM</li>
|
||||
<li>sv: make default service dir configurable (Vladimir wants it)</li>
|
||||
<li>sysctl: fix bug 3894 (by Kryzhanovskyy Maksym)</li>
|
||||
<li>tar: fix bug 3844: non-root tar does not preserve perms</li>
|
||||
<li>telnetd: handle emacs M-DEL and IAC-NOP. by Jim Cathey (jcathey AT ciena.com)</li>
|
||||
<li>top: fix "top -d 1" (bug 5144)</li>
|
||||
<li>top: optional SMP support by Vineet Gupta (vineetg76 AT gmail.com)</li>
|
||||
<li>trylink: make messages less confusing</li>
|
||||
<li>unzip: handle "central directory". needed for OpenOffice, gmail attachment .zips etc</li>
|
||||
<li>vi: Rob's algorithm of reading and matching ESC sequences (nice work btw!)</li>
|
||||
<li>vi: deal with EOF/error on stdin and with input NULs</li>
|
||||
<li>vi: fix uninitialized last_search_pattern (bug 5794)</li>
|
||||
<li>vi: handle chars 0x80, 0x81 etc correctly</li>
|
||||
<li>volume identification: abolish /proc/partitions and /proc/cdroms scanning. It does not catch volume managers and such. Simply scan /dev/* for any block devices</li>
|
||||
<li>watchdog: WDIOC_SETTIMEOUT accepts seconds, not milliseconds</li>
|
||||
<li>watchdog: add -T option</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>
|
||||
|
||||
<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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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>
|
||||
<p>
|
||||
Bugfix-only releases for 1.11.x and 1.12.x branches.
|
||||
<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>
|
||||
|
||||
<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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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>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>
|
||||
|
||||
<p>Sizes of busybox-1.11.2 and busybox-1.12.0 (with equivalent config, static uclibc build):<pre>
|
||||
<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><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>
|
||||
|
||||
<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
|
||||
829687 617 7052 837356 cc6ec busybox-1.11.2/busybox
|
||||
822961 594 6832 830387 cabb3 busybox-1.12.0/busybox
|
||||
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: rdev (Grant Erickson), setfont, showkey (both by Vladimir)
|
||||
<p>New applets: brctl, chat (by Vladimir Dronnikov <dronnikov AT gmail.com>),
|
||||
findfs, ifenslave (closes bug 115), lpd (by Vladimir Dronnikov <dronnikov AT gmail.com>),
|
||||
lpr+lpq (by Walter Harms), script (by Pascal Bellard <pascal.bellard AT ads-lu.com>),
|
||||
sendmail (Vladimir Dronnikov <dronnikov AT gmail.com>), tac, tftpd.
|
||||
|
||||
<p>Most significant changes since previous release (please report any regression):
|
||||
<ul>
|
||||
<li>ash: bash compat: "shift $BIGNUM" is equivalent to "shift 1"</li>
|
||||
<li>ash: dont allow e.g. exec <&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>&- from closing fd used for script reading</li>
|
||||
<li>ash: teach ash about 123>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>Made NOMMU-compatible: crond, crontab, ifupdown, inetd, init, runsv, svlogd, tcpsvd, udpsvd.
|
||||
|
||||
<p>Other changes:
|
||||
<p>Changes since previous release:
|
||||
<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 && 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>globally: add -Wunused-parameter
|
||||
<li>globally: add optimization barrier to all "G trick" locations
|
||||
<li>adduser/addgroup: check username for invalid chars (by Tito <farmatito AT tiscali.it>)
|
||||
<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>/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 <roy at marples.name>)
|
||||
<li>fsck_minix: fix bug in map_block2: s/(blknr >= 256 * 256)/(blknr < 256 * 256)/
|
||||
<li>fuser: substantial rewrite
|
||||
<li>getopt: add support for "a+" specifier for nonnegative int parameters. By Vladimir Dronnikov <dronnikov at gmail.com>
|
||||
<li>getty: don't try to detect parity on local lines (Joakim Tjernlund <Joakim.Tjernlund at transmode.se>)
|
||||
<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 <jacmet AT uclibc.org>)
|
||||
<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 <eugebo AT gmail.com>)
|
||||
<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], [/], <enter search pattern>, [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 <farmatito AT tiscali.it>
|
||||
<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 <timo.teras at iki.fi>)
|
||||
<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 <cristian.ionescu-idbohrn at axis.com>)
|
||||
<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 <mailinglist.cache at gmail.com>
|
||||
<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 <roberto.gordo AT gmail.com>
|
||||
<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 <Ralf.Friedl AT online.de>)
|
||||
<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 <natanael.copa at gmail.com>
|
||||
<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 <cristian.ionescu-idbohrn AT axis.com>)
|
||||
<li>udhcpc: fix wrong options in decline and release packets (Jonas Danielsson <jonas.danielsson AT axis.com>)
|
||||
<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 <pascal.bellard AT ads-lu.com>
|
||||
<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><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://sources.busybox.net/index.py/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>21 March 2008 -- BusyBox old stable releases</b>
|
||||
<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.
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li><b>11 July 2008 -- HOWTO is updated</b>
|
||||
Bugfix-only releases for four past branches. Links to locations
|
||||
for future hot patches are in parentheses.
|
||||
<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.
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
<li><b>Old News</b><p>
|
||||
Click here to read <a href="oldnews.html">older news</a>
|
||||
<li><b>Old News</b><p>
|
||||
<a href="/oldnews.html">Click here to read older news</a>
|
||||
</p>
|
||||
</li>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
+87
-362
@@ -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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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 <dronnikov AT gmail.com>),
|
||||
findfs, ifenslave (closes bug 115), lpd (by Vladimir Dronnikov <dronnikov AT gmail.com>),
|
||||
lpr+lpq (by Walter Harms), script (by Pascal Bellard <pascal.bellard AT ads-lu.com>),
|
||||
sendmail (Vladimir Dronnikov <dronnikov AT gmail.com>), 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 <farmatito AT tiscali.it>)</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>/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 <roy at marples.name>)</li>
|
||||
<li>fsck_minix: fix bug in map_block2: s/(blknr >= 256 * 256)/(blknr < 256 * 256)/</li>
|
||||
<li>fuser: substantial rewrite</li>
|
||||
<li>getopt: add support for "a+" specifier for nonnegative int parameters. By Vladimir Dronnikov <dronnikov at gmail.com></li>
|
||||
<li>getty: don't try to detect parity on local lines (Joakim Tjernlund <Joakim.Tjernlund at transmode.se>)</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 <jacmet AT uclibc.org>)</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 <eugebo AT gmail.com>)</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], [/], <enter search pattern>, [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 <farmatito AT tiscali.it></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 <timo.teras at iki.fi>)</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 <cristian.ionescu-idbohrn at axis.com>)</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 <mailinglist.cache at gmail.com></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 <roberto.gordo AT gmail.com></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 <Ralf.Friedl AT online.de>)</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 <natanael.copa at gmail.com></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 <cristian.ionescu-idbohrn AT axis.com>)</li>
|
||||
<li>udhcpc: fix wrong options in decline and release packets (Jonas Danielsson <jonas.danielsson AT axis.com>)</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 <pascal.bellard AT ads-lu.com></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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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 <pascal.bellard at ads-lu.com>)
|
||||
<li>hexdump: -R option (Pascal Bellard <pascal.bellard at ads-lu.com>)
|
||||
</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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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://sources.busybox.net/index.py/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>
|
||||
|
||||
@@ -1086,7 +811,7 @@ Same .config built against static uclibc:
|
||||
several existing applets. This prerelease should be noticeably more
|
||||
<a href="http://www.opengroup.org/onlinepubs/009695399/">standards
|
||||
compliant</a> than earlier versions of busybox, although we're
|
||||
still working out the <a href="https://bugs.busybox.net">bugs</a>.</p>
|
||||
still working out the <a href="http://bugs.busybox.net">bugs</a>.</p>
|
||||
|
||||
<li><b>16 August 2005 -- 1.01 is out</b>
|
||||
|
||||
@@ -1102,7 +827,7 @@ Same .config built against static uclibc:
|
||||
in their brains at a time. In my case, I'm lucky if I can remember my own
|
||||
name, much less a bug report posted last week... To prevent your bug report
|
||||
from getting lost, if you find a bug in BusyBox, please use the
|
||||
<a href="https://bugs.busybox.net/">shiny new Bug and Patch Tracking System</a>
|
||||
<a href="http://bugs.busybox.net/">shiny new Bug and Patch Tracking System</a>
|
||||
to post all the gory details.
|
||||
|
||||
<p>
|
||||
@@ -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
|
||||
@@ -2042,7 +1767,7 @@ image</a>. Here's how you use it:
|
||||
Also, some exciting infrastructure news! Busybox now has its own
|
||||
<a href="lists/busybox/">mailing list</a>,
|
||||
publically browsable
|
||||
<a href="http://sources.busybox.net/index.py/trunk/busybox/">CVS tree</a>,
|
||||
<a href="/cgi-bin/viewcvs.cgi/trunk/busybox/">CVS tree</a>,
|
||||
anonymous
|
||||
<a href="cvs_anon.html">CVS access</a>, and
|
||||
for those that are actively contributing there is even
|
||||
|
||||
@@ -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,122 +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.dream-multimedia-tv.de/">Dreambox (Linux based PVR)</a>
|
||||
<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&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=&Section_Id=201522&pcount=&Product_Id=136493">Belkin 54g Wireless DSL/Cable Gateway Router</a>
|
||||
</li><li><a href="http://catalog.belkin.com/IWCatProductPage.process?Merchant_Id=&Section_Id=201522&pcount=&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
|
||||
@@ -142,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://opensource.actiontec.com/">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>
|
||||
with source <a href="http://128.121.226.214/gtproducts/index.html">here</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" -->
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -18,9 +18,9 @@ grab a copy of the latest version of BusyBox using anonymous svn access:
|
||||
svn co svn://busybox.net/trunk/busybox</pre>
|
||||
|
||||
<p>
|
||||
The <em>stable branches</em> can be obtained with
|
||||
The current <em>stable branch</em> can be obtained with
|
||||
<pre>
|
||||
svn co svn://busybox.net/branches/busybox_1_NN_stable
|
||||
svn co svn://busybox.net/branches/busybox_1_9_stable
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
/* A sample style sheet for displaying the Subversion directory listing
|
||||
that is generated by mod_dav_svn and "svnindex.xsl". */
|
||||
|
||||
body{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: navy;
|
||||
}
|
||||
|
||||
.header {
|
||||
padding-top: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 8em;
|
||||
padding: 0.5em 1em 0.5em;
|
||||
border: 1px solid;
|
||||
border-width: 1px 0;
|
||||
clear: both;
|
||||
border-color: rgb(30%,30%,50%) navy rgb(75%,80%,85%) navy;
|
||||
background: rgb(88%,90%,92%);
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
.svn {
|
||||
margin: 3em;
|
||||
}
|
||||
|
||||
.rev {
|
||||
margin-right: 3px;
|
||||
padding-left: 3px;
|
||||
text-align: left;
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
.dir a {
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.file a {
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.path {
|
||||
margin: 3px;
|
||||
padding: 3px;
|
||||
background: #FFCC66;
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
.updir {
|
||||
margin: 3px;
|
||||
padding: 3px;
|
||||
margin-left: 3em;
|
||||
background: #FFEEAA;
|
||||
}
|
||||
|
||||
.file {
|
||||
margin: 3px;
|
||||
padding: 3px;
|
||||
margin-left: 3em;
|
||||
background: rgb(95%,95%,95%);
|
||||
}
|
||||
|
||||
.file:hover {
|
||||
margin: 3px;
|
||||
padding: 3px;
|
||||
margin-left: 3em;
|
||||
background: rgb(100%,100%,90%);
|
||||
/* border: 1px black solid; */
|
||||
}
|
||||
|
||||
.dir {
|
||||
margin: 3px;
|
||||
padding: 3px;
|
||||
margin-left: 3em;
|
||||
background: rgb(90%,90%,90%);
|
||||
}
|
||||
|
||||
.dir:hover {
|
||||
margin: 3px;
|
||||
padding: 3px;
|
||||
margin-left: 3em;
|
||||
background: rgb(100%,100%,80%);
|
||||
/* border: 1px black solid; */
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- A sample XML transformation style sheet for displaying the Subversion
|
||||
directory listing that is generated by mod_dav_svn when the "SVNIndexXSLT"
|
||||
directive is used. -->
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<xsl:output method="html"/>
|
||||
|
||||
<xsl:template match="*"/>
|
||||
|
||||
<xsl:template match="svn">
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
<xsl:if test="string-length(index/@name) != 0">
|
||||
<xsl:value-of select="index/@name"/>
|
||||
<xsl:text>: </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="index/@path"/>
|
||||
</title>
|
||||
<link rel="stylesheet" type="text/css" href="/svnindex.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header" style="font-family: lucida, helvetica; font-size: 248%">
|
||||
<xsl:text>BUSYBOX</xsl:text>
|
||||
</div>
|
||||
<div class="header">
|
||||
<a href="http://www.busybox.net"><img src="/images/busybox1.png" border="0" /></a>
|
||||
</div>
|
||||
<div class="svn">
|
||||
<xsl:apply-templates/>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<xsl:text>Powered by </xsl:text>
|
||||
<xsl:element name="a">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="@href"/>
|
||||
</xsl:attribute>
|
||||
<xsl:text>Subversion</xsl:text>
|
||||
</xsl:element>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@version"/>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="index">
|
||||
<div class="rev">
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:if test="@base">
|
||||
<xsl:if test="@name">
|
||||
<xsl:text>:  </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="@base" />
|
||||
</xsl:if>
|
||||
<xsl:if test="@rev">
|
||||
<xsl:if test="@base | @name">
|
||||
<xsl:text> — </xsl:text>
|
||||
</xsl:if>
|
||||
<xsl:text>Revision </xsl:text>
|
||||
<xsl:value-of select="@rev"/>
|
||||
</xsl:if>
|
||||
</div>
|
||||
<div class="path">
|
||||
<xsl:value-of select="@path"/>
|
||||
</div>
|
||||
<xsl:apply-templates select="updir"/>
|
||||
<xsl:apply-templates select="dir"/>
|
||||
<xsl:apply-templates select="file"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="updir">
|
||||
<div class="updir">
|
||||
<xsl:text>[</xsl:text>
|
||||
<xsl:element name="a">
|
||||
<xsl:attribute name="href">..</xsl:attribute>
|
||||
<xsl:text>Parent Directory</xsl:text>
|
||||
</xsl:element>
|
||||
<xsl:text>]</xsl:text>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dir">
|
||||
<div class="dir">
|
||||
<xsl:element name="a">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="@href"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
</xsl:element>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="file">
|
||||
<div class="file">
|
||||
<xsl:element name="a">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="@href"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="@name"/>
|
||||
</xsl:element>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -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" -->
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
Logging and backgrounding
|
||||
|
||||
By default, bb_[p]error_msg[_and_die] messages go to stderr,
|
||||
and of course, usually applets do not auto-background. :)
|
||||
|
||||
Historically, daemons and inetd services are different.
|
||||
|
||||
Busybox is trying to provide compatible behavior, thus if an applet
|
||||
is emulating an existing utility, it should mimic it. If utility
|
||||
auto-backgrounds itself, busybox applet should do the same.
|
||||
If utility normally logs to syslog, busybox applet should do
|
||||
the same too.
|
||||
|
||||
However, busybox should not needlessly restrict the freedom
|
||||
of the users. And users have different needs and different preferences.
|
||||
Some might like logging everything from daemons to syslog.
|
||||
Others prefer running stuff under runsv/svlogd and thus would like
|
||||
logging to stderr and no daemonization.
|
||||
|
||||
To help with that, busybox applets should have options to override
|
||||
default behavior, whatever that is for a given applet.
|
||||
|
||||
|
||||
Current sutiation is a bit of a mess:
|
||||
|
||||
acpid - auto-backgrounds unless -d
|
||||
crond - auto-backgrounds unless -f, logs to syslog unless -d or -L.
|
||||
option -d logs to stderr, -L FILE logs to FILE
|
||||
devfsd - (obsolete)
|
||||
dnsd - option -d makes it background and log to syslog
|
||||
fakeidentd - inetd service. Auto-backgrounds and logs to syslog
|
||||
if no -f and no -i and no -w (-i is "inetd service" flag,
|
||||
-w is "inetd-wait service" flag)
|
||||
ftpd - inetd service. Logs to syslog with -S, with -v logs to strerr too
|
||||
httpd - auto-backgrounds unless -f or -i (-i is "inetd service" flag)
|
||||
inetd - auto-backgrounds unless -f, logs to syslog unless -e
|
||||
klogd - auto-backgrounds unless -n
|
||||
syslogd - auto-backgrounds unless -n
|
||||
telnetd - auto-backgrounds unless -f or -i (-i is "inetd service" flag)
|
||||
udhcpc - auto-backgrounds unless -f after lease is obtained,
|
||||
option -b makes it background sooner (when lease attempt
|
||||
fails and retries start),
|
||||
after backgrounding it stops logging to stderr;
|
||||
logs to stderr, but option -S makes it log *also* to syslog
|
||||
udhcpd - auto-backgrounds and do not log to stderr unless -f,
|
||||
otherwise logs to stderr, but option -S makes it log *also* to syslog
|
||||
zcip - auto-backgrounds and logs *also* to syslog unless -f
|
||||
|
||||
Total: 13 applets (+1 obsolete),
|
||||
4 log to syslog by default (crond fakeidentd inetd zcip),
|
||||
5 never log to syslog (acpid httpd telnetd klogd syslogd, last two
|
||||
- for obviously correct reasons),
|
||||
there are no daemons which always log to syslog,
|
||||
12 auto-background if not run as inetd servies (all except dnsd.
|
||||
Note that there is no "standard" dnsd AFAIKS). But see below
|
||||
for daemons (tcpsvd etc) which don't auto-background.
|
||||
|
||||
miscutils/crond.c: logmode = LOGMODE_SYSLOG;
|
||||
networking/dnsd.c: logmode = LOGMODE_SYSLOG;
|
||||
networking/ftpd.c: logmode = LOGMODE_NONE;
|
||||
networking/ftpd.c: logmode |= LOGMODE_SYSLOG;
|
||||
networking/inetd.c: logmode = LOGMODE_SYSLOG;
|
||||
networking/isrv_identd.c: logmode = LOGMODE_SYSLOG;
|
||||
networking/telnetd.c: logmode = LOGMODE_SYSLOG;
|
||||
networking/udhcp/dhcpc.c: logmode = LOGMODE_NONE;
|
||||
networking/udhcp/dhcpc.c: logmode |= LOGMODE_SYSLOG;
|
||||
networking/udhcp/dhcpc.c: logmode &= ~LOGMODE_STDIO;
|
||||
networking/udhcp/dhcpd.c: logmode = LOGMODE_NONE;
|
||||
networking/udhcp/dhcpd.c: logmode |= LOGMODE_SYSLOG;
|
||||
networking/zcip.c: logmode |= LOGMODE_SYSLOG;
|
||||
|
||||
|
||||
These daemons never auto-background and never log to syslog:
|
||||
|
||||
lpd - inetd service. Has nothing to log so far, though
|
||||
dhcprelay - standard behavior
|
||||
inotifyd - standard behavior
|
||||
runsv - standard behavior
|
||||
runsvdir - standard behavior
|
||||
svlogd - standard behavior
|
||||
tcpsvd, udpsvd - standard behavior
|
||||
tftpd - standard behavior
|
||||
|
||||
|
||||
Non-daemons (seems to be use syslog for a good reason):
|
||||
|
||||
networking/nameif.c: logmode |= LOGMODE_SYSLOG;
|
||||
loginutils/chpasswd.c: logmode = LOGMODE_BOTH;
|
||||
loginutils/chpasswd.c: logmode = LOGMODE_STDIO;
|
||||
loginutils/getty.c: logmode = LOGMODE_BOTH;
|
||||
loginutils/getty.c: logmode = LOGMODE_NONE;
|
||||
loginutils/passwd.c: logmode = LOGMODE_STDIO;
|
||||
loginutils/passwd.c: logmode = LOGMODE_BOTH;
|
||||
loginutils/sulogin.c: logmode = LOGMODE_SYSLOG; (used if stdio isn't a tty)
|
||||
loginutils/sulogin.c: logmode = LOGMODE_BOTH;
|
||||
util-linux/mount.c: logmode = LOGMODE_SYSLOG; (used in a backgrounded NFS mount helper)
|
||||
+2
-4
@@ -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
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
* Copyright (C) 1991, 1992 Linus Torvalds
|
||||
*/
|
||||
|
||||
#ifndef LINUX_EXT2_FS_H
|
||||
#define LINUX_EXT2_FS_H 1
|
||||
#ifndef _LINUX_EXT2_FS_H
|
||||
#define _LINUX_EXT2_FS_H
|
||||
|
||||
/*
|
||||
* Special inode numbers
|
||||
@@ -558,4 +558,4 @@ struct ext2_dir_entry_2 {
|
||||
#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \
|
||||
~EXT2_DIR_ROUND)
|
||||
|
||||
#endif
|
||||
#endif /* _LINUX_EXT2_FS_H */
|
||||
@@ -2,7 +2,8 @@
|
||||
/*
|
||||
* See README for additional information
|
||||
*
|
||||
* Licensed under GPLv2, see file LICENSE in this tarball for details.
|
||||
* This file can be redistributed under the terms of the GNU Library General
|
||||
* Public License
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
Loaded 100 of 558 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user