Compare commits
230
Commits
1_00_pre10
...
1_00
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9395ca4f68 | ||
|
|
9789bf1019 | ||
|
|
1aee3ff8bb | ||
|
|
0e020d1025 | ||
|
|
9315842242 | ||
|
|
62e0037d2d | ||
|
|
5c5f983faf | ||
|
|
90d3317fbf | ||
|
|
fdfa09b5c7 | ||
|
|
6c4a6b1a23 | ||
|
|
ad63cb2514 | ||
|
|
a62665b72f | ||
|
|
abf58d6ba5 | ||
|
|
751750e3ee | ||
|
|
82baf63de5 | ||
|
|
2271809d75 | ||
|
|
c00e11df85 | ||
|
|
31c27a9c65 | ||
|
|
94d628c76a | ||
|
|
07f2fea62c | ||
|
|
9e954abc4f | ||
|
|
7daa076d3e | ||
|
|
2842659cc0 | ||
|
|
d952ee2e9e | ||
|
|
f86391e7d7 | ||
|
|
ca29ffc206 | ||
|
|
bdf6319d3a | ||
|
|
53090cdedd | ||
|
|
29de86314a | ||
|
|
afc9ab8686 | ||
|
|
6f8542b98d | ||
|
|
31ec93e580 | ||
|
|
ca1c1afadc | ||
|
|
f15dfc5570 | ||
|
|
995d96a99d | ||
|
|
240a91d8a1 | ||
|
|
b6570d07c4 | ||
|
|
225be8c1f0 | ||
|
|
73ebb889da | ||
|
|
d4004ee6a9 | ||
|
|
ab1955c236 | ||
|
|
d2bd7d8dd5 | ||
|
|
e11db0ed35 | ||
|
|
e9c826f12a | ||
|
|
f91b9282a3 | ||
|
|
4a79c0e9e1 | ||
|
|
fd7a4c8c28 | ||
|
|
7b08cdd98c | ||
|
|
45a0513a64 | ||
|
|
192c35f6eb | ||
|
|
7eb79fff10 | ||
|
|
b225e2a76b | ||
|
|
785001468d | ||
|
|
75813eea23 | ||
|
|
138791050d | ||
|
|
37ba6bfb6d | ||
|
|
095dd0c46d | ||
|
|
713d6e3dd3 | ||
|
|
97a1de10e9 | ||
|
|
52499cb9ae | ||
|
|
6fea7328ee | ||
|
|
b619419962 | ||
|
|
a4d27d2d38 | ||
|
|
a9eb33ddc7 | ||
|
|
807bd846b6 | ||
|
|
a4fcccefa6 | ||
|
|
b131db4326 | ||
|
|
cb01bb1d68 | ||
|
|
9ab4657c89 | ||
|
|
b36900c4b4 | ||
|
|
85ae1bb67d | ||
|
|
e3a792c80c | ||
|
|
1f50e84283 | ||
|
|
88e38ca2fb | ||
|
|
acd647c877 | ||
|
|
0722513497 | ||
|
|
cf6ef05711 | ||
|
|
beaef16315 | ||
|
|
9940e081c9 | ||
|
|
4014ab1c60 | ||
|
|
fcf47321d4 | ||
|
|
18bbd9bf3b | ||
|
|
73db8be80a | ||
|
|
d2c6f9a1f9 | ||
|
|
65c8c7ba27 | ||
|
|
2f325a030b | ||
|
|
12ed333714 | ||
|
|
12de6cf0d7 | ||
|
|
8401eeafd6 | ||
|
|
44b5758247 | ||
|
|
93d7fba892 | ||
|
|
ec91de762a | ||
|
|
67776bef59 | ||
|
|
cbcdbc41ff | ||
|
|
b737b1a68b | ||
|
|
aad29b37a7 | ||
|
|
15b588559b | ||
|
|
e71e760a99 | ||
|
|
373bc1eaee | ||
|
|
413db4d583 | ||
|
|
27645b4345 | ||
|
|
ccfc44806d | ||
|
|
9768a65eb4 | ||
|
|
7f8bcbefc7 | ||
|
|
461cdc89a9 | ||
|
|
b2a300590d | ||
|
|
8f38782a6e | ||
|
|
53f5c0d5bf | ||
|
|
ac594257c3 | ||
|
|
882cec3e40 | ||
|
|
29128cd412 | ||
|
|
f54176de6d | ||
|
|
06e62fd5f0 | ||
|
|
380919905c | ||
|
|
4f807a84c5 | ||
|
|
5dcf15e02d | ||
|
|
7991ad1720 | ||
|
|
6caf13bc7f | ||
|
|
efc6bf6365 | ||
|
|
c0dd26f68d | ||
|
|
d250167bd2 | ||
|
|
72b14a8638 | ||
|
|
1fbc909570 | ||
|
|
2e99d43846 | ||
|
|
9c83e83628 | ||
|
|
eeb06bf230 | ||
|
|
435962327a | ||
|
|
b875631754 | ||
|
|
4d405bbc05 | ||
|
|
5529b7bb87 | ||
|
|
36a836d564 | ||
|
|
0177ce1256 | ||
|
|
e8f46515cb | ||
|
|
8539667279 | ||
|
|
469a1ead53 | ||
|
|
28939ade2d | ||
|
|
a88ae491e3 | ||
|
|
f828da0020 | ||
|
|
bd8dd1e763 | ||
|
|
809387fe9e | ||
|
|
83676f1731 | ||
|
|
a212af1ef2 | ||
|
|
24c20b1d10 | ||
|
|
ab95e3cd66 | ||
|
|
f429d511b1 | ||
|
|
197d6d45f3 | ||
|
|
c0693ed61b | ||
|
|
aea8e0eea7 | ||
|
|
98e4eab0c6 | ||
|
|
165e8cbf34 | ||
|
|
5e136f269b | ||
|
|
65659be213 | ||
|
|
f9584a19ca | ||
|
|
8f41bfc05c | ||
|
|
9615a08218 | ||
|
|
837f058fb3 | ||
|
|
449f2bca96 | ||
|
|
e8521f14a2 | ||
|
|
fe9b9cdfa5 | ||
|
|
d926149d26 | ||
|
|
0373cf1396 | ||
|
|
774e6cc29c | ||
|
|
d9670461c4 | ||
|
|
5f2a23c3c6 | ||
|
|
5275b1e49f | ||
|
|
fac312d78b | ||
|
|
e983584c70 | ||
|
|
bb692cdb32 | ||
|
|
cb3b9b1fed | ||
|
|
d943837dab | ||
|
|
4872ed9737 | ||
|
|
7f94a5caa2 | ||
|
|
36adca81f5 | ||
|
|
78a5ddeff0 | ||
|
|
ed9ecf7894 | ||
|
|
16a4c41674 | ||
|
|
3023317a91 | ||
|
|
f34b0e996b | ||
|
|
07e1ccdf75 | ||
|
|
84b6264670 | ||
|
|
58b118ae33 | ||
|
|
1ce5968443 | ||
|
|
86af052d25 | ||
|
|
2c1f1bc7f6 | ||
|
|
d709743b09 | ||
|
|
a6f6a95ba4 | ||
|
|
42f8883c71 | ||
|
|
823b17263a | ||
|
|
abc513a90f | ||
|
|
dec7f81370 | ||
|
|
ee70fa5523 | ||
|
|
0dfe4e9956 | ||
|
|
febd744d31 | ||
|
|
9855548a77 | ||
|
|
d4d01d2b9b | ||
|
|
7f164cd052 | ||
|
|
f086ed8ddd | ||
|
|
1be01072e9 | ||
|
|
84bdea8cb2 | ||
|
|
5c9323f4e6 | ||
|
|
256c4fd587 | ||
|
|
28885c3f20 | ||
|
|
309c7b71e6 | ||
|
|
91e006c1ad | ||
|
|
57f49d3185 | ||
|
|
21d7d61de1 | ||
|
|
5d2edbf16d | ||
|
|
6c0396ba2a | ||
|
|
aaff79a8dd | ||
|
|
6c8161d69f | ||
|
|
5ec58285c3 | ||
|
|
ff5309ac99 | ||
|
|
cbc453c7a2 | ||
|
|
d14084019f | ||
|
|
6f9a7783ce | ||
|
|
90d2bff4c6 | ||
|
|
edaf39156a | ||
|
|
faa3546fd7 | ||
|
|
f71ad6c9e4 | ||
|
|
51ba90ef51 | ||
|
|
c6992feee3 | ||
|
|
b94669543d | ||
|
|
faa7d863fc | ||
|
|
1219879422 | ||
|
|
c6a99b993d | ||
|
|
7ff33f1b42 | ||
|
|
b054aeb4fe | ||
|
|
73afd89610 | ||
|
|
2c2256cb8b | ||
|
|
aff114c33d |
No files matched your search
@@ -9,7 +9,7 @@ incorect, _please_ let me know.
|
||||
-----------
|
||||
|
||||
Emanuele Aina <emanuele.aina@tiscali.it>
|
||||
run-parts
|
||||
run-parts
|
||||
|
||||
Erik Andersen <andersen@codepoet.org>
|
||||
Tons of new stuff, major rewrite of most of the
|
||||
@@ -40,7 +40,7 @@ Dave Cinege <dcinege@psychosis.com>
|
||||
various fixes, Linux Router Project maintenance
|
||||
|
||||
Jordan Crouse <jordan@cosmicpenguin.net>
|
||||
ipcalc
|
||||
ipcalc
|
||||
|
||||
Magnus Damm <damm@opensource.se>
|
||||
tftp client
|
||||
@@ -56,6 +56,10 @@ Gennady Feldman <gfeldman@gena01.com>
|
||||
Sysklogd (single threaded syslogd, IPC Circular buffer support,
|
||||
logread), various fixes.
|
||||
|
||||
Robert Griebl <sandman@handhelds.org>
|
||||
modprobe, hwclock, suid/sgid handling, tinylogin integration
|
||||
many bugfixes and enhancements
|
||||
|
||||
Karl M. Hegbloom <karlheg@debian.org>
|
||||
cp_mv.c, the test suite, various fixes to utility.c, &c.
|
||||
|
||||
@@ -66,13 +70,15 @@ Matt Kraai <kraai@alumni.cmu.edu>
|
||||
documentation, bugfixes, test suite
|
||||
|
||||
Stephan Linz <linz@li-pro.net>
|
||||
ipcalc, Red Hat equivalence
|
||||
ipcalc, Red Hat equivalence
|
||||
|
||||
John Lombardo <john@deltanet.com>
|
||||
tr
|
||||
|
||||
Glenn McGrath <bug1@optushome.com.au>
|
||||
ar, dpkg, dpkg-deb
|
||||
Glenn McGrath <bug1@iinet.net.au>
|
||||
Common unarchving code and unarchiving applets, ifupdown, ftpgetput,
|
||||
nameif, sed, patch, fold, install, uudecode.
|
||||
Various bugfixes, review and apply numerous patches.
|
||||
|
||||
Manuel Novoa III <mjn3@codepoet.org>
|
||||
cat, head, mkfifo, mknod, rmdir, sleep, tee, tty, uniq, usleep, wc, yes,
|
||||
@@ -123,5 +129,5 @@ Enrique Zanardi <ezanardi@ull.es>
|
||||
tarcat (since removed), loadkmap, various fixes, Debian maintenance
|
||||
|
||||
Tito Ragusa <farmatito@tiscali.it>
|
||||
devfsd and size optimizations in strings, openvt and deallocvt.
|
||||
devfsd and size optimizations in strings, openvt, chvt, deallocvt, hdparm and fdformat.
|
||||
|
||||
@@ -22,41 +22,126 @@
|
||||
#--------------------------------------------------------------
|
||||
noconfig_targets := menuconfig config oldconfig randconfig \
|
||||
defconfig allyesconfig allnoconfig clean distclean \
|
||||
release tags
|
||||
TOPDIR=./
|
||||
include Rules.mak
|
||||
release tags
|
||||
|
||||
ifndef TOPDIR
|
||||
TOPDIR=$(CURDIR)/
|
||||
endif
|
||||
ifndef top_srcdir
|
||||
top_srcdir=$(CURDIR)
|
||||
endif
|
||||
ifndef top_builddir
|
||||
top_builddir=$(CURDIR)
|
||||
endif
|
||||
|
||||
srctree=$(top_srcdir)
|
||||
vpath %/Config.in $(srctree)
|
||||
|
||||
include $(top_builddir)/Rules.mak
|
||||
|
||||
DIRS:=applets archival archival/libunarchive coreutils console-tools \
|
||||
debianutils editors findutils init miscutils modutils networking \
|
||||
networking/libiproute networking/udhcp procps loginutils shell \
|
||||
sysklogd util-linux libpwdgrp coreutils/libcoreutils libbb
|
||||
|
||||
SRC_DIRS:=$(patsubst %,$(top_srcdir)/%,$(DIRS))
|
||||
|
||||
ifeq ($(strip $(CONFIG_SELINUX)),y)
|
||||
CFLAGS += -I/usr/include/selinux
|
||||
LIBRARIES += -lsecure
|
||||
endif
|
||||
|
||||
CONFIG_CONFIG_IN = sysdeps/$(TARGET_OS)/Config.in
|
||||
CONFIG_DEFCONFIG = sysdeps/$(TARGET_OS)/defconfig
|
||||
CONFIG_CONFIG_IN = $(top_srcdir)/sysdeps/$(TARGET_OS)/Config.in
|
||||
CONFIG_DEFCONFIG = $(top_srcdir)/sysdeps/$(TARGET_OS)/defconfig
|
||||
|
||||
ALL_DIRS:= $(DIRS) scripts/config
|
||||
ALL_MAKEFILES:=$(patsubst %,%/Makefile,$(ALL_DIRS))
|
||||
|
||||
ifeq ($(KBUILD_SRC),)
|
||||
|
||||
ifdef O
|
||||
ifeq ("$(origin O)", "command line")
|
||||
KBUILD_OUTPUT := $(O)
|
||||
endif
|
||||
endif
|
||||
|
||||
# That's our default target when none is given on the command line
|
||||
.PHONY: _all
|
||||
_all:
|
||||
|
||||
ifneq ($(KBUILD_OUTPUT),)
|
||||
# Invoke a second make in the output directory, passing relevant variables
|
||||
# check that the output directory actually exists
|
||||
saved-output := $(KBUILD_OUTPUT)
|
||||
KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
|
||||
$(if $(wildcard $(KBUILD_OUTPUT)),, \
|
||||
$(error output directory "$(saved-output)" does not exist))
|
||||
|
||||
.PHONY: $(MAKECMDGOALS)
|
||||
|
||||
$(filter-out _all,$(MAKECMDGOALS)) _all: $(KBUILD_OUTPUT)/Rules.mak $(KBUILD_OUTPUT)/Makefile
|
||||
$(MAKE) -C $(KBUILD_OUTPUT) \
|
||||
top_srcdir=$(CURDIR) \
|
||||
top_builddir=$(KBUILD_OUTPUT) \
|
||||
TOPDIR=$(KBUILD_OUTPUT) \
|
||||
KBUILD_SRC=$(CURDIR) \
|
||||
-f $(CURDIR)/Makefile $@
|
||||
|
||||
$(KBUILD_OUTPUT)/Rules.mak:
|
||||
@echo > $@
|
||||
@echo top_srcdir=$(CURDIR) >> $@
|
||||
@echo top_builddir=$(KBUILD_OUTPUT) >> $@
|
||||
@echo include $(top_srcdir)/Rules.mak >> $@
|
||||
|
||||
$(KBUILD_OUTPUT)/Makefile:
|
||||
@echo > $@
|
||||
@echo top_srcdir=$(CURDIR) >> $@
|
||||
@echo top_builddir=$(KBUILD_OUTPUT) >> $@
|
||||
@echo KBUILD_SRC='$$(top_srcdir)' >> $@
|
||||
@echo include '$$(KBUILD_SRC)'/Makefile >> $@
|
||||
|
||||
# Leave processing to above invocation of make
|
||||
skip-makefile := 1
|
||||
endif # ifneq ($(KBUILD_OUTPUT),)
|
||||
endif # ifeq ($(KBUILD_SRC),)
|
||||
|
||||
ifeq ($(skip-makefile),)
|
||||
|
||||
_all: all
|
||||
|
||||
ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
|
||||
|
||||
all: busybox busybox.links doc
|
||||
|
||||
# In this section, we need .config
|
||||
-include .config.cmd
|
||||
include $(patsubst %,%/Makefile.in, $(DIRS))
|
||||
-include $(TOPDIR).depend
|
||||
all_tree: $(ALL_MAKEFILES)
|
||||
|
||||
busybox: .depend include/config.h $(libraries-y)
|
||||
$(ALL_MAKEFILES): %/Makefile: $(top_srcdir)/%/Makefile
|
||||
d=`dirname $@`; [ -d "$$d" ] || mkdir -p "$$d"; cp $< $@
|
||||
|
||||
# In this section, we need .config
|
||||
-include $(top_builddir)/.config.cmd
|
||||
include $(patsubst %,%/Makefile.in, $(SRC_DIRS))
|
||||
-include $(top_builddir)/.depend
|
||||
|
||||
busybox: $(ALL_MAKEFILES) .depend include/config.h $(libraries-y)
|
||||
$(CC) $(LDFLAGS) -o $@ -Wl,--start-group $(libraries-y) $(LIBRARIES) -Wl,--end-group
|
||||
$(STRIPCMD) $@
|
||||
|
||||
busybox.links: applets/busybox.mkll include/config.h
|
||||
busybox.links: $(top_srcdir)/applets/busybox.mkll include/config.h $(top_srcdir)/include/applets.h
|
||||
- $(SHELL) $^ >$@
|
||||
|
||||
install: applets/install.sh busybox busybox.links
|
||||
$(SHELL) $< $(PREFIX)
|
||||
ifeq ($(strip $(CONFIG_FEATURE_SUID)),y)
|
||||
@echo
|
||||
@echo
|
||||
@echo --------------------------------------------------
|
||||
@echo You will probably need to make your busybox binary
|
||||
@echo setuid root to ensure all configured applets will
|
||||
@echo work properly.
|
||||
@echo --------------------------------------------------
|
||||
@echo
|
||||
endif
|
||||
|
||||
uninstall: busybox.links
|
||||
rm -f $(PREFIX)/bin/busybox
|
||||
@@ -65,14 +150,18 @@ uninstall: busybox.links
|
||||
install-hardlinks: applets/install.sh busybox busybox.links
|
||||
$(SHELL) $< $(PREFIX) --hardlinks
|
||||
|
||||
check: busybox
|
||||
bindir=$(top_builddir) srcdir=$(top_srcdir)/testsuite \
|
||||
$(top_srcdir)/testsuite/runtest
|
||||
|
||||
# Documentation Targets
|
||||
doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
|
||||
|
||||
docs/busybox.pod : docs/busybox_header.pod include/usage.h docs/busybox_footer.pod
|
||||
- ( cat docs/busybox_header.pod; \
|
||||
docs/autodocifier.pl include/usage.h; \
|
||||
cat docs/busybox_footer.pod ) > docs/busybox.pod
|
||||
docs/busybox.pod : $(top_srcdir)/docs/busybox_header.pod $(top_srcdir)/include/usage.h $(top_srcdir)/docs/busybox_footer.pod
|
||||
-mkdir -p docs
|
||||
- ( cat $(top_srcdir)/docs/busybox_header.pod; \
|
||||
$(top_srcdir)/docs/autodocifier.pl $(top_srcdir)/include/usage.h; \
|
||||
cat $(top_srcdir)/docs/busybox_footer.pod ) > docs/busybox.pod
|
||||
|
||||
docs/BusyBox.txt: docs/busybox.pod
|
||||
@echo
|
||||
@@ -89,7 +178,7 @@ docs/BusyBox.1: docs/busybox.pod
|
||||
docs/BusyBox.html: docs/busybox.net/BusyBox.html
|
||||
- mkdir -p docs
|
||||
-@ rm -f docs/BusyBox.html
|
||||
-@ ln -s busybox.net/BusyBox.html docs/BusyBox.html
|
||||
-@ cp docs/busybox.net/BusyBox.html docs/BusyBox.html
|
||||
|
||||
docs/busybox.net/BusyBox.html: docs/busybox.pod
|
||||
-@ mkdir -p docs/busybox.net
|
||||
@@ -98,20 +187,19 @@ docs/busybox.net/BusyBox.html: docs/busybox.pod
|
||||
-@ rm -f pod2htm*
|
||||
|
||||
# The nifty new buildsystem stuff
|
||||
scripts/mkdep: scripts/mkdep.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
|
||||
scripts/mkdep: $(top_srcdir)/scripts/mkdep.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
|
||||
|
||||
scripts/split-include: scripts/split-include.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
|
||||
scripts/split-include: $(top_srcdir)/scripts/split-include.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
|
||||
|
||||
.depend: scripts/mkdep
|
||||
rm -f .depend .hdepend;
|
||||
mkdir -p include/config;
|
||||
$(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
|
||||
scripts/mkdep -I include -- \
|
||||
`find -name \*.c -print | sed -e "s,^./,,"` >> .depend;
|
||||
`find $(top_srcdir) -name \*.c -print | sed -e "s,^./,,"` >> .depend;
|
||||
scripts/mkdep -I include -- \
|
||||
`find -name \*.h -print | sed -e "s,^./,,"` >> .hdepend;
|
||||
`find $(top_srcdir) -name \*.h -print | sed -e "s,^./,,"` >> .hdepend;
|
||||
|
||||
depend dep: include/config.h .depend
|
||||
|
||||
@@ -120,13 +208,10 @@ include/config/MARKER: depend scripts/split-include
|
||||
@ touch include/config/MARKER
|
||||
|
||||
include/config.h: .config
|
||||
@if [ ! -x ./scripts/config/conf ] ; then \
|
||||
@if [ ! -x $(top_builddir)/scripts/config/conf ] ; then \
|
||||
$(MAKE) -C scripts/config conf; \
|
||||
fi;
|
||||
@./scripts/config/conf -o $(CONFIG_CONFIG_IN)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
|
||||
@$(top_builddir)/scripts/config/conf -o $(CONFIG_CONFIG_IN)
|
||||
|
||||
finished2:
|
||||
@echo
|
||||
@@ -140,12 +225,16 @@ all: menuconfig
|
||||
# configuration
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
scripts/config/conf:
|
||||
$(ALL_MAKEFILES): %/Makefile: $(top_srcdir)/%/Makefile
|
||||
d=`dirname $@`; [ -d "$$d" ] || mkdir -p "$$d"; cp $< $@
|
||||
|
||||
scripts/config/conf: scripts/config/Makefile Rules.mak
|
||||
$(MAKE) -C scripts/config conf
|
||||
-@if [ ! -f .config ] ; then \
|
||||
cp $(CONFIG_DEFCONFIG) .config; \
|
||||
fi
|
||||
scripts/config/mconf:
|
||||
|
||||
scripts/config/mconf: scripts/config/Makefile Rules.mak
|
||||
$(MAKE) -C scripts/config ncurses conf mconf
|
||||
-@if [ ! -f .config ] ; then \
|
||||
cp $(CONFIG_DEFCONFIG) .config; \
|
||||
@@ -177,16 +266,7 @@ allnoconfig: scripts/config/conf
|
||||
defconfig: scripts/config/conf
|
||||
@./scripts/config/conf -d $(CONFIG_CONFIG_IN)
|
||||
|
||||
test tests: busybox
|
||||
# Note that 'tests' is depricated. Use 'make check' instead
|
||||
# To use the nice new testsuite....
|
||||
cd tests && ./tester.sh
|
||||
|
||||
check: busybox
|
||||
cd testsuite && ./runtest
|
||||
|
||||
clean:
|
||||
- $(MAKE) -C tests clean
|
||||
- rm -f docs/busybox.dvi docs/busybox.ps \
|
||||
docs/busybox.pod docs/busybox.net/busybox.html \
|
||||
docs/busybox pod2htm* *.gdb *.elf *~ core .*config.log \
|
||||
@@ -228,7 +308,8 @@ tags:
|
||||
|
||||
endif # ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
|
||||
|
||||
endif # ifeq ($(skip-makefile),)
|
||||
|
||||
.PHONY: dummy subdirs release distclean clean config oldconfig \
|
||||
menuconfig tags check test tests depend
|
||||
|
||||
menuconfig tags check test depend buildtree
|
||||
|
||||
@@ -31,25 +31,27 @@ If you wish to install hard links, rather than symlinks, you can use
|
||||
|
||||
Supported architectures:
|
||||
|
||||
BusyBox in general will build on any architecture supported by gcc. It has
|
||||
a few specialized features added for __sparc__ and __alpha__. insmod
|
||||
functionality is currently limited to x86, ARM, SH3/4, powerpc, m68k,
|
||||
MIPS, cris, and v850e.
|
||||
BusyBox in general will build on any architecture supported by gcc.
|
||||
Kernel module loading for 2.2 and 2.4 Linux kernels is currently
|
||||
limited to ARM, CRIS, H8/300, x86, ia64, x86_64, m68k, MIPS, PowerPC,
|
||||
S390, SH3/4/5, Sparc, v850e, and x86_64 for 2.4.x kernels. For 2.6.x
|
||||
kernels, kernel module loading support should work on all architectures.
|
||||
|
||||
|
||||
Supported C Libraries:
|
||||
|
||||
glibc-2.0.x, glibc-2.1.x, glibc-2.2.x, glibc-2.3.x, uClibc. People
|
||||
are looking at newlib and diet-libc, but consider them unsupported,
|
||||
untested, or worse. Linux-libc5 is no longer supported -- you
|
||||
should probably use uClibc instead if you want a small C library.
|
||||
uClibc and glibc are supported. People have been looking at newlib and
|
||||
dietlibc, but they are currently considered unsupported, untested, or
|
||||
worse. Linux-libc5 is no longer supported -- you should probably use uClibc
|
||||
instead if you want a small C library.
|
||||
|
||||
Supported kernels:
|
||||
|
||||
Full functionality requires Linux 2.2.x or better. A large fraction of the
|
||||
code should run on just about anything. While the current code is fairly
|
||||
Linux specific, it should be fairly easy to port the majority of the code
|
||||
to, say, FreeBSD or Solaris, or Mac OS X, or even Windows (if you are into
|
||||
that sort of thing).
|
||||
to support, say, FreeBSD or Solaris, or Mac OS X, or even Windows (if you
|
||||
are into that sort of thing).
|
||||
|
||||
----------------
|
||||
|
||||
@@ -80,7 +82,7 @@ an example:
|
||||
With GNU date I get the following output:
|
||||
|
||||
$ date
|
||||
Sat Mar 27 14:19:41 MST 2004
|
||||
Fri Oct 8 14:19:41 MDT 2004
|
||||
|
||||
But when I use BusyBox date I get this instead:
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#--------------------------------------------------------
|
||||
PROG := busybox
|
||||
VERSION := 1.00-pre10
|
||||
VERSION := 1.00
|
||||
BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z")
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ LD = $(CROSS)ld
|
||||
NM = $(CROSS)nm
|
||||
STRIP = $(CROSS)strip
|
||||
CPP = $(CC) -E
|
||||
MAKEFILES = $(TOPDIR).config
|
||||
# MAKEFILES = $(top_builddir)/.config
|
||||
|
||||
# What OS are you compiling busybox for? This allows you to include
|
||||
# OS specific things, syscall overrides, etc.
|
||||
@@ -80,7 +80,7 @@ BB_SRC_DIR=
|
||||
#GCCINCDIR:=$(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
|
||||
|
||||
WARNINGS=-Wall -Wstrict-prototypes -Wshadow
|
||||
CFLAGS=-I$(TOPDIR)include
|
||||
CFLAGS=-I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)
|
||||
ARFLAGS=-r
|
||||
|
||||
#--------------------------------------------------------
|
||||
@@ -102,7 +102,7 @@ endif
|
||||
|
||||
# Pull in the user's busybox configuration
|
||||
ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
|
||||
-include $(TOPDIR).config
|
||||
-include $(top_builddir)/.config
|
||||
endif
|
||||
|
||||
# A nifty macro to make testing gcc features easier
|
||||
@@ -189,12 +189,8 @@ endif
|
||||
# have a chance of winning.
|
||||
CFLAGS += $(CFLAGS_EXTRA)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
|
||||
|
||||
.PHONY: dummy
|
||||
|
||||
|
||||
|
||||
.EXPORT_ALL_VARIABLES:
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
Busybox TODO
|
||||
|
||||
Stuff that needs to be done
|
||||
|
||||
----
|
||||
tr - missing SuS3 features in busybox 1.0pre10
|
||||
|
||||
tr doesnt support [:blank:], [:digit:] or other predefined classes, [=equiv=]
|
||||
support is also missing.
|
||||
----
|
||||
|
||||
+7
-5
@@ -17,13 +17,15 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TOPDIR:= ../
|
||||
top_srcdir=..
|
||||
top_builddir=..
|
||||
srcdir=$(top_srcdir)/applets
|
||||
APPLETS_DIR:=./
|
||||
include $(TOPDIR).config
|
||||
include $(TOPDIR)Rules.mak
|
||||
include Makefile.in
|
||||
include $(top_builddir)/Rules.mak
|
||||
include $(top_builddir)/.config
|
||||
include $(srcdir)/Makefile.in
|
||||
all: $(libraries-y)
|
||||
-include $(TOPDIR).depend
|
||||
-include $(top_builddir).depend
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a $(AR_TARGET)
|
||||
|
||||
+6
-5
@@ -19,18 +19,19 @@
|
||||
|
||||
APPLETS_AR:=applets.a
|
||||
ifndef $(APPLETS_DIR)
|
||||
APPLETS_DIR:=$(TOPDIR)applets/
|
||||
APPLETS_DIR:=$(top_builddir)/applets/
|
||||
endif
|
||||
srcdir=$(top_srcdir)/applets
|
||||
|
||||
APPLET_SRC:=applets.c busybox.c
|
||||
APPLET_OBJ:= $(patsubst %.c,$(APPLETS_DIR)%.o, $(APPLET_SRC))
|
||||
|
||||
|
||||
|
||||
libraries-y+=$(APPLETS_DIR)$(APPLETS_AR)
|
||||
|
||||
$(APPLET_OBJ): $(TOPDIR).config
|
||||
|
||||
$(APPLETS_DIR)$(APPLETS_AR): $(APPLET_OBJ)
|
||||
$(AR) -ro $@ $(APPLET_OBJ)
|
||||
|
||||
$(APPLET_OBJ): $(top_builddir)/.config
|
||||
$(APPLET_OBJ): $(APPLETS_DIR)%.o: $(srcdir)/%.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
|
||||
|
||||
+1
-1
@@ -475,7 +475,7 @@ static void parse_config_file(void)
|
||||
|
||||
/* Encountering configuration lines prior to seeing a
|
||||
* section header is treated as an error. This is how
|
||||
* the old code worked, but it may not be desireable.
|
||||
* the old code worked, but it may not be desirable.
|
||||
* We may want to simply ignore such lines in case they
|
||||
* are used in some future version of busybox. */
|
||||
if (!section) {
|
||||
|
||||
+7
-5
@@ -17,13 +17,15 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TOPDIR:= ../
|
||||
top_srcdir=..
|
||||
top_builddir=..
|
||||
ARCHIVAL_DIR:=./
|
||||
include $(TOPDIR).config
|
||||
include $(TOPDIR)Rules.mak
|
||||
include Makefile.in
|
||||
srcdir=$(top_srcdir)/archival
|
||||
include $(top_builddir)/Rules.mak
|
||||
include $(top_builddir)/.config
|
||||
include $(srcdir)/Makefile.in
|
||||
all: $(libraries-y)
|
||||
-include $(TOPDIR).depend
|
||||
-include $(top_builddir)/.depend
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a $(AR_TARGET)
|
||||
|
||||
@@ -19,8 +19,9 @@
|
||||
|
||||
ARCHIVAL_AR:=archival.a
|
||||
ifndef $(ARCHIVAL_DIR)
|
||||
ARCHIVAL_DIR:=$(TOPDIR)archival/
|
||||
ARCHIVAL_DIR:=$(top_builddir)/archival/
|
||||
endif
|
||||
srcdir=$(top_srcdir)/archival
|
||||
|
||||
ARCHIVAL-y:=
|
||||
ARCHIVAL-$(CONFIG_APT_GET) +=
|
||||
@@ -42,3 +43,6 @@ libraries-y+=$(ARCHIVAL_DIR)$(ARCHIVAL_AR)
|
||||
$(ARCHIVAL_DIR)$(ARCHIVAL_AR): $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y))
|
||||
$(AR) -ro $@ $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y))
|
||||
|
||||
$(ARCHIVAL_DIR)%.o: $(srcdir)/%.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
|
||||
|
||||
+11
-7
@@ -3,7 +3,7 @@
|
||||
* Mini ar implementation for busybox
|
||||
*
|
||||
* Copyright (C) 2000 by Glenn McGrath
|
||||
* Written by Glenn McGrath <bug1@optushome.com.au> 1 June 2000
|
||||
* Written by Glenn McGrath <bug1@iinet.net.au> 1 June 2000
|
||||
*
|
||||
* Based in part on BusyBox tar, Debian dpkg-deb and GNU ar.
|
||||
*
|
||||
@@ -50,11 +50,12 @@ static void header_verbose_list_ar(const file_header_t *file_header)
|
||||
printf("%s %d/%d%7d %s %s\n", &mode[1], file_header->uid, file_header->gid, (int) file_header->size, &mtime[4], file_header->name);
|
||||
}
|
||||
|
||||
#define AR_CTX_PRINT 1
|
||||
#define AR_CTX_LIST 2
|
||||
#define AR_CTX_EXTRACT 4
|
||||
#define AR_OPT_PRESERVE_DATE 8
|
||||
#define AR_OPT_VERBOSE 16
|
||||
#define AR_CTX_PRINT 0x01
|
||||
#define AR_CTX_LIST 0x02
|
||||
#define AR_CTX_EXTRACT 0x04
|
||||
#define AR_OPT_PRESERVE_DATE 0x08
|
||||
#define AR_OPT_VERBOSE 0x10
|
||||
#define AR_OPT_CREATE 0x20
|
||||
|
||||
extern int ar_main(int argc, char **argv)
|
||||
{
|
||||
@@ -65,7 +66,7 @@ extern int ar_main(int argc, char **argv)
|
||||
archive_handle = init_handle();
|
||||
|
||||
bb_opt_complementaly = "p~tx:t~px:x~pt";
|
||||
opt = bb_getopt_ulflags(argc, argv, "ptxov");
|
||||
opt = bb_getopt_ulflags(argc, argv, "ptxovc");
|
||||
|
||||
if ((opt & 0x80000000UL) || (optind == argc)) {
|
||||
bb_show_usage();
|
||||
@@ -86,6 +87,9 @@ extern int ar_main(int argc, char **argv)
|
||||
if (opt & AR_OPT_VERBOSE) {
|
||||
archive_handle->action_header = header_verbose_list_ar;
|
||||
}
|
||||
if (opt & AR_OPT_CREATE) {
|
||||
bb_error_msg_and_die("Archive creation not supported. Install binutils 'ar'.");
|
||||
}
|
||||
|
||||
archive_handle->src_fd = bb_xopen(argv[optind++], O_RDONLY);
|
||||
|
||||
|
||||
+3
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Modified for busybox by Glenn McGrath <bug1@optushome.com.au>
|
||||
* Modified for busybox by Glenn McGrath <bug1@iinet.net.au>
|
||||
* Added support output to stdout by Thomas Lundquist <thomasez@zelow.no>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -33,6 +33,8 @@
|
||||
int bunzip2_main(int argc, char **argv)
|
||||
{
|
||||
char *compressed_name;
|
||||
/* Note: Ignore the warning about save_name being used uninitialized.
|
||||
* That is not the case, but gcc has trouble working that out... */
|
||||
char *save_name;
|
||||
unsigned long opt;
|
||||
int status;
|
||||
|
||||
+18
-18
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Mini dpkg implementation for busybox.
|
||||
* This is not meant as a replacemnt for dpkg
|
||||
* This is not meant as a replacement for dpkg
|
||||
*
|
||||
* Written By Glenn McGrath with the help of others
|
||||
* Copyright (C) 2001 by Glenn McGrath
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Known difference between busybox dpkg and the official dpkg that i dont
|
||||
* Known difference between busybox dpkg and the official dpkg that i don't
|
||||
* consider important, its worth keeping a note of differences anyway, just to
|
||||
* make it easier to maintain.
|
||||
* - The first value for the Confflile: field isnt placed on a new line.
|
||||
@@ -86,7 +86,7 @@ common_node_t *package_hashtable[PACKAGE_HASH_PRIME + 1];
|
||||
|
||||
/* Currently it doesnt store packages that have state-status of not-installed
|
||||
* So it only really has to be the size of the maximum number of packages
|
||||
* likely to be installed at any one time, so there is a bit of leaway here */
|
||||
* likely to be installed at any one time, so there is a bit of leeway here */
|
||||
#define STATUS_HASH_PRIME 8191
|
||||
typedef struct status_node_s {
|
||||
unsigned int package:14; /* has to fit PACKAGE_HASH_PRIME */
|
||||
@@ -94,7 +94,7 @@ typedef struct status_node_s {
|
||||
} status_node_t;
|
||||
status_node_t *status_hashtable[STATUS_HASH_PRIME + 1];
|
||||
|
||||
/* Even numbers are for 'extras', like ored dependecies or null */
|
||||
/* Even numbers are for 'extras', like ored dependencies or null */
|
||||
enum edge_type_e {
|
||||
EDGE_NULL = 0,
|
||||
EDGE_PRE_DEPENDS = 1,
|
||||
@@ -148,7 +148,7 @@ void make_hash(const char *key, unsigned int *start, unsigned int *decrement, co
|
||||
for(i = 1; i < len; i++) {
|
||||
/* 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, dont want to shift data to where it has
|
||||
* to be shifted is 8, don't want to shift data to where it has
|
||||
* no effect*/
|
||||
hash_num += ((key[i] + key[i-1]) << ((key[i] * i) % 24));
|
||||
}
|
||||
@@ -392,7 +392,7 @@ int search_package_hashtable(const unsigned int name, const unsigned int version
|
||||
/*
|
||||
* This function searches through the entire package_hashtable looking
|
||||
* for a package which provides "needle". It returns the index into
|
||||
* the package_hashtable for the provining package.
|
||||
* the package_hashtable for the providing package.
|
||||
*
|
||||
* needle is the index into name_hashtable of the package we are
|
||||
* looking for.
|
||||
@@ -489,7 +489,7 @@ void add_split_dependencies(common_node_t *parent_node, const char *whole_line,
|
||||
/* Skip leading ' ' or '(' */
|
||||
version += strspn(field2, " ");
|
||||
version += strspn(version, "(");
|
||||
/* Calculate length of any operator charactors */
|
||||
/* Calculate length of any operator characters */
|
||||
offset_ch = strspn(version, "<=>");
|
||||
/* Determine operator */
|
||||
if (offset_ch > 0) {
|
||||
@@ -636,7 +636,7 @@ unsigned int get_status(const unsigned int status_node, const int num)
|
||||
for (i = 1; i < num; i++) {
|
||||
/* skip past a word */
|
||||
status_string += strcspn(status_string, " ");
|
||||
/* skip past the seperating spaces */
|
||||
/* skip past the separating spaces */
|
||||
status_string += strspn(status_string, " ");
|
||||
}
|
||||
len = strcspn(status_string, " \n\0");
|
||||
@@ -955,13 +955,13 @@ void write_status_file(deb_file_t **deb_file)
|
||||
fclose(new_status_file);
|
||||
|
||||
|
||||
/* Create a seperate backfile to dpkg */
|
||||
/* Create a separate backfile to dpkg */
|
||||
if (rename("/var/lib/dpkg/status", "/var/lib/dpkg/status.udeb.bak") == -1) {
|
||||
struct stat stat_buf;
|
||||
if (stat("/var/lib/dpkg/status", &stat_buf) == 0) {
|
||||
bb_error_msg_and_die("Couldnt create backup status file");
|
||||
}
|
||||
/* Its ok if renaming the status file fails becasue status
|
||||
/* Its ok if renaming the status file fails because status
|
||||
* file doesnt exist, maybe we are starting from scratch */
|
||||
bb_error_msg("No status file found, creating new one");
|
||||
}
|
||||
@@ -971,10 +971,10 @@ void write_status_file(deb_file_t **deb_file)
|
||||
}
|
||||
}
|
||||
|
||||
/* This function returns TRUE if the given package can statisfy a
|
||||
/* This function returns TRUE if the given package can satisfy a
|
||||
* dependency of type depend_type.
|
||||
*
|
||||
* A pre-depends is statisfied only if a package is already installed,
|
||||
* A pre-depends is satisfied only if a package is already installed,
|
||||
* which a regular depends can be satisfied by a package which we want
|
||||
* to install.
|
||||
*/
|
||||
@@ -1085,7 +1085,7 @@ int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
|
||||
for (i = 0; i < PACKAGE_HASH_PRIME; i++) {
|
||||
int status_num = 0;
|
||||
int number_of_alternatives = 0;
|
||||
const edge_t * root_of_alternatives;
|
||||
const edge_t * root_of_alternatives = NULL;
|
||||
const common_node_t *package_node = package_hashtable[i];
|
||||
|
||||
/* If the package node does not exist then this
|
||||
@@ -1118,7 +1118,7 @@ int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
/* This code is tested only for EDGE_DEPENDS, sine I
|
||||
/* This code is tested only for EDGE_DEPENDS, since I
|
||||
* have no suitable pre-depends available. There is no
|
||||
* reason that it shouldn't work though :-)
|
||||
*/
|
||||
@@ -1211,7 +1211,7 @@ char **create_list(const char *filename)
|
||||
char *line = NULL;
|
||||
int count = 0;
|
||||
|
||||
/* dont use [xw]fopen here, handle error ourself */
|
||||
/* don't use [xw]fopen here, handle error ourself */
|
||||
list_stream = fopen(filename, "r");
|
||||
if (list_stream == NULL) {
|
||||
return(NULL);
|
||||
@@ -1385,7 +1385,7 @@ void remove_package(const unsigned int package_num, int noisy)
|
||||
bb_error_msg_and_die("script failed, prerm failure");
|
||||
}
|
||||
|
||||
/* Create a list of files to remove, and a seperate list of those to keep */
|
||||
/* Create a list of files to remove, and a separate list of those to keep */
|
||||
sprintf(list_name, "/var/lib/dpkg/info/%s.list", package_name);
|
||||
remove_files = create_list(list_name);
|
||||
|
||||
@@ -1480,7 +1480,7 @@ static void init_archive_deb_control(archive_handle_t *ar_handle)
|
||||
tar_handle = init_handle();
|
||||
tar_handle->src_fd = ar_handle->src_fd;
|
||||
|
||||
/* We dont care about data.tar.* or debian-binary, just control.tar.* */
|
||||
/* We don't care about data.tar.* or debian-binary, just control.tar.* */
|
||||
#ifdef CONFIG_FEATURE_DEB_TAR_GZ
|
||||
ar_handle->accept = llist_add_to(NULL, "control.tar.gz");
|
||||
#endif
|
||||
@@ -1502,7 +1502,7 @@ static void init_archive_deb_data(archive_handle_t *ar_handle)
|
||||
tar_handle = init_handle();
|
||||
tar_handle->src_fd = ar_handle->src_fd;
|
||||
|
||||
/* We dont care about control.tar.* or debian-binary, just data.tar.* */
|
||||
/* We don't care about control.tar.* or debian-binary, just data.tar.* */
|
||||
#ifdef CONFIG_FEATURE_DEB_TAR_GZ
|
||||
ar_handle->accept = llist_add_to(NULL, "data.tar.gz");
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
* handling.
|
||||
*
|
||||
* General cleanup to better adhere to the style guide and make use of standard
|
||||
* busybox functions by Glenn McGrath <bug1@optushome.com.au>
|
||||
* busybox functions by Glenn McGrath <bug1@iinet.net.au>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
+1
-1
@@ -632,7 +632,7 @@ static void copy_block(char *buf, unsigned len, int header)
|
||||
* However the F&G algorithm may be faster for some highly redundant
|
||||
* files if the parameter max_chain_length (described below) is too large.
|
||||
*
|
||||
* ACKNOWLEDGEMENTS
|
||||
* ACKNOWLEDGMENTS
|
||||
*
|
||||
* The idea of lazy evaluation of matches is due to Jan-Mark Wams, and
|
||||
* I found it in 'freeze' written by Leonid Broukhis.
|
||||
|
||||
@@ -17,13 +17,15 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TOPDIR:= ../../
|
||||
top_srcdir=../..
|
||||
top_builddir=../..
|
||||
srcdir=$(top_srcdir)/archival/libunarchive
|
||||
LIBUNARCHIVE_DIR:=./
|
||||
include $(TOPDIR).config
|
||||
include $(TOPDIR)Rules.mak
|
||||
include Makefile.in
|
||||
include $(top_builddir)/Rules.mak
|
||||
include $(top_builddir)/.config
|
||||
include $(srcdir)/Makefile.in
|
||||
all: $(libraries-y)
|
||||
-include $(TOPDIR).depend
|
||||
-include $(top_builddir)/.depend
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a $(AR_TARGET)
|
||||
|
||||
@@ -19,8 +19,9 @@
|
||||
|
||||
LIBUNARCHIVE_AR:=libunarchive.a
|
||||
ifndef $(LIBUNARCHIVE_DIR)
|
||||
LIBUNARCHIVE_DIR:=$(TOPDIR)archival/libunarchive/
|
||||
LIBUNARCHIVE_DIR:=$(top_builddir)/archival/libunarchive/
|
||||
endif
|
||||
srcdir=$(top_srcdir)/archvial/libunarchive
|
||||
|
||||
LIBUNARCHIVE-y:= \
|
||||
\
|
||||
@@ -78,3 +79,6 @@ libraries-y+=$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR)
|
||||
$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR): $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y))
|
||||
$(AR) -ro $@ $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y))
|
||||
|
||||
$(LIBUNARCHIVA_DIR)%.o: $(srcdir)/%.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
|
||||
|
||||
@@ -35,7 +35,7 @@ extern void data_extract_all(archive_handle_t *archive_handle)
|
||||
|
||||
if (archive_handle->flags & ARCHIVE_CREATE_LEADING_DIRS) {
|
||||
char *name = bb_xstrdup(file_header->name);
|
||||
bb_make_directory (dirname(name), 0777, FILEUTILS_RECUR);
|
||||
bb_make_directory (dirname(name), -1, FILEUTILS_RECUR);
|
||||
free(name);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ extern void data_extract_all(archive_handle_t *archive_handle)
|
||||
}
|
||||
}
|
||||
|
||||
/* Handle hard links seperately
|
||||
/* Handle hard links separately
|
||||
* We identified hard links as regular files of size 0 with a symlink */
|
||||
if (S_ISREG(file_header->mode) && (file_header->link_name) && (file_header->size == 0)) {
|
||||
/* hard link */
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/*
|
||||
Size and speed optimizations by Manuel Novoa III (mjn3@codepoet.org).
|
||||
|
||||
More efficient reading of huffman codes, a streamlined read_bunzip()
|
||||
More efficient reading of Huffman codes, a streamlined read_bunzip()
|
||||
function, and various other tweaks. In (limited) tests, approximately
|
||||
20% faster than bzcat on x86 and about 10% faster on arm.
|
||||
|
||||
@@ -49,10 +49,10 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
/* Constants for huffman coding */
|
||||
/* Constants for Huffman coding */
|
||||
#define MAX_GROUPS 6
|
||||
#define GROUP_SIZE 50 /* 64 would have been more efficient */
|
||||
#define MAX_HUFCODE_BITS 20 /* Longest huffman code allowed */
|
||||
#define MAX_HUFCODE_BITS 20 /* Longest Huffman code allowed */
|
||||
#define MAX_SYMBOLS 258 /* 256 literals + RUNA + RUNB */
|
||||
#define SYMBOL_RUNA 0
|
||||
#define SYMBOL_RUNB 1
|
||||
@@ -70,7 +70,7 @@
|
||||
/* Other housekeeping constants */
|
||||
#define IOBUF_SIZE 4096
|
||||
|
||||
/* This is what we know about each huffman coding group */
|
||||
/* This is what we know about each Huffman coding group */
|
||||
struct group_data {
|
||||
/* We have an extra slot at the end of limit[] for a sentinal value. */
|
||||
int limit[MAX_HUFCODE_BITS+1],base[MAX_HUFCODE_BITS],permute[MAX_SYMBOLS];
|
||||
@@ -92,7 +92,7 @@ typedef struct {
|
||||
unsigned int *dbuf, dbufSize;
|
||||
/* These things are a bit too big to go on the stack */
|
||||
unsigned char selectors[32768]; /* nSelectors=15 bits */
|
||||
struct group_data groups[MAX_GROUPS]; /* huffman coding tables */
|
||||
struct group_data groups[MAX_GROUPS]; /* Huffman coding tables */
|
||||
/* For I/O error handling */
|
||||
jmp_buf jmpbuf;
|
||||
} bunzip_data;
|
||||
@@ -134,6 +134,8 @@ static unsigned int get_bits(bunzip_data *bd, char bits_wanted)
|
||||
|
||||
static int get_next_block(bunzip_data *bd)
|
||||
{
|
||||
/* Note: Ignore the warning about hufGroup, base and limit being used uninitialized.
|
||||
* They will be initialized on the fist pass of the loop. */
|
||||
struct group_data *hufGroup;
|
||||
int dbufCount,nextSym,dbufSize,groupCount,*base,*limit,selector,
|
||||
i,j,k,t,runPos,symCount,symTotal,nSelectors,byteCount[256];
|
||||
@@ -172,10 +174,10 @@ static int get_next_block(bunzip_data *bd)
|
||||
if(k&(1<<(15-j))) symToByte[symTotal++]=(16*i)+j;
|
||||
}
|
||||
}
|
||||
/* How many different huffman coding groups does this block use? */
|
||||
/* How many different Huffman coding groups does this block use? */
|
||||
groupCount=get_bits(bd,3);
|
||||
if (groupCount<2 || groupCount>MAX_GROUPS) return RETVAL_DATA_ERROR;
|
||||
/* nSelectors: Every GROUP_SIZE many symbols we select a new huffman coding
|
||||
/* nSelectors: Every GROUP_SIZE many symbols we select a new Huffman coding
|
||||
group. Read in the group selector list, which is stored as MTF encoded
|
||||
bit runs. (MTF=Move To Front, as each value is used it's moved to the
|
||||
start of the list.) */
|
||||
@@ -189,13 +191,13 @@ static int get_next_block(bunzip_data *bd)
|
||||
for(;j;j--) mtfSymbol[j] = mtfSymbol[j-1];
|
||||
mtfSymbol[0]=selectors[i]=uc;
|
||||
}
|
||||
/* Read the huffman coding tables for each group, which code for symTotal
|
||||
/* Read the Huffman coding tables for each group, which code for symTotal
|
||||
literal symbols, plus two run symbols (RUNA, RUNB) */
|
||||
symCount=symTotal+2;
|
||||
for (j=0; j<groupCount; j++) {
|
||||
unsigned char length[MAX_SYMBOLS],temp[MAX_HUFCODE_BITS+1];
|
||||
int minLen, maxLen, pp;
|
||||
/* Read huffman code lengths for each symbol. They're stored in
|
||||
/* Read Huffman code lengths for each symbol. They're stored in
|
||||
a way similar to mtf; record a starting value for the first symbol,
|
||||
and an offset from the previous value for everys symbol after that.
|
||||
(Subtracting 1 before the loop and then adding it back at the end is
|
||||
@@ -228,12 +230,12 @@ static int get_next_block(bunzip_data *bd)
|
||||
}
|
||||
/* Calculate permute[], base[], and limit[] tables from length[].
|
||||
*
|
||||
* permute[] is the lookup table for converting huffman coded symbols
|
||||
* permute[] is the lookup table for converting Huffman coded symbols
|
||||
* into decoded symbols. base[] is the amount to subtract from the
|
||||
* value of a huffman symbol of a given length when using permute[].
|
||||
* value of a Huffman symbol of a given length when using permute[].
|
||||
*
|
||||
* limit[] indicates the largest numerical value a symbol with a given
|
||||
* number of bits can have. This is how the huffman codes can vary in
|
||||
* number of bits can have. This is how the Huffman codes can vary in
|
||||
* length: each code with a value>limit[length] needs another bit.
|
||||
*/
|
||||
hufGroup=bd->groups+j;
|
||||
@@ -275,7 +277,7 @@ static int get_next_block(bunzip_data *bd)
|
||||
base[minLen]=0;
|
||||
}
|
||||
/* We've finished reading and digesting the block header. Now read this
|
||||
block's huffman coded symbols from the file and undo the huffman coding
|
||||
block's Huffman coded symbols from the file and undo the Huffman coding
|
||||
and run length encoding, saving the result into dbuf[dbufCount++]=uc */
|
||||
|
||||
/* Initialize symbol occurrence counters and symbol Move To Front table */
|
||||
@@ -286,7 +288,7 @@ static int get_next_block(bunzip_data *bd)
|
||||
/* Loop through compressed symbols. */
|
||||
runPos=dbufCount=symCount=selector=0;
|
||||
for(;;) {
|
||||
/* Determine which huffman coding group to use. */
|
||||
/* Determine which Huffman coding group to use. */
|
||||
if(!(symCount--)) {
|
||||
symCount=GROUP_SIZE-1;
|
||||
if(selector>=nSelectors) return RETVAL_DATA_ERROR;
|
||||
@@ -294,7 +296,7 @@ static int get_next_block(bunzip_data *bd)
|
||||
base=hufGroup->base-1;
|
||||
limit=hufGroup->limit-1;
|
||||
}
|
||||
/* Read next huffman-coded symbol. */
|
||||
/* Read next Huffman-coded symbol. */
|
||||
/* Note: It is far cheaper to read maxLen bits and back up than it is
|
||||
to read minLen bits and then an additional bit at a time, testing
|
||||
as we go. Because there is a trailing last block (with file CRC),
|
||||
@@ -383,7 +385,7 @@ got_huff_bits:
|
||||
byteCount[uc]++;
|
||||
dbuf[dbufCount++] = (unsigned int)uc;
|
||||
}
|
||||
/* At this point, we've read all the huffman-coded symbols (and repeated
|
||||
/* At this point, we've read all the Huffman-coded symbols (and repeated
|
||||
runs) for this block from the input stream, and decoded them into the
|
||||
intermediate buffer. There are dbufCount many decoded bytes in dbuf[].
|
||||
Now undo the Burrows-Wheeler transform on dbuf.
|
||||
@@ -439,7 +441,7 @@ static int read_bunzip(bunzip_data *bd, char *outbuf, int len)
|
||||
|
||||
/* We will always have pending decoded data to write into the output
|
||||
buffer unless this is the very first call (in which case we haven't
|
||||
huffman-decoded a block into the intermediate buffer yet). */
|
||||
Huffman-decoded a block into the intermediate buffer yet). */
|
||||
|
||||
if (bd->writeCopies) {
|
||||
/* Inside the loop, writeCopies means extra copies (beyond 1) */
|
||||
@@ -495,7 +497,7 @@ decode_next_byte:
|
||||
}
|
||||
}
|
||||
|
||||
/* Refill the intermediate buffer by huffman-decoding next block of input */
|
||||
/* Refill the intermediate buffer by Huffman-decoding next block of input */
|
||||
/* (previous is just a convenient unused temp variable here) */
|
||||
previous=get_next_block(bd);
|
||||
if(previous) {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* Defailt input buffer size */
|
||||
/* Default input buffer size */
|
||||
#define IBUFSIZ 2048
|
||||
|
||||
/* Default output buffer size */
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* command line handling.
|
||||
*
|
||||
* General cleanup to better adhere to the style guide and make use of standard
|
||||
* busybox functions by Glenn McGrath <bug1@optushome.com.au>
|
||||
* busybox functions by Glenn McGrath <bug1@iinet.net.au>
|
||||
*
|
||||
* read_gz interface + associated hacking by Laurence Anderson
|
||||
*
|
||||
@@ -892,7 +892,7 @@ static int inflate_get_next_window(void)
|
||||
/* Doesnt get here */
|
||||
}
|
||||
|
||||
/* Initialise bytebuffer, be carefull not to overfill the buffer */
|
||||
/* Initialise bytebuffer, be careful not to overfill the buffer */
|
||||
extern void inflate_init(unsigned int bufsize)
|
||||
{
|
||||
/* Set the bytebuffer size, default is same as gunzip_wsize */
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/sysmacros.h> /* major() and minor() */
|
||||
#include "unarchive.h"
|
||||
#include "libbb.h"
|
||||
|
||||
@@ -117,6 +118,8 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
|
||||
file_header->link_name[file_header->size] = '\0';
|
||||
archive_handle->offset += file_header->size;
|
||||
file_header->size = 0; /* Stop possible seeks in future */
|
||||
} else {
|
||||
file_header->link_name = NULL;
|
||||
}
|
||||
if (nlink > 1 && !S_ISDIR(file_header->mode)) {
|
||||
if (file_header->size == 0) { /* Put file on a linked list for later */
|
||||
@@ -141,7 +144,7 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
|
||||
}
|
||||
}
|
||||
}
|
||||
file_header->device = (major << 8) | minor;
|
||||
file_header->device = makedev(major, minor);
|
||||
|
||||
if (archive_handle->filter(archive_handle) == EXIT_SUCCESS) {
|
||||
archive_handle->action_data(archive_handle);
|
||||
@@ -151,5 +154,8 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
|
||||
}
|
||||
|
||||
archive_handle->offset += file_header->size;
|
||||
|
||||
free(file_header->link_name);
|
||||
|
||||
return (EXIT_SUCCESS);
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* FIXME:
|
||||
* In privelidged mode if uname and gname map to a uid amd gid then use the
|
||||
* In privileged mode if uname and gname map to a uid and gid then use the
|
||||
* mapped value instead of the uid/gid values in tar header
|
||||
*
|
||||
* References:
|
||||
@@ -121,8 +121,8 @@ extern char get_header_tar(archive_handle_t *archive_handle)
|
||||
file_header->mtime = strtol(tar.formated.mtime, NULL, 8);
|
||||
file_header->link_name = (tar.formated.linkname[0] != '\0') ?
|
||||
bb_xstrdup(tar.formated.linkname) : NULL;
|
||||
file_header->device = (dev_t) ((strtol(tar.formated.devmajor, NULL, 8) << 8) +
|
||||
strtol(tar.formated.devminor, NULL, 8));
|
||||
file_header->device = makedev(strtol(tar.formated.devmajor, NULL, 8),
|
||||
strtol(tar.formated.devminor, NULL, 8));
|
||||
|
||||
/* Set bits 0-11 of the files mode */
|
||||
file_header->mode = 07777 & strtol(tar.formated.mode, NULL, 8);
|
||||
|
||||
+19
-20
@@ -2,11 +2,11 @@
|
||||
/*
|
||||
* Mini tar implementation for busybox
|
||||
*
|
||||
* Modifed to use common extraction code used by ar, cpio, dpkg-deb, dpkg
|
||||
* Glenn McGrath <bug1@optushome.com.au>
|
||||
* Modified to use common extraction code used by ar, cpio, dpkg-deb, dpkg
|
||||
* Glenn McGrath <bug1@iinet.net.au>
|
||||
*
|
||||
* Note, that as of BusyBox-0.43, tar has been completely rewritten from the
|
||||
* ground up. It still has remnents of the old code lying about, but it is
|
||||
* ground up. It still has remnants of the old code lying about, but it is
|
||||
* very different now (i.e., cleaner, less global variables, etc.)
|
||||
*
|
||||
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
|
||||
@@ -49,6 +49,7 @@
|
||||
#include <signal.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/sysmacros.h> /* major() and minor() */
|
||||
#include "unarchive.h"
|
||||
#include "busybox.h"
|
||||
|
||||
@@ -58,11 +59,6 @@
|
||||
# define TAR_MAGIC "ustar" /* ustar and a null */
|
||||
# define TAR_VERSION " " /* Be compatable with GNU tar format */
|
||||
|
||||
# ifndef MAJOR
|
||||
# define MAJOR(dev) (((dev)>>8)&0xff)
|
||||
# define MINOR(dev) ((dev)&0xff)
|
||||
# endif
|
||||
|
||||
static const int TAR_BLOCK_SIZE = 512;
|
||||
static const int TAR_MAGIC_LEN = 6;
|
||||
static const int TAR_VERSION_LEN = 2;
|
||||
@@ -238,9 +234,9 @@ static inline int writeTarHeader(struct TarBallInfo *tbInfo,
|
||||
TAR_MAGIC_LEN + TAR_VERSION_LEN);
|
||||
|
||||
/* Enter the user and group names (default to root if it fails) */
|
||||
if (my_getpwuid(header.uname, statbuf->st_uid) == NULL)
|
||||
if (my_getpwuid(header.uname, statbuf->st_uid, sizeof(header.uname)) == NULL)
|
||||
strcpy(header.uname, "root");
|
||||
if (my_getgrgid(header.gname, statbuf->st_gid) == NULL)
|
||||
if (my_getgrgid(header.gname, statbuf->st_gid, sizeof(header.gname)) == NULL)
|
||||
strcpy(header.gname, "root");
|
||||
|
||||
if (tbInfo->hlInfo) {
|
||||
@@ -262,15 +258,15 @@ static inline int writeTarHeader(struct TarBallInfo *tbInfo,
|
||||
} else if (S_ISCHR(statbuf->st_mode)) {
|
||||
header.typeflag = CHRTYPE;
|
||||
putOctal(header.devmajor, sizeof(header.devmajor),
|
||||
MAJOR(statbuf->st_rdev));
|
||||
major(statbuf->st_rdev));
|
||||
putOctal(header.devminor, sizeof(header.devminor),
|
||||
MINOR(statbuf->st_rdev));
|
||||
minor(statbuf->st_rdev));
|
||||
} else if (S_ISBLK(statbuf->st_mode)) {
|
||||
header.typeflag = BLKTYPE;
|
||||
putOctal(header.devmajor, sizeof(header.devmajor),
|
||||
MAJOR(statbuf->st_rdev));
|
||||
major(statbuf->st_rdev));
|
||||
putOctal(header.devminor, sizeof(header.devminor),
|
||||
MINOR(statbuf->st_rdev));
|
||||
minor(statbuf->st_rdev));
|
||||
} else if (S_ISFIFO(statbuf->st_mode)) {
|
||||
header.typeflag = FIFOTYPE;
|
||||
} else if (S_ISREG(statbuf->st_mode)) {
|
||||
@@ -477,8 +473,8 @@ static inline int writeTarFile(const int tar_fd, const int verboseFlag,
|
||||
dup2(gzipDataPipe[0], 0);
|
||||
close(gzipDataPipe[1]);
|
||||
|
||||
if (tbInfo.tarFd != 1);
|
||||
dup2(tbInfo.tarFd, 1);
|
||||
if (tbInfo.tarFd != 1)
|
||||
dup2(tbInfo.tarFd, 1);
|
||||
|
||||
close(gzipStatusPipe[0]);
|
||||
fcntl(gzipStatusPipe[1], F_SETFD, FD_CLOEXEC); /* close on exec shows sucess */
|
||||
@@ -625,7 +621,7 @@ static char get_header_tar_Z(archive_handle_t *archive_handle)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_TAR_FROM
|
||||
# define TAR_OPT_FROM_FILE (1 << (8 + TAR_OPT_FLAG_CREATE + TAR_OPT_FLAG_BZIP2))
|
||||
# define TAR_OPT_INCLUDE_FROM (1 << (8 + TAR_OPT_FLAG_CREATE + TAR_OPT_FLAG_BZIP2))
|
||||
# define TAR_OPT_EXCLUDE_FROM (1 << (8 + TAR_OPT_FLAG_CREATE + TAR_OPT_FLAG_BZIP2 + 1))
|
||||
# define TAR_OPT_STR_FROM "T:X:"
|
||||
# define TAR_OPT_FLAG_FROM 2
|
||||
@@ -675,7 +671,7 @@ static const struct option tar_long_options[] = {
|
||||
{ "bzip2", 0, NULL, 'j' },
|
||||
# endif
|
||||
# ifdef CONFIG_FEATURE_TAR_FROM
|
||||
{ "from-file", 1, NULL, 'T' },
|
||||
{ "files-from", 1, NULL, 'T' },
|
||||
{ "exclude-from", 1, NULL, 'X' },
|
||||
# endif
|
||||
# ifdef CONFIG_FEATURE_TAR_GZIP
|
||||
@@ -722,7 +718,7 @@ int tar_main(int argc, char **argv)
|
||||
&base_dir, /* Change to dir <optarg> */
|
||||
&tar_filename /* archive filename */
|
||||
#ifdef CONFIG_FEATURE_TAR_FROM
|
||||
, NULL,
|
||||
, &(tar_handle->accept),
|
||||
&(tar_handle->reject)
|
||||
#endif
|
||||
);
|
||||
@@ -787,6 +783,9 @@ int tar_main(int argc, char **argv)
|
||||
if(opt & TAR_OPT_EXCLUDE_FROM) {
|
||||
tar_handle->reject = append_file_list_to_list(tar_handle->reject);
|
||||
}
|
||||
if(opt & TAR_OPT_INCLUDE_FROM) {
|
||||
tar_handle->accept = append_file_list_to_list(tar_handle->accept);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Check if we are reading from stdin */
|
||||
@@ -796,7 +795,7 @@ int tar_main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* Setup an array of filenames to work with */
|
||||
/* TODO: This is the same as in ar, seperate function ? */
|
||||
/* TODO: This is the same as in ar, separate function ? */
|
||||
while (optind < argc) {
|
||||
char *filename_ptr = last_char_is(argv[optind], '/');
|
||||
if (filename_ptr) {
|
||||
|
||||
+4
-1
@@ -20,7 +20,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* For reference to format see http://www.pkware.com/support/appnote.html */
|
||||
/* For reference see
|
||||
* http://www.pkware.com/products/enterprise/white_papers/appnote.txt
|
||||
* http://www.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
|
||||
*/
|
||||
|
||||
/* TODO Endian issues, exclude, should we accept input from stdin ? */
|
||||
|
||||
|
||||
@@ -17,13 +17,15 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TOPDIR:= ../
|
||||
top_srcdir=..
|
||||
top_builddir=..
|
||||
srcdir=$(top_srcdir)/console/tools
|
||||
CONSOLETOOLS_DIR:=./
|
||||
include $(TOPDIR).config
|
||||
include $(TOPDIR)Rules.mak
|
||||
include Makefile.in
|
||||
include $(top_builddir)/Rules.mak
|
||||
include $(top_builddir)/.config
|
||||
include $(srcdir)/Makefile.in
|
||||
all: $(libraries-y)
|
||||
-include $(TOPDIR).depend
|
||||
-include $(top_builddir)/.depend
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a $(AR_TARGET)
|
||||
|
||||
@@ -19,8 +19,9 @@
|
||||
|
||||
CONSOLETOOLS_AR:=console-tools.a
|
||||
ifndef $(CONSOLETOOLS_DIR)
|
||||
CONSOLETOOLS_DIR:=$(TOPDIR)console-tools/
|
||||
CONSOLETOOLS_DIR:=$(top_builddir)/console-tools/
|
||||
endif
|
||||
srcdir=$(top_srcdir)/console-tools
|
||||
|
||||
CONSOLETOOLS_DIR-y:=
|
||||
CONSOLETOOLS_DIR-$(CONFIG_CHVT) += chvt.o
|
||||
@@ -38,3 +39,6 @@ libraries-y+=$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR)
|
||||
$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR): $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y))
|
||||
$(AR) -ro $@ $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y))
|
||||
|
||||
$(CONSOLETOOLS_DIR)%.o: $(srcdir)/%.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
|
||||
|
||||
@@ -455,6 +455,13 @@ if !CONFIG_ASH && !CONFIG_HUSH && !CONFIG_LASH && !CONFIG_MSH
|
||||
and bash) have test builtin.
|
||||
endif
|
||||
|
||||
config CONFIG_FEATURE_TEST_64
|
||||
bool " Extend test to 64 bit"
|
||||
default n
|
||||
depends on CONFIG_TEST
|
||||
help
|
||||
Enable 64-bit support in test.
|
||||
|
||||
config CONFIG_TOUCH
|
||||
bool "touch"
|
||||
default n
|
||||
@@ -538,6 +545,7 @@ config CONFIG_WC
|
||||
config CONFIG_WHO
|
||||
bool "who"
|
||||
default n
|
||||
select CONFIG_FEATURE_U_W_TMP
|
||||
help
|
||||
who is used to show who is logged on.
|
||||
|
||||
|
||||
+7
-5
@@ -17,13 +17,15 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TOPDIR:= ../
|
||||
top_srcdir=..
|
||||
top_builddir=..
|
||||
srcdir=$(top_srcdir)/coreutils
|
||||
SHELLUTILS_DIR:=./
|
||||
include $(TOPDIR).config
|
||||
include $(TOPDIR)Rules.mak
|
||||
include Makefile.in
|
||||
include $(top_builddir)/Rules.mak
|
||||
include $(top_builddir)/.config
|
||||
include $(srcdir)/Makefile.in
|
||||
all: $(libraries-y)
|
||||
-include $(TOPDIR).depend
|
||||
-include $(top_builddir)/.depend
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a $(AR_TARGET)
|
||||
|
||||
@@ -19,8 +19,9 @@
|
||||
|
||||
COREUTILS_AR:=coreutils.a
|
||||
ifndef $(COREUTILS_DIR)
|
||||
COREUTILS_DIR:=$(TOPDIR)coreutils/
|
||||
COREUTILS_DIR:=$(top_builddir)/coreutils/
|
||||
endif
|
||||
srcdir=$(top_srcdir)/coreutils
|
||||
|
||||
COREUTILS-y:=
|
||||
COREUTILS-$(CONFIG_BASENAME) += basename.o
|
||||
@@ -91,3 +92,7 @@ libraries-y+=$(COREUTILS_DIR)$(COREUTILS_AR)
|
||||
|
||||
$(COREUTILS_DIR)$(COREUTILS_AR): $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y))
|
||||
$(AR) -ro $@ $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y))
|
||||
|
||||
$(COREUTILS_DIR)%.o: $(srcdir)/%.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ static const char sep1752[] = {
|
||||
|
||||
static int julian;
|
||||
|
||||
/* leap year -- account for gregorian reformation in 1752 */
|
||||
/* leap year -- account for Gregorian reformation in 1752 */
|
||||
#define leap_year(yr) \
|
||||
((yr) <= 1752 ? !((yr) % 4) : \
|
||||
(!((yr) % 4) && ((yr) % 100)) || !((yr) % 400))
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
*
|
||||
* Original version majorly reworked for SUSv3 compliance, bug fixes, and
|
||||
* size optimizations. Changes include:
|
||||
* 1) Now correctly distingusishes between errors and actual file differences.
|
||||
* 1) Now correctly distinguishes between errors and actual file differences.
|
||||
* 2) Proper handling of '-' args.
|
||||
* 3) Actual error checking of i/o.
|
||||
* 4) Accept SUSv3 -l option. Note that we use the slightly nicer gnu format
|
||||
|
||||
+2
-2
@@ -70,7 +70,7 @@ static int cmpfunc(const void *a, const void *b)
|
||||
/*
|
||||
* parse_lists() - parses a list and puts values into startpos and endpos.
|
||||
* valid list formats: N, N-, N-M, -M
|
||||
* more than one list can be seperated by commas
|
||||
* more than one list can be separated by commas
|
||||
*/
|
||||
static void parse_lists(char *lists)
|
||||
{
|
||||
@@ -79,7 +79,7 @@ static void parse_lists(char *lists)
|
||||
char *junk;
|
||||
int s = 0, e = 0;
|
||||
|
||||
/* take apart the lists, one by one (they are seperated with commas */
|
||||
/* take apart the lists, one by one (they are separated with commas */
|
||||
while ((ltok = strsep(&lists, ",")) != NULL) {
|
||||
|
||||
/* it's actually legal to pass an empty list */
|
||||
|
||||
+10
-1
@@ -42,11 +42,12 @@
|
||||
/* Input parsing code is always bulky - used heavy duty libc stuff as
|
||||
much as possible, missed out a lot of bounds checking */
|
||||
|
||||
/* Default input handling to save suprising some people */
|
||||
/* Default input handling to save surprising some people */
|
||||
|
||||
static struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
|
||||
{
|
||||
int nr;
|
||||
char *cp;
|
||||
|
||||
nr = sscanf(t_string, "%2d%2d%2d%2d%d", &(tm_time->tm_mon),
|
||||
&(tm_time->tm_mday), &(tm_time->tm_hour), &(tm_time->tm_min),
|
||||
@@ -56,6 +57,14 @@ static struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
|
||||
bb_error_msg_and_die(bb_msg_invalid_date, t_string);
|
||||
}
|
||||
|
||||
cp = strchr(t_string, '.');
|
||||
if (cp) {
|
||||
nr = sscanf(cp + 1, "%2d", &(tm_time->tm_sec));
|
||||
if (nr != 1) {
|
||||
bb_error_msg_and_die(bb_msg_invalid_date, t_string);
|
||||
}
|
||||
}
|
||||
|
||||
/* correct for century - minor Y2K problem here? */
|
||||
if (tm_time->tm_year >= 1900) {
|
||||
tm_time->tm_year -= 1900;
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@
|
||||
/* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org)
|
||||
*
|
||||
* Size reduction. Removed floating point dependency. Added error checking
|
||||
* on output. Output stats on 0-sized filesystems if specificly listed on
|
||||
* on output. Output stats on 0-sized filesystems if specifically listed on
|
||||
* the command line. Properly round *-blocks, Used, and Available quantities.
|
||||
*/
|
||||
|
||||
@@ -130,7 +130,7 @@ extern int df_main(int argc, char **argv)
|
||||
} else if (strcmp(device, "/dev/root") == 0) {
|
||||
/* Adjusts device to be the real root device,
|
||||
* or leaves device alone if it can't find it */
|
||||
if ((device = find_real_root_device_name(device)) == NULL) {
|
||||
if ((device = find_real_root_device_name()) == NULL) {
|
||||
goto SET_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,9 @@ static int convert(char *fn, int ConvType)
|
||||
c = strlen(tempFn);
|
||||
tempFn[c] = '.';
|
||||
while(1) {
|
||||
if (c >=BUFSIZ)
|
||||
/* tempFn is BUFSIZ so the last addressable spot it BUFSIZ-1.
|
||||
* The loop increments by 2. So this must check for BUFSIZ-3. */
|
||||
if (c >=BUFSIZ-3)
|
||||
bb_error_msg_and_die("unique name not found");
|
||||
/* Get some semi random stuff to try and make a
|
||||
* random filename based (and in the same dir as)
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
|
||||
/* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org)
|
||||
*
|
||||
* Because of behavioral differences, implemented configureable SUSv3
|
||||
* Because of behavioral differences, implemented configurable SUSv3
|
||||
* or 'fancy' gnu-ish behaviors. Also, reduced size and fixed bugs.
|
||||
* 1) In handling '\c' escape, the previous version only suppressed the
|
||||
* trailing newline. SUSv3 specifies _no_ output after '\c'.
|
||||
|
||||
+2
-2
@@ -34,8 +34,8 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Modified by Vladimir Oleynik <andersen@codepoet.org> (C) 2003
|
||||
* - corretion "-" option usage
|
||||
* Modified by Vladimir Oleynik <dzo@simtreas.ru> (C) 2003
|
||||
* - correct "-" option usage
|
||||
* - multiple "-u unsetenv" support
|
||||
* - GNU long option support
|
||||
* - save errno after exec failed before bb_perror_msg()
|
||||
|
||||
+11
-11
@@ -9,24 +9,24 @@
|
||||
* Copyright (c) 2000 Edward Betts <edward@debian.org>.
|
||||
* Aug 2003 Vladimir Oleynik - reduced 464 bytes.
|
||||
*
|
||||
* this program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the gnu general public license as published by
|
||||
* the free software foundation; either version 2 of the license, or
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* this program is distributed in the hope that it will be useful,
|
||||
* but without any warranty; without even the implied warranty of
|
||||
* merchantability or fitness for a particular purpose. see the gnu
|
||||
* general public license for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* you should have received a copy of the gnu general public license
|
||||
* along with this program; if not, write to the free software
|
||||
* foundation, inc., 59 temple place, suite 330, boston, ma 02111-1307 usa
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
/* This program evaluates expressions. Each token (operator, operand,
|
||||
* parenthesis) of the expression must be a seperate argument. The
|
||||
* parenthesis) of the expression must be a separate argument. The
|
||||
* parser used is a reasonably general one, though any incarnation of
|
||||
* it is language-specific. It is especially nice for expressions.
|
||||
*
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
Copyright (C) 91, 1995-2002 Free Software Foundation, Inc.
|
||||
|
||||
Modified for busybox based on coreutils v 5.0
|
||||
Copyright (C) 2003 Glenn McGrath <bug1@optushome.com.au>
|
||||
Copyright (C) 2003 Glenn McGrath <bug1@iinet.net.au>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
+84
-59
@@ -21,90 +21,115 @@
|
||||
*/
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#include "busybox.h"
|
||||
#include "pwd_.h"
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef CONFIG_SELINUX
|
||||
#include <proc_secure.h>
|
||||
#include <flask_util.h>
|
||||
#endif
|
||||
|
||||
#define JUST_USER 1
|
||||
#define JUST_GROUP 2
|
||||
#define PRINT_REAL 4
|
||||
#define NAME_NOT_NUMBER 8
|
||||
#define PRINT_REAL 1
|
||||
#define NAME_NOT_NUMBER 2
|
||||
#define JUST_USER 4
|
||||
#define JUST_GROUP 8
|
||||
|
||||
static short printf_full(unsigned int id, const char *arg, const char prefix)
|
||||
{
|
||||
const char *fmt = "%cid=%u";
|
||||
short status=EXIT_FAILURE;
|
||||
|
||||
if(arg) {
|
||||
fmt = "%cid=%u(%s)";
|
||||
status=EXIT_SUCCESS;
|
||||
}
|
||||
bb_printf(fmt, prefix, id, arg);
|
||||
return status;
|
||||
}
|
||||
|
||||
extern int id_main(int argc, char **argv)
|
||||
{
|
||||
char user[9], group[9];
|
||||
long pwnam, grnam;
|
||||
int uid, gid;
|
||||
int flags;
|
||||
struct passwd *p;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
unsigned long flags;
|
||||
short status;
|
||||
#ifdef CONFIG_SELINUX
|
||||
int is_flask_enabled_flag = is_flask_enabled();
|
||||
#endif
|
||||
|
||||
flags = bb_getopt_ulflags(argc, argv, "ugrn");
|
||||
bb_opt_complementaly = "u~g:g~u";
|
||||
flags = bb_getopt_ulflags(argc, argv, "rnug");
|
||||
|
||||
if (((flags & (JUST_USER | JUST_GROUP)) == (JUST_USER | JUST_GROUP))
|
||||
|| (argc > optind + 1)
|
||||
) {
|
||||
if ((flags & 0x80000000UL)
|
||||
/* Don't allow -n -r -nr */
|
||||
|| (flags <= 3 && flags > 0)
|
||||
/* Don't allow more than one username */
|
||||
|| (argc > optind + 1))
|
||||
bb_show_usage();
|
||||
|
||||
/* This values could be overwritten later */
|
||||
uid = geteuid();
|
||||
gid = getegid();
|
||||
if (flags & PRINT_REAL) {
|
||||
uid = getuid();
|
||||
gid = getgid();
|
||||
}
|
||||
|
||||
if(argv[optind]) {
|
||||
p=getpwnam(argv[optind]);
|
||||
/* my_getpwnam is needed because it exits on failure */
|
||||
uid = my_getpwnam(argv[optind]);
|
||||
gid = p->pw_gid;
|
||||
/* in this case PRINT_REAL is the same */
|
||||
}
|
||||
|
||||
if (argv[optind] == NULL) {
|
||||
if (flags & PRINT_REAL) {
|
||||
uid = getuid();
|
||||
gid = getgid();
|
||||
if(flags & (JUST_GROUP | JUST_USER)) {
|
||||
/* JUST_GROUP and JUST_USER are mutually exclusive */
|
||||
if(flags & NAME_NOT_NUMBER) {
|
||||
/* my_getpwuid and my_getgrgid exit on failure so puts cannot segfault */
|
||||
puts((flags & JUST_USER) ? my_getpwuid(NULL, uid, -1 ) : my_getgrgid(NULL, gid, -1 ));
|
||||
} else {
|
||||
uid = geteuid();
|
||||
gid = getegid();
|
||||
bb_printf("%u\n",(flags & JUST_USER) ? uid : gid);
|
||||
}
|
||||
my_getpwuid(user, uid);
|
||||
} else {
|
||||
safe_strncpy(user, argv[optind], sizeof(user));
|
||||
gid = my_getpwnamegid(user);
|
||||
/* exit */
|
||||
bb_fflush_stdout_and_exit(EXIT_SUCCESS);
|
||||
}
|
||||
my_getgrgid(group, gid);
|
||||
|
||||
pwnam=my_getpwnam(user);
|
||||
grnam=my_getgrnam(group);
|
||||
|
||||
if (flags & (JUST_GROUP | JUST_USER)) {
|
||||
char *s = group;
|
||||
if (flags & JUST_USER) {
|
||||
s = user;
|
||||
grnam = pwnam;
|
||||
}
|
||||
if (flags & NAME_NOT_NUMBER) {
|
||||
puts(s);
|
||||
} else {
|
||||
printf("%ld\n", grnam);
|
||||
}
|
||||
} else {
|
||||
/* Print full info like GNU id */
|
||||
/* my_getpwuid doesn't exit on failure here */
|
||||
status=printf_full(uid, my_getpwuid(NULL, uid, 0), 'u');
|
||||
putchar(' ');
|
||||
/* my_getgrgid doesn't exit on failure here */
|
||||
status|=printf_full(gid, my_getgrgid(NULL, gid, 0), 'g');
|
||||
#ifdef CONFIG_SELINUX
|
||||
printf("uid=%ld(%s) gid=%ld(%s)", pwnam, user, grnam, group);
|
||||
if(is_flask_enabled_flag)
|
||||
{
|
||||
security_id_t mysid = getsecsid();
|
||||
char context[80];
|
||||
int len = sizeof(context);
|
||||
context[0] = '\0';
|
||||
if(security_sid_to_context(mysid, context, &len))
|
||||
strcpy(context, "unknown");
|
||||
printf(" context=%s\n", context);
|
||||
}
|
||||
else
|
||||
printf("\n");
|
||||
#else
|
||||
printf("uid=%ld(%s) gid=%ld(%s)\n", pwnam, user, grnam, group);
|
||||
#endif
|
||||
|
||||
if(is_flask_enabled_flag) {
|
||||
security_id_t mysid = getsecsid();
|
||||
char context[80];
|
||||
int len = sizeof(context);
|
||||
context[0] = '\0';
|
||||
if(security_sid_to_context(mysid, context, &len))
|
||||
strcpy(context, "unknown");
|
||||
bb_printf(" context=%s", context);
|
||||
}
|
||||
|
||||
bb_fflush_stdout_and_exit(0);
|
||||
#endif
|
||||
putchar('\n');
|
||||
bb_fflush_stdout_and_exit(status);
|
||||
}
|
||||
|
||||
/* END CODE */
|
||||
/*
|
||||
Local Variables:
|
||||
c-file-style: "linux"
|
||||
c-basic-offset: 4
|
||||
tab-width: 4
|
||||
End:
|
||||
*/
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2003 by Glenn McGrath <bug1@optushome.com.au>
|
||||
* Copyright (C) 2003 by Glenn McGrath <bug1@iinet.net.au>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -17,13 +17,16 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TOPDIR:= ../../
|
||||
top_srcdir=../..
|
||||
top_builddir=../..
|
||||
srcdir=$(top_srcdir)/coreutils/libcoreutils
|
||||
LIBCOREUTILS_DIR:=./
|
||||
include $(TOPDIR).config
|
||||
include $(TOPDIR)Rules.mak
|
||||
include Makefile.in
|
||||
include $(top_builddir)/Rules.mak
|
||||
include $(top_builddir)/.config
|
||||
include $(srcdir)/Makefile.in
|
||||
|
||||
all: $(libraries-y)
|
||||
-include $(TOPDIR).depend
|
||||
-include $(top_builddir)/.depend
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a $(AR_TARGET)
|
||||
|
||||
@@ -19,8 +19,9 @@
|
||||
|
||||
LIBCOREUTILS_AR:=libcoreutils.a
|
||||
ifndef $(LIBCOREUTILS_DIR)
|
||||
LIBCOREUTILS_DIR:=$(TOPDIR)coreutils/libcoreutils/
|
||||
LIBCOREUTILS_DIR:=$(top_builddir)/coreutils/libcoreutils/
|
||||
endif
|
||||
srcdir=$(top_srcdir)/coreutils/libcoreutils
|
||||
|
||||
LIBCOREUTILS_SRC:= cp_mv_stat.c getopt_mk_fifo_nod.c xgetoptfile_sort_uniq.c
|
||||
|
||||
@@ -30,3 +31,7 @@ libraries-y+=$(LIBCOREUTILS_DIR)$(LIBCOREUTILS_AR)
|
||||
|
||||
$(LIBCOREUTILS_DIR)$(LIBCOREUTILS_AR): $(LIBCOREUTILS_OBJS)
|
||||
$(AR) -ro $@ $(LIBCOREUTILS_OBJS)
|
||||
|
||||
$(LIBCOREUTILS_DIR)%.o: $(srcdir)/%.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@
|
||||
* is _not_ the same. Erik apparently made this change almost 3 years
|
||||
* ago to avoid failing when no utmp was available. However, the
|
||||
* correct course of action wrt SUSv3 for a failing getlogin() is
|
||||
* a dianostic message and an error return.
|
||||
* a diagnostic message and an error return.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
+6
-10
@@ -61,6 +61,7 @@ enum {
|
||||
#include <signal.h>
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/sysmacros.h> /* major() and minor() */
|
||||
#include "busybox.h"
|
||||
#ifdef CONFIG_SELINUX
|
||||
#include <fs_secure.h>
|
||||
@@ -72,11 +73,6 @@ enum {
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#ifndef MAJOR
|
||||
#define MAJOR(dev) (((dev)>>8)&0xff)
|
||||
#define MINOR(dev) ((dev)&0xff)
|
||||
#endif
|
||||
|
||||
/* what is the overall style of the listing */
|
||||
#define STYLE_AUTO (0)
|
||||
#define STYLE_COLUMNS (1U<<21) /* fill columns */
|
||||
@@ -687,9 +683,9 @@ static int list_single(struct dnode *dn)
|
||||
break;
|
||||
case LIST_ID_NAME:
|
||||
#ifdef CONFIG_FEATURE_LS_USERNAME
|
||||
my_getpwuid(scratch, dn->dstat.st_uid);
|
||||
my_getpwuid(scratch, dn->dstat.st_uid, sizeof(scratch));
|
||||
printf("%-8.8s ", scratch);
|
||||
my_getgrgid(scratch, dn->dstat.st_gid);
|
||||
my_getgrgid(scratch, dn->dstat.st_gid, sizeof(scratch));
|
||||
printf("%-8.8s", scratch);
|
||||
column += 17;
|
||||
break;
|
||||
@@ -700,8 +696,8 @@ static int list_single(struct dnode *dn)
|
||||
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));
|
||||
column += printf("%4d, %3d ", (int) major(dn->dstat.st_rdev),
|
||||
(int) minor(dn->dstat.st_rdev));
|
||||
} else {
|
||||
#ifdef CONFIG_FEATURE_HUMAN_READABLE
|
||||
if (all_fmt & LS_DISP_HR) {
|
||||
@@ -878,7 +874,7 @@ static const char ls_options[]="Cadil1gnsxAk" \
|
||||
LS_STR_SELINUX \
|
||||
LS_STR_AUTOWIDTH;
|
||||
|
||||
#define LIST_MASK_TRIGGER LIST_SHORT
|
||||
#define LIST_MASK_TRIGGER 0
|
||||
#define STYLE_MASK_TRIGGER STYLE_MASK
|
||||
#define SORT_MASK_TRIGGER SORT_MASK
|
||||
#define DISP_MASK_TRIGGER DISP_ROWS
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#define FLAG_CHECK 2
|
||||
#define FLAG_WARN 4
|
||||
|
||||
/* This might be usefull elsewhere */
|
||||
/* This might be useful elsewhere */
|
||||
static unsigned char *hash_bin_to_hex(unsigned char *hash_value,
|
||||
unsigned char hash_length)
|
||||
{
|
||||
|
||||
+5
-5
@@ -155,13 +155,13 @@ static const char * const add_strings[] = {
|
||||
"4/4 \" %011o \" \"\\n\"", /* O */
|
||||
};
|
||||
|
||||
static const signed char od_opts[] = "aBbcDdeFfHhIiLlOovXx";
|
||||
static const signed char od_opts[] = "aBbcDdeFfHhIiLlOoXxv";
|
||||
|
||||
static const signed char od_o2si[] = {
|
||||
0, 1, 2, 3, 5,
|
||||
4, 6, 6, 7, 8,
|
||||
9, 0xa, 0xb, 0xa, 0xa,
|
||||
0xb, 1, -1, 8, 9,
|
||||
0xb, 1, 8, 9,
|
||||
};
|
||||
|
||||
int od_main(int argc, char **argv)
|
||||
@@ -173,7 +173,9 @@ int od_main(int argc, char **argv)
|
||||
bb_dump_length = -1;
|
||||
|
||||
while ((ch = getopt(argc, argv, od_opts)) > 0) {
|
||||
if (((p = strchr(od_opts, ch)) != NULL) && (*p >= 0)) {
|
||||
if (ch == 'v') {
|
||||
bb_dump_vflag = ALL;
|
||||
} else if (((p = strchr(od_opts, ch)) != NULL) && (*p >= 0)) {
|
||||
if (first) {
|
||||
first = 0;
|
||||
bb_dump_add("\"%07.7_Ao\n\"");
|
||||
@@ -182,8 +184,6 @@ int od_main(int argc, char **argv)
|
||||
bb_dump_add("\" \"");
|
||||
}
|
||||
bb_dump_add(add_strings[od_o2si[(int)(p-od_opts)]]);
|
||||
} else if (ch == 'v') {
|
||||
bb_dump_vflag = ALL;
|
||||
} else { /* P, p, s, w, or other unhandled */
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
+21
-133
@@ -58,68 +58,19 @@
|
||||
#include <assert.h>
|
||||
#include "busybox.h"
|
||||
|
||||
|
||||
#ifndef S_IFMT
|
||||
static const int S_IFMT = 0170000;
|
||||
#endif
|
||||
#if !defined(S_ISBLK) && defined(S_IFBLK)
|
||||
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
||||
#endif
|
||||
#if !defined(S_ISCHR) && defined(S_IFCHR)
|
||||
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
||||
#endif
|
||||
#if !defined(S_ISDIR) && defined(S_IFDIR)
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
#if !defined(S_ISREG) && defined(S_IFREG)
|
||||
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
#endif
|
||||
#if !defined(S_ISFIFO) && defined(S_IFIFO)
|
||||
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
||||
#endif
|
||||
#if !defined(S_ISLNK) && defined(S_IFLNK)
|
||||
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
||||
#endif
|
||||
#if !defined(S_ISSOCK) && defined(S_IFSOCK)
|
||||
# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
|
||||
#endif
|
||||
#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
|
||||
# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
|
||||
# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
|
||||
#endif
|
||||
#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
|
||||
# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
|
||||
#endif
|
||||
|
||||
#define IN_CTYPE_DOMAIN(c) 1
|
||||
|
||||
#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c))
|
||||
#define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
|
||||
#define ISDIGIT(c) (((unsigned char) (c)) - '0' <= 9)
|
||||
|
||||
#define isodigit(c) ((c) >= '0' && (c) <= '7')
|
||||
#define hextobin(c) ((c)>='a'&&(c)<='f' ? (c)-'a'+10 : (c)>='A'&&(c)<='F' ? (c)-'A'+10 : (c)-'0')
|
||||
#define octtobin(c) ((c) - '0')
|
||||
|
||||
static double xstrtod __P((char *s));
|
||||
static int print_esc __P((char *escstart));
|
||||
static int print_formatted __P((char *format, int argc, char **argv));
|
||||
static long xstrtol __P((char *s));
|
||||
static unsigned long xstrtoul __P((char *s));
|
||||
static void print_esc_string __P((char *str));
|
||||
static int print_formatted __P((char *format, int argc, char **argv));
|
||||
static void print_direc __P( (char *start, size_t length,
|
||||
int field_width, int precision, char *argument));
|
||||
static void print_esc_char __P((int c));
|
||||
static void print_esc_string __P((char *str));
|
||||
|
||||
/* The value to return to the calling program. */
|
||||
static int exit_status;
|
||||
|
||||
int printf_main(int argc, char **argv)
|
||||
{
|
||||
char *format;
|
||||
int args_used;
|
||||
|
||||
exit_status = 0;
|
||||
if (argc <= 1 || **(argv + 1) == '-') {
|
||||
bb_show_usage();
|
||||
}
|
||||
@@ -140,7 +91,7 @@ int printf_main(int argc, char **argv)
|
||||
fprintf(stderr, "excess args ignored");
|
||||
*/
|
||||
|
||||
return(exit_status);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
/* Print the text in FORMAT, using ARGV (with ARGC elements) for
|
||||
@@ -188,7 +139,7 @@ static int print_formatted(char *format, int argc, char **argv)
|
||||
} else
|
||||
field_width = 0;
|
||||
} else
|
||||
while (ISDIGIT(*f)) {
|
||||
while (isdigit(*f)) {
|
||||
++f;
|
||||
++direc_length;
|
||||
}
|
||||
@@ -205,7 +156,7 @@ static int print_formatted(char *format, int argc, char **argv)
|
||||
} else
|
||||
precision = 0;
|
||||
} else
|
||||
while (ISDIGIT(*f)) {
|
||||
while (isdigit(*f)) {
|
||||
++f;
|
||||
++direc_length;
|
||||
}
|
||||
@@ -230,7 +181,10 @@ static int print_formatted(char *format, int argc, char **argv)
|
||||
break;
|
||||
|
||||
case '\\':
|
||||
f += print_esc(f);
|
||||
if (*++f == 'c')
|
||||
exit(0);
|
||||
putchar(bb_process_escape_sequence((const char **)&f));
|
||||
f--;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -241,84 +195,6 @@ static int print_formatted(char *format, int argc, char **argv)
|
||||
return save_argc - argc;
|
||||
}
|
||||
|
||||
/* Print a \ escape sequence starting at ESCSTART.
|
||||
Return the number of characters in the escape sequence
|
||||
besides the backslash. */
|
||||
|
||||
static int print_esc(char *escstart)
|
||||
{
|
||||
register char *p = escstart + 1;
|
||||
int esc_value = 0; /* Value of \nnn escape. */
|
||||
int esc_length; /* Length of \nnn escape. */
|
||||
|
||||
/* \0ooo and \xhhh escapes have maximum length of 3 chars. */
|
||||
if (*p == 'x') {
|
||||
for (esc_length = 0, ++p;
|
||||
esc_length < 3 && ISXDIGIT(*p); ++esc_length, ++p)
|
||||
esc_value = esc_value * 16 + hextobin(*p);
|
||||
/* if (esc_length == 0)
|
||||
fprintf(stderr, "missing hex in esc");
|
||||
*/
|
||||
putchar(esc_value);
|
||||
} else if (*p == '0') {
|
||||
for (esc_length = 0, ++p;
|
||||
esc_length < 3 && isodigit(*p); ++esc_length, ++p)
|
||||
esc_value = esc_value * 8 + octtobin(*p);
|
||||
putchar(esc_value);
|
||||
} else if (strchr("\"\\abcfnrtv", *p))
|
||||
print_esc_char(*p++);
|
||||
/* else
|
||||
fprintf(stderr, "\\%c: invalid esc", *p);
|
||||
*/
|
||||
return p - escstart - 1;
|
||||
}
|
||||
|
||||
/* Output a single-character \ escape. */
|
||||
|
||||
static void print_esc_char(int c)
|
||||
{
|
||||
switch (c) {
|
||||
case 'a': /* Alert. */
|
||||
putchar(7);
|
||||
break;
|
||||
case 'b': /* Backspace. */
|
||||
putchar(8);
|
||||
break;
|
||||
case 'c': /* Cancel the rest of the output. */
|
||||
exit(0);
|
||||
break;
|
||||
case 'f': /* Form feed. */
|
||||
putchar(12);
|
||||
break;
|
||||
case 'n': /* New line. */
|
||||
putchar(10);
|
||||
break;
|
||||
case 'r': /* Carriage return. */
|
||||
putchar(13);
|
||||
break;
|
||||
case 't': /* Horizontal tab. */
|
||||
putchar(9);
|
||||
break;
|
||||
case 'v': /* Vertical tab. */
|
||||
putchar(11);
|
||||
break;
|
||||
default:
|
||||
putchar(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Print string STR, evaluating \ escapes. */
|
||||
|
||||
static void print_esc_string(char *str)
|
||||
{
|
||||
for (; *str; str++)
|
||||
if (*str == '\\')
|
||||
str += print_esc(str);
|
||||
else
|
||||
putchar(*str);
|
||||
}
|
||||
|
||||
static void
|
||||
print_direc(char *start, size_t length, int field_width, int precision,
|
||||
char *argument)
|
||||
@@ -426,3 +302,15 @@ static double xstrtod(char *arg)
|
||||
return result;
|
||||
}
|
||||
|
||||
static void print_esc_string(char *str)
|
||||
{
|
||||
for (; *str; str++) {
|
||||
if (*str == '\\') {
|
||||
str++;
|
||||
putchar(bb_process_escape_sequence((const char **)&str));
|
||||
} else {
|
||||
putchar(*str);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+13
-6
@@ -1,4 +1,7 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* seq implementation for busybox
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
@@ -27,18 +30,22 @@ extern int seq_main(int argc, char **argv)
|
||||
if (argc == 4) {
|
||||
first = atof(argv[1]);
|
||||
increment = atof(argv[2]);
|
||||
}
|
||||
else if (argc == 3) {
|
||||
} else if (argc == 3) {
|
||||
first = atof(argv[1]);
|
||||
}
|
||||
else if (argc != 2) {
|
||||
} else if (argc != 2) {
|
||||
bb_show_usage();
|
||||
}
|
||||
last = atof(argv[argc - 1]);
|
||||
|
||||
for (i = first; ((first <= last) ? (i <= last): (i >= last));i += increment) {
|
||||
/* You should note that this is pos-5.0.91 semantics, -- FK. */
|
||||
if ((first > last) && (increment > 0)) {
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
for (i = first; ((first <= last) ? (i <= last) : (i >= last));
|
||||
i += increment) {
|
||||
printf("%g\n", i);
|
||||
}
|
||||
|
||||
return(EXIT_SUCCESS);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -980,6 +980,7 @@ set_window_size(int rows, int cols, int fd)
|
||||
if ((ioctl(fd, TIOCSWINSZ, (char *) &win) != 0)
|
||||
|| (ioctl(fd, TIOCSSIZE, (char *) &ttysz) != 0)) {
|
||||
perror_on_device("%s");
|
||||
}
|
||||
return;
|
||||
}
|
||||
# endif
|
||||
|
||||
@@ -228,6 +228,7 @@ int tail_main(int argc, char **argv)
|
||||
buf = tailbuf;
|
||||
taillen = 0;
|
||||
seen = 1;
|
||||
newline = 0;
|
||||
|
||||
while ((nread = tail_read(fds[i], buf, tailbufsize-taillen)) > 0) {
|
||||
if (from_top) {
|
||||
|
||||
+6
-2
@@ -38,7 +38,7 @@ int tee_main(int argc, char **argv)
|
||||
int flags;
|
||||
int retval = EXIT_SUCCESS;
|
||||
#ifdef CONFIG_FEATURE_TEE_USE_BLOCK_IO
|
||||
size_t c;
|
||||
ssize_t c;
|
||||
RESERVE_CONFIG_BUFFER(buf, BUFSIZ);
|
||||
#else
|
||||
int c;
|
||||
@@ -78,12 +78,16 @@ int tee_main(int argc, char **argv)
|
||||
*p = NULL; /* Store the sentinal value. */
|
||||
|
||||
#ifdef CONFIG_FEATURE_TEE_USE_BLOCK_IO
|
||||
while ((c = fread(buf, 1, BUFSIZ, stdin)) != 0) {
|
||||
while ((c = safe_read(STDIN_FILENO, buf, BUFSIZ)) > 0) {
|
||||
for (p=files ; *p ; p++) {
|
||||
fwrite(buf, 1, c, *p);
|
||||
}
|
||||
}
|
||||
|
||||
if (c < 0) { /* Make sure read errors are signaled. */
|
||||
retval = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FEATURE_CLEAN_UP
|
||||
RELEASE_CONFIG_BUFFER(buf);
|
||||
#endif
|
||||
|
||||
+28
-14
@@ -155,19 +155,25 @@ static const struct t_op {
|
||||
0, 0, 0}
|
||||
};
|
||||
|
||||
#ifdef CONFIG_FEATURE_TEST_64
|
||||
typedef int64_t arith_t;
|
||||
#else
|
||||
typedef int arith_t;
|
||||
#endif
|
||||
|
||||
static char **t_wp;
|
||||
static struct t_op const *t_wp_op;
|
||||
static gid_t *group_array = NULL;
|
||||
static int ngroups;
|
||||
|
||||
static enum token t_lex(char *s);
|
||||
static int oexpr(enum token n);
|
||||
static int aexpr(enum token n);
|
||||
static int nexpr(enum token n);
|
||||
static arith_t oexpr(enum token n);
|
||||
static arith_t aexpr(enum token n);
|
||||
static arith_t nexpr(enum token n);
|
||||
static int binop(void);
|
||||
static int primary(enum token n);
|
||||
static arith_t primary(enum token n);
|
||||
static int filstat(char *nm, enum token mode);
|
||||
static int getn(const char *s);
|
||||
static arith_t getn(const char *s);
|
||||
static int newerf(const char *f1, const char *f2);
|
||||
static int olderf(const char *f1, const char *f2);
|
||||
static int equalf(const char *f1, const char *f2);
|
||||
@@ -232,9 +238,9 @@ static void syntax(const char *op, const char *msg)
|
||||
}
|
||||
}
|
||||
|
||||
static int oexpr(enum token n)
|
||||
static arith_t oexpr(enum token n)
|
||||
{
|
||||
int res;
|
||||
arith_t res;
|
||||
|
||||
res = aexpr(n);
|
||||
if (t_lex(*++t_wp) == BOR) {
|
||||
@@ -244,9 +250,9 @@ static int oexpr(enum token n)
|
||||
return res;
|
||||
}
|
||||
|
||||
static int aexpr(enum token n)
|
||||
static arith_t aexpr(enum token n)
|
||||
{
|
||||
int res;
|
||||
arith_t res;
|
||||
|
||||
res = nexpr(n);
|
||||
if (t_lex(*++t_wp) == BAND)
|
||||
@@ -255,16 +261,16 @@ static int aexpr(enum token n)
|
||||
return res;
|
||||
}
|
||||
|
||||
static int nexpr(enum token n)
|
||||
static arith_t nexpr(enum token n)
|
||||
{
|
||||
if (n == UNOT)
|
||||
return !nexpr(t_lex(*++t_wp));
|
||||
return primary(n);
|
||||
}
|
||||
|
||||
static int primary(enum token n)
|
||||
static arith_t primary(enum token n)
|
||||
{
|
||||
int res;
|
||||
arith_t res;
|
||||
|
||||
if (n == EOI) {
|
||||
syntax(NULL, "argument expected");
|
||||
@@ -441,13 +447,21 @@ static enum token t_lex(char *s)
|
||||
}
|
||||
|
||||
/* atoi with error detection */
|
||||
static int getn(const char *s)
|
||||
static arith_t getn(const char *s)
|
||||
{
|
||||
char *p;
|
||||
#ifdef CONFIG_FEATURE_TEST_64
|
||||
long long r;
|
||||
#else
|
||||
long r;
|
||||
#endif
|
||||
|
||||
errno = 0;
|
||||
#ifdef CONFIG_FEATURE_TEST_64
|
||||
r = strtoll(s, &p, 10);
|
||||
#else
|
||||
r = strtol(s, &p, 10);
|
||||
#endif
|
||||
|
||||
if (errno != 0)
|
||||
bb_error_msg_and_die("%s: out of range", s);
|
||||
@@ -456,7 +470,7 @@ static int getn(const char *s)
|
||||
if (*(bb_skip_whitespace(p)))
|
||||
bb_error_msg_and_die("%s: bad number", s);
|
||||
|
||||
return (int) r;
|
||||
return r;
|
||||
}
|
||||
|
||||
static int newerf(const char *f1, const char *f2)
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ static const char uniq_opts[] = "f:s:cdu\0\7\3\5\1\2\4";
|
||||
int uniq_main(int argc, char **argv)
|
||||
{
|
||||
FILE *in, *out;
|
||||
/* Note: Ignore the warning about dups and e0 possibly being uninitialized.
|
||||
/* Note: Ignore the warning about dups and e0 being used uninitialized.
|
||||
* They will be initialized on the fist pass of the loop (since s0 is NULL). */
|
||||
unsigned long dups, skip_fields, skip_chars, i;
|
||||
const char *s0, *e0, *s1, *e1, *input_filename;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* GPLv2
|
||||
* Copyright 2003, Glenn McGrath <bug1@optushome.com.au>
|
||||
* Copyright 2003, Glenn McGrath <bug1@iinet.net.au>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as published
|
||||
|
||||
+3
-9
@@ -29,16 +29,10 @@
|
||||
|
||||
extern int whoami_main(int argc, char **argv)
|
||||
{
|
||||
char user[9];
|
||||
uid_t uid;
|
||||
|
||||
if (argc > 1)
|
||||
bb_show_usage();
|
||||
|
||||
uid = geteuid();
|
||||
if (my_getpwuid(user, uid)) {
|
||||
puts(user);
|
||||
bb_fflush_stdout_and_exit(EXIT_SUCCESS);
|
||||
}
|
||||
bb_error_msg_and_die("cannot find username for UID %u", (unsigned) uid);
|
||||
puts(my_getpwuid(NULL, geteuid(), -1));
|
||||
/* exits on error */
|
||||
bb_fflush_stdout_and_exit(EXIT_SUCCESS);
|
||||
}
|
||||
@@ -17,13 +17,15 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TOPDIR:= ../
|
||||
top_srcdir=..
|
||||
top_builddir=..
|
||||
srcdir=$(top_srcdir)/debianutils
|
||||
DEBIANUTILS_DIR:=./
|
||||
include $(TOPDIR).config
|
||||
include $(TOPDIR)Rules.mak
|
||||
include Makefile.in
|
||||
include $(top_builddir)/Rules.mak
|
||||
include $(top_builddir)/.config
|
||||
include $(srcdir)/Makefile.in
|
||||
all: $(libraries-y)
|
||||
-include $(TOPDIR).depend
|
||||
-include $(top_builddir)/.depend
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a $(AR_TARGET)
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
|
||||
DEBIANUTILS_AR:=debianutils.a
|
||||
ifndef $(DEBIANUTILS_DIR)
|
||||
DEBIANUTILS_DIR:=$(TOPDIR)debianutils/
|
||||
DEBIANUTILS_DIR:=$(top_builddir)/debianutils/
|
||||
endif
|
||||
|
||||
srcdir=$(top_srcdir)/debianutils
|
||||
|
||||
DEBIANUTILS-y:=
|
||||
DEBIANUTILS-$(CONFIG_MKTEMP) += mktemp.o
|
||||
@@ -36,3 +36,6 @@ libraries-y+=$(DEBIANUTILS_DIR)$(DEBIANUTILS_AR)
|
||||
$(DEBIANUTILS_DIR)$(DEBIANUTILS_AR): $(patsubst %,$(DEBIANUTILS_DIR)%, $(DEBIANUTILS-y))
|
||||
$(AR) -ro $@ $(patsubst %,$(DEBIANUTILS_DIR)%, $(DEBIANUTILS-y))
|
||||
|
||||
$(DEBIANUTILS_DIR)%.o: $(srcdir)/%.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
|
||||
|
||||
@@ -0,0 +1,324 @@
|
||||
<!--#include file="header.html" -->
|
||||
|
||||
|
||||
<h3>Frequently Asked Questions</h3>
|
||||
|
||||
This is a collection of some of the more frequently asked questions
|
||||
about BusyBox. Some of the questions even have answers. If you
|
||||
have additions to this FAQ document, we would love to add them,
|
||||
|
||||
<ol>
|
||||
<li><a href="#kernel">Which Linux kernel versions are supported?</a>
|
||||
<li><a href="#arch">Which architectures does BusyBox run on?</a>
|
||||
<li><a href="#libc">Which C libraries are supported?</a>
|
||||
<li><a href="#commercial">Can I include BusyBox as part of the software on my device?</a>
|
||||
<li><a href="#bugs">I think I found a bug in BusyBox! What should I do?!</a>
|
||||
<li><a href="#job_control">Why do I keep getting "sh: can't access tty; job control
|
||||
turned off" errors? Why doesn't Control-C work within my shell?</a>
|
||||
<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><a href="#getting_started">How can I get started using BusyBox?</a>
|
||||
<li><a href="#helpme">I need help with BusyBox! What should I do?</a>
|
||||
<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><a href="#support">I think you guys are great and I want to help support your work!</a>
|
||||
|
||||
|
||||
</ol>
|
||||
|
||||
|
||||
<hr />
|
||||
<p>
|
||||
<h2><a name="kernel">Which Linux kernel versions are supported?</a></h2>
|
||||
<p>
|
||||
|
||||
|
||||
Full functionality requires Linux 2.2.x or better. A large fraction of the
|
||||
code should run on just about anything. While the current code is fairly
|
||||
Linux specific, it should be fairly easy to port the majority of the code
|
||||
to support, say, FreeBSD or Solaris, or Mac OS X, or even Windows (if you
|
||||
are into that sort of thing).
|
||||
|
||||
|
||||
<hr />
|
||||
<p>
|
||||
<h2><a name="arch">Which architectures does BusyBox run on?</a></h2>
|
||||
<p>
|
||||
|
||||
|
||||
BusyBox in general will build on any architecture supported by gcc.
|
||||
Kernel module loading for 2.2 and 2.4 Linux kernels is currently
|
||||
limited to ARM, CRIS, H8/300, x86, ia64, x86_64, m68k, MIPS, PowerPC,
|
||||
S390, SH3/4/5, Sparc, v850e, and x86_64 for 2.4.x kernels.
|
||||
|
||||
With 2.6.x kernels, module loading support should work on all architectures.
|
||||
|
||||
|
||||
<hr />
|
||||
<p>
|
||||
<h2><a name="libc">Which C libraries are supported?</a></h2>
|
||||
<p>
|
||||
|
||||
|
||||
uClibc and glibc are supported. People have been looking at newlib and
|
||||
dietlibc, but they are currently considered unsupported, untested, or
|
||||
worse. Linux-libc5 is no longer supported. If you require a small C
|
||||
library, you should probably use uClibc.
|
||||
|
||||
|
||||
<hr />
|
||||
<p>
|
||||
<h2><a name="commercial">Can I include BusyBox as part of the software on my device?</h2>
|
||||
|
||||
Yes. As long as you <a href="http://busybox.net/license.html">fully comply
|
||||
with the generous terms of the GPL BusyBox license</a> you can ship BusyBox
|
||||
as part of the software on your device.
|
||||
|
||||
<a href="#support">Please consider sharing some of the money you make.</a>
|
||||
|
||||
|
||||
<hr />
|
||||
<p>
|
||||
<h2><a name="bugs">I think I found a bug in BusyBox! What should I do?</h2>
|
||||
<p>
|
||||
|
||||
If you find a problem with BusyBox, please submit a detailed bug report to
|
||||
the BusyBox mailing list at <a href="mailto:busybox@mail.busybox.net">
|
||||
busybox@mail.busybox.net</a>. Please do not send private email to Erik
|
||||
(the maintainer of BusyBox) 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, while private answers help only you...
|
||||
|
||||
<p>
|
||||
|
||||
If you find bugs, please submit a detailed bug report to the BusyBox mailing
|
||||
list at busybox@mail.busybox.net. A well-written bug report should include a
|
||||
transcript of a shell session that demonstrates the bad behavior and enables
|
||||
anyone else to duplicate the bug on their own machine. The following is such
|
||||
an example:
|
||||
|
||||
<pre>
|
||||
To: busybox@mail.busybox.net
|
||||
From: diligent@testing.linux.org
|
||||
Subject: /bin/date doesn't work
|
||||
|
||||
Package: BusyBox
|
||||
Version: 1.00
|
||||
|
||||
When I execute BusyBox 'date' it produces unexpected results.
|
||||
With GNU date I get the following output:
|
||||
|
||||
$ date
|
||||
Fri Oct 8 14:19:41 MDT 2004
|
||||
|
||||
But when I use BusyBox date I get this instead:
|
||||
|
||||
$ date
|
||||
illegal instruction
|
||||
|
||||
I am using Debian unstable, kernel version 2.4.27 on a x86 system,
|
||||
and the latest uClibc from CVS. Thanks for the wonderful program!
|
||||
|
||||
-Diligent
|
||||
</pre>
|
||||
|
||||
Note the careful description and use of examples showing not only what BusyBox
|
||||
does, but also a counter example showing what an equivalent GNU app does. Bug
|
||||
reports lacking proper detail may never be fixed... Thanks for understanding.
|
||||
|
||||
<hr />
|
||||
<p>
|
||||
<h2><a name="job_control">Why do I keep getting "sh: can't access tty; job control
|
||||
turned off" errors? Why doesn't Control-C work within my shell?</a></h2>
|
||||
<p>
|
||||
|
||||
Job control will be turned off since your shell can not obtain a controlling
|
||||
terminal. This typically happens when you run your shell on /dev/console.
|
||||
The kernel will not provide a controlling terminal on the /dev/console
|
||||
device. Your should run your shell on a normal tty such as tty1 or ttyS0
|
||||
and everything will work perfectly. If you <em>REALLY</em> want your shell
|
||||
to run on /dev/console, then you can hack your kernel (if you are into that
|
||||
sortof thing) by changing drivers/char/tty_io.c to change the lines where
|
||||
it sets "noctty = 1;" to instead set it to "0". I recommend you instead
|
||||
run your shell on a real console...
|
||||
|
||||
|
||||
<hr />
|
||||
<p>
|
||||
<h2><a name="getting_started">How can I get started using BusyBox?</a></h2>
|
||||
<p>
|
||||
|
||||
An easy method to build your own basic BusyBox based system, is to
|
||||
follow these simple steps:
|
||||
<ul>
|
||||
<li> Point your web browser <a href="/cgi-bin/cvsweb/buildroot/">here</a>
|
||||
<li> Click on "Download tarball"
|
||||
<li> Unpack the tarball on your Linux system somewhere
|
||||
<li> run 'make' and configure things to taste.
|
||||
<li> run 'unset CC'. Some Linux systems (i.e. Gentoo) set 'CC'
|
||||
in the system environment which messes up cross compiles.
|
||||
<li> run 'make'
|
||||
<li> go have lunch, drink a pop, call a friend, play a video game, etc
|
||||
till it finishes downloading software and compiling things.
|
||||
<li> You should now have a shiny new BusyBox based system.
|
||||
</ul>
|
||||
|
||||
|
||||
<hr />
|
||||
<p>
|
||||
<h2><a name="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></h2>
|
||||
<p>
|
||||
|
||||
You have not paid us a single cent and yet you still have the product of
|
||||
many years of our work. We are not your slaves! We work on BusyBox
|
||||
because we find it useful and interesting. If you go off flaming us, we
|
||||
will ignore you.
|
||||
|
||||
|
||||
<hr />
|
||||
<p>
|
||||
<h2><a name="helpme">I need help with BusyBox! What should I do?</a></h2>
|
||||
<p>
|
||||
|
||||
If you find that you need help with BusyBox, you can ask for help on the
|
||||
BusyBox mailing list at busybox@mail.busybox.net. In addition to the BusyBox
|
||||
mailing list, Erik (andersee), Manuel (mjn3) and others are known to hang out
|
||||
on the uClibc IRC channel: #uclibc on irc.freenode.net.
|
||||
|
||||
<p>
|
||||
|
||||
<b>Please do not send private email to Erik, Manuel, or the other BusyBox
|
||||
contributors asking for private help unless you are planning on paying for
|
||||
consulting services.</b>
|
||||
|
||||
<p>
|
||||
|
||||
When we answer questions on the BusyBox mailing list, it helps everyone
|
||||
since people with similar problems in the future will be able to get help
|
||||
by searching the mailing list archives. Private help is reserved as a paid
|
||||
service. If you need to use private communication, or if you are serious
|
||||
about getting timely assistance with BusyBox, you should seriously consider
|
||||
paying for consulting services.
|
||||
|
||||
<p>
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
<p>
|
||||
<h2><a name="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></h2>
|
||||
<p>
|
||||
|
||||
Sure! Now you have our attention! What you should do is contact <a
|
||||
href="mailto:andersen@codepoet.org">Erik Andersen</a> of <a
|
||||
href="http://codepoet-consulting.com/">CodePoet Consulting</a> to bid
|
||||
on your project. If Erik is too busy to personally add your feature, there
|
||||
are many other active BusyBox contributors who will almost certainly be able
|
||||
to help you out. Erik can contact them privatly, and may even let you to
|
||||
post your request for services on the mailing list.
|
||||
|
||||
|
||||
<hr />
|
||||
<p>
|
||||
<h2><a name="support">I think you guys are great and I want to help support your work!</a></h2>
|
||||
<p>
|
||||
|
||||
Wow, that would be great! Erik personally pays for all the bandwidth, and
|
||||
all servers used for busybox.net out of his own pocket. If you would like
|
||||
to make a donation to help support BusyBox, and/or request features, you
|
||||
can click here:
|
||||
|
||||
<!-- Begin PayPal Logo -->
|
||||
<center>
|
||||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
||||
<input type="hidden" name="cmd" value="_xclick">
|
||||
<input type="hidden" name="business" value="andersen@codepoet.org">
|
||||
<input type="hidden" name="item_name" value="Support BusyBox">
|
||||
<input type="hidden" name="image_url" value="http://codepoet-consulting.com/images/codepoet.png">
|
||||
<input type="hidden" name="no_shipping" value="1">
|
||||
<input type="image" src="images/donate.png" name="submit" alt="Make donation using PayPal">
|
||||
</form>
|
||||
</center>
|
||||
<!-- End PayPal Logo -->
|
||||
|
||||
If you prefer to contact Erik directly to make a donation, donate hardware,
|
||||
request support, etc, you can contact
|
||||
<a href="http://codepoet-consulting.com/">CodePoet Consulting</a> here.
|
||||
CodePoet Consulting can accept both Visa and MasterCard for those that do not
|
||||
trust PayPal...
|
||||
|
||||
<hr />
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<!--#include file="footer.html" -->
|
||||
|
||||
@@ -25,7 +25,7 @@ to you, but not store it).
|
||||
<p>
|
||||
Note that if you would prefer to keep your communications with me
|
||||
private, you can encrypt your email using my
|
||||
<a href="http://www.codepoet.org/~andersen/erik/gpg.asc">public key</a>.
|
||||
<a href="http://www.codepoet.org/andersen/erik/gpg.asc">public key</a>.
|
||||
|
||||
<!--#include file="footer.html" -->
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
<br><a href="/lists.html">Mailing Lists</a>
|
||||
<br><a href="/news.html">Latest News</a>
|
||||
<br><a href="/download.html">Download</a>
|
||||
<br><a href="/FAQ.html">FAQ</a>
|
||||
<br><a href="/cvs_anon.html">Accessing CVS</a>
|
||||
<br><a href="/cgi-bin/cvsweb/busybox/">Browse CVS</a>
|
||||
<br><a href="/docs.html">Documentation</a>
|
||||
|
||||
@@ -10,12 +10,32 @@ whatsoever, this page attempts to summarize what you should do to
|
||||
ensure you do not accidentally violate the law.
|
||||
|
||||
<p>
|
||||
<h3>Complying with the BusyBox license is easy and completely free.</h3>
|
||||
|
||||
U.S. and International Law protects copyright owners from the unauthorized
|
||||
reproduction, adaptation, display, distribution, etc of copyright protected
|
||||
works. Copyright violations (such as shipping BusyBox in a manner contrary to
|
||||
its license) are subject to severe penalties. The courts can award up to
|
||||
$150,000 per product shipped without even showing any actual loss by the
|
||||
copyright holder. Criminal penalties are available for intentional acts
|
||||
undertaken for purposes of "commercial advantage" or "private financial gain."
|
||||
In addition, if it comes to my attention that you are violating the BusyBox
|
||||
license, I will list you on the <a href="/shame.html">BusyBox Hall of Shame</a>
|
||||
webpage.
|
||||
|
||||
<p>
|
||||
|
||||
Nobody wants that to happen. Do everyone a favor and don't break the law -- if
|
||||
you use BusyBox, you <b>must comply with the BusyBox license</b>.
|
||||
|
||||
<p>
|
||||
<h3>BusyBox is licensed under the GNU General Public License</h3>
|
||||
|
||||
BusyBox is licensed under the GNU General Public License , which
|
||||
is generally just abbreviated simply as the GPL license, or
|
||||
just the GPL. <a href="/products.html">Anyone thinking of shipping
|
||||
is generally just abbreviated as the GPL license, or
|
||||
just the GPL.
|
||||
<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. You are advised to take a look over the
|
||||
@@ -49,41 +69,43 @@ encrypt or obfuscate it. You are not required to provide full
|
||||
source for all the closed source applications that happen to be
|
||||
part of the system with BusyBox, though you can certainly do so
|
||||
if you feel like it. But providing source for the GPL licensed
|
||||
applications such as BusyBox is manditory.
|
||||
applications such as BusyBox is mandatory.
|
||||
|
||||
<p>
|
||||
|
||||
<b>Accompanied by source</b> generally means you place the full
|
||||
source code for all GPL'd products such as BusyBox on a driver CD
|
||||
somewhere. Full source code includes the BusyBox ".config" file
|
||||
used when your shipping BusyBox binary was compiled.
|
||||
<b>Accompanied by source</b> generally means you distribute the full
|
||||
source code for all GPL'd products including BusyBox along with your
|
||||
product, such as by placing it somewhere on a driver CD. Full source
|
||||
code includes the BusyBox ".config" file used when your shipping BusyBox
|
||||
binary was compiled, and any and all modifications you made to the
|
||||
BusyBox source code.
|
||||
|
||||
<p>
|
||||
|
||||
<b>A written offer</b> generally means that somewhere in the
|
||||
docs for your product, you write something like
|
||||
documentation for your product, you write something like
|
||||
|
||||
<blockquote>
|
||||
The GPL source code contained in this product is available as a
|
||||
free download from http://blah.blah.blah/
|
||||
</blockquote>
|
||||
Or you can offer source by writing
|
||||
somewhere in the docs for your product something like
|
||||
Alternatively, you can offer the source code by writing
|
||||
somewhere in the documentation for your product something like
|
||||
<blockquote>
|
||||
If you would like a copy of the GPL source code in this product
|
||||
on a CD, please send $9.99 to <address> for the costs of
|
||||
preparing and mailing a CD to you.
|
||||
If you would like a copy of the GPL source code contained in this
|
||||
product shipped to you on CD, please send $9.99 to <address>
|
||||
which covers the cost of preparing and mailing a CD to you.
|
||||
</blockquote>
|
||||
<p>
|
||||
|
||||
Keep in mind though that if you distribute GPL'd binaries online
|
||||
(as is often done when supplying firmware updates), it is highly
|
||||
recommended that you make the corresponding source available online
|
||||
at the same place. Regardless, you <b>must</b> either make source
|
||||
available online (i.e. <b>accompanied by source</b>) and/or inform
|
||||
those downloading firmware updates of their right to obtain source
|
||||
(i.e. <b>a written offer</b>). Failure to do so is a violation of
|
||||
your licensing obligations.
|
||||
Keep in mind though that if you distribute GPL'd binaries online (as is often
|
||||
done when supplying firmware updates), it is <b>highly</b> recommended that you
|
||||
make the corresponding source available online at the same place. Regardless,
|
||||
if you distribute a binary copy of BusyBox online (such as part of a firmware
|
||||
update) you <b>must</b> either make source available online (i.e.
|
||||
<b>accompanied by source</b>) and/or inform those downloading firmware updates
|
||||
of their right to obtain source (i.e. <b>a written offer</b>). Failure to do
|
||||
so is a violation of your licensing obligations.
|
||||
|
||||
|
||||
<p>
|
||||
@@ -97,6 +119,7 @@ If you distribute any GPL'd binaries, you must also make source available
|
||||
as discussed on this webpage.
|
||||
|
||||
<p>
|
||||
<h3>A Good Example</h3>
|
||||
|
||||
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
|
||||
@@ -104,8 +127,8 @@ example of how to do things right. Please take a moment and
|
||||
check out what they do with
|
||||
<a href="http://www.linksys.com/download/firmware.asp?fwid=178">
|
||||
distributing the firmware for their WRT54G Router.</a>
|
||||
Following their example would be a fine way to ensure you have
|
||||
fulfilled your licensing obligations.
|
||||
Following their example would be a fine way to ensure that you
|
||||
have also fulfilled your licensing obligations.
|
||||
|
||||
|
||||
<!--#include file="footer.html" -->
|
||||
|
||||
@@ -7,12 +7,15 @@
|
||||
BusyBox has a <a href="/lists/busybox/">mailing list</a> for discussion and
|
||||
development. You can subscribe by visiting
|
||||
<a href="http://codepoet.org/mailman/listinfo/busybox">this page</a>.
|
||||
Only subscribers to the BusyBox mailing list are allowed to post
|
||||
to this list.
|
||||
|
||||
<p>
|
||||
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://codepoet.org/mailman/listinfo/busybox-cvs">this page</a>.
|
||||
The CVS server is the only one permtted to post to this list.
|
||||
|
||||
<p>
|
||||
|
||||
|
||||
+32
-63
@@ -3,74 +3,43 @@
|
||||
|
||||
<ul>
|
||||
|
||||
<li><b>13 April 2004 -- BusyBox 1.0.0-pre10 released</b><p>
|
||||
<li><b>13 October 2004 -- BusyBox 1.00 released</b><p>
|
||||
|
||||
Ok, I lied. It turns out that -pre9 will not be the final BusyBox
|
||||
pre-release. With any luck however -pre10 will be, since I <b>really</b>
|
||||
want to get BusyBox 1.0.0 released this week. As usual, please do not
|
||||
bother to send in patches adding cool new features at this time. Only
|
||||
bug-fix patches will be accepted. It would also be <b>very</b> helpful if
|
||||
people could continue to review the BusyBox documentation and submit
|
||||
improvements.
|
||||
When you take a careful look at nearly every embedded Linux device or
|
||||
software distribution shipping today, you will find a copy of BusyBox.
|
||||
With countless routers, set top boxes, wireless access points, PDAs, and
|
||||
who knows what else, the future for Linux and BusyBox on embedded devices
|
||||
is looking very bright.
|
||||
|
||||
<p>
|
||||
The <a href="downloads/Changelog">changelog</a> has all the details.
|
||||
And as usual you can <a href="downloads">download busybox here</a>.
|
||||
|
||||
It is therefore with great satisfaction that I declare each and every
|
||||
device already shipping with BusyBox is now officially out of date.
|
||||
The highly anticipated release of BusyBox 1.00 has arrived!
|
||||
|
||||
<p>
|
||||
|
||||
Over three years in development, BusyBox 1.00 represents a tremendous
|
||||
improvement over the old 0.60.x stable series. Now featuring a Linux
|
||||
KernelConf based configuration system (as used by the Linux kernel),
|
||||
Linux 2.6 kernel support, many many new applets, and the development
|
||||
work and testing of thousands of people from around the world.
|
||||
|
||||
<p>
|
||||
|
||||
If you are already using BusyBox, you are strongly encouraged to upgrade to
|
||||
BusyBox 1.00. If you are considering developing an embedded Linux device
|
||||
or software distribution, you may wish to investigate if using BusyBox is
|
||||
right for your application. If you need help getting started using
|
||||
BusyBox, if you wish to donate to help cover expenses, or if you find a bug
|
||||
and need help reporting it, you are invited to visit the <a
|
||||
href="FAQ.html">BusyBox FAQ</a>.
|
||||
|
||||
<p>
|
||||
|
||||
As usual you can <a href="downloads">download busybox here</a>.
|
||||
|
||||
<p>Have Fun!
|
||||
<p>
|
||||
|
||||
|
||||
<p>
|
||||
<li><b>6 April 2004 -- BusyBox 1.0.0-pre9 released</b><p>
|
||||
|
||||
Here goes the final BusyBox pre-release... This is your last chance for
|
||||
bug fixes. With luck this will be released as BusyBox 1.0.0 later this
|
||||
week. Please do not bother to send in patches adding cool new features at
|
||||
this time. Only bug-fix patches will be accepted. It would also be
|
||||
<b>very</b> helpful if people could help review the BusyBox documentation
|
||||
and submit improvements. I've spent a lot of time updating the
|
||||
documentation to make it better match reality, but I could really use some
|
||||
assistance in checking that the features supported by the various applets
|
||||
match the features listed in the documentation.
|
||||
|
||||
<p>
|
||||
I had hoped to get this released a month ago, but
|
||||
<a href="http://codepoet.org/gallery/baby_peter/img_1796">
|
||||
another release on 1 March 2004</a> has kept me busy...
|
||||
|
||||
<p>
|
||||
The <a href="downloads/Changelog">changelog</a> has all the details.
|
||||
And as usual you can <a href="downloads">download busybox here</a>.
|
||||
|
||||
<p>Have Fun!
|
||||
<p>
|
||||
|
||||
|
||||
<p>
|
||||
<li><b>23 February 2004 -- BusyBox 1.0.0-pre8 released</b><p>
|
||||
|
||||
Here goes yet another BusyBox pre-release... Please do not bother to send
|
||||
in patches supplying new features at this time. Only bug-fix patches will
|
||||
be accepted. If you have a cool new feature you would like to see
|
||||
supported, or if you have an amazing new applet you would like to submit,
|
||||
please wait and submit such things later. We really want to get a release
|
||||
out we can all be proud of. We are still aiming to finish off the -pre
|
||||
series in February and move on to the final 1.0.0 release... So if you
|
||||
spot any bugs, now would be an excellent time to send in a fix to the
|
||||
busybox mailing list. It would also be <b>very</b> helpful if people could
|
||||
help review the BusyBox documentation and submit improvements. It would be
|
||||
especially helpful if people could check that the features supported by the
|
||||
various applets match the features listed in the documentation.
|
||||
|
||||
<p>
|
||||
|
||||
The <a href="downloads/Changelog">changelog</a> has all the details.
|
||||
And as usual you can <a href="downloads">download busybox here</a>.
|
||||
|
||||
<p>Have Fun!
|
||||
<p>
|
||||
|
||||
|
||||
<p>
|
||||
<li><b>Old News</b><p>
|
||||
|
||||
@@ -3,6 +3,142 @@
|
||||
|
||||
<ul>
|
||||
|
||||
<li><b>16 August 2004 -- BusyBox 1.0.0-rc3 released</b><p>
|
||||
|
||||
Here goes release candidate 3...
|
||||
<p>
|
||||
The <a href="downloads/Changelog">changelog</a> has all the details.
|
||||
And as usual you can <a href="downloads">download busybox here</a>.
|
||||
|
||||
<p>Have Fun!
|
||||
|
||||
<p>
|
||||
<li><b>26 July 2004 -- BusyBox 1.0.0-rc2 released</b><p>
|
||||
|
||||
Here goes release candidate 2...
|
||||
<p>
|
||||
The <a href="downloads/Changelog">changelog</a> has all the details.
|
||||
And as usual you can <a href="downloads">download busybox here</a>.
|
||||
|
||||
<p>Have Fun!
|
||||
|
||||
<p>
|
||||
<li><b>20 July 2004 -- BusyBox 1.0.0-rc1 released</b><p>
|
||||
|
||||
Here goes release candidate 1... This fixes all (most?) of the problems
|
||||
that have turned up since -pre10. In particular, loading and unloading of
|
||||
kernel modules with 2.6.x kernels should be working much better.
|
||||
<p>
|
||||
|
||||
I <b>really</b> want to get BusyBox 1.0.0 released soon and I see no real
|
||||
reason why the 1.0.0 release shouldn't happen with things pretty much as
|
||||
is. BusyBox is in good shape at the moment, and it works nicely for
|
||||
everything that I'm doing with it. And from the reports I've been getting,
|
||||
it works nicely for what most everyone else is doing with it as well.
|
||||
There will eventually be a 1.0.1 anyway, so we might as well get on with
|
||||
it. No, BusyBox is not perfect. No piece of software ever is. And while
|
||||
there is still plenty that can be done to improve things, most of that work
|
||||
is waiting till we can get a solid 1.0.0 release out the door....
|
||||
<p>
|
||||
|
||||
Please do not bother to send in patches adding cool new features at this
|
||||
time. Only bug-fix patches will be accepted. If you have submitted a
|
||||
bug-fixing patch to the busybox mailing list and no one has emailed you
|
||||
explaining why your patch was rejected, it is safe to say that your patch
|
||||
has been lost or forgotten. That happens sometimes. Please re-submit your
|
||||
bug-fixing patch to the BusyBox mailing list, and be sure to put "[PATCH]"
|
||||
at the beginning of the email subject line!
|
||||
|
||||
<p>
|
||||
The <a href="downloads/Changelog">changelog</a> has all the details.
|
||||
And as usual you can <a href="downloads">download busybox here</a>.
|
||||
|
||||
<p>Have Fun!
|
||||
|
||||
<p>
|
||||
On a less happy note, My 92 year old grandmother (my dad's mom) passed away
|
||||
yesterday (June 19th). The funeral will be Thursday in a little town about
|
||||
2 hours south of my home. I've checked and there is absolutely no way I
|
||||
could be back in time for the funeral if I attend <a
|
||||
href="http://www.linuxsymposium.org/2004/">OLS</a> and give my presentation
|
||||
as scheduled.
|
||||
<p>
|
||||
As such, it is with great reluctance and sadness that I have come
|
||||
to the conclusion I will have to make my appologies and skip OLS
|
||||
this year.
|
||||
<p>
|
||||
|
||||
|
||||
<p>
|
||||
<li><b>13 April 2004 -- BusyBox 1.0.0-pre10 released</b><p>
|
||||
|
||||
Ok, I lied. It turns out that -pre9 will not be the final BusyBox
|
||||
pre-release. With any luck however -pre10 will be, since I <b>really</b>
|
||||
want to get BusyBox 1.0.0 released very soon. As usual, please do not
|
||||
bother to send in patches adding cool new features at this time. Only
|
||||
bug-fix patches will be accepted. It would also be <b>very</b> helpful if
|
||||
people could continue to review the BusyBox documentation and submit
|
||||
improvements.
|
||||
|
||||
<p>
|
||||
The <a href="downloads/Changelog">changelog</a> has all the details.
|
||||
And as usual you can <a href="downloads">download busybox here</a>.
|
||||
|
||||
<p>Have Fun!
|
||||
<p>
|
||||
|
||||
|
||||
<p>
|
||||
<li><b>6 April 2004 -- BusyBox 1.0.0-pre9 released</b><p>
|
||||
|
||||
Here goes the final BusyBox pre-release... This is your last chance for
|
||||
bug fixes. With luck this will be released as BusyBox 1.0.0 later this
|
||||
week. Please do not bother to send in patches adding cool new features at
|
||||
this time. Only bug-fix patches will be accepted. It would also be
|
||||
<b>very</b> helpful if people could help review the BusyBox documentation
|
||||
and submit improvements. I've spent a lot of time updating the
|
||||
documentation to make it better match reality, but I could really use some
|
||||
assistance in checking that the features supported by the various applets
|
||||
match the features listed in the documentation.
|
||||
|
||||
<p>
|
||||
I had hoped to get this released a month ago, but
|
||||
<a href="http://codepoet.org/gallery/baby_peter/img_1796">
|
||||
another release on 1 March 2004</a> has kept me busy...
|
||||
|
||||
<p>
|
||||
The <a href="downloads/Changelog">changelog</a> has all the details.
|
||||
And as usual you can <a href="downloads">download busybox here</a>.
|
||||
|
||||
<p>Have Fun!
|
||||
<p>
|
||||
|
||||
|
||||
<p>
|
||||
<li><b>23 February 2004 -- BusyBox 1.0.0-pre8 released</b><p>
|
||||
|
||||
Here goes yet another BusyBox pre-release... Please do not bother to send
|
||||
in patches supplying new features at this time. Only bug-fix patches will
|
||||
be accepted. If you have a cool new feature you would like to see
|
||||
supported, or if you have an amazing new applet you would like to submit,
|
||||
please wait and submit such things later. We really want to get a release
|
||||
out we can all be proud of. We are still aiming to finish off the -pre
|
||||
series in February and move on to the final 1.0.0 release... So if you
|
||||
spot any bugs, now would be an excellent time to send in a fix to the
|
||||
busybox mailing list. It would also be <b>very</b> helpful if people could
|
||||
help review the BusyBox documentation and submit improvements. It would be
|
||||
especially helpful if people could check that the features supported by the
|
||||
various applets match the features listed in the documentation.
|
||||
|
||||
<p>
|
||||
|
||||
The <a href="downloads/Changelog">changelog</a> has all the details.
|
||||
And as usual you can <a href="downloads">download busybox here</a>.
|
||||
|
||||
<p>Have Fun!
|
||||
<p>
|
||||
|
||||
|
||||
<li><b>4 February 2004 -- BusyBox 1.0.0-pre7 released</b><p>
|
||||
|
||||
There was a bug in -pre6 that broke argument parsing for a
|
||||
|
||||
@@ -26,7 +26,7 @@ Debian installer (boot floppies) project</a>
|
||||
</li><li><a href="http://redhat.com/">Red Hat installer</a>
|
||||
|
||||
</li><li><a href=
|
||||
"http://distro.ibiblio.org/pub/Linux/distributions/slackware/source/rootdsks/">
|
||||
"http://distro.ibiblio.org/pub/Linux/distributions/slackware/slackware-current/source/rootdisks/">
|
||||
Slackware Installer</a>
|
||||
|
||||
</li><li><a href="http://www.gentoo.org/">Gentoo Linux install/boot CDs</a>
|
||||
@@ -71,17 +71,13 @@ nanoEngine</a>
|
||||
</li><li><a href="http://www.ltsp.org/">Linux Terminal
|
||||
Server Project</a>
|
||||
|
||||
</li><li><a href=
|
||||
"http://www.devil-linux.org/">Devil-Linux</a>
|
||||
</li><li><a href="http://www.devil-linux.org/">Devil-Linux</a>
|
||||
|
||||
</li><li><a href=
|
||||
"http://dutnux.sourceforge.net/">DutNux</a>
|
||||
</li><li><a href="http://dutnux.sourceforge.net/">DutNux</a>
|
||||
|
||||
</li><li><a href=
|
||||
"http://www.microwerks.net/~hugo/mindi/">Mindi</a>
|
||||
</li><li><a href="http://www.microwerks.net/~hugo/mindi/">Mindi</a>
|
||||
|
||||
</li><li><a href=
|
||||
"http://www.tzi.de/~pharao90/ttylinux">ttylinux</a>
|
||||
</li><li><a href="http://www.minimalinux.org/ttylinux/">ttylinux</a>
|
||||
|
||||
</li><li><a href="http://www.coyotelinux.com/">Coyote Linux</a>
|
||||
|
||||
@@ -93,6 +89,7 @@ Image</a>
|
||||
</li><li><a href="http://tinfoilhat.cultists.net/">Tinfoil
|
||||
Hat Linux</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>
|
||||
@@ -136,7 +133,30 @@ Hat Linux</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><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
|
||||
cardmgr, device detection, gpm, lspci, etc. Also includes udhcp,
|
||||
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><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><li><a href="http://www.actiontec.com/products/broadband/54mbps_wireless_gateway_1p/index.html">
|
||||
ActionTec GT701-WG Wireless Gateway/DSL Modem</a>
|
||||
with source <a href="http://128.121.226.214/gtproducts/index.html">here</a>
|
||||
</li><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><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><li><a href="http://frwt.stim.ru/">Free Remote Windows Terminal</a>
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -13,7 +13,7 @@ font-family: monospace; font-size: smaller;" width="100">
|
||||
|
||||
|
||||
$ ./busybox
|
||||
BusyBox v1.00 (2004.04.06-14:56+0000) multi-call binary
|
||||
BusyBox v1.00 (2004.10.13-04:49+0000) multi-call binary
|
||||
|
||||
Usage: busybox [function] [arguments]...
|
||||
or: [function] [arguments]...
|
||||
@@ -33,11 +33,11 @@ Currently defined functions:
|
||||
fgrep, find, fold, free, freeramdisk, fsck.minix, ftpget, ftpput, getopt,
|
||||
getty, grep, gunzip, gzip, halt, hdparm, head, hexdump, hostid, hostname,
|
||||
httpd, hush, hwclock, id, ifconfig, ifdown, ifup, inetd, init, insmod,
|
||||
install, ip, ipcalc, iplink, iproute, iptunnel, kill, killall, klogd, lash,
|
||||
last, length, linuxrc, ln, loadfont, loadkmap, logger, login, logname,
|
||||
logread, losetup, ls, lsmod, makedevs, md5sum, mesg, mkdir, mkfifo,
|
||||
mkfs.minix, mknod, mkswap, mktemp, modprobe, more, mount, msh, mt, mv,
|
||||
nameif, nc, netstat, nslookup, od, openvt, passwd, patch, pidof, ping,
|
||||
install, ip, ipaddr, ipcalc, iplink, iproute, iptunnel, kill, killall,
|
||||
klogd, lash, last, length, linuxrc, ln, loadfont, loadkmap, logger, login,
|
||||
logname, logread, losetup, ls, lsmod, makedevs, md5sum, mesg, mkdir,
|
||||
mkfifo, mkfs.minix, mknod, mkswap, mktemp, modprobe, more, mount, msh, mt,
|
||||
mv, nameif, nc, netstat, nslookup, od, openvt, passwd, patch, pidof, ping,
|
||||
ping6, pipe_progress, pivot_root, poweroff, printf, ps, pwd, rdate,
|
||||
readlink, realpath, reboot, renice, reset, rm, rmdir, rmmod, route, rpm,
|
||||
rpm2cpio, run-parts, rx, sed, seq, setkeycodes, sha1sum, sleep, sort,
|
||||
|
||||
+10
-13
@@ -22,9 +22,13 @@ companies listed below should be ashamed of themselves. Furthermore, each
|
||||
product listed here is subject to being legally ordered to cease and desist
|
||||
distribution for violation of copyright law, and the distributor of each
|
||||
product is subject to being sued for statutory copyright infringement damages
|
||||
plus legal fees. Nobody wants to be sued, and <a
|
||||
href="mailto:andersen@codepoet.org">Erik</a> certainly has better things to do
|
||||
than sue people. But he will sue if forced to do so to maintain compliance.
|
||||
of up to $150,000 per work plus legal fees. Nobody wants to be sued, and <a
|
||||
href="mailto:andersen@codepoet.org">Erik</a> certainly would prefer to spend
|
||||
his time doing better things than sue people. But he will sue if forced to
|
||||
do so to maintain compliance.
|
||||
|
||||
<p>
|
||||
|
||||
Do everyone a favor and don't break the law -- if you use busybox, comply with
|
||||
the busybox license by releasing the source code with your product.
|
||||
|
||||
@@ -34,17 +38,9 @@ the busybox license by releasing the source code with your product.
|
||||
|
||||
<li><a href="http://www.trittontechnologies.com/products.html">Tritton Technologies NAS120</a>
|
||||
<br>see <a href="http://www.ussg.iu.edu/hypermail/linux/kernel/0404.0/1611.html">here for details</a>
|
||||
<li><a href="http://www.acronis.com/products/partitionexpert/">Acronis PartitionExpert 2003</a>
|
||||
<br>includes a heavily modified BusyBox v0.60.5 with no source
|
||||
and no offer for source on their website. Some other Acronis
|
||||
products have also been reported as being in violation.
|
||||
<li><a href="http://www.macsense.com/product/homepod/">Macsense HomePod</a>
|
||||
<br>with details
|
||||
<a href="http://developer.gloolabs.com/modules.php?op=modload&name=Forums&file=viewtopic&topic=123&forum=7">here</a>
|
||||
<li><a href="http://www.actiontec.com/products/broadband/54mbps_wireless_gateway_1p/index.html">ActionTec GT701-WG Wireless Gateway/DSL Modem</a>
|
||||
<br>appears to be running BusyBox v0.61.pre, built Jan 09, 2004, but the accompanying
|
||||
CD and documentation do not mention BusyBox, nor the GPL, and no source code is mentioned
|
||||
or offered on their website.
|
||||
<li><a href="http://www.cpx.com/products.asp?c=Wireless+Products">Compex Wireless Products</a>
|
||||
<br>appears to be running v0.60.5 with Linux version 2.4.20-uc0 on ColdFire,
|
||||
but no source code is mentioned or offered.
|
||||
@@ -55,8 +51,6 @@ the busybox license by releasing the source code with your product.
|
||||
<li><a href="http://www.trendware.com/products/TEW-410APB.htm">TRENDnet TEW-410APB</a>
|
||||
</li><li><a href="http://www.hauppauge.com/Pages/products/data_mediamvp.html">Hauppauge Media MVP</a>
|
||||
<br>Hauppauge contacted me on 16 Dec 2003, and claims to be working on resolving this problem.
|
||||
</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>
|
||||
</li><li><a href="http://www.usr.com/">U.S. Robotics Sureconnect 4-port ADSL router</a>
|
||||
</li><li><a href="http://www.hitex.com/download/adescom/data/">TriCore</a>
|
||||
</li><li><a href="http://www.allnet.de/">ALLNET 0186 wireless router</a>
|
||||
</li><li><a href="http://www.dmmtv.com/">Dreambox DM7000S DVB Satellite Receiver</a>
|
||||
@@ -71,6 +65,9 @@ the busybox license by releasing the source code with your product.
|
||||
</li><li><a href="http://www.vinc.us/">Bravo DVD players using the Sigma Designs EM8500</a>
|
||||
</li><li><a href="http://www.hb-direct.com/">H&B DX3110 Divx player based on Sigma Designs EM8500</a>
|
||||
</li><li><a href="http://www.recospa.it/mdpro1/index.php">United *DVX4066 mpeg4 capable DVD players</a>
|
||||
</li><li><a href="http://www.a-link.com/RR64AP.html">Avaks alink Roadrunner 64</a>
|
||||
<br> Partial source available, based on source distributed under NDA from <a href="http://www.lsilogic.com/products/dsl_platform_solutions/hb_linuxr2_2.html"> LSILogic</a>. Why the NDA LSILogic, what are you hiding ?
|
||||
<br>To verify the Avaks infrigment see my slashdot <a href="http://slashdot.org/~bug1/journal/">journal</a>.
|
||||
</li><li>Undoubtedly there are others... Please report them so we can shame them (or if necessary sue them) into compliance.
|
||||
|
||||
</ul>
|
||||
|
||||
@@ -156,9 +156,11 @@ John Lombardo <john@deltanet.com>
|
||||
|
||||
=for html <br>
|
||||
|
||||
Glenn McGrath <bug1@optushome.com.au>
|
||||
Glenn McGrath <bug1@iinet.net.au>
|
||||
|
||||
ar, dpkg, dpkg-deb
|
||||
Common unarchving code and unarchiving applets, ifupdown, ftpgetput,
|
||||
nameif, sed, patch, fold, install, uudecode.
|
||||
Various bugfixes, review and apply numerous patches.
|
||||
|
||||
=for html <br>
|
||||
|
||||
@@ -252,5 +254,5 @@ Tito Ragusa <farmatito@tiscali.it>
|
||||
|
||||
=cut
|
||||
|
||||
# $Id: busybox_footer.pod,v 1.16 2004/04/13 16:31:41 andersen Exp $
|
||||
# $Id: busybox_footer.pod,v 1.18 2004/04/25 06:05:14 bug1 Exp $
|
||||
|
||||
@@ -89,11 +89,11 @@ Currently defined functions include:
|
||||
fgrep, find, fold, free, freeramdisk, fsck.minix, ftpget, ftpput, getopt,
|
||||
getty, grep, gunzip, gzip, halt, hdparm, head, hexdump, hostid, hostname,
|
||||
httpd, hush, hwclock, id, ifconfig, ifdown, ifup, inetd, init, insmod,
|
||||
install, ip, ipcalc, iplink, iproute, iptunnel, kill, killall, klogd, lash,
|
||||
last, length, linuxrc, ln, loadfont, loadkmap, logger, login, logname,
|
||||
logread, losetup, ls, lsmod, makedevs, md5sum, mesg, mkdir, mkfifo,
|
||||
mkfs.minix, mknod, mkswap, mktemp, modprobe, more, mount, msh, mt, mv,
|
||||
nameif, nc, netstat, nslookup, od, openvt, passwd, patch, pidof, ping,
|
||||
install, ip, ipaddr, ipcalc, iplink, iproute, iptunnel, kill, killall,
|
||||
klogd, lash, last, length, linuxrc, ln, loadfont, loadkmap, logger, login,
|
||||
logname, logread, losetup, ls, lsmod, makedevs, md5sum, mesg, mkdir,
|
||||
mkfifo, mkfs.minix, mknod, mkswap, mktemp, modprobe, more, mount, msh, mt,
|
||||
mv, nameif, nc, netstat, nslookup, od, openvt, passwd, patch, pidof, ping,
|
||||
ping6, pipe_progress, pivot_root, poweroff, printf, ps, pwd, rdate,
|
||||
readlink, realpath, reboot, renice, reset, rm, rmdir, rmmod, route, rpm,
|
||||
rpm2cpio, run-parts, rx, sed, seq, setkeycodes, sha1sum, sleep, sort,
|
||||
|
||||
@@ -73,7 +73,7 @@ Areas Where You Can Help
|
||||
------------------------
|
||||
|
||||
Busybox can always use improvement! If you're looking for ways to help, there
|
||||
there are a variety of areas where you could help.
|
||||
are a variety of areas where you could help.
|
||||
|
||||
|
||||
What Busybox Doesn't Need
|
||||
@@ -214,7 +214,7 @@ These are dirty jobs, but somebody's gotta do 'em.
|
||||
is very Perl-specific, but the advice given in here applies equally well to
|
||||
C.
|
||||
|
||||
- C library funciton use audits: Verifying that functions are being used
|
||||
- C library function use audits: Verifying that functions are being used
|
||||
properly (called with the right args), replacing unsafe library functions
|
||||
with safer versions, making sure return codes are being checked, etc.
|
||||
|
||||
|
||||
+7
-5
@@ -17,13 +17,15 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TOPDIR:= ../
|
||||
top_srcdir=..
|
||||
top_builddir=..
|
||||
srcdir=$(top_srcdir)/editors
|
||||
EDITOR_DIR:=./
|
||||
include $(TOPDIR).config
|
||||
include $(TOPDIR)Rules.mak
|
||||
include Makefile.in
|
||||
include $(top_builddir)/Rules.mak
|
||||
include $(top_builddir)/.config
|
||||
include $(srcdir)/Makefile.in
|
||||
all: $(libraries-y)
|
||||
-include $(TOPDIR).depend
|
||||
-include $(top_builddir)/.depend
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a $(AR_TARGET)
|
||||
|
||||
+5
-1
@@ -19,8 +19,9 @@
|
||||
|
||||
EDITOR_AR:=editors.a
|
||||
ifndef $(EDITOR_DIR)
|
||||
EDITOR_DIR:=$(TOPDIR)editors/
|
||||
EDITOR_DIR:=$(top_builddir)/editors/
|
||||
endif
|
||||
srcdir=$(top_srcdir)/editors
|
||||
|
||||
EDITOR-y:=
|
||||
EDITOR-$(CONFIG_AWK) += awk.o
|
||||
@@ -42,3 +43,6 @@ endif
|
||||
$(EDITOR_DIR)$(EDITOR_AR): $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
|
||||
$(AR) -ro $@ $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
|
||||
|
||||
$(EDITOR_DIR)%.o: $(srcdir)/%.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
|
||||
|
||||
+9
-3
@@ -784,7 +784,7 @@ static int istrue(var *v) {
|
||||
return (v->string && *(v->string)) ? 1 : 0;
|
||||
}
|
||||
|
||||
/* temporary varables allocator. Last allocated should be first freed */
|
||||
/* temporary variables allocator. Last allocated should be first freed */
|
||||
static var *nvalloc(int n) {
|
||||
|
||||
nvblock *pb = NULL;
|
||||
@@ -1211,6 +1211,7 @@ static void chain_group(void) {
|
||||
|
||||
if (c & TC_GRPSTART) {
|
||||
while(next_token(TC_GRPSEQ | TC_GRPTERM) != TC_GRPTERM) {
|
||||
if (t.tclass & TC_NEWLINE) continue;
|
||||
rollback_token();
|
||||
chain_group();
|
||||
}
|
||||
@@ -1386,7 +1387,7 @@ static node *mk_splitter(char *s, tsplitter *spl) {
|
||||
}
|
||||
|
||||
/* use node as a regular expression. Supplied with node ptr and regex_t
|
||||
* storage space. Return ptr to regex (if result points to preg, it shuold
|
||||
* storage space. Return ptr to regex (if result points to preg, it should
|
||||
* be later regfree'd manually
|
||||
*/
|
||||
static regex_t *as_regex(node *op, regex_t *preg) {
|
||||
@@ -1553,7 +1554,7 @@ static void handle_special(var *v) {
|
||||
memcpy(b+len, s, l);
|
||||
len += l;
|
||||
}
|
||||
b[len] = '\0';
|
||||
if (b) b[len] = '\0';
|
||||
setvar_p(V[F0], b);
|
||||
is_f0_split = TRUE;
|
||||
|
||||
@@ -2550,6 +2551,7 @@ static int awk_exit(int r) {
|
||||
|
||||
if (! exiting) {
|
||||
exiting = TRUE;
|
||||
nextrec = FALSE;
|
||||
evaluate(endseq.first, &tv);
|
||||
}
|
||||
|
||||
@@ -2669,8 +2671,12 @@ extern int awk_main(int argc, char **argv) {
|
||||
for (envp=environ; *envp; envp++) {
|
||||
s = bb_xstrdup(*envp);
|
||||
s1 = strchr(s, '=');
|
||||
if (!s1) {
|
||||
goto keep_going;
|
||||
}
|
||||
*(s1++) = '\0';
|
||||
setvar_u(findvar(iamarray(V[ENVIRON]), s), s1);
|
||||
keep_going:
|
||||
free(s);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* busybox patch applet to handle the unified diff format.
|
||||
* Copyright (C) 2003 Glenn McGrath <bug1@optushome.com.au>
|
||||
* Copyright (C) 2003 Glenn McGrath <bug1@iinet.net.au>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
+16
-9
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1999,2000,2001 by Lineo, inc. and Mark Whitley
|
||||
* Copyright (C) 1999,2000,2001 by Mark Whitley <markw@codepoet.org>
|
||||
* Copyright (C) 2002 Matt Kraai
|
||||
* Copyright (C) 2003 by Glenn McGrath <bug1@optushome.com.au>
|
||||
* Copyright (C) 2003 by Glenn McGrath <bug1@iinet.net.au>
|
||||
* Copyright (C) 2003,2004 by Rob Landley <rob@landley.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -112,7 +112,7 @@ typedef struct sed_cmd_s {
|
||||
|
||||
/* globals */
|
||||
/* options */
|
||||
static int be_quiet = 0, in_place=0;
|
||||
static int be_quiet = 0, in_place=0, regex_type=0;
|
||||
FILE *nonstdout;
|
||||
char *outname;
|
||||
|
||||
@@ -210,7 +210,7 @@ static char *copy_parsing_slashn(const char *string, int len)
|
||||
/*
|
||||
* index_of_next_unescaped_regexp_delim - walks left to right through a string
|
||||
* beginning at a specified index and returns the index of the next regular
|
||||
* expression delimiter (typically a forward * slash ('/')) not preceeded by
|
||||
* expression delimiter (typically a forward * slash ('/')) not preceded by
|
||||
* a backslash ('\').
|
||||
*/
|
||||
static int index_of_next_unescaped_regexp_delim(const char delimiter,
|
||||
@@ -298,7 +298,7 @@ static int get_address(char *my_str, int *linenum, regex_t ** regex)
|
||||
|
||||
temp=copy_parsing_slashn(pos,next);
|
||||
*regex = (regex_t *) xmalloc(sizeof(regex_t));
|
||||
xregcomp(*regex, temp, REG_NEWLINE);
|
||||
xregcomp(*regex, temp, regex_type|REG_NEWLINE);
|
||||
free(temp);
|
||||
/* Move position to next character after last delimiter */
|
||||
pos+=(next+1);
|
||||
@@ -326,7 +326,7 @@ static int parse_file_cmd(sed_cmd_t * sed_cmd, const char *filecmdstr, char **re
|
||||
|
||||
static int parse_subst_cmd(sed_cmd_t * const sed_cmd, char *substr)
|
||||
{
|
||||
int cflags = 0;
|
||||
int cflags = regex_type;
|
||||
char *match;
|
||||
int idx = 0;
|
||||
|
||||
@@ -1096,7 +1096,9 @@ static void add_cmd_block(char *cmdstr)
|
||||
|
||||
extern int sed_main(int argc, char **argv)
|
||||
{
|
||||
int opt, status = EXIT_SUCCESS;
|
||||
int status = EXIT_SUCCESS;
|
||||
int opt;
|
||||
uint8_t getpat = 1;
|
||||
|
||||
#ifdef CONFIG_FEATURE_CLEAN_UP
|
||||
/* destroy command strings on exit */
|
||||
@@ -1113,17 +1115,21 @@ extern int sed_main(int argc, char **argv)
|
||||
#endif
|
||||
|
||||
/* do normal option parsing */
|
||||
while ((opt = getopt(argc, argv, "ine:f:")) > 0) {
|
||||
while ((opt = getopt(argc, argv, "irne:f:")) > 0) {
|
||||
switch (opt) {
|
||||
case 'i':
|
||||
in_place++;
|
||||
atexit(cleanup_outname);
|
||||
break;
|
||||
case 'r':
|
||||
regex_type|=REG_EXTENDED;
|
||||
break;
|
||||
case 'n':
|
||||
be_quiet++;
|
||||
break;
|
||||
case 'e':
|
||||
add_cmd_block(optarg);
|
||||
getpat=0;
|
||||
break;
|
||||
case 'f':
|
||||
{
|
||||
@@ -1135,6 +1141,7 @@ extern int sed_main(int argc, char **argv)
|
||||
while ((line = bb_get_chomped_line_from_file(cmdfile))
|
||||
!= NULL) {
|
||||
add_cmd(line);
|
||||
getpat=0;
|
||||
free(line);
|
||||
}
|
||||
bb_xprint_and_close_file(cmdfile);
|
||||
@@ -1148,7 +1155,7 @@ extern int sed_main(int argc, char **argv)
|
||||
|
||||
/* if we didn't get a pattern from a -e and no command file was specified,
|
||||
* argv[optind] should be the pattern. no pattern, no worky */
|
||||
if (sed_cmd_head.next == NULL) {
|
||||
if(getpat) {
|
||||
if (argv[optind] == NULL)
|
||||
bb_show_usage();
|
||||
else
|
||||
@@ -1189,7 +1196,7 @@ extern int sed_main(int argc, char **argv)
|
||||
nonstdout=bb_wfopen(outname,"w");
|
||||
/* Set permissions of output file */
|
||||
fstat(fileno(file),&statbuf);
|
||||
fchmod(fileno(file),statbuf.st_mode);
|
||||
fchmod(fileno(nonstdout),statbuf.st_mode);
|
||||
atexit(cleanup_outname);
|
||||
}
|
||||
process_file(file);
|
||||
|
||||
+10
-9
@@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
static const char vi_Version[] =
|
||||
"$Id: vi.c,v 1.35 2004/03/31 11:12:51 andersen Exp $";
|
||||
"$Id: vi.c,v 1.38 2004/08/19 19:15:06 andersen Exp $";
|
||||
|
||||
/*
|
||||
* To compile for standalone use:
|
||||
@@ -45,7 +45,7 @@ static const char vi_Version[] =
|
||||
* An "ex" line oriented mode- maybe using "cmdedit"
|
||||
*/
|
||||
|
||||
//---- Feature -------------- Bytes to immplement
|
||||
//---- Feature -------------- Bytes to implement
|
||||
#ifdef STANDALONE
|
||||
#define vi_main main
|
||||
#define CONFIG_FEATURE_VI_COLON // 4288
|
||||
@@ -507,7 +507,6 @@ static void edit_file(Byte * fn)
|
||||
#endif /* CONFIG_FEATURE_VI_DOT_CMD */
|
||||
redraw(FALSE); // dont force every col re-draw
|
||||
show_status_line();
|
||||
fflush(stdout);
|
||||
|
||||
//------This is the main Vi cmd handling loop -----------------------
|
||||
while (editing > 0) {
|
||||
@@ -641,7 +640,7 @@ static Byte *get_address(Byte *p, int *b, int *e) // get two colon addrs, if pre
|
||||
p = get_one_address(p, b);
|
||||
while (isblnk(*p))
|
||||
p++;
|
||||
if (*p == ',') { // is there a address seperator
|
||||
if (*p == ',') { // is there a address separator
|
||||
p++;
|
||||
while (isblnk(*p))
|
||||
p++;
|
||||
@@ -676,7 +675,7 @@ static void colon(Byte * buf)
|
||||
Byte c, *orig_buf, *buf1, *q, *r;
|
||||
Byte *fn, cmd[BUFSIZ], args[BUFSIZ];
|
||||
int i, l, li, ch, st, b, e;
|
||||
int useforce, forced;
|
||||
int useforce = FALSE, forced = FALSE;
|
||||
struct stat st_buf;
|
||||
|
||||
// :3154 // if (-e line 3154) goto it else stay put
|
||||
@@ -693,12 +692,12 @@ static void colon(Byte * buf)
|
||||
// :s/find/replace/ // substitute pattern "find" with "replace"
|
||||
// :!<cmd> // run <cmd> then return
|
||||
//
|
||||
|
||||
if (strlen((char *) buf) <= 0)
|
||||
goto vc1;
|
||||
if (*buf == ':')
|
||||
buf++; // move past the ':'
|
||||
|
||||
forced = useforce = FALSE;
|
||||
li = st = ch = i = 0;
|
||||
b = e = -1;
|
||||
q = text; // assume 1,$ for the range
|
||||
@@ -1452,7 +1451,7 @@ static Byte *new_screen(int ro, int co)
|
||||
screen = (Byte *) xmalloc(screensize);
|
||||
// initialize the new screen. assume this will be a empty file.
|
||||
screen_erase();
|
||||
// non-existant text[] lines start with a tilde (~).
|
||||
// non-existent text[] lines start with a tilde (~).
|
||||
for (li = 1; li < ro - 1; li++) {
|
||||
screen[(li * co) + 0] = '~';
|
||||
}
|
||||
@@ -2528,7 +2527,7 @@ static int file_write(Byte * fn, Byte * first, Byte * last)
|
||||
|
||||
//----- Terminal Drawing ---------------------------------------
|
||||
// The terminal is made up of 'rows' line of 'columns' columns.
|
||||
// classicly this would be 24 x 80.
|
||||
// classically this would be 24 x 80.
|
||||
// screen coordinates
|
||||
// 0,0 ... 0,79
|
||||
// 1,0 ... 1,79
|
||||
@@ -2660,6 +2659,7 @@ static void show_status_line(void)
|
||||
static int last_cksum;
|
||||
int l, cnt, cksum;
|
||||
|
||||
edit_status();
|
||||
cnt = strlen((char *) status_buffer);
|
||||
for (cksum= l= 0; l < cnt; l++) { cksum += (int)(status_buffer[l]); }
|
||||
// don't write the status line unless it changes
|
||||
@@ -2670,6 +2670,7 @@ static void show_status_line(void)
|
||||
clear_to_eol();
|
||||
place_cursor(crow, ccol, FALSE); // put cursor back in correct place
|
||||
}
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
//----- format the status buffer, the bottom line of screen ------
|
||||
@@ -3222,7 +3223,7 @@ key_cmd_mode:
|
||||
case 'f': // f- forward to a user specified char
|
||||
last_forward_char = get_one_char(); // get the search char
|
||||
//
|
||||
// dont seperate these two commands. 'f' depends on ';'
|
||||
// dont separate these two commands. 'f' depends on ';'
|
||||
//
|
||||
//**** fall thru to ... 'i'
|
||||
case ';': // ;- look at rest of line for last forward char
|
||||
|
||||
@@ -15,9 +15,10 @@ then
|
||||
do :
|
||||
done
|
||||
|
||||
metric=0
|
||||
for i in $router
|
||||
do
|
||||
/sbin/route add default gw $i dev $interface
|
||||
/sbin/route add default gw $i dev $interface metric $((metric++))
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
@@ -15,9 +15,10 @@ then
|
||||
do :
|
||||
done
|
||||
|
||||
metric=0
|
||||
for i in $router
|
||||
do
|
||||
/sbin/route add default gw $i dev $interface
|
||||
/sbin/route add default gw $i dev $interface metric $((metric++))
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
@@ -22,8 +22,9 @@ case "$1" in
|
||||
:
|
||||
done
|
||||
|
||||
metric=0
|
||||
for i in $router ; do
|
||||
route add default gw $i dev $interface
|
||||
route add default gw $i dev $interface metric $((metric++))
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
@@ -114,3 +114,10 @@ option lease 864000 # 10 days of seconds
|
||||
#opt ntpsrv
|
||||
#opt tftp
|
||||
#opt bootfile
|
||||
|
||||
|
||||
# Static leases map
|
||||
#static_lease 00:60:08:11:CE:4E 192.168.0.54
|
||||
#static_lease 00:60:08:11:CE:3E 192.168.0.44
|
||||
|
||||
|
||||
+7
-5
@@ -17,13 +17,15 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TOPDIR:= ../
|
||||
top_srcdir=..
|
||||
top_builddir=..
|
||||
srcdir=$(top_srcdir)/findutils
|
||||
FINDUTILS_DIR:=./
|
||||
include $(TOPDIR).config
|
||||
include $(TOPDIR)Rules.mak
|
||||
include Makefile.in
|
||||
include $(top_builddir)/Rules.mak
|
||||
include $(top_builddir)/.config
|
||||
include $(srcdir)/Makefile.in
|
||||
all: $(libraries-y)
|
||||
-include $(TOPDIR).depend
|
||||
-include $(top_builddir)/.depend
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a $(AR_TARGET)
|
||||
|
||||
@@ -19,8 +19,9 @@
|
||||
|
||||
FINDUTILS_AR:=findutils.a
|
||||
ifndef $(FINDUTILS_DIR)
|
||||
FINDUTILS_DIR:=$(TOPDIR)findutils/
|
||||
FINDUTILS_DIR:=$(top_builddir)/findutils/
|
||||
endif
|
||||
srcdir=$(top_srcdir)/findutils
|
||||
|
||||
FINDUTILS-y:=
|
||||
FINDUTILS-$(CONFIG_FIND) += find.o
|
||||
@@ -32,3 +33,6 @@ libraries-y+=$(FINDUTILS_DIR)$(FINDUTILS_AR)
|
||||
$(FINDUTILS_DIR)$(FINDUTILS_AR): $(patsubst %,$(FINDUTILS_DIR)%, $(FINDUTILS-y))
|
||||
$(AR) -ro $@ $(patsubst %,$(FINDUTILS_DIR)%, $(FINDUTILS-y))
|
||||
|
||||
$(FINDUTILS_DIR)%.o: $(srcdir)/%.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
|
||||
|
||||
+36
-30
@@ -20,8 +20,8 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* Jun 2003 by Vladimir Oleynik <dzo@simtreas.ru> -
|
||||
* correction "-e pattern1 -e -e pattern2" logic and more optimizations.
|
||||
* Apr 2004 by Vladimir Oleynik <dzo@simtreas.ru> -
|
||||
* correction "-e pattern1 -e pattern2" logic and more optimizations.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -34,36 +34,38 @@
|
||||
|
||||
|
||||
/* options */
|
||||
#define GREP_OPTS "lnqvscFiHhe:f:"
|
||||
#define GREP_OPT_l 1
|
||||
#define GREP_OPTS "lnqvscFiHhe:f:L"
|
||||
#define GREP_OPT_l (1<<0)
|
||||
static char print_files_with_matches;
|
||||
#define GREP_OPT_n 2
|
||||
#define GREP_OPT_n (1<<1)
|
||||
static char print_line_num;
|
||||
#define GREP_OPT_q 4
|
||||
#define GREP_OPT_q (1<<2)
|
||||
static char be_quiet;
|
||||
#define GREP_OPT_v 8
|
||||
#define GREP_OPT_v (1<<3)
|
||||
typedef char invert_search_t;
|
||||
static invert_search_t invert_search;
|
||||
#define GREP_OPT_s 16
|
||||
#define GREP_OPT_s (1<<4)
|
||||
static char suppress_err_msgs;
|
||||
#define GREP_OPT_c 32
|
||||
#define GREP_OPT_c (1<<5)
|
||||
static char print_match_counts;
|
||||
#define GREP_OPT_F 64
|
||||
#define GREP_OPT_F (1<<6)
|
||||
static char fgrep_flag;
|
||||
#define GREP_OPT_i 128
|
||||
#define GREP_OPT_H 256
|
||||
#define GREP_OPT_h 512
|
||||
#define GREP_OPT_e 1024
|
||||
#define GREP_OPT_f 2048
|
||||
#define GREP_OPT_i (1<<7)
|
||||
#define GREP_OPT_H (1<<8)
|
||||
#define GREP_OPT_h (1<<9)
|
||||
#define GREP_OPT_e (1<<10)
|
||||
#define GREP_OPT_f (1<<11)
|
||||
#define GREP_OPT_L (1<<12)
|
||||
static char print_files_without_matches;
|
||||
#ifdef CONFIG_FEATURE_GREP_CONTEXT
|
||||
#define GREP_OPT_CONTEXT "A:B:C"
|
||||
#define GREP_OPT_A 4096
|
||||
#define GREP_OPT_B 8192
|
||||
#define GREP_OPT_C 16384
|
||||
#define GREP_OPT_E 32768U
|
||||
#define GREP_OPT_A (1<<13)
|
||||
#define GREP_OPT_B (1<<14)
|
||||
#define GREP_OPT_C (1<<15)
|
||||
#define GREP_OPT_E (1<<16)
|
||||
#else
|
||||
#define GREP_OPT_CONTEXT ""
|
||||
#define GREP_OPT_E 4096
|
||||
#define GREP_OPT_E (1<<13)
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_GREP_EGREP_ALIAS
|
||||
# define OPT_EGREP "E"
|
||||
@@ -89,7 +91,7 @@ static char *cur_file; /* the current file we are reading */
|
||||
static void print_line(const char *line, int linenum, char decoration)
|
||||
{
|
||||
#ifdef CONFIG_FEATURE_GREP_CONTEXT
|
||||
/* possibly print the little '--' seperator */
|
||||
/* possibly print the little '--' separator */
|
||||
if ((lines_before || lines_after) && last_line_printed &&
|
||||
last_line_printed < linenum - 1) {
|
||||
puts("--");
|
||||
@@ -135,11 +137,9 @@ static int grep_file(FILE *file)
|
||||
*/
|
||||
regex_t regex;
|
||||
xregcomp(®ex, pattern_ptr->data, reflags);
|
||||
ret = regexec(®ex, line, 0, NULL, 0) == 0;
|
||||
ret |= regexec(®ex, line, 0, NULL, 0) == 0;
|
||||
regfree(®ex);
|
||||
}
|
||||
if (!ret)
|
||||
break;
|
||||
pattern_ptr = pattern_ptr->link;
|
||||
} /* while (pattern_ptr) */
|
||||
|
||||
@@ -149,7 +149,7 @@ static int grep_file(FILE *file)
|
||||
free(line);
|
||||
|
||||
/* if we found a match but were told to be quiet, stop here */
|
||||
if (be_quiet)
|
||||
if (be_quiet || print_files_without_matches)
|
||||
return -1;
|
||||
|
||||
/* keep track of matches */
|
||||
@@ -229,6 +229,11 @@ static int grep_file(FILE *file)
|
||||
puts(cur_file);
|
||||
}
|
||||
|
||||
/* grep -L: print just the filename, but only if we didn't grep the line in the file */
|
||||
if (print_files_without_matches && nmatches == 0) {
|
||||
puts(cur_file);
|
||||
}
|
||||
|
||||
return nmatches;
|
||||
}
|
||||
|
||||
@@ -244,9 +249,9 @@ static void load_regexes_from_file(llist_t *fopt)
|
||||
fopt = cur->link;
|
||||
free(cur);
|
||||
f = bb_xfopen(ffile, "r");
|
||||
while ((line = bb_get_chomped_line_from_file(f)) != NULL) {
|
||||
pattern_head = llist_add_to(pattern_head, line);
|
||||
}
|
||||
while ((line = bb_get_chomped_line_from_file(f)) != NULL) {
|
||||
pattern_head = llist_add_to(pattern_head, line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,7 +261,7 @@ extern int grep_main(int argc, char **argv)
|
||||
FILE *file;
|
||||
int matched;
|
||||
unsigned long opt;
|
||||
llist_t *fopt;
|
||||
llist_t *fopt = NULL;
|
||||
|
||||
/* do normal option parsing */
|
||||
#ifdef CONFIG_FEATURE_GREP_CONTEXT
|
||||
@@ -292,7 +297,7 @@ extern int grep_main(int argc, char **argv)
|
||||
bb_error_msg_and_die("invalid context length argument");
|
||||
}
|
||||
/* sanity checks after parse may be invalid numbers ;-) */
|
||||
if ((opt & (GREP_OPT_c|GREP_OPT_q|GREP_OPT_l))) {
|
||||
if ((opt & (GREP_OPT_c|GREP_OPT_q|GREP_OPT_l|GREP_OPT_L))) {
|
||||
opt &= ~GREP_OPT_n;
|
||||
lines_before = 0;
|
||||
lines_after = 0;
|
||||
@@ -307,6 +312,7 @@ extern int grep_main(int argc, char **argv)
|
||||
|
||||
#endif
|
||||
print_files_with_matches = opt & GREP_OPT_l;
|
||||
print_files_without_matches = (opt & GREP_OPT_L) != 0;
|
||||
print_line_num = opt & GREP_OPT_n;
|
||||
be_quiet = opt & GREP_OPT_q;
|
||||
invert_search = (opt & GREP_OPT_v) != 0; /* 0 | 1 */
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
* (C) 2002,2003 by Vladimir Oleynik <dzo@simtreas.ru>
|
||||
*
|
||||
* Special thanks
|
||||
* - Mark Whitley and Glenn McGrath for stimul to rewrote :)
|
||||
* - Mark Whitley and Glenn McGrath for stimulus to rewrite :)
|
||||
* - Mike Rendell <michael@cs.mun.ca>
|
||||
* and David MacKenzie <djm@gnu.ai.mit.edu>.
|
||||
*
|
||||
|
||||
+1
-10
@@ -341,7 +341,7 @@
|
||||
APPLET(logger, logger_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
|
||||
#endif
|
||||
#ifdef CONFIG_LOGIN
|
||||
APPLET(login, login_main, _BB_DIR_BIN, _BB_SUID_NEVER)
|
||||
APPLET(login, login_main, _BB_DIR_BIN, _BB_SUID_ALWAYS)
|
||||
#endif
|
||||
#ifdef CONFIG_LOGNAME
|
||||
APPLET(logname, logname_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
|
||||
@@ -367,9 +367,6 @@
|
||||
#ifdef CONFIG_MESG
|
||||
APPLET(mesg, mesg_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
|
||||
#endif
|
||||
#ifdef CONFIG_MINIT
|
||||
APPLET(minit, minit_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
|
||||
#endif
|
||||
#ifdef CONFIG_MKDIR
|
||||
APPLET(mkdir, mkdir_main, _BB_DIR_BIN, _BB_SUID_NEVER)
|
||||
#endif
|
||||
@@ -400,9 +397,6 @@
|
||||
#ifdef CONFIG_MSH
|
||||
APPLET_NOUSAGE("msh", msh_main, _BB_DIR_BIN, _BB_SUID_NEVER)
|
||||
#endif
|
||||
#ifdef CONFIG_MSVC
|
||||
APPLET(msvc, msvc_main, _BB_DIR_BIN, _BB_SUID_NEVER)
|
||||
#endif
|
||||
#ifdef CONFIG_MT
|
||||
APPLET(mt, mt_main, _BB_DIR_BIN, _BB_SUID_NEVER)
|
||||
#endif
|
||||
@@ -433,9 +427,6 @@
|
||||
#ifdef CONFIG_PATCH
|
||||
APPLET(patch, patch_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
|
||||
#endif
|
||||
#ifdef CONFIG_PIDFILEHACK
|
||||
APPLET(pidfilehack, pidfilehack_main, _BB_DIR_BIN, _BB_SUID_NEVER)
|
||||
#endif
|
||||
#ifdef CONFIG_PIDOF
|
||||
APPLET(pidof, pidof_main, _BB_DIR_BIN, _BB_SUID_NEVER)
|
||||
#endif
|
||||
|
||||
+95
-18
@@ -1,39 +1,116 @@
|
||||
#ifndef __CONFIG_GRP_H
|
||||
#define __CONFIG_GRP_H
|
||||
/* Copyright (C) 1991,92,95,96,97,98,99,2000,01 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/*
|
||||
* POSIX Standard: 9.2.1 Group Database Access <grp.h>
|
||||
*/
|
||||
|
||||
|
||||
#if !defined CONFIG_USE_BB_PWD_GRP
|
||||
#include <grp.h>
|
||||
|
||||
#else
|
||||
|
||||
#ifndef _GRP_H
|
||||
#define _GRP_H 1
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <features.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
/* The group structure */
|
||||
/* The group structure. */
|
||||
struct group
|
||||
{
|
||||
char *gr_name; /* Group name. */
|
||||
char *gr_passwd; /* Password. */
|
||||
gid_t gr_gid; /* Group ID. */
|
||||
char **gr_mem; /* Member list. */
|
||||
char *gr_name; /* Group name. */
|
||||
char *gr_passwd; /* Password. */
|
||||
gid_t gr_gid; /* Group ID. */
|
||||
char **gr_mem; /* Member list. */
|
||||
};
|
||||
|
||||
extern void setgrent __P ((void));
|
||||
extern void endgrent __P ((void));
|
||||
extern struct group * getgrent __P ((void));
|
||||
|
||||
extern struct group * getgrgid __P ((__const gid_t gid));
|
||||
extern struct group * getgrnam __P ((__const char * name));
|
||||
/* Rewind the group-file stream. */
|
||||
extern void setgrent (void);
|
||||
|
||||
extern struct group * fgetgrent __P ((FILE * file));
|
||||
/* Close the group-file stream. */
|
||||
extern void endgrent (void);
|
||||
|
||||
extern int setgroups __P ((size_t n, __const gid_t * groups));
|
||||
extern int initgroups __P ((__const char * user, gid_t gid));
|
||||
/* Read an entry from the group-file stream, opening it if necessary. */
|
||||
extern struct group *getgrent (void);
|
||||
|
||||
extern struct group * bb_getgrent __P ((int grp_fd));
|
||||
/* Read a group entry from STREAM. */
|
||||
extern struct group *fgetgrent (FILE *__stream);
|
||||
|
||||
#endif /* USE_SYSTEM_PWD_GRP */
|
||||
#endif /* __CONFIG_GRP_H */
|
||||
/* Write the given entry onto the given stream. */
|
||||
extern int putgrent (__const struct group *__restrict __p,
|
||||
FILE *__restrict __f);
|
||||
|
||||
/* Search for an entry with a matching group ID. */
|
||||
extern struct group *getgrgid (gid_t __gid);
|
||||
|
||||
/* Search for an entry with a matching group name. */
|
||||
extern struct group *getgrnam (__const char *__name);
|
||||
|
||||
/* Reentrant versions of some of the functions above.
|
||||
|
||||
PLEASE NOTE: the `getgrent_r' function is not (yet) standardized.
|
||||
The interface may change in later versions of this library. But
|
||||
the interface is designed following the principals used for the
|
||||
other reentrant functions so the chances are good this is what the
|
||||
POSIX people would choose. */
|
||||
|
||||
extern int getgrent_r (struct group *__restrict __resultbuf,
|
||||
char *__restrict __buffer, size_t __buflen,
|
||||
struct group **__restrict __result);
|
||||
|
||||
/* Search for an entry with a matching group ID. */
|
||||
extern int getgrgid_r (gid_t __gid, struct group *__restrict __resultbuf,
|
||||
char *__restrict __buffer, size_t __buflen,
|
||||
struct group **__restrict __result);
|
||||
|
||||
/* Search for an entry with a matching group name. */
|
||||
extern int getgrnam_r (__const char *__restrict __name,
|
||||
struct group *__restrict __resultbuf,
|
||||
char *__restrict __buffer, size_t __buflen,
|
||||
struct group **__restrict __result);
|
||||
|
||||
/* Read a group entry from STREAM. This function is not standardized
|
||||
an probably never will. */
|
||||
extern int fgetgrent_r (FILE *__restrict __stream,
|
||||
struct group *__restrict __resultbuf,
|
||||
char *__restrict __buffer, size_t __buflen,
|
||||
struct group **__restrict __result);
|
||||
|
||||
/* Set the group set for the current user to GROUPS (N of them). */
|
||||
extern int setgroups (size_t __n, __const gid_t *__groups);
|
||||
|
||||
/* Store at most *NGROUPS members of the group set for USER into
|
||||
*GROUPS. Also include GROUP. The actual number of groups found is
|
||||
returned in *NGROUPS. Return -1 if the if *NGROUPS is too small. */
|
||||
extern int getgrouplist (__const char *__user, gid_t __group,
|
||||
gid_t *__groups, int *__ngroups);
|
||||
|
||||
/* Initialize the group set for the current user
|
||||
by reading the group database and using all groups
|
||||
of which USER is a member. Also include GROUP. */
|
||||
extern int initgroups (__const char *__user, gid_t __group);
|
||||
|
||||
|
||||
#endif /* grp.h */
|
||||
#endif
|
||||
+5
-9
@@ -134,7 +134,7 @@ extern void write_mtab(char* blockDevice, char* directory,
|
||||
char* filesystemType, long flags, char* string_flags);
|
||||
extern void erase_mtab(const char * name);
|
||||
extern long *find_pid_by_name( const char* pidName);
|
||||
extern char *find_real_root_device_name(const char* name);
|
||||
extern char *find_real_root_device_name(void);
|
||||
extern char *bb_get_line_from_file(FILE *file);
|
||||
extern char *bb_get_chomped_line_from_file(FILE *file);
|
||||
extern int bb_copyfd_size(int fd1, int fd2, const off_t size);
|
||||
@@ -230,9 +230,10 @@ extern unsigned long bb_xparse_number(const char *numstr,
|
||||
* increases target size and is often not needed embedded systems. */
|
||||
extern long my_getpwnam(const char *name);
|
||||
extern long my_getgrnam(const char *name);
|
||||
extern char * my_getpwuid(char *name, long uid);
|
||||
extern char * my_getgrgid(char *group, long gid);
|
||||
extern long my_getpwnamegid(const char *name);
|
||||
extern char * my_getug(char *buffer, char *idname, long id, int bufsize, char prefix);
|
||||
extern char * my_getpwuid(char *name, long uid, int bufsize);
|
||||
extern char * my_getgrgid(char *group, long gid, int bufsize);
|
||||
extern char *bb_askpass(int timeout, const char * prompt);
|
||||
|
||||
extern int device_open(const char *device, int mode);
|
||||
|
||||
@@ -248,9 +249,6 @@ extern int vdprintf(int d, const char *format, va_list ap);
|
||||
int nfsmount(const char *spec, const char *node, int *flags,
|
||||
char **extra_opts, char **mount_opts, int running_bg);
|
||||
|
||||
void syslog_msg_with_name(const char *name, int facility, int pri, const char *msg);
|
||||
void syslog_msg(int facility, int pri, const char *msg);
|
||||
|
||||
/* Include our own copy of struct sysinfo to avoid binary compatability
|
||||
* problems with Linux 2.4, which changed things. Grumble, grumble. */
|
||||
struct sysinfo {
|
||||
@@ -288,8 +286,6 @@ char *concat_path_file(const char *path, const char *filename);
|
||||
char *concat_subpath_file(const char *path, const char *filename);
|
||||
char *last_char_is(const char *s, int c);
|
||||
|
||||
extern long arith (const char *startbuf, int *errcode);
|
||||
|
||||
int read_package_field(const char *package_buffer, char **field_name, char **field_value);
|
||||
//#warning yuk!
|
||||
char *fgets_str(FILE *file, const char *terminating_string);
|
||||
|
||||
+85
-20
@@ -1,11 +1,33 @@
|
||||
#ifndef __CONFIG_PWD_H
|
||||
#define __CONFIG_PWD_H
|
||||
/* Copyright (C) 1991,92,95,96,97,98,99,2001 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/*
|
||||
* POSIX Standard: 9.2.2 User Database Access <pwd.h>
|
||||
*/
|
||||
|
||||
#if !defined CONFIG_USE_BB_PWD_GRP
|
||||
#include <pwd.h>
|
||||
|
||||
#else
|
||||
|
||||
#ifndef _PWD_H
|
||||
#define _PWD_H 1
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <features.h>
|
||||
#include <stdio.h>
|
||||
@@ -13,29 +35,72 @@
|
||||
/* The passwd structure. */
|
||||
struct passwd
|
||||
{
|
||||
char *pw_name; /* Username. */
|
||||
char *pw_passwd; /* Password. */
|
||||
uid_t pw_uid; /* User ID. */
|
||||
gid_t pw_gid; /* Group ID. */
|
||||
char *pw_gecos; /* Real name. */
|
||||
char *pw_dir; /* Home directory. */
|
||||
char *pw_shell; /* Shell program. */
|
||||
char *pw_name; /* Username. */
|
||||
char *pw_passwd; /* Password. */
|
||||
uid_t pw_uid; /* User ID. */
|
||||
gid_t pw_gid; /* Group ID. */
|
||||
char *pw_gecos; /* Real name. */
|
||||
char *pw_dir; /* Home directory. */
|
||||
char *pw_shell; /* Shell program. */
|
||||
};
|
||||
|
||||
extern void setpwent __P ((void));
|
||||
extern void endpwent __P ((void));
|
||||
extern struct passwd * getpwent __P ((void));
|
||||
|
||||
extern int putpwent __P ((__const struct passwd * __p, FILE * __f));
|
||||
extern int getpw __P ((uid_t uid, char *buf));
|
||||
/* Rewind the password-file stream. */
|
||||
extern void setpwent (void);
|
||||
|
||||
extern struct passwd * fgetpwent __P ((FILE * file));
|
||||
/* Close the password-file stream. */
|
||||
extern void endpwent (void);
|
||||
|
||||
extern struct passwd * getpwuid __P ((__const uid_t));
|
||||
extern struct passwd * getpwnam __P ((__const char *));
|
||||
/* Read an entry from the password-file stream, opening it if necessary. */
|
||||
extern struct passwd *getpwent (void);
|
||||
|
||||
extern struct passwd * __getpwent __P ((__const int passwd_fd));
|
||||
/* Read an entry from STREAM. */
|
||||
extern struct passwd *fgetpwent (FILE *__stream);
|
||||
|
||||
#endif /* USE_SYSTEM_PWD_GRP */
|
||||
#endif /* __CONFIG_PWD_H */
|
||||
/* Write the given entry onto the given stream. */
|
||||
extern int putpwent (__const struct passwd *__restrict __p,
|
||||
FILE *__restrict __f);
|
||||
|
||||
/* Search for an entry with a matching user ID. */
|
||||
extern struct passwd *getpwuid (uid_t __uid);
|
||||
|
||||
/* Search for an entry with a matching username. */
|
||||
extern struct passwd *getpwnam (__const char *__name);
|
||||
|
||||
/* Reentrant versions of some of the functions above.
|
||||
|
||||
PLEASE NOTE: the `getpwent_r' function is not (yet) standardized.
|
||||
The interface may change in later versions of this library. But
|
||||
the interface is designed following the principals used for the
|
||||
other reentrant functions so the chances are good this is what the
|
||||
POSIX people would choose. */
|
||||
|
||||
extern int getpwent_r (struct passwd *__restrict __resultbuf,
|
||||
char *__restrict __buffer, size_t __buflen,
|
||||
struct passwd **__restrict __result);
|
||||
|
||||
extern int getpwuid_r (uid_t __uid,
|
||||
struct passwd *__restrict __resultbuf,
|
||||
char *__restrict __buffer, size_t __buflen,
|
||||
struct passwd **__restrict __result);
|
||||
|
||||
extern int getpwnam_r (__const char *__restrict __name,
|
||||
struct passwd *__restrict __resultbuf,
|
||||
char *__restrict __buffer, size_t __buflen,
|
||||
struct passwd **__restrict __result);
|
||||
|
||||
|
||||
/* Read an entry from STREAM. This function is not standardized and
|
||||
probably never will. */
|
||||
extern int fgetpwent_r (FILE *__restrict __stream,
|
||||
struct passwd *__restrict __resultbuf,
|
||||
char *__restrict __buffer, size_t __buflen,
|
||||
struct passwd **__restrict __result);
|
||||
|
||||
/* Re-construct the password-file line for the given uid
|
||||
in the given buffer. This knows the format that the caller
|
||||
will expect, but this need not be the format of the password file. */
|
||||
extern int getpw (uid_t __uid, char *__buffer);
|
||||
|
||||
#endif /* pwd.h */
|
||||
#endif
|
||||
+83
-67
@@ -1,82 +1,98 @@
|
||||
/*
|
||||
* Copyright 1988 - 1994, Julianne Frances Haugh <jockgrrl@austin.rr.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of Julianne F. Haugh nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
#ifndef _H_SHADOW
|
||||
#define _H_SHADOW
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
#ifdef USE_SYSTEM_SHADOW
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/* Declaration of types and functions for shadow password suite. */
|
||||
|
||||
#if !defined CONFIG_USE_BB_SHADOW
|
||||
#include <shadow.h>
|
||||
#else
|
||||
|
||||
/*
|
||||
* This information is not derived from AT&T licensed sources. Posted
|
||||
* to the USENET 11/88, and updated 11/90 with information from SVR4.
|
||||
*
|
||||
* $Id: shadow_.h,v 1.1 2002/06/23 04:24:20 andersen Exp $
|
||||
*/
|
||||
#ifndef _SHADOW_H
|
||||
#define _SHADOW_H 1
|
||||
|
||||
typedef long sptime;
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
* Shadow password security file structure.
|
||||
*/
|
||||
/* Paths to the user database files. */
|
||||
#ifndef _PATH_SHADOW
|
||||
#define _PATH_SHADOW "/etc/shadow"
|
||||
#endif
|
||||
#define SHADOW _PATH_SHADOW
|
||||
|
||||
struct spwd {
|
||||
char *sp_namp; /* login name */
|
||||
char *sp_pwdp; /* encrypted password */
|
||||
sptime sp_lstchg; /* date of last change */
|
||||
sptime sp_min; /* minimum number of days between changes */
|
||||
sptime sp_max; /* maximum number of days between changes */
|
||||
sptime sp_warn; /* number of days of warning before password
|
||||
expires */
|
||||
sptime sp_inact; /* number of days after password expires
|
||||
until the account becomes unusable. */
|
||||
sptime sp_expire; /* days since 1/1/70 until account expires */
|
||||
unsigned long sp_flag; /* reserved for future use */
|
||||
|
||||
/* Structure of the password file. */
|
||||
struct spwd
|
||||
{
|
||||
char *sp_namp; /* Login name. */
|
||||
char *sp_pwdp; /* Encrypted password. */
|
||||
long int sp_lstchg; /* Date of last change. */
|
||||
long int sp_min; /* Minimum number of days between changes. */
|
||||
long int sp_max; /* Maximum number of days between changes. */
|
||||
long int sp_warn; /* Number of days to warn user to change
|
||||
the password. */
|
||||
long int sp_inact; /* Number of days the account may be
|
||||
inactive. */
|
||||
long int sp_expire; /* Number of days since 1970-01-01 until
|
||||
account expires. */
|
||||
unsigned long int sp_flag; /* Reserved. */
|
||||
};
|
||||
|
||||
/*
|
||||
* Shadow password security file functions.
|
||||
*/
|
||||
|
||||
#include <stdio.h> /* for FILE */
|
||||
/* Open database for reading. */
|
||||
extern void setspent (void);
|
||||
|
||||
extern struct spwd *getspent(void);
|
||||
extern struct spwd *sgetspent(const char *);
|
||||
extern struct spwd *fgetspent(FILE *);
|
||||
extern void setspent(void);
|
||||
extern void endspent(void);
|
||||
extern int putspent(const struct spwd *, FILE *);
|
||||
extern struct spwd *getspnam(const char *name);
|
||||
extern struct spwd *pwd_to_spwd(const struct passwd *pw);
|
||||
/* Close database. */
|
||||
extern void endspent (void);
|
||||
|
||||
#endif /* USE_LOCAL_SHADOW */
|
||||
/* Get next entry from database, perhaps after opening the file. */
|
||||
extern struct spwd *getspent (void);
|
||||
|
||||
#endif /* _H_SHADOW */
|
||||
/* Get shadow entry matching NAME. */
|
||||
extern struct spwd *getspnam (__const char *__name);
|
||||
|
||||
/* Read shadow entry from STRING. */
|
||||
extern struct spwd *sgetspent (__const char *__string);
|
||||
|
||||
/* Read next shadow entry from STREAM. */
|
||||
extern struct spwd *fgetspent (FILE *__stream);
|
||||
|
||||
/* Write line containing shadow password entry to stream. */
|
||||
extern int putspent (__const struct spwd *__p, FILE *__stream);
|
||||
|
||||
/* Reentrant versions of some of the functions above. */
|
||||
extern int getspent_r (struct spwd *__result_buf, char *__buffer,
|
||||
size_t __buflen, struct spwd **__result);
|
||||
|
||||
extern int getspnam_r (__const char *__name, struct spwd *__result_buf,
|
||||
char *__buffer, size_t __buflen,
|
||||
struct spwd **__result)__THROW;
|
||||
|
||||
extern int sgetspent_r (__const char *__string, struct spwd *__result_buf,
|
||||
char *__buffer, size_t __buflen,
|
||||
struct spwd **__result);
|
||||
|
||||
extern int fgetspent_r (FILE *__stream, struct spwd *__result_buf,
|
||||
char *__buffer, size_t __buflen,
|
||||
struct spwd **__result);
|
||||
/* Protect password file against multi writers. */
|
||||
extern int lckpwdf (void);
|
||||
|
||||
/* Unlock password file. */
|
||||
extern int ulckpwdf (void);
|
||||
|
||||
#endif /* shadow.h */
|
||||
#endif
|
||||
+90
-88
@@ -4,14 +4,14 @@
|
||||
#define addgroup_trivial_usage \
|
||||
"[-g GID] group_name [user_name]"
|
||||
#define addgroup_full_usage \
|
||||
"Adds a group to the system" \
|
||||
"Adds a group to the system\n\n" \
|
||||
"Options:\n" \
|
||||
"\t-g GID\t\tspecify gid"
|
||||
|
||||
#define adduser_trivial_usage \
|
||||
"[OPTIONS] user_name"
|
||||
#define adduser_full_usage \
|
||||
"Adds a user to the system" \
|
||||
"Adds a user to the system\n\n" \
|
||||
"Options:\n" \
|
||||
"\t-h DIR\t\tAssign home directory DIR\n" \
|
||||
"\t-g GECOS\tAssign gecos field GECOS\n" \
|
||||
@@ -219,6 +219,7 @@
|
||||
"\ti\t\textract\n" \
|
||||
"\tm\t\tpreserve mtime\n" \
|
||||
"\tt\t\tlist\n" \
|
||||
"\tv\t\tverbose\n" \
|
||||
"\tu\t\tunconditional overwrite\n" \
|
||||
"\tF\t\tinput from file"
|
||||
|
||||
@@ -228,7 +229,7 @@
|
||||
"\t-d [#] -l [#] -S -L logfile -f -b -c dir\n" \
|
||||
"\t-d num\tdebug level\n" \
|
||||
"\t-l num\tlog level (8 - default)\n" \
|
||||
"\t-S\tlog to syslod (default)\n" \
|
||||
"\t-S\tlog to syslogd (default)\n" \
|
||||
"\t-L file\tlog to file\n" \
|
||||
"\t-f\trun in fordeground\n" \
|
||||
"\t-b\trun in background (default)\n" \
|
||||
@@ -281,6 +282,7 @@
|
||||
"\t\t\t`hours', `minutes', or `seconds' for date and,\n" \
|
||||
"\t\t\ttime to the indicated precision.\n") \
|
||||
"\t-s\t\tSets time described by STRING\n" \
|
||||
"\t-r FILE\t\tDisplays the last modification time of FILE\n" \
|
||||
"\t-u\t\tPrints or sets Coordinated Universal Time"
|
||||
#define date_example_usage \
|
||||
"$ date\n" \
|
||||
@@ -299,15 +301,15 @@
|
||||
"o - Pops the value off the top of the stack and uses it to set the output radix.\n" \
|
||||
" Only 10 and 16 are supported."
|
||||
#define dc_example_usage \
|
||||
"$ dc 2 2 +\n" \
|
||||
"$ dc 2 2 + p\n" \
|
||||
"4\n" \
|
||||
"$ dc 8 8 * 2 2 + /\n" \
|
||||
"$ dc 8 8 \\* 2 2 + / p\n" \
|
||||
"16\n" \
|
||||
"$ dc 0 1 and\n" \
|
||||
"$ dc 0 1 and p\n" \
|
||||
"0\n" \
|
||||
"$ dc 0 1 or\n" \
|
||||
"$ dc 0 1 or p\n" \
|
||||
"1\n" \
|
||||
"$ echo 72 9 div 8 mul | dc\n" \
|
||||
"$ echo 72 9 div 8 mul p | dc\n" \
|
||||
"64\n"
|
||||
|
||||
#define dd_trivial_usage \
|
||||
@@ -423,26 +425,26 @@
|
||||
"\t-d\toutput will be in DOS format"
|
||||
|
||||
#define dpkg_trivial_usage \
|
||||
"[-iCPru] package_name"
|
||||
"[-ilCPru] [-F option] package_name"
|
||||
#define dpkg_full_usage \
|
||||
"dpkg is a utility to install, remove and manage Debian packages.\n\n" \
|
||||
"Options:\n" \
|
||||
"\t-i\tInstall the package\n" \
|
||||
"\t-C\tConfigure an unpackaged package\n" \
|
||||
"\t-P\tPurge all files of a package\n" \
|
||||
"\t-r\tRemove all but the configuration files for a package\n" \
|
||||
"\t-u\tUnpack a package, but dont configure it"
|
||||
"\t-i\t\tInstall the package\n" \
|
||||
"\t-l\t\tList of installed packages\n" \
|
||||
"\t-C\t\tConfigure an unpackaged package\n" \
|
||||
"\t-F depends\tIgnore depency problems\n" \
|
||||
"\t-P\t\tPurge all files of a package\n" \
|
||||
"\t-r\t\tRemove all but the configuration files for a package\n" \
|
||||
"\t-u\t\tUnpack a package, but don't configure it"
|
||||
|
||||
#define dpkg_deb_trivial_usage \
|
||||
"[-cefItxX] FILE [argument]"
|
||||
"[-cefxX] FILE [argument]"
|
||||
#define dpkg_deb_full_usage \
|
||||
"Perform actions on Debian packages (.debs)\n\n" \
|
||||
"Options:\n" \
|
||||
"\t-c\tList contents of filesystem tree\n" \
|
||||
"\t-e\tExtract control files to [argument] directory\n" \
|
||||
"\t-f\tDisplay control field name starting with [argument]\n" \
|
||||
"\t-I\tDisplay the control filenamed [argument]\n" \
|
||||
"\t-t\tExtract filesystem tree to stdout in tar format\n" \
|
||||
"\t-x\tExtract packages filesystem tree to directory\n" \
|
||||
"\t-X\tVerbose extract"
|
||||
#define dpkg_deb_example_usage \
|
||||
@@ -502,8 +504,8 @@
|
||||
"Displays the DHCP leases granted by udhcpd.\n\n" \
|
||||
"Options:\n" \
|
||||
"\t-f,\t--file=FILENAME\tLeases file to load\n" \
|
||||
"\t-r,\t--remaining\tInterepret lease times as time remaing\n" \
|
||||
"\t-a,\t--absolute\tInterepret lease times as expire time"
|
||||
"\t-r,\t--remaining\tInterpret lease times as time remaing\n" \
|
||||
"\t-a,\t--absolute\tInterpret lease times as expire time"
|
||||
|
||||
#ifdef CONFIG_FEATURE_FANCY_ECHO
|
||||
#define USAGE_FANCY_ECHO(a) a
|
||||
@@ -608,7 +610,7 @@
|
||||
"\t-n\tDon't verify after format"
|
||||
|
||||
#define fdisk_trivial_usage \
|
||||
"[-l] [-v] [-b SSZ] [-u] DISK"
|
||||
"[-luv] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SSZ] DISK"
|
||||
#define fdisk_full_usage \
|
||||
"Change partition table\n" \
|
||||
"Options:\n" \
|
||||
@@ -616,6 +618,9 @@
|
||||
"\t-u Give Start and End in sector (instead of cylinder) units\n" \
|
||||
"\t-s PARTITION Give partition size(s) in blocks\n" \
|
||||
"\t-b 2048: (for certain MO disks) use 2048-byte sectors\n" \
|
||||
"\t-C CYLINDERS Set the number of cylinders\n" \
|
||||
"\t-H HEADS Set the number of heads\n" \
|
||||
"\t-S SECTORS Set the number of sectors\n" \
|
||||
"\t-v Give fdisk version"
|
||||
|
||||
#ifdef CONFIG_FEATURE_FIND_TYPE
|
||||
@@ -741,7 +746,7 @@
|
||||
"\t-Q, --quiet-output No normal output\n" \
|
||||
"\t-s, --shell=shell Set shell quoting conventions\n" \
|
||||
"\t-T, --test Test for getopt(1) version\n" \
|
||||
"\t-u, --unqote Do not quote the output"
|
||||
"\t-u, --unquoted Do not quote the output"
|
||||
#define getopt_example_usage \
|
||||
"$ cat getopt.test\n" \
|
||||
"#!/bin/sh\n" \
|
||||
@@ -806,6 +811,7 @@
|
||||
"Uncompress FILE (or standard input if FILE is '-').\n\n" \
|
||||
"Options:\n" \
|
||||
"\t-c\tWrite output to standard output\n" \
|
||||
"\t-f\tForce read when source is a terminal\n" \
|
||||
"\t-t\tTest compressed file integrity"
|
||||
#define gunzip_example_usage \
|
||||
"$ ls -la /tmp/BusyBox*\n" \
|
||||
@@ -821,7 +827,8 @@
|
||||
"When FILE is '-' or unspecified, reads standard input. Implies -c.\n\n" \
|
||||
"Options:\n" \
|
||||
"\t-c\tWrite output to standard output instead of FILE.gz\n" \
|
||||
"\t-d\tdecompress"
|
||||
"\t-d\tDecompress\n" \
|
||||
"\t-f\tForce write when destination is a terminal"
|
||||
#define gzip_example_usage \
|
||||
"$ ls -la /tmp/busybox*\n" \
|
||||
"-rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/busybox.tar\n" \
|
||||
@@ -830,9 +837,11 @@
|
||||
"-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n"
|
||||
|
||||
#define halt_trivial_usage \
|
||||
""
|
||||
"[-d<delay>]"
|
||||
#define halt_full_usage \
|
||||
"Halt the system."
|
||||
"Halt the system.\n" \
|
||||
"Options:\n" \
|
||||
"\t-d\t\tdelay interval for halting."
|
||||
|
||||
#ifdef CONFIG_FEATURE_HDPARM_GET_IDENTITY
|
||||
#define USAGE_HDPARM_IDENT(a) a
|
||||
@@ -1003,15 +1012,17 @@
|
||||
USAGE_HTTPD_SETUID(" [-u user]") \
|
||||
USAGE_HTTPD_BASIC_AUTH(" [-r <realm>]") \
|
||||
USAGE_HTTPD_AUTH_MD5(" [-m pass]") \
|
||||
" [-h home]" \
|
||||
" [-d/-e <string>]"
|
||||
#define httpd_full_usage \
|
||||
"Listens for incoming http server requests.\n\n"\
|
||||
"Options:\n" \
|
||||
"\t-c FILE\t\tSpecifies configuration file. (default httpd.conf)\n" \
|
||||
USAGE_HTTPD_STANDALONE("\t-p PORT\tServer port (default 80)\n") \
|
||||
USAGE_HTTPD_SETUID("\t-u USER\tSet uid to USER after listening privilegies port\n") \
|
||||
USAGE_HTTPD_SETUID("\t-u USER\tSet uid to USER after listening privileges port\n") \
|
||||
USAGE_HTTPD_BASIC_AUTH("\t-r REALM\tAuthentication Realm for Basic Authentication\n") \
|
||||
USAGE_HTTPD_AUTH_MD5("\t-m PASS\t\tCrypt PASS with md5 algorithm\n") \
|
||||
"\t-h HOME \tSpecifies http HOME directory (default ./)\n" \
|
||||
"\t-e STRING\tHtml encode STRING\n" \
|
||||
"\t-d STRING\tURL decode STRING"
|
||||
|
||||
@@ -1217,7 +1228,7 @@
|
||||
"\n" \
|
||||
" <process>:\n" \
|
||||
"\n" \
|
||||
" Specifies the process to be executed and it's command line.\n" \
|
||||
" Specifies the process to be executed and its command line.\n" \
|
||||
"\n" \
|
||||
"Example /etc/inittab file:\n" \
|
||||
"\n" \
|
||||
@@ -1269,6 +1280,7 @@
|
||||
"\t-f\tForce module to load into the wrong kernel version.\n" \
|
||||
"\t-k\tMake module autoclean-able.\n" \
|
||||
"\t-v\tverbose output\n" \
|
||||
"\t-q\tquiet output\n" \
|
||||
"\t-L\tLock to prevent simultaneous loads of a module\n" \
|
||||
USAGE_INSMOD_MAP("\t-m\tOutput load map to stdout\n") \
|
||||
"\t-o NAME\tSet internal module name to NAME\n" \
|
||||
@@ -1280,6 +1292,7 @@
|
||||
"Copies files and set attributes\n\n" \
|
||||
"Options:\n" \
|
||||
"\t-c\tcopy the file, default\n" \
|
||||
"\t-d\tcreate directories\n" \
|
||||
"\t-g\tset group ownership\n" \
|
||||
"\t-m\tset permission modes\n" \
|
||||
"\t-o\tset ownership\n" \
|
||||
@@ -1369,11 +1382,12 @@
|
||||
"$ kill 252\n"
|
||||
|
||||
#define killall_trivial_usage \
|
||||
"[-signal] process-name [process-name ...]"
|
||||
"[-q] [-signal] process-name [process-name ...]"
|
||||
#define killall_full_usage \
|
||||
"Send a signal (default is SIGTERM) to the specified process(es).\n\n"\
|
||||
"Options:\n" \
|
||||
"\t-l\tList all signal names and numbers."
|
||||
"\t-l\tList all signal names and numbers.\n"\
|
||||
"\t-q\tDo not complain if no processes were killed."
|
||||
#define killall_example_usage \
|
||||
"$ killall apache\n"
|
||||
|
||||
@@ -1591,11 +1605,6 @@
|
||||
"\ty\tAllow write access to your terminal.\n" \
|
||||
"\tn\tDisallow write access to your terminal.\n"
|
||||
|
||||
#define minit_trivial_usage \
|
||||
"[-spPrRC]"
|
||||
#define minit_full_usage \
|
||||
"A small replacement for SysV init"
|
||||
|
||||
#define mkdir_trivial_usage \
|
||||
"[OPTION] DIRECTORY..."
|
||||
#define mkdir_full_usage \
|
||||
@@ -1654,10 +1663,13 @@
|
||||
"\tblock-count\tNumber of block to use (default is entire partition)."
|
||||
|
||||
#define mktemp_trivial_usage \
|
||||
"[-q] TEMPLATE"
|
||||
"[-dq] TEMPLATE"
|
||||
#define mktemp_full_usage \
|
||||
"Creates a temporary file with its name based on TEMPLATE.\n" \
|
||||
"TEMPLATE is any name with six `Xs' (i.e., /tmp/temp.XXXXXX)."
|
||||
"TEMPLATE is any name with six `Xs' (i.e., /tmp/temp.XXXXXX).\n\n" \
|
||||
"Options:\n" \
|
||||
"\t-d\t\tMake a directory instead of a file\n" \
|
||||
"\t-q\t\tFail silently if an error occurs"
|
||||
#define mktemp_example_usage \
|
||||
"$ mktemp /tmp/temp.XXXXXX\n" \
|
||||
"/tmp/temp.mWiLjM\n" \
|
||||
@@ -1665,9 +1677,16 @@
|
||||
"-rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM\n"
|
||||
|
||||
#define modprobe_trivial_usage \
|
||||
"[FILE ...]"
|
||||
"[-knqrsv] [MODULE ...]"
|
||||
#define modprobe_full_usage \
|
||||
"Used for high level module loading and unloading."
|
||||
"Used for high level module loading and unloading.\n\n" \
|
||||
"Options:\n" \
|
||||
"\t-k\tMake module autoclean-able.\n" \
|
||||
"\t-n\tJust show what would be done.\n" \
|
||||
"\t-q\tQuiet output.\n" \
|
||||
"\t-r\tRemove module (stacks) or do autoclean.\n" \
|
||||
"\t-s\tReport via syslog instead of stderr.\n" \
|
||||
"\t-v\tVerbose output."
|
||||
#define modprobe_example_usage \
|
||||
"$ modprobe cdrom\n"
|
||||
|
||||
@@ -1726,25 +1745,6 @@
|
||||
"$ mount /dev/fd0 /mnt -t msdos -o ro\n" \
|
||||
"$ mount /tmp/diskimage /opt -t ext2 -o loop\n"
|
||||
|
||||
#define msvc_trivial_usage \
|
||||
"-[udorspchaitkx] service"
|
||||
#define msvc_full_usage \
|
||||
"[option] service\n" \
|
||||
"Where option is one of\n" \
|
||||
"\t-u\tUp. If the service is not running, start it. If the service stops, restart it.\n" \
|
||||
"\t-d\tDown. If the service is running, stop it, do not restart it.\n" \
|
||||
"\t-o\tOnce. If the service is not running, start it. Do not restart it if it stops.\n" \
|
||||
"\t-r\tTell supervise that the service is normally running; this affects status messages.\n" \
|
||||
"\t-s\tTell supervise that the service is normally stopped; this affects status messages.\n" \
|
||||
"\t-p\tPause. Send the service a STOP signal.\n" \
|
||||
"\t-c\tContinue. Send the service a CONT signal.\n" \
|
||||
"\t-h\tHangup. Send the service a HUP signal.\n" \
|
||||
"\t-a\tAlarm. Send the service an ALRM signal.\n" \
|
||||
"\t-i\tInterrupt. Send the service an INT signal.\n" \
|
||||
"\t-t\tTerminate. Send the service a TERM signal.\n" \
|
||||
"\t-k\tKill. Send the service a KILL signal.\n" \
|
||||
"\t-x\tExit. supervise will quit as soon as the service is down."
|
||||
|
||||
#define mt_trivial_usage \
|
||||
"[-f device] opcode value"
|
||||
#define mt_full_usage \
|
||||
@@ -1756,10 +1756,13 @@
|
||||
"setpart tell unload unlock weof wset"
|
||||
|
||||
#define mv_trivial_usage \
|
||||
"SOURCE DEST\n" \
|
||||
"or: mv SOURCE... DIRECTORY"
|
||||
"[OPTION]... SOURCE DEST\n" \
|
||||
"or: mv [OPTION]... SOURCE... DIRECTORY"
|
||||
#define mv_full_usage \
|
||||
"Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY."
|
||||
"Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\n\n" \
|
||||
"Options:\n" \
|
||||
"\t-f\tdon't prompt before overwriting\n" \
|
||||
"\t-i\tinteractive, prompt before overwrite"
|
||||
#define mv_example_usage \
|
||||
"$ mv /tmp/foo /bin/bar\n"
|
||||
|
||||
@@ -1861,16 +1864,13 @@
|
||||
#define patch_example_usage \
|
||||
"$ patch -p1 <example.diff"
|
||||
|
||||
#define pidfilehack_trivial_usage \
|
||||
"[daemon.pid] [daemon]"
|
||||
#define pidfilehack_full_usage \
|
||||
"service /var/run/daemon.pid /usr/sbin/daemon args...\n"
|
||||
|
||||
#define pidof_trivial_usage \
|
||||
"process-name [process-name ...]"
|
||||
"process-name [OPTION] [process-name ...]"
|
||||
#define pidof_full_usage \
|
||||
"Lists the PIDs of all processes with names that match the\n" \
|
||||
"names on the command line"
|
||||
"names on the command line.\n" \
|
||||
"Options:\n" \
|
||||
"\t-s\t\tdisplay only a single PID."
|
||||
#define pidof_example_usage \
|
||||
"$ pidof init\n" \
|
||||
"1\n"
|
||||
@@ -1928,9 +1928,11 @@
|
||||
"the new root file system."
|
||||
|
||||
#define poweroff_trivial_usage \
|
||||
""
|
||||
"[-d<delay>]"
|
||||
#define poweroff_full_usage \
|
||||
"Halt the system and request that the kernel shut off the power."
|
||||
"Halt the system and request that the kernel shut off the power.\n" \
|
||||
"Options:\n" \
|
||||
"\t-d\t\tdelay interval for shutting off."
|
||||
|
||||
#define printf_trivial_usage \
|
||||
"FORMAT [ARGUMENT...]"
|
||||
@@ -1975,12 +1977,6 @@
|
||||
"$ pwd\n" \
|
||||
"/root\n"
|
||||
|
||||
#define raid_start_trivial_usage \
|
||||
"MD_DEVICE DISK_DEVICE"
|
||||
#define raid_start_full_usage \
|
||||
"Start MD_DEVICE, taking superblock from DISK_DEVICE.\n" \
|
||||
"Example: raid_start /dev/md0 /dev/sdb"
|
||||
|
||||
#define rdate_trivial_usage \
|
||||
"[-sp] HOST"
|
||||
#define rdate_full_usage \
|
||||
@@ -2000,9 +1996,11 @@
|
||||
"Returns the absolute pathnames of given argument."
|
||||
|
||||
#define reboot_trivial_usage \
|
||||
""
|
||||
"[-d<delay>]"
|
||||
#define reboot_full_usage \
|
||||
"Reboot the system."
|
||||
"Reboot the system.\n" \
|
||||
"Options:\n" \
|
||||
"\t-d\t\tdelay interval for rebooting."
|
||||
|
||||
#define renice_trivial_usage \
|
||||
"priority pid [pid ...]"
|
||||
@@ -2095,14 +2093,15 @@
|
||||
"$ rx /tmp/foo\n"
|
||||
|
||||
#define sed_trivial_usage \
|
||||
"[-nef] pattern [files...]"
|
||||
"[-efinr] pattern [files...]"
|
||||
#define sed_full_usage \
|
||||
"Options:\n" \
|
||||
"\t-n\t\tsuppress automatic printing of pattern space\n" \
|
||||
"\t-e script\tadd the script to the commands to be executed\n" \
|
||||
"\t-f scriptfile\tadd script-file contents to the\n" \
|
||||
"\t\t\tcommands to be executed\n" \
|
||||
"\t-i\t\tEdit files in-place\n" \
|
||||
"\t-i\t\tedit files in-place\n" \
|
||||
"\t-n\t\tsuppress automatic printing of pattern space\n" \
|
||||
"\t-r\t\tuse extended regular expression syntax\n" \
|
||||
"\n" \
|
||||
"If no -e or -f is given, the first non-option argument is taken as the sed\n"\
|
||||
"script to interpret. All remaining arguments are names of input files; if no\n"\
|
||||
@@ -2235,6 +2234,7 @@
|
||||
#define strings_full_usage \
|
||||
"Display printable strings in a binary file." \
|
||||
"\n\nOptions:" \
|
||||
"\n\t-a\tScan the whole files (this is the default)."\
|
||||
"\n\t-f\tPrecede each string with the name of the file where it was found." \
|
||||
"\n\t-n N\tSpecifies that at least N characters forms a sequence (default 4)" \
|
||||
"\n\t-o\tEach string is preceded by its decimal offset in the file."
|
||||
@@ -2309,17 +2309,16 @@
|
||||
"sysctl - configure kernel parameters at runtime\n\n" \
|
||||
"Options:\n" \
|
||||
"\t-n\tUse this option to disable printing of the key name when printing values.\n" \
|
||||
"\t-e\tUse this option to ignore errors about unknown keys.\n" \
|
||||
"\t-w\tUse this option when you want to change a sysctl setting.\n" \
|
||||
"\t-p\tLoad in sysctl settings from the file specified or /etc/sysctl.conf if none given.\n" \
|
||||
"\t-a\tDisplay all values currently available.\n" \
|
||||
"\t-A\tDisplay all values currently available in table form."
|
||||
#define sysctl_example_usage
|
||||
"sysctl [-n] [-e] variable ...\n" \
|
||||
"sysctl [-n] [-e] -w variable=value ...\n" \
|
||||
"sysctl [-n] [-e] -a\n" \
|
||||
"sysctl [-n] [-e] -p <file>\t(default /etc/sysctl.conf)\n" \
|
||||
"sysctl [-n] [-e] -A\n"
|
||||
"sysctl [-n] variable ...\n" \
|
||||
"sysctl [-n] -w variable=value ...\n" \
|
||||
"sysctl [-n] -a\n" \
|
||||
"sysctl [-n] -p <file>\t(default /etc/sysctl.conf)\n" \
|
||||
"sysctl [-n] -A\n"
|
||||
#endif
|
||||
|
||||
#define syslogd_trivial_usage \
|
||||
@@ -2330,7 +2329,8 @@
|
||||
"Options:\n" \
|
||||
"\t-m MIN\t\tMinutes between MARK lines (default=20, 0=off)\n" \
|
||||
"\t-n\t\tRun as a foreground process\n" \
|
||||
"\t-O FILE\t\tUse an alternate log file (default=/var/log/messages)" \
|
||||
"\t-O FILE\t\tUse an alternate log file (default=/var/log/messages)\n" \
|
||||
"\t-S\t\tMake logging output smaller." \
|
||||
USAGE_ROTATE_LOGFILE( \
|
||||
"\n\t-s SIZE\t\tMax size (KB) before rotate (default=200KB, 0=off)\n" \
|
||||
"\t-b NUM\t\tNumber of rotated logs to keep (default=1, max=99, 0=purge)") \
|
||||
@@ -2461,7 +2461,8 @@
|
||||
#define telnetd_full_usage \
|
||||
"Telnetd uses incoming TELNET connections via inetd.\n"\
|
||||
"Options:\n" \
|
||||
"\t-l LOGIN\texec LOGIN on connect (default /bin/sh)"
|
||||
"\t-l LOGIN\texec LOGIN on connect (default /bin/sh)\n" \
|
||||
"\t-f issue_file\tDisplay issue_file instead of /etc/issue."
|
||||
#else
|
||||
#define telnetd_trivial_usage \
|
||||
"[OPTION]"
|
||||
@@ -2469,7 +2470,8 @@
|
||||
"Telnetd listens for incoming TELNET connections on PORT.\n"\
|
||||
"Options:\n" \
|
||||
"\t-p PORT\tlisten for connections on PORT (default 23)\n"\
|
||||
"\t-l LOGIN\texec LOGIN on connect (default /bin/sh)"
|
||||
"\t-l LOGIN\texec LOGIN on connect (default /bin/sh)\n"\
|
||||
"\t-f issue_file\tDisplay issue_file instead of /etc/issue."
|
||||
#endif
|
||||
|
||||
#define test_trivial_usage \
|
||||
|
||||
@@ -61,30 +61,6 @@ config CONFIG_REBOOT
|
||||
help
|
||||
Stop all processes and reboot the system.
|
||||
|
||||
config CONFIG_MINIT
|
||||
bool "minit"
|
||||
default n
|
||||
depends on ! CONFIG_INIT
|
||||
help
|
||||
Minimal init, based on minit v0.9.1. This is a simple
|
||||
init replacement that handles starting/stopping services,
|
||||
and service dependencies. See http://www.fefe.de/minit/
|
||||
for additional information.
|
||||
|
||||
config CONFIG_PIDFILEHACK
|
||||
bool "pidfilehack"
|
||||
default y
|
||||
depends on CONFIG_MINIT
|
||||
help
|
||||
pidfilehack is used by minit to run servers.
|
||||
|
||||
config CONFIG_MSVC
|
||||
bool "msvc"
|
||||
default y
|
||||
depends on CONFIG_MINIT
|
||||
help
|
||||
msvc is used to start and stop processes controlled by minit
|
||||
|
||||
config CONFIG_MESG
|
||||
bool "mesg"
|
||||
default y
|
||||
|
||||
+7
-5
@@ -17,13 +17,15 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
TOPDIR:= ../
|
||||
top_srcdir=..
|
||||
top_builddir=..
|
||||
srcdir=$(top_srcdir)/init
|
||||
INIT_DIR:=./
|
||||
include $(TOPDIR).config
|
||||
include $(TOPDIR)Rules.mak
|
||||
include Makefile.in
|
||||
include $(top_builddir)/Rules.mak
|
||||
include $(top_builddir)/.config
|
||||
include $(srcdir)/Makefile.in
|
||||
all: $(libraries-y)
|
||||
-include $(TOPDIR).depend
|
||||
-include $(top_builddir)/.depend
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a $(AR_TARGET)
|
||||
|
||||
+5
-4
@@ -19,16 +19,14 @@
|
||||
|
||||
INIT_AR:=init.a
|
||||
ifndef $(INIT_DIR)
|
||||
INIT_DIR:=$(TOPDIR)init/
|
||||
INIT_DIR:=$(top_builddir)/init/
|
||||
endif
|
||||
srcdir=$(top_srcdir)/init
|
||||
|
||||
INIT-y:=
|
||||
INIT-$(CONFIG_HALT) += halt.o
|
||||
INIT-$(CONFIG_INIT) += init.o
|
||||
INIT-$(CONFIG_MESG) += mesg.o
|
||||
INIT-$(CONFIG_MINIT) += minit.o
|
||||
INIT-$(CONFIG_MSVC) += msvc.o
|
||||
INIT-$(CONFIG_PIDFILEHACK) += pidfilehack.o
|
||||
INIT-$(CONFIG_POWEROFF) += poweroff.o
|
||||
INIT-$(CONFIG_REBOOT) += reboot.o
|
||||
|
||||
@@ -59,3 +57,6 @@ libraries-y+=$(INIT_DIR)$(INIT_AR)
|
||||
$(INIT_DIR)$(INIT_AR): $(patsubst %,$(INIT_DIR)%, $(INIT-y))
|
||||
$(AR) -ro $@ $(patsubst %,$(INIT_DIR)%, $(INIT-y))
|
||||
|
||||
$(INIT_DIR)%.o: $(srcdir)/%.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
|
||||
|
||||
+41
-14
@@ -53,10 +53,6 @@
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__UCLIBC__) && !defined(__ARCH_HAS_MMU__)
|
||||
#define fork vfork
|
||||
#endif
|
||||
|
||||
#define INIT_BUFFS_SIZE 256
|
||||
|
||||
/* From <linux/vt.h> */
|
||||
@@ -229,7 +225,9 @@ static void message(int device, const char *fmt, ...)
|
||||
/* Log the message to syslogd */
|
||||
if (device & LOG) {
|
||||
/* don`t out "\r\n" */
|
||||
syslog_msg(LOG_DAEMON, LOG_INFO, msg + 1);
|
||||
openlog(bb_applet_name, 0, LOG_DAEMON);
|
||||
syslog(LOG_INFO, "%s", msg);
|
||||
closelog();
|
||||
}
|
||||
|
||||
msg[l++] = '\n';
|
||||
@@ -578,6 +576,7 @@ static pid_t run(const struct init_action *a)
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
|
||||
if (a->action & ASKFIRST) {
|
||||
char c;
|
||||
/*
|
||||
@@ -595,6 +594,7 @@ static pid_t run(const struct init_action *a)
|
||||
while(read(0, &c, 1) == 1 && c != '\n')
|
||||
;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Log the process name and args */
|
||||
message(LOG, "Starting pid %d, console %s: '%s'",
|
||||
@@ -846,7 +846,7 @@ static void cont_handler(int sig)
|
||||
|
||||
static void new_init_action(int action, const char *command, const char *cons)
|
||||
{
|
||||
struct init_action *new_action, *a;
|
||||
struct init_action *new_action, *a, *last;
|
||||
|
||||
if (*cons == '\0')
|
||||
cons = console;
|
||||
@@ -864,16 +864,19 @@ static void new_init_action(int action, const char *command, const char *cons)
|
||||
}
|
||||
|
||||
/* Append to the end of the list */
|
||||
for (a = init_action_list; a && a->next; a = a->next) {
|
||||
/* don't enter action if it's already in the list */
|
||||
for (a = last = init_action_list; a; a = a->next) {
|
||||
/* don't enter action if it's already in the list,
|
||||
* but do overwrite existing actions */
|
||||
if ((strcmp(a->command, command) == 0) &&
|
||||
(strcmp(a->terminal, cons) ==0)) {
|
||||
a->action = action;
|
||||
free(new_action);
|
||||
return;
|
||||
}
|
||||
last = a;
|
||||
}
|
||||
if (a) {
|
||||
a->next = new_action;
|
||||
if (last) {
|
||||
last->next = new_action;
|
||||
} else {
|
||||
init_action_list = new_action;
|
||||
}
|
||||
@@ -1046,14 +1049,33 @@ static void parse_inittab(void)
|
||||
#endif /* CONFIG_FEATURE_USE_INITTAB */
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FEATURE_USE_INITTAB
|
||||
static void reload_signal(int sig)
|
||||
{
|
||||
message(LOG, "Reloading /etc/inittab");
|
||||
parse_inittab();
|
||||
struct init_action *a, *tmp;
|
||||
|
||||
message(LOG, "Reloading /etc/inittab");
|
||||
|
||||
/* disable old entrys */
|
||||
for (a = init_action_list; a; a = a->next ) {
|
||||
a->action = ONCE;
|
||||
}
|
||||
|
||||
parse_inittab();
|
||||
|
||||
/* remove unused entrys */
|
||||
for (a = init_action_list; a; a = tmp) {
|
||||
tmp = a->next;
|
||||
if (a->action & (ONCE | SYSINIT | WAIT ) &&
|
||||
a->pid == 0 ) {
|
||||
delete_init_action(a);
|
||||
}
|
||||
}
|
||||
run_actions(RESPAWN);
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_FEATURE_USE_INITTAB */
|
||||
|
||||
extern int init_main(int argc, char **argv)
|
||||
{
|
||||
struct init_action *a;
|
||||
@@ -1144,8 +1166,13 @@ extern int init_main(int argc, char **argv)
|
||||
/* Next run anything to be run only once */
|
||||
run_actions(ONCE);
|
||||
|
||||
#ifdef CONFIG_FEATURE_USE_INITTAB
|
||||
/* Redefine SIGHUP to reread /etc/inittab */
|
||||
signal(SIGHUP, reload_signal);
|
||||
#else
|
||||
signal(SIGHUP, SIG_IGN);
|
||||
#endif /* CONFIG_FEATURE_USE_INITTAB */
|
||||
|
||||
|
||||
/* Now run the looping stuff for the rest of forever */
|
||||
while (1) {
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ extern int mesg_main(int argc, char *argv[])
|
||||
{
|
||||
struct stat sb;
|
||||
char *tty;
|
||||
char c;
|
||||
char c = 0;
|
||||
|
||||
if ((--argc == 0)
|
||||
|| ((argc == 1) && (((c = **++argv) == 'y') || (c == 'n')))) {
|
||||
|
||||
-612
@@ -1,612 +0,0 @@
|
||||
/*
|
||||
* minit version 0.9.1 by Felix von Leitner
|
||||
* ported to busybox by Glenn McGrath <bug1@optushome.com.au>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <time.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/poll.h>
|
||||
#include <sys/reboot.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/wait.h>
|
||||
#include <linux/kd.h>
|
||||
|
||||
#include "busybox.h"
|
||||
|
||||
#define MINITROOT "/etc/minit"
|
||||
|
||||
static int i_am_init;
|
||||
static int infd, outfd;
|
||||
|
||||
extern char **environ;
|
||||
|
||||
static struct process {
|
||||
char *name;
|
||||
pid_t pid;
|
||||
char respawn;
|
||||
char circular;
|
||||
time_t startedat;
|
||||
int __stdin, __stdout;
|
||||
int logservice;
|
||||
} *root;
|
||||
|
||||
static int maxprocess = -1;
|
||||
|
||||
static int processalloc = 0;
|
||||
|
||||
static unsigned int fmt_ulong(char *dest, unsigned long i)
|
||||
{
|
||||
register unsigned long len, tmp, len2;
|
||||
|
||||
/* first count the number of bytes needed */
|
||||
for (len = 1, tmp = i; tmp > 9; ++len)
|
||||
tmp /= 10;
|
||||
if (dest)
|
||||
for (tmp = i, dest += len, len2 = len + 1; --len2; tmp /= 10)
|
||||
*--dest = (tmp % 10) + '0';
|
||||
return len;
|
||||
}
|
||||
|
||||
/* split buf into n strings that are separated by c. return n as *len.
|
||||
* Allocate plus more slots and leave the first ofs of them alone. */
|
||||
static char **split(char *buf, int c, int *len, int plus, int ofs)
|
||||
{
|
||||
int n = 1;
|
||||
char **v = 0;
|
||||
char **w;
|
||||
|
||||
/* step 1: count tokens */
|
||||
char *s;
|
||||
|
||||
for (s = buf; *s; s++)
|
||||
if (*s == c)
|
||||
n++;
|
||||
/* step 2: allocate space for pointers */
|
||||
v = (char **) malloc((n + plus) * sizeof(char *));
|
||||
if (!v)
|
||||
return 0;
|
||||
w = v + ofs;
|
||||
*w++ = buf;
|
||||
for (s = buf;; s++) {
|
||||
while (*s && *s != c)
|
||||
s++;
|
||||
if (*s == 0)
|
||||
break;
|
||||
if (*s == c) {
|
||||
*s = 0;
|
||||
*w++ = s + 1;
|
||||
}
|
||||
}
|
||||
*len = w - v;
|
||||
return v;
|
||||
}
|
||||
|
||||
static int openreadclose(char *fn, char **buf, unsigned long *len)
|
||||
{
|
||||
int fd = open(fn, O_RDONLY);
|
||||
|
||||
if (fd < 0)
|
||||
return -1;
|
||||
if (!*buf) {
|
||||
*len = lseek(fd, 0, SEEK_END);
|
||||
lseek(fd, 0, SEEK_SET);
|
||||
*buf = (char *) malloc(*len + 1);
|
||||
if (!*buf) {
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
*len = read(fd, *buf, *len);
|
||||
if (*len != (unsigned long) -1)
|
||||
(*buf)[*len] = 0;
|
||||
return close(fd);
|
||||
}
|
||||
|
||||
/* return index of service in process data structure or -1 if not found */
|
||||
static int findservice(char *service)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= maxprocess; i++) {
|
||||
if (!strcmp(root[i].name, service))
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* look up process index in data structure by PID */
|
||||
static int findbypid(pid_t pid)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= maxprocess; i++) {
|
||||
if (root[i].pid == pid)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* clear circular dependency detection flags */
|
||||
static void circsweep(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= maxprocess; i++)
|
||||
root[i].circular = 0;
|
||||
}
|
||||
|
||||
/* add process to data structure, return index or -1 */
|
||||
static int addprocess(struct process *p)
|
||||
{
|
||||
if (maxprocess + 1 >= processalloc) {
|
||||
struct process *fump;
|
||||
|
||||
processalloc += 8;
|
||||
if ((fump =
|
||||
(struct process *) xrealloc(root,
|
||||
processalloc *
|
||||
sizeof(struct process))) == 0)
|
||||
return -1;
|
||||
root = fump;
|
||||
}
|
||||
memmove(&root[++maxprocess], p, sizeof(struct process));
|
||||
return maxprocess;
|
||||
}
|
||||
|
||||
/* load a service into the process data structure and return index or -1
|
||||
* if failed */
|
||||
static int loadservice(char *service)
|
||||
{
|
||||
struct process tmp;
|
||||
int fd;
|
||||
|
||||
if (*service == 0)
|
||||
return -1;
|
||||
fd = findservice(service);
|
||||
if (fd >= 0)
|
||||
return fd;
|
||||
if (chdir(MINITROOT) || chdir(service))
|
||||
return -1;
|
||||
if (!(tmp.name = strdup(service)))
|
||||
return -1;
|
||||
tmp.pid = 0;
|
||||
fd = open("respawn", O_RDONLY);
|
||||
if (fd >= 0) {
|
||||
tmp.respawn = 1;
|
||||
close(fd);
|
||||
} else
|
||||
tmp.respawn = 0;
|
||||
tmp.startedat = 0;
|
||||
tmp.circular = 0;
|
||||
tmp.__stdin = 0;
|
||||
tmp.__stdout = 1;
|
||||
{
|
||||
char *logservice = alloca(strlen(service) + 5);
|
||||
|
||||
strcpy(logservice, service);
|
||||
strcat(logservice, "/log");
|
||||
tmp.logservice = loadservice(logservice);
|
||||
if (tmp.logservice >= 0) {
|
||||
int pipefd[2];
|
||||
|
||||
if (pipe(pipefd))
|
||||
return -1;
|
||||
root[tmp.logservice].__stdin = pipefd[0];
|
||||
tmp.__stdout = pipefd[1];
|
||||
}
|
||||
}
|
||||
return (addprocess(&tmp));
|
||||
}
|
||||
|
||||
/* usage: isup(findservice("sshd")).
|
||||
* returns nonzero if process is up */
|
||||
static int isup(int service)
|
||||
{
|
||||
if (service < 0)
|
||||
return 0;
|
||||
return (root[service].pid != 0);
|
||||
}
|
||||
|
||||
static void opendevconsole(void)
|
||||
{
|
||||
int fd;
|
||||
|
||||
if ((fd = open("/dev/console", O_RDWR | O_NOCTTY)) >= 0) {
|
||||
dup2(fd, 0);
|
||||
dup2(fd, 1);
|
||||
dup2(fd, 2);
|
||||
if (fd > 2)
|
||||
close(fd);
|
||||
}
|
||||
}
|
||||
|
||||
/* called from inside the service directory, return the PID or 0 on error */
|
||||
static pid_t forkandexec(int pause_flag, int service)
|
||||
{
|
||||
char **argv = 0;
|
||||
int count = 0;
|
||||
pid_t p;
|
||||
int fd;
|
||||
unsigned long len;
|
||||
char *s = 0;
|
||||
int argc;
|
||||
char *argv0 = 0;
|
||||
|
||||
again:
|
||||
switch (p = fork()) {
|
||||
case (pid_t) - 1:
|
||||
if (count > 3)
|
||||
return 0;
|
||||
sleep(++count * 2);
|
||||
goto again;
|
||||
case 0:
|
||||
/* child */
|
||||
|
||||
if (i_am_init) {
|
||||
ioctl(0, TIOCNOTTY, 0);
|
||||
setsid();
|
||||
opendevconsole();
|
||||
tcsetpgrp(0, getpgrp());
|
||||
}
|
||||
close(infd);
|
||||
close(outfd);
|
||||
if (pause_flag) {
|
||||
struct timespec req;
|
||||
|
||||
req.tv_sec = 0;
|
||||
req.tv_nsec = 500000000;
|
||||
nanosleep(&req, 0);
|
||||
}
|
||||
if (!openreadclose("params", &s, &len)) {
|
||||
argv = split(s, '\n', &argc, 2, 1);
|
||||
if (argv[argc - 1])
|
||||
argv[argc - 1] = 0;
|
||||
else
|
||||
argv[argc] = 0;
|
||||
} else {
|
||||
argv = (char **) xmalloc(2 * sizeof(char *));
|
||||
argv[1] = 0;
|
||||
}
|
||||
argv0 = (char *) xmalloc(PATH_MAX + 1);
|
||||
if (!argv || !argv0)
|
||||
goto abort;
|
||||
if (readlink("run", argv0, PATH_MAX) < 0) {
|
||||
if (errno != EINVAL)
|
||||
goto abort; /* not a symbolic link */
|
||||
argv0 = strdup("./run");
|
||||
}
|
||||
argv[0] = strrchr(argv0, '/');
|
||||
if (argv[0])
|
||||
argv[0]++;
|
||||
else
|
||||
argv[0] = argv0;
|
||||
if (root[service].__stdin != 0)
|
||||
dup2(root[service].__stdin, 0);
|
||||
if (root[service].__stdout != 1) {
|
||||
dup2(root[service].__stdout, 1);
|
||||
dup2(root[service].__stdout, 2);
|
||||
}
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 3; i < 1024; ++i)
|
||||
close(i);
|
||||
}
|
||||
execve(argv0, argv, environ);
|
||||
_exit(0);
|
||||
abort:
|
||||
free(argv0);
|
||||
free(argv);
|
||||
_exit(0);
|
||||
default:
|
||||
fd = open("sync", O_RDONLY);
|
||||
if (fd >= 0) {
|
||||
pid_t p2;
|
||||
|
||||
close(fd);
|
||||
p2 = waitpid(p, 0, 0);
|
||||
return 1;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
||||
/* start a service, return nonzero on error */
|
||||
static int startnodep(int service, int pause_flag)
|
||||
{
|
||||
/* step 1: see if the process is already up */
|
||||
if (isup(service))
|
||||
return 0;
|
||||
|
||||
/* step 2: fork and exec service, put PID in data structure */
|
||||
if (chdir(MINITROOT) || chdir(root[service].name))
|
||||
return -1;
|
||||
root[service].startedat = time(0);
|
||||
root[service].pid = forkandexec(pause_flag, service);
|
||||
return root[service].pid;
|
||||
}
|
||||
|
||||
static int startservice(int service, int pause_flag)
|
||||
{
|
||||
int dir = -1;
|
||||
unsigned long len;
|
||||
char *s = 0;
|
||||
pid_t pid;
|
||||
|
||||
if (service < 0)
|
||||
return 0;
|
||||
if (root[service].circular)
|
||||
return 0;
|
||||
root[service].circular = 1;
|
||||
if (root[service].logservice >= 0)
|
||||
startservice(root[service].logservice, pause_flag);
|
||||
if (chdir(MINITROOT) || chdir(root[service].name))
|
||||
return -1;
|
||||
if ((dir = open(".", O_RDONLY)) >= 0) {
|
||||
if (!openreadclose("depends", &s, &len)) {
|
||||
char **deps;
|
||||
int depc, i;
|
||||
|
||||
deps = split(s, '\n', &depc, 0, 0);
|
||||
for (i = 0; i < depc; i++) {
|
||||
int service_index;
|
||||
|
||||
if (deps[i][0] == '#')
|
||||
continue;
|
||||
service_index = loadservice(deps[i]);
|
||||
if (service_index >= 0 && root[service_index].pid != 1)
|
||||
startservice(service_index, 0);
|
||||
}
|
||||
fchdir(dir);
|
||||
}
|
||||
pid = startnodep(service, pause_flag);
|
||||
close(dir);
|
||||
dir = -1;
|
||||
return pid;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void sulogin(void)
|
||||
{
|
||||
/* exiting on an initialization failure is not a good idea for init */
|
||||
char *argv[] = { "sulogin", 0 };
|
||||
execve("/sbin/sulogin", argv, environ);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static void handlekilled(pid_t killed)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (killed == (pid_t) - 1) {
|
||||
write(2, "all services exited.\n", 21);
|
||||
exit(0);
|
||||
}
|
||||
if (killed == 0)
|
||||
return;
|
||||
i = findbypid(killed);
|
||||
if (i >= 0) {
|
||||
root[i].pid = 0;
|
||||
if (root[i].respawn) {
|
||||
circsweep();
|
||||
startservice(i, time(0) - root[i].startedat < 1);
|
||||
} else {
|
||||
root[i].startedat = time(0);
|
||||
root[i].pid = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void childhandler(void)
|
||||
{
|
||||
int status;
|
||||
pid_t killed;
|
||||
|
||||
do {
|
||||
killed = waitpid(-1, &status, WNOHANG);
|
||||
handlekilled(killed);
|
||||
} while (killed && killed != (pid_t) - 1);
|
||||
}
|
||||
|
||||
static volatile int dowinch = 0;
|
||||
static volatile int doint = 0;
|
||||
|
||||
static void sigchild(int whatever)
|
||||
{
|
||||
}
|
||||
static void sigwinch(int sig)
|
||||
{
|
||||
dowinch = 1;
|
||||
}
|
||||
static void sigint(int sig)
|
||||
{
|
||||
doint = 1;
|
||||
}
|
||||
|
||||
extern int minit_main(int argc, char *argv[])
|
||||
{
|
||||
/* Schritt 1: argv[1] als Service nehmen und starten */
|
||||
struct pollfd pfd;
|
||||
time_t last = time(0);
|
||||
int nfds = 1;
|
||||
int count = 0;
|
||||
int i;
|
||||
|
||||
infd = open("/etc/minit/in", O_RDWR);
|
||||
outfd = open("/etc/minit/out", O_RDWR | O_NONBLOCK);
|
||||
if (getpid() == 1) {
|
||||
int fd;
|
||||
|
||||
i_am_init = 1;
|
||||
reboot(0);
|
||||
if ((fd = open("/dev/console", O_RDWR | O_NOCTTY))) {
|
||||
ioctl(fd, KDSIGACCEPT, SIGWINCH);
|
||||
close(fd);
|
||||
} else
|
||||
ioctl(0, KDSIGACCEPT, SIGWINCH);
|
||||
}
|
||||
/* signal(SIGPWR,sighandler); don't know what to do about it */
|
||||
/* signal(SIGHUP,sighandler); ??? */
|
||||
{
|
||||
struct sigaction sa;
|
||||
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_sigaction = 0;
|
||||
sa.sa_flags = SA_RESTART | SA_NOCLDSTOP;
|
||||
sa.sa_handler = sigchild;
|
||||
sigaction(SIGCHLD, &sa, 0);
|
||||
sa.sa_handler = sigint;
|
||||
sigaction(SIGINT, &sa, 0); /* ctrl-alt-del */
|
||||
sa.sa_handler = sigwinch;
|
||||
sigaction(SIGWINCH, &sa, 0); /* keyboard request */
|
||||
}
|
||||
if (infd < 0 || outfd < 0) {
|
||||
puts("minit: could not open /etc/minit/in or /etc/minit/out\n");
|
||||
sulogin();
|
||||
nfds = 0;
|
||||
} else
|
||||
pfd.fd = infd;
|
||||
pfd.events = POLLIN;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
circsweep();
|
||||
if (startservice(loadservice(argv[i]), 0))
|
||||
count++;
|
||||
}
|
||||
circsweep();
|
||||
if (!count)
|
||||
startservice(loadservice("default"), 0);
|
||||
for (;;) {
|
||||
char buf[1501];
|
||||
time_t now;
|
||||
|
||||
if (doint) {
|
||||
doint = 0;
|
||||
startservice(loadservice("ctrlaltdel"), 0);
|
||||
}
|
||||
if (dowinch) {
|
||||
dowinch = 0;
|
||||
startservice(loadservice("kbreq"), 0);
|
||||
}
|
||||
childhandler();
|
||||
now = time(0);
|
||||
if (now < last || now - last > 30) {
|
||||
/* The system clock was reset. Compensate. */
|
||||
long diff = last - now;
|
||||
int j;
|
||||
|
||||
for (j = 0; j <= maxprocess; ++j) {
|
||||
root[j].startedat -= diff;
|
||||
}
|
||||
}
|
||||
last = now;
|
||||
switch (poll(&pfd, nfds, 5000)) {
|
||||
case -1:
|
||||
if (errno == EINTR) {
|
||||
childhandler();
|
||||
break;
|
||||
}
|
||||
opendevconsole();
|
||||
puts("poll failed!\n");
|
||||
sulogin();
|
||||
/* what should we do if poll fails?! */
|
||||
break;
|
||||
case 1:
|
||||
i = read(infd, buf, 1500);
|
||||
if (i > 1) {
|
||||
pid_t pid;
|
||||
int idx = 0;
|
||||
int tmp;
|
||||
|
||||
buf[i] = 0;
|
||||
|
||||
if (buf[0] != 's' && ((idx = findservice(buf + 1)) < 0))
|
||||
error:
|
||||
write(outfd, "0", 1);
|
||||
else {
|
||||
switch (buf[0]) {
|
||||
case 'p':
|
||||
write(outfd, buf, fmt_ulong(buf, root[idx].pid));
|
||||
break;
|
||||
case 'r':
|
||||
root[idx].respawn = 0;
|
||||
goto ok;
|
||||
case 'R':
|
||||
root[idx].respawn = 1;
|
||||
goto ok;
|
||||
case 'C':
|
||||
if (kill(root[idx].pid, 0)) { /* check if still active */
|
||||
handlekilled(root[idx].pid); /* no!?! remove form active list */
|
||||
goto error;
|
||||
}
|
||||
goto ok;
|
||||
break;
|
||||
case 'P':
|
||||
{
|
||||
unsigned char *x = buf + strlen(buf) + 1;
|
||||
unsigned char c;
|
||||
|
||||
tmp = 0;
|
||||
while ((c = *x++ - '0') < 10)
|
||||
tmp = tmp * 10 + c;
|
||||
}
|
||||
if (tmp > 0) {
|
||||
if (kill(tmp, 0))
|
||||
goto error;
|
||||
pid = tmp;
|
||||
}
|
||||
root[idx].pid = tmp;
|
||||
goto ok;
|
||||
case 's':
|
||||
idx = loadservice(buf + 1);
|
||||
if (idx < 0)
|
||||
goto error;
|
||||
if (root[idx].pid < 2) {
|
||||
root[idx].pid = 0;
|
||||
circsweep();
|
||||
idx = startservice(idx, 0);
|
||||
if (idx == 0) {
|
||||
write(outfd, "0", 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
ok:
|
||||
write(outfd, "1", 1);
|
||||
break;
|
||||
case 'u':
|
||||
write(outfd, buf,
|
||||
fmt_ulong(buf, time(0) - root[idx].startedat));
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
-300
@@ -1,300 +0,0 @@
|
||||
/*
|
||||
* minit version 0.9.1 by Felix von Leitner
|
||||
* ported to busybox by Glenn McGrath <bug1@optushome.com.au>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/file.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "busybox.h"
|
||||
|
||||
static int infd, outfd;
|
||||
|
||||
static char buf[1500];
|
||||
|
||||
static unsigned int fmt_ulong(char *dest, unsigned long i)
|
||||
{
|
||||
register unsigned long len, tmp, len2;
|
||||
|
||||
/* first count the number of bytes needed */
|
||||
for (len = 1, tmp = i; tmp > 9; ++len)
|
||||
tmp /= 10;
|
||||
if (dest)
|
||||
for (tmp = i, dest += len, len2 = len + 1; --len2; tmp /= 10)
|
||||
*--dest = (tmp % 10) + '0';
|
||||
return len;
|
||||
}
|
||||
|
||||
static void addservice(char *service)
|
||||
{
|
||||
char *service_ptr;
|
||||
|
||||
if (strncmp(service, "/etc/minit/", 11) == 0) {
|
||||
service += 11;
|
||||
}
|
||||
|
||||
while ((service_ptr = last_char_is(service, '/')) != NULL) {
|
||||
*service_ptr = 0;
|
||||
}
|
||||
strncpy(buf + 1, service, 1400);
|
||||
buf[1400] = 0;
|
||||
}
|
||||
|
||||
static int addreadwrite(char *service)
|
||||
{
|
||||
addservice(service);
|
||||
write(infd, buf, strlen(buf));
|
||||
return read(outfd, buf, 1500);
|
||||
}
|
||||
|
||||
/* return PID, 0 if error */
|
||||
static pid_t __readpid(char *service)
|
||||
{
|
||||
int len;
|
||||
|
||||
buf[0] = 'p';
|
||||
len = addreadwrite(service);
|
||||
if (len < 0)
|
||||
return 0;
|
||||
buf[len] = 0;
|
||||
return atoi(buf);
|
||||
}
|
||||
|
||||
/* return nonzero if error */
|
||||
static int respawn(char *service, int yesno)
|
||||
{
|
||||
int len;
|
||||
|
||||
buf[0] = yesno ? 'R' : 'r';
|
||||
len = addreadwrite(service);
|
||||
return (len != 1 || buf[0] == '0');
|
||||
}
|
||||
|
||||
/* return nonzero if error */
|
||||
static int startservice(char *service)
|
||||
{
|
||||
int len;
|
||||
|
||||
buf[0] = 's';
|
||||
len = addreadwrite(service);
|
||||
return (len != 1 || buf[0] == '0');
|
||||
}
|
||||
|
||||
extern int msvc_main(int argc, char **argv)
|
||||
{
|
||||
if (argc < 2) {
|
||||
bb_show_usage();
|
||||
}
|
||||
infd = bb_xopen("/etc/minit/in", O_WRONLY);
|
||||
outfd = bb_xopen("/etc/minit/out", O_RDONLY);
|
||||
|
||||
while (lockf(infd, F_LOCK, 1)) {
|
||||
bb_perror_msg("could not aquire lock!\n");
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
if (argc == 2) {
|
||||
pid_t pid = __readpid(argv[1]);
|
||||
|
||||
if (buf[0] != '0') {
|
||||
int len;
|
||||
int up_time;
|
||||
|
||||
printf("%s: ", argv[1]);
|
||||
if (pid == 0)
|
||||
printf("down ");
|
||||
else if (pid == 1)
|
||||
printf("finished ");
|
||||
else {
|
||||
printf("up (pid %d) ", pid);
|
||||
}
|
||||
|
||||
buf[0] = 'u';
|
||||
len = addreadwrite(argv[1]);
|
||||
if (len < 0) {
|
||||
up_time = 0;
|
||||
} else {
|
||||
buf[len] = 0;
|
||||
up_time = atoi(buf);
|
||||
}
|
||||
printf("%d seconds\n", up_time);
|
||||
|
||||
if (pid == 0)
|
||||
return 2;
|
||||
else if (pid == 1)
|
||||
return 3;
|
||||
else
|
||||
return 0;
|
||||
} else {
|
||||
bb_error_msg_and_die("no such service");
|
||||
}
|
||||
} else {
|
||||
int i;
|
||||
int ret = 0;
|
||||
int sig = 0;
|
||||
pid_t pid;
|
||||
|
||||
if (argv[1][0] == '-') {
|
||||
switch (argv[1][1]) {
|
||||
case 'g':
|
||||
for (i = 2; i < argc; ++i) {
|
||||
pid = __readpid(argv[i]);
|
||||
if (pid < 2) {
|
||||
if (pid == 1) {
|
||||
bb_error_msg("%s, service termination", argv[i]);
|
||||
} else {
|
||||
bb_error_msg("%s, no such service", argv[i]);
|
||||
}
|
||||
ret = 1;
|
||||
}
|
||||
printf("%d\n", pid);
|
||||
}
|
||||
break;
|
||||
case 'p':
|
||||
sig = SIGSTOP;
|
||||
goto dokill;
|
||||
break;
|
||||
case 'c':
|
||||
sig = SIGCONT;
|
||||
goto dokill;
|
||||
break;
|
||||
case 'h':
|
||||
sig = SIGHUP;
|
||||
goto dokill;
|
||||
break;
|
||||
case 'a':
|
||||
sig = SIGALRM;
|
||||
goto dokill;
|
||||
break;
|
||||
case 'i':
|
||||
sig = SIGINT;
|
||||
goto dokill;
|
||||
break;
|
||||
case 't':
|
||||
sig = SIGTERM;
|
||||
goto dokill;
|
||||
break;
|
||||
case 'k':
|
||||
sig = SIGKILL;
|
||||
goto dokill;
|
||||
break;
|
||||
case 'o':
|
||||
for (i = 2; i < argc; ++i)
|
||||
if (startservice(argv[i]) || respawn(argv[i], 0)) {
|
||||
bb_error_msg("Couldnt not start %s\n", argv[i]);
|
||||
ret = 1;
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
for (i = 2; i < argc; ++i) {
|
||||
pid = __readpid(argv[i]);
|
||||
if (pid == 0) {
|
||||
bb_error_msg("%s, no such service\n", argv[i]);
|
||||
ret = 1;
|
||||
} else if (pid == 1)
|
||||
continue;
|
||||
if (respawn(argv[i], 0) || kill(pid, SIGTERM)
|
||||
|| kill(pid, SIGCONT));
|
||||
}
|
||||
break;
|
||||
case 'u':
|
||||
for (i = 2; i < argc; ++i) {
|
||||
if (startservice(argv[i]) || respawn(argv[i], 1)) {
|
||||
bb_error_msg("Couldnt not start %s\n", argv[i]);
|
||||
ret = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'C':
|
||||
for (i = 2; i < argc; ++i) {
|
||||
int len;
|
||||
|
||||
buf[0] = 'C';
|
||||
len = addreadwrite(argv[i]);
|
||||
if (len != 1 || buf[0] == '0') {
|
||||
bb_error_msg("%s has terminated or was killed\n",
|
||||
argv[i]);
|
||||
ret = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'P':
|
||||
pid = atoi(argv[1] + 2);
|
||||
if (pid > 1) {
|
||||
char *tmp;
|
||||
int len;
|
||||
|
||||
buf[0] = 'P';
|
||||
addservice(argv[2]);
|
||||
tmp = buf + strlen(buf) + 1;
|
||||
tmp[fmt_ulong(tmp, pid)] = 0;
|
||||
write(infd, buf, strlen(buf) + strlen(tmp) + 2);
|
||||
len = read(outfd, buf, 1500);
|
||||
if (len != 1 || buf[0] == '0') {
|
||||
bb_error_msg_and_die("Couldnt not set pid of service %s\n", argv[2]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
bb_show_usage();
|
||||
}
|
||||
} else {
|
||||
bb_show_usage();
|
||||
}
|
||||
return ret;
|
||||
dokill:
|
||||
for (i = 2; i < argc; i++) {
|
||||
pid = __readpid(argv[i]);
|
||||
if (!pid) {
|
||||
bb_error_msg("%s no such service\n", argv[i]);
|
||||
ret = 1;
|
||||
}
|
||||
if (kill(pid, sig)) {
|
||||
bb_error_msg("%s, could not send signal %d to PID %d\n",
|
||||
argv[i], sig, pid);
|
||||
ret = 1;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
-u Up. If the service is not running, start it. If the service stops,
|
||||
restart it.
|
||||
-d Down. If the service is running, send it a TERM signal and then a CONT
|
||||
signal. After it stops, do not restart it.
|
||||
-o Once. If the service is not running, start it. Do not restart it if it
|
||||
stops.
|
||||
-r Tell supervise that the service is normally running; this affects status
|
||||
messages.
|
||||
-s Tell supervise that the service is normally stopped; this affects status
|
||||
messages.
|
||||
-p Pause. Send the service a STOP signal.
|
||||
-c Continue. Send the service a CONT signal.
|
||||
-h Hangup. Send the service a HUP signal.
|
||||
-a Alarm. Send the service an ALRM signal.
|
||||
-i Interrupt. Send the service an INT signal.
|
||||
-t Terminate. Send the service a TERM signal.
|
||||
-k Kill. Send the service a KILL signal.
|
||||
-x Exit. supervise will quit as soon as the service is down.
|
||||
*/
|
||||
Loaded 100 of 278 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user