Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7cce16cf21 | ||
|
|
aeea32ca69 | ||
|
|
ef43749e83 | ||
|
|
c71c18957d | ||
|
|
c06f568dda | ||
|
|
4575bbf7b8 | ||
|
|
5b0d7deb75 | ||
|
|
16e45d7e29 | ||
|
|
31b98dd097 | ||
|
|
083862228a | ||
|
|
24cb17f9be | ||
|
|
35db2281b7 | ||
|
|
a3212eb4cc | ||
|
|
dfe30032af | ||
|
|
ad95373efc | ||
|
|
1a834be1ce | ||
|
|
d242079387 | ||
|
|
dfcb5b0412 | ||
|
|
0f56de665c | ||
|
|
39cdf4e2ab | ||
|
|
ad84a516bb | ||
|
|
ab26cc3d8a | ||
|
|
ebce2daa60 | ||
|
|
f88bb72f1f | ||
|
|
242ab83499 | ||
|
|
82364bb591 | ||
|
|
43112b4b65 | ||
|
|
13cf6626c8 | ||
|
|
63bcf1a55f | ||
|
|
f2ec37902a | ||
|
|
7018385fe7 | ||
|
|
bbbe21d6b0 | ||
|
|
4766a2d56c | ||
|
|
303e989a11 | ||
|
|
ca43b485de | ||
|
|
2d016a3715 | ||
|
|
654a99b691 | ||
|
|
711bb92d7c | ||
|
|
578eff5066 | ||
|
|
475820c9de | ||
|
|
8d44178381 | ||
|
|
85c5152cb8 | ||
|
|
a1e4a0ef67 | ||
|
|
ee829065cb | ||
|
|
eaf5bc0038 | ||
|
|
348672d46d | ||
|
|
15eb39c25a | ||
|
|
53766c4063 | ||
|
|
65b6d8bdb6 | ||
|
|
792cae5f2a | ||
|
|
58a2e0e262 | ||
|
|
036dbaa082 | ||
|
|
b03be7f567 | ||
|
|
a277e02663 | ||
|
|
ff6ec8a2ae | ||
|
|
3e77b4e954 | ||
|
|
c3b134f3b7 | ||
|
|
2faf306c73 | ||
|
|
16f94a6722 | ||
|
|
17b4a20a9c | ||
|
|
67285965f3 | ||
|
|
6a78631164 | ||
|
|
1cda715bbc | ||
|
|
7c87b67c08 | ||
|
|
76620620ec | ||
|
|
dfb6211df3 | ||
|
|
447bc2d17f | ||
|
|
716ccb2635 | ||
|
|
8e2f74f5a7 | ||
|
|
95f75a3dcd | ||
|
|
1f28b90a9c | ||
|
|
9d65ab2beb | ||
|
|
66e21fd161 | ||
|
|
ab7780655b | ||
|
|
6cb3bc056c | ||
|
|
08ca752c68 | ||
|
|
930453bdcf | ||
|
|
40ec4aeb8e | ||
|
|
3b25185733 | ||
|
|
ffa28d1b46 | ||
|
|
8f3eb1dbab | ||
|
|
a43faccbde | ||
|
|
5c9f0d05b3 | ||
|
|
cfc0ad4260 | ||
|
|
7f48a959f5 | ||
|
|
7b253f8c72 | ||
|
|
f980bd5848 | ||
|
|
6caa073760 | ||
|
|
ce91c8ac2b | ||
|
|
ab8215431f | ||
|
|
3b1a74467a | ||
|
|
d242e49c89 | ||
|
|
a8992635b1 | ||
|
|
b90502828c | ||
|
|
5089534be0 | ||
|
|
d10f36fe2e | ||
|
|
3a5ed56803 | ||
|
|
9cccc18141 | ||
|
|
27bb79080d | ||
|
|
a6beeb6a7e | ||
|
|
f0da28c91b | ||
|
|
52a3c2726e | ||
|
|
b89fcd4430 | ||
|
|
334dc65c92 | ||
|
|
a120c32cfa | ||
|
|
67ff3a1ffd | ||
|
|
0933a92f5a | ||
|
|
f295b5a408 | ||
|
|
8f3bc4ce52 | ||
|
|
a8d82fe52e | ||
|
|
b868f55c78 | ||
|
|
08573e0ac4 | ||
|
|
02e0355504 | ||
|
|
236e93d133 | ||
|
|
f62ea20aff | ||
|
|
266c1f5eff | ||
|
|
ffccf6eb5d | ||
|
|
03d8091859 | ||
|
|
514aeabc36 | ||
|
|
28c111e1c5 | ||
|
|
d4a5e255c4 | ||
|
|
3752d337b3 | ||
|
|
89f10bcf37 | ||
|
|
769a3ef08d | ||
|
|
f18bd8931d | ||
|
|
1a773a656e | ||
|
|
658f8b1d1a | ||
|
|
b8d2cd44a6 | ||
|
|
b51eb26568 | ||
|
|
07d2f4052f | ||
|
|
850b05fbde | ||
|
|
f796700cf0 | ||
|
|
4e864a36b6 | ||
|
|
e30495654d | ||
|
|
76729b8c69 | ||
|
|
5f46f1c241 | ||
|
|
b627c54813 | ||
|
|
6b3f757053 | ||
|
|
4040d3d712 | ||
|
|
8b3845106a | ||
|
|
4b77acafa6 | ||
|
|
7becf5987a | ||
|
|
a3170d5aab | ||
|
|
8f43126934 | ||
|
|
62419df95c | ||
|
|
4a9e34c148 | ||
|
|
a1fece2c70 | ||
|
|
d4f7a5edad | ||
|
|
c1893c5801 | ||
|
|
416c24224d | ||
|
|
7dad86601a | ||
|
|
e06bea7767 | ||
|
|
5b8a59400c | ||
|
|
c181f34c87 | ||
|
|
e7047887b0 | ||
|
|
37f4116ecb | ||
|
|
de4f07e56e | ||
|
|
9f6c12a42e | ||
|
|
2e0455d82b | ||
|
|
539eef6f28 | ||
|
|
d5c746f3a8 | ||
|
|
747f2f7d78 | ||
|
|
f6bba3d689 | ||
|
|
9adcf73152 | ||
|
|
5c0d84aaf0 | ||
|
|
142abc18ce | ||
|
|
22e1ca382b | ||
|
|
c83e3a6406 | ||
|
|
50547c0745 | ||
|
|
3860b2ebd6 | ||
|
|
5be6a200f0 | ||
|
|
b8c3a54531 | ||
|
|
11e69471be | ||
|
|
e39ee01821 | ||
|
|
fea4b446df | ||
|
|
4ddddd180e | ||
|
|
c3498f678a | ||
|
|
f0515dad66 | ||
|
|
7ffe133864 | ||
|
|
1a2d75fd72 | ||
|
|
d0550d8fc9 | ||
|
|
acbdc47aac | ||
|
|
2cd1eb16ad | ||
|
|
78cd84da8a | ||
|
|
e857122c97 | ||
|
|
d9c8ab40a4 | ||
|
|
3a2fcc63b8 | ||
|
|
bebc40b406 | ||
|
|
ba49651de9 | ||
|
|
90c9df93f3 | ||
|
|
0413af0e27 | ||
|
|
5c069aaf2f | ||
|
|
d85421de22 | ||
|
|
931ae9d2f8 | ||
|
|
0c5d9c27a5 | ||
|
|
7370f62493 | ||
|
|
0b6539f7f9 | ||
|
|
56f16b42c9 | ||
|
|
20872be9a4 | ||
|
|
3b9fc8fe2a | ||
|
|
de3ea9f049 | ||
|
|
aee0fd8320 | ||
|
|
303b7d83f0 | ||
|
|
f074afc2a0 | ||
|
|
cccf49fb0f | ||
|
|
7e4b3347b2 | ||
|
|
0874a613d2 | ||
|
|
8dc8cb133c | ||
|
|
5699b8525e | ||
|
|
54ac057c00 | ||
|
|
5c2c8eca4a | ||
|
|
e57feeb9e6 | ||
|
|
eba86e2adb | ||
|
|
e9080c9f41 | ||
|
|
7b215b99b2 | ||
|
|
1a41db8eaf | ||
|
|
94cf153c2b | ||
|
|
d09bcecda8 | ||
|
|
5f28455c6e | ||
|
|
b6e58d2b9a | ||
|
|
c16686c1e2 | ||
|
|
61b038accc | ||
|
|
8211db5af0 | ||
|
|
e0c83af4ce | ||
|
|
d2a897aab0 | ||
|
|
0bdf41ad7e | ||
|
|
bbce615c7e | ||
|
|
2849209db2 | ||
|
|
28d4e16cd7 | ||
|
|
d2160aaeab | ||
|
|
b1ffba0401 | ||
|
|
1b1942f93d | ||
|
|
7f9de02ca6 | ||
|
|
5912acb670 | ||
|
|
2685724e23 | ||
|
|
6d687817a8 | ||
|
|
b7077a7316 | ||
|
|
04d055f4e1 | ||
|
|
f6067beaa9 | ||
|
|
e6dc439b3a | ||
|
|
8179cf2b78 | ||
|
|
252183e3f5 | ||
|
|
e64bf409dd | ||
|
|
4ef5a84583 | ||
|
|
0120be94a0 | ||
|
|
9716575f1a | ||
|
|
40c9489d33 | ||
|
|
09c295a5bc | ||
|
|
00ed36fd52 | ||
|
|
b8b6816f7b | ||
|
|
f4fd3a1331 | ||
|
|
984b45142a | ||
|
|
6530f0d3a1 | ||
|
|
4636aa9dcd | ||
|
|
f235d05773 | ||
|
|
1c834407e3 | ||
|
|
debb21ece7 | ||
|
|
e81fc5fb30 | ||
|
|
5fa4db29f7 | ||
|
|
2053a8c747 | ||
|
|
e78fe2414b | ||
|
|
a92877403a | ||
|
|
a48b0a3af7 | ||
|
|
514633bf3f | ||
|
|
7f6295f516 | ||
|
|
28672dd3b9 | ||
|
|
9ef6c93090 | ||
|
|
976a55e168 | ||
|
|
f1d3ac429e | ||
|
|
637d2266e1 | ||
|
|
5289969f08 | ||
|
|
88c916bdec | ||
|
|
951df20b7e | ||
|
|
acf6c917e2 | ||
|
|
1acfb72e71 | ||
|
|
0d6d88a205 | ||
|
|
6fe55ae939 | ||
|
|
7857c03808 | ||
|
|
d12061b299 | ||
|
|
61796945e3 | ||
|
|
75a5684793 | ||
|
|
2af70005b9 | ||
|
|
fe4704e948 | ||
|
|
12940e1ce0 | ||
|
|
17d21fa519 | ||
|
|
a55d72bbb4 | ||
|
|
99825960c1 | ||
|
|
29c77f71ba | ||
|
|
dae099b2f9 | ||
|
|
638da75f4b | ||
|
|
07085855ad | ||
|
|
586d86cc8c | ||
|
|
9d1a33c690 | ||
|
|
add3eadc46 | ||
|
|
42c25735e6 | ||
|
|
fd7bc13557 | ||
|
|
f86bd9f2cd | ||
|
|
07cf92676a | ||
|
|
1dc0ccafdd | ||
|
|
8ac86e33a2 | ||
|
|
4a77c781ef | ||
|
|
cb920d9778 | ||
|
|
91b3d460c7 | ||
|
|
9c91e4142d | ||
|
|
0ad4daa54e | ||
|
|
738fb33994 | ||
|
|
aa5a602689 | ||
|
|
e6ba16f830 | ||
|
|
f7dd10f67c | ||
|
|
a79220db6e | ||
|
|
6b0658f5c0 | ||
|
|
6376b583e2 | ||
|
|
c98c7d9a14 | ||
|
|
761ec20f81 | ||
|
|
a406a9c853 | ||
|
|
eebcc1d98a | ||
|
|
d72e34c752 | ||
|
|
d3612178b7 | ||
|
|
2570b43e82 | ||
|
|
204ff1cea4 | ||
|
|
96fd1b98f1 | ||
|
|
baaa6e9e7d | ||
|
|
a3822de23e | ||
|
|
e16ab475ad | ||
|
|
977451ef44 | ||
|
|
47e5ca1ecb | ||
|
|
e3e28d3bb6 | ||
|
|
8efe967018 | ||
|
|
c4f72d1426 | ||
|
|
45638df230 | ||
|
|
2205c84de4 | ||
|
|
1393a39df4 | ||
|
|
2eed0e2d47 | ||
|
|
6e5687abc3 | ||
|
|
7b35121297 | ||
|
|
73116311e5 | ||
|
|
65f9dc01f3 | ||
|
|
640c1f547f | ||
|
|
ba5eb27ce3 | ||
|
|
c43f9edf88 | ||
|
|
294d113adb | ||
|
|
8417c8c38b | ||
|
|
7bf8f5bc5e | ||
|
|
8a0b59fb82 | ||
|
|
edc388cf4e | ||
|
|
3fe475677a | ||
|
|
f4523562b6 | ||
|
|
8aac05bfe5 | ||
|
|
7c59a83a77 | ||
|
|
4dc1d25a30 | ||
|
|
f36635cec6 | ||
|
|
c18ce373a2 | ||
|
|
c2b9186be1 | ||
|
|
2af30446f1 | ||
|
|
eb213bd2a2 | ||
|
|
7f2935ba0e | ||
|
|
70af8834df | ||
|
|
aa2afee922 | ||
|
|
839bd4a73b | ||
|
|
3acfedfafe | ||
|
|
23bc836f42 | ||
|
|
beb3bbd991 | ||
|
|
ef91bf67ed | ||
|
|
51ed242ad6 | ||
|
|
e15138a870 | ||
|
|
f57a614db9 | ||
|
|
a4389cfb51 | ||
|
|
14092a1ed2 | ||
|
|
81155f8fa8 | ||
|
|
2fdba24620 | ||
|
|
6231f092bd | ||
|
|
cc20ebc11e | ||
|
|
1cb2622f9c | ||
|
|
fe538ba5d6 | ||
|
|
87af49f26b | ||
|
|
640fb86b28 | ||
|
|
07f6b95d8f | ||
|
|
5875be406e | ||
|
|
55bf79f944 | ||
|
|
b65422cf65 | ||
|
|
350733abb8 | ||
|
|
d6bdd5dc08 | ||
|
|
b77158a934 | ||
|
|
99bd5adf99 | ||
|
|
759d7ececd | ||
|
|
530ea42abc | ||
|
|
dc4e75ef7c | ||
|
|
005f83adf5 | ||
|
|
d9461f887e | ||
|
|
c2942f0904 | ||
|
|
bb13624d8c | ||
|
|
502907f5b3 | ||
|
|
759515c26a | ||
|
|
29a05f56d5 | ||
|
|
9b04f1841e | ||
|
|
72f5f02184 | ||
|
|
5cd6461b6f | ||
|
|
e01c550eab | ||
|
|
21aacba2b7 | ||
|
|
8ce8f9b482 | ||
|
|
2233685f00 | ||
|
|
2ce002a732 | ||
|
|
b19c73dee6 | ||
|
|
3bff66617a | ||
|
|
87470def24 | ||
|
|
b54a748621 | ||
|
|
08dea3e5a7 | ||
|
|
62b031fb82 | ||
|
|
a6b7bdcf8c | ||
|
|
dc72f3ace2 | ||
|
|
7b8765c808 | ||
|
|
23365976f8 | ||
|
|
523c1675a2 | ||
|
|
e7bdfccb3f | ||
|
|
83e4a5bccf | ||
|
|
8b96b7169d | ||
|
|
4cee66d5a8 | ||
|
|
444566837c | ||
|
|
b79db92a21 | ||
|
|
c3f2956cfa | ||
|
|
4d5e4685fe | ||
|
|
ce6482eace | ||
|
|
97e2426582 | ||
|
|
6d3c7e7a9c | ||
|
|
24e098a77d | ||
|
|
d382c89467 | ||
|
|
3d5828fb6d | ||
|
|
062913f662 | ||
|
|
bf83355dda | ||
|
|
4456f25e8f | ||
|
|
5b3c05637d | ||
|
|
9a9f6777e9 | ||
|
|
96379b0d7d | ||
|
|
8f4cdd516d | ||
|
|
b287e2e27a | ||
|
|
c601ff149a | ||
|
|
2e9c257000 | ||
|
|
f1c56a9306 | ||
|
|
92fb9395f7 | ||
|
|
99a75d1376 | ||
|
|
de6a6ae876 | ||
|
|
6c0e0fb8ac | ||
|
|
3869f66eac | ||
|
|
9089844382 | ||
|
|
dc19af4179 | ||
|
|
fdd2a0f318 | ||
|
|
d3652bf334 | ||
|
|
0a57a79e38 | ||
|
|
4b4e09854c | ||
|
|
50af12dbd6 | ||
|
|
481772a4c2 | ||
|
|
5378fbcb33 | ||
|
|
8f4ef159f0 | ||
|
|
c774efe317 | ||
|
|
7001480a5e | ||
|
|
72d8e444f0 | ||
|
|
461c279ac1 | ||
|
|
b1d5b741ac | ||
|
|
546f21aa2d | ||
|
|
e6b811583a | ||
|
|
91e464632b | ||
|
|
6a9ca985b8 |
No files matched your search
@@ -11,7 +11,7 @@ incorect, _please_ let me know.
|
||||
Emanuele Aina <emanuele.aina@tiscali.it>
|
||||
run-parts
|
||||
|
||||
Erik Andersen <andersen@codepoet.org>, <andersen@codepoet.org>
|
||||
Erik Andersen <andersen@codepoet.org>
|
||||
Tons of new stuff, major rewrite of most of the
|
||||
core apps, tons of new apps as noted in header files.
|
||||
|
||||
@@ -22,16 +22,16 @@ Jeff Angielski <jeff@theptrgroup.com>
|
||||
ftpput, ftpget
|
||||
|
||||
Edward Betts <edward@debian.org>
|
||||
expr, hostid, logname, tty, wc, whoami, yes
|
||||
expr, hostid, logname, whoami
|
||||
|
||||
John Beppu <beppu@codepoet.org>
|
||||
du, head, nslookup, sort, tee, uniq
|
||||
du, nslookup, sort
|
||||
|
||||
Brian Candler <B.Candler@pobox.com>
|
||||
tiny-ls(ls)
|
||||
|
||||
Randolph Chung <tausq@debian.org>
|
||||
fbset, ping, hostname, and mkfifo
|
||||
fbset, ping, hostname
|
||||
|
||||
Dave Cinege <dcinege@psychosis.com>
|
||||
more(v2), makedevs, dutmp, modularization, auto links file,
|
||||
@@ -67,11 +67,21 @@ Stephan Linz <linz@li-pro.net>
|
||||
ipcalc, Red Hat equivalence
|
||||
|
||||
John Lombardo <john@deltanet.com>
|
||||
dirname, tr
|
||||
tr
|
||||
|
||||
Glenn McGrath <bug1@optushome.com.au>
|
||||
ar, dpkg, dpkg-deb
|
||||
|
||||
Manuel Novoa III <mjn3@codepoet.org>
|
||||
cat, head, mkfifo, mknod, rmdir, sleep, tee, tty, uniq, usleep, wc, yes,
|
||||
mesg, vconfig, make_directory, parse_mode, dirname, mode_string,
|
||||
get_last_path_component, simplify_path, and a number trivial libbb routines
|
||||
|
||||
also bug fixes, partial rewrites, and size optimizations in
|
||||
ash, basename, cal, cmp, cp, df, du, echo, env, ln, logname, md5sum, mkdir,
|
||||
mv, realpath, rm, sort, tail, touch, uname, watch, arith, human_readable,
|
||||
interface, dutmp, ifconfig
|
||||
|
||||
Vladimir Oleynik <dzo@simtreas.ru>
|
||||
cmdedit; xargs(current), httpd(current);
|
||||
ports: ash, crond, fdisk, inetd, stty, traceroute, top;
|
||||
@@ -109,3 +119,7 @@ Charles P. Wright <cpwright@villagenet.com>
|
||||
|
||||
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.
|
||||
|
||||
@@ -36,6 +36,9 @@ CFLAGS += -I/usr/include/selinux
|
||||
LIBRARIES += -lsecure
|
||||
endif
|
||||
|
||||
CONFIG_CONFIG_IN = sysdeps/$(TARGET_OS)/Config.in
|
||||
CONFIG_DEFCONFIG = sysdeps/$(TARGET_OS)/defconfig
|
||||
|
||||
ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
|
||||
|
||||
all: busybox busybox.links doc
|
||||
@@ -45,7 +48,7 @@ all: busybox busybox.links doc
|
||||
include $(patsubst %,%/Makefile.in, $(DIRS))
|
||||
|
||||
busybox: .depend include/config.h $(libraries-y)
|
||||
$(CC) $(LDFLAGS) -o $@ $(libraries-y) $(LIBRARIES)
|
||||
$(CC) $(LDFLAGS) -o $@ -Wl,--start-group $(libraries-y) $(LIBRARIES) -Wl,--end-group
|
||||
$(STRIPCMD) $@
|
||||
|
||||
busybox.links: applets/busybox.mkll include/config.h
|
||||
@@ -54,8 +57,9 @@ busybox.links: applets/busybox.mkll include/config.h
|
||||
install: applets/install.sh busybox busybox.links
|
||||
$(SHELL) $< $(PREFIX)
|
||||
|
||||
uninstall: busybox busybox.links
|
||||
for i in `cat busybox.links` ; do rm -f $$PREFIX$$i; done
|
||||
uninstall: busybox.links
|
||||
rm -f $(PREFIX)/bin/busybox
|
||||
for i in `cat busybox.links` ; do rm -f $(PREFIX)$$i; done
|
||||
|
||||
install-hardlinks: applets/install.sh busybox busybox.links
|
||||
$(SHELL) $< $(PREFIX) --hardlinks
|
||||
@@ -147,9 +151,9 @@ include/config/MARKER: depend scripts/split-include
|
||||
|
||||
include/config.h: .config
|
||||
@if [ ! -x ./scripts/config/conf ] ; then \
|
||||
make -C scripts/config conf; \
|
||||
$(MAKE) -C scripts/config conf; \
|
||||
fi;
|
||||
@./scripts/config/conf -o sysdeps/$(TARGET_OS)/Config.in
|
||||
@./scripts/config/conf -o $(CONFIG_CONFIG_IN)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
|
||||
@@ -167,36 +171,36 @@ all: menuconfig
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
scripts/config/conf:
|
||||
make -C scripts/config conf
|
||||
$(MAKE) -C scripts/config conf
|
||||
-@if [ ! -f .config ] ; then \
|
||||
cp sysdeps/$(TARGET_OS)/defconfig .config; \
|
||||
cp $(CONFIG_DEFCONFIG) .config; \
|
||||
fi
|
||||
scripts/config/mconf:
|
||||
make -C scripts/config ncurses conf mconf
|
||||
$(MAKE) -C scripts/config ncurses conf mconf
|
||||
-@if [ ! -f .config ] ; then \
|
||||
cp sysdeps/$(TARGET_OS)/defconfig .config; \
|
||||
cp $(CONFIG_DEFCONFIG) .config; \
|
||||
fi
|
||||
|
||||
menuconfig: scripts/config/mconf
|
||||
@./scripts/config/mconf sysdeps/$(TARGET_OS)/Config.in
|
||||
@./scripts/config/mconf $(CONFIG_CONFIG_IN)
|
||||
|
||||
config: scripts/config/conf
|
||||
@./scripts/config/conf sysdeps/$(TARGET_OS)/Config.in
|
||||
@./scripts/config/conf $(CONFIG_CONFIG_IN)
|
||||
|
||||
oldconfig: scripts/config/conf
|
||||
@./scripts/config/conf -o sysdeps/$(TARGET_OS)/Config.in
|
||||
@./scripts/config/conf -o $(CONFIG_CONFIG_IN)
|
||||
|
||||
randconfig: scripts/config/conf
|
||||
@./scripts/config/conf -r sysdeps/$(TARGET_OS)/Config.in
|
||||
@./scripts/config/conf -r $(CONFIG_CONFIG_IN)
|
||||
|
||||
allyesconfig: scripts/config/conf
|
||||
@./scripts/config/conf -y sysdeps/$(TARGET_OS)/Config.in
|
||||
@./scripts/config/conf -y $(CONFIG_CONFIG_IN)
|
||||
|
||||
allnoconfig: scripts/config/conf
|
||||
@./scripts/config/conf -n sysdeps/$(TARGET_OS)/Config.in
|
||||
@./scripts/config/conf -n $(CONFIG_CONFIG_IN)
|
||||
|
||||
defconfig: scripts/config/conf
|
||||
@./scripts/config/conf -d sysdeps/$(TARGET_OS)/Config.in
|
||||
@./scripts/config/conf -d $(CONFIG_CONFIG_IN)
|
||||
|
||||
test tests: busybox
|
||||
# Note that 'tests' is depricated. Use 'make check' instead
|
||||
@@ -208,13 +212,13 @@ check: busybox
|
||||
|
||||
clean:
|
||||
- $(MAKE) -C tests clean
|
||||
- rm -f docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \
|
||||
docs/busybox.net/BusyBox.html
|
||||
- rm -f docs/busybox.txt docs/busybox.dvi docs/busybox.ps \
|
||||
docs/busybox.pdf docs/busybox.pod docs/busybox.net/busybox.html \
|
||||
docs/busybox _install pod2htm* *.gdb *.elf *~ core
|
||||
- rm -f busybox busybox.links libbb/loop.h .config.old .hdepend
|
||||
- rm -f .*config.log
|
||||
docs/busybox pod2htm* *.gdb *.elf *~ core .*config.log \
|
||||
docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \
|
||||
docs/busybox.net/BusyBox.html busybox.links libbb/loop.h \
|
||||
.config.old .hdepend busybox
|
||||
- rm -rf _install
|
||||
- find . -name .\*.flags -exec rm -f {} \;
|
||||
- find . -name \*.o -exec rm -f {} \;
|
||||
- find . -name \*.a -exec rm -f {} \;
|
||||
@@ -228,20 +232,20 @@ distclean: clean
|
||||
|
||||
release: distclean #doc
|
||||
cd ..; \
|
||||
rm -rf busybox-$(VERSION); \
|
||||
cp -a busybox busybox-$(VERSION); \
|
||||
rm -rf $(PROG)-$(VERSION); \
|
||||
cp -a busybox $(PROG)-$(VERSION); \
|
||||
\
|
||||
find busybox-$(VERSION)/ -type d \
|
||||
find $(PROG)-$(VERSION)/ -type d \
|
||||
-name CVS \
|
||||
-print \
|
||||
-exec rm -rf {} \; ; \
|
||||
\
|
||||
find busybox-$(VERSION)/ -type f \
|
||||
find $(PROG)-$(VERSION)/ -type f \
|
||||
-name .\#* \
|
||||
-print \
|
||||
-exec rm -f {} \; ; \
|
||||
\
|
||||
tar -cvzf busybox-$(VERSION).tar.gz busybox-$(VERSION)/;
|
||||
tar -cvzf $(PROG)-$(VERSION).tar.gz $(PROG)-$(VERSION)/;
|
||||
|
||||
tags:
|
||||
ctags -R .
|
||||
|
||||
@@ -37,7 +37,7 @@ 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, and v850e.
|
||||
MIPS, cris, and v850e.
|
||||
|
||||
Supported libcs:
|
||||
|
||||
@@ -56,36 +56,6 @@ Supported kernels:
|
||||
|
||||
----------------
|
||||
|
||||
Shells:
|
||||
|
||||
lash is the very smallest shell (adds just 10k) and it is quite usable as
|
||||
a command prompt, but it is not suitable for any but the most trivial
|
||||
scripting (such as an initrd that calls insmod a few times) since it does
|
||||
not understand Bourne shell grammer. It does handle pipes, redirects, and
|
||||
job control though. Adding in command editing makes it a very nice
|
||||
lightweight command prompt.
|
||||
|
||||
hush is also quite small (just 18k) and it has very complete Bourne shell
|
||||
grammer. It handles if/then/else/fi just fine, but doesn't handle loops
|
||||
like for/do/done or case/esac and such. It also currently has a problem
|
||||
with job control. Using hush is not yet recommended.
|
||||
|
||||
msh: The minix shell (adds just 30k) is quite complete and handles things
|
||||
like for/do/done, case/esac and all the things you expect a Bourne shell to
|
||||
do. It is not always pedantically correct about Bourne shell grammer (try
|
||||
running the shell testscript "tests/sh.testcases" on it and compare vs bash)
|
||||
but for most things it works quite well. It also uses only vfork, so it can
|
||||
be used on uClinux systems. This was only recently added, so there is still
|
||||
room to shrink it further...
|
||||
|
||||
ash: This adds about 60k in the default configuration and is the most
|
||||
complete and most pedantically correct shell included with busybox. This
|
||||
shell was also recently added, and several people (mainly Vladimir and Erik)
|
||||
have been working on it. There are a number of configurable things at the
|
||||
top of ash.c as well, so check those out if you want to tweak things.
|
||||
|
||||
----------------
|
||||
|
||||
Getting help:
|
||||
|
||||
When you find you need help, you can check out the BusyBox mailing list
|
||||
@@ -97,12 +67,12 @@ the mailing list if you are interested.
|
||||
Bugs:
|
||||
|
||||
If you find bugs, please submit a detailed bug report to the busybox mailing
|
||||
list at busybox@busybox.net. A well-written bug report should include a
|
||||
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:
|
||||
|
||||
To: busybox@busybox.net
|
||||
To: busybox@mail.busybox.net
|
||||
From: diligent@testing.linux.org
|
||||
Subject: /bin/date doesn't work
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#--------------------------------------------------------
|
||||
PROG := busybox
|
||||
VERSION := 1.00-pre2
|
||||
VERSION := 1.00-pre7
|
||||
BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z")
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z")
|
||||
# by asking the CC compiler what arch it compiles things for, so unless
|
||||
# your compiler is broken, you should not need to specify TARGET_ARCH
|
||||
CROSS =$(subst ",, $(strip $(CROSS_COMPILER_PREFIX)))
|
||||
#CROSS =/usr/i386-linux-uclibc/bin/i386-uclibc-
|
||||
CC = $(CROSS)gcc
|
||||
AR = $(CROSS)ar
|
||||
AS = $(CROSS)as
|
||||
@@ -101,7 +100,7 @@ TARGET_ARCH=$(shell $(CC) -dumpmachine | sed -e s'/-.*//' \
|
||||
)
|
||||
endif
|
||||
|
||||
# Pull in the user's uClibc configuration
|
||||
# Pull in the user's busybox configuration
|
||||
ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
|
||||
-include $(TOPDIR).config
|
||||
endif
|
||||
|
||||
+229
-184
@@ -29,6 +29,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include "busybox.h"
|
||||
|
||||
#undef APPLET
|
||||
@@ -53,9 +54,7 @@ static void check_suid (struct BB_applet *app);
|
||||
#include "pwd_.h"
|
||||
#include "grp_.h"
|
||||
|
||||
static int parse_config_file (void);
|
||||
|
||||
static int config_ok;
|
||||
static void parse_config_file (void);
|
||||
|
||||
#define CONFIG_FILE "/etc/busybox.conf"
|
||||
|
||||
@@ -127,7 +126,7 @@ run_applet_by_name (const char *name, int argc, char **argv)
|
||||
|
||||
#ifdef CONFIG_FEATURE_SUID_CONFIG
|
||||
if (recurse_level == 0)
|
||||
config_ok = parse_config_file ();
|
||||
parse_config_file ();
|
||||
#endif
|
||||
|
||||
recurse_level++;
|
||||
@@ -193,7 +192,7 @@ check_suid (struct BB_applet *applet)
|
||||
uid_t rgid = getgid ();
|
||||
|
||||
#ifdef CONFIG_FEATURE_SUID_CONFIG
|
||||
if (config_ok) {
|
||||
if (suid_config) {
|
||||
struct BB_suid_config *sct;
|
||||
|
||||
for (sct = suid_config; sct; sct = sct->m_next) {
|
||||
@@ -253,191 +252,237 @@ check_suid (struct BB_applet *applet)
|
||||
|
||||
#ifdef CONFIG_FEATURE_SUID_CONFIG
|
||||
|
||||
/* This should probably be a libbb routine. In that case,
|
||||
* I'd probably rename it to something like bb_trimmed_slice.
|
||||
*/
|
||||
static char *get_trimmed_slice(char *s, char *e)
|
||||
{
|
||||
/* First, consider the value at e to be nul and back up until we
|
||||
* reach a non-space char. Set the char after that (possibly at
|
||||
* the original e) to nul. */
|
||||
while (e-- > s) {
|
||||
if (!isspace(*e)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
e[1] = 0;
|
||||
|
||||
/* Next, advance past all leading space and return a ptr to the
|
||||
* first non-space char; possibly the terminating nul. */
|
||||
return (char *) bb_skip_whitespace(s);
|
||||
}
|
||||
|
||||
|
||||
#define parse_error(x) { err=x; goto pe_label; }
|
||||
|
||||
/* Don't depend on the tools to combine strings. */
|
||||
static const char config_file[] = CONFIG_FILE;
|
||||
|
||||
int
|
||||
parse_config_file (void)
|
||||
/* There are 4 chars + 1 nul for each of user/group/other. */
|
||||
static const char mode_chars[] = "Ssx-\0Ssx-\0Ttx-";
|
||||
|
||||
/* We don't supply a value for the nul, so an index adjustment is
|
||||
* necessary below. Also, we use unsigned short here to save some
|
||||
* space even though these are really mode_t values. */
|
||||
static const unsigned short mode_mask[] = {
|
||||
/* SST sst xxx --- */
|
||||
S_ISUID, S_ISUID|S_IXUSR, S_IXUSR, 0, /* user */
|
||||
S_ISGID, S_ISGID|S_IXGRP, S_IXGRP, 0, /* group */
|
||||
0, S_IXOTH, S_IXOTH, 0 /* other */
|
||||
};
|
||||
|
||||
static void parse_config_file(void)
|
||||
{
|
||||
struct stat st;
|
||||
char *err = 0;
|
||||
FILE *f = 0;
|
||||
int lc = 0;
|
||||
struct BB_suid_config *sct_head;
|
||||
struct BB_suid_config *sct;
|
||||
struct BB_applet *applet;
|
||||
FILE *f;
|
||||
char *err;
|
||||
char *s;
|
||||
char *e;
|
||||
int i, lc, section;
|
||||
char buffer[256];
|
||||
struct stat st;
|
||||
|
||||
suid_config = 0;
|
||||
assert(!suid_config); /* Should be set to NULL by bss init. */
|
||||
|
||||
/* is there a config file ? */
|
||||
if (stat (CONFIG_FILE, &st) == 0) {
|
||||
/* is it owned by root with no write perm. for group and others ? */
|
||||
if (S_ISREG (st.st_mode) && (st.st_uid == 0)
|
||||
&& (!(st.st_mode & (S_IWGRP | S_IWOTH)))) {
|
||||
/* that's ok .. then try to open it */
|
||||
f = fopen (CONFIG_FILE, "r");
|
||||
|
||||
if (f) {
|
||||
char buffer[256];
|
||||
int section = 0;
|
||||
|
||||
while (fgets (buffer, sizeof (buffer) - 1, f)) {
|
||||
char c = buffer[0];
|
||||
char *p;
|
||||
|
||||
lc++;
|
||||
|
||||
p = strchr (buffer, '#');
|
||||
if (p)
|
||||
*p = 0;
|
||||
p = buffer + bb_strlen (buffer);
|
||||
while ((p > buffer) && isspace (*--p))
|
||||
*p = 0;
|
||||
|
||||
if (p == buffer)
|
||||
continue;
|
||||
|
||||
if (c == '[') {
|
||||
p = strchr (buffer, ']');
|
||||
|
||||
if (!p || (p == (buffer + 1))) /* no matching ] or empty [] */
|
||||
parse_error ("malformed section header");
|
||||
|
||||
*p = 0;
|
||||
|
||||
if (strcasecmp (buffer + 1, "SUID") == 0)
|
||||
section = 1;
|
||||
else
|
||||
section = -1; /* unknown section - just skip */
|
||||
} else if (section) {
|
||||
switch (section) {
|
||||
case 1:{ /* SUID */
|
||||
int l;
|
||||
struct BB_applet *applet;
|
||||
|
||||
p = strchr (buffer, '='); /* <key>[::space::]*=[::space::]*<value> */
|
||||
|
||||
if (!p || (p == (buffer + 1))) /* no = or key is empty */
|
||||
parse_error ("malformed keyword");
|
||||
|
||||
l = p - buffer;
|
||||
while (isspace (buffer[--l])) {
|
||||
/* skip whitespace */
|
||||
}
|
||||
|
||||
buffer[l + 1] = 0;
|
||||
|
||||
if ((applet = find_applet_by_name (buffer))) {
|
||||
struct BB_suid_config *sct =
|
||||
xmalloc (sizeof (struct BB_suid_config));
|
||||
|
||||
sct->m_applet = applet;
|
||||
sct->m_next = suid_config;
|
||||
suid_config = sct;
|
||||
|
||||
while (isspace (*++p)) {
|
||||
/* skip whitespace */
|
||||
}
|
||||
|
||||
sct->m_mode = 0;
|
||||
|
||||
switch (*p++) {
|
||||
case 'S':
|
||||
sct->m_mode |= S_ISUID;
|
||||
break;
|
||||
case 's':
|
||||
sct->m_mode |= S_ISUID;
|
||||
/* no break */
|
||||
case 'x':
|
||||
sct->m_mode |= S_IXUSR;
|
||||
break;
|
||||
case '-':
|
||||
break;
|
||||
default:
|
||||
parse_error ("invalid user mode");
|
||||
}
|
||||
|
||||
switch (*p++) {
|
||||
case 's':
|
||||
sct->m_mode |= S_ISGID;
|
||||
/* no break */
|
||||
case 'x':
|
||||
sct->m_mode |= S_IXGRP;
|
||||
break;
|
||||
case 'S':
|
||||
break;
|
||||
case '-':
|
||||
break;
|
||||
default:
|
||||
parse_error ("invalid group mode");
|
||||
}
|
||||
|
||||
switch (*p) {
|
||||
case 't':
|
||||
case 'x':
|
||||
sct->m_mode |= S_IXOTH;
|
||||
break;
|
||||
case 'T':
|
||||
case '-':
|
||||
break;
|
||||
default:
|
||||
parse_error ("invalid other mode");
|
||||
}
|
||||
|
||||
while (isspace (*++p)) {
|
||||
/* skip whitespace */
|
||||
}
|
||||
|
||||
if (isdigit (*p)) {
|
||||
sct->m_uid = strtol (p, &p, 10);
|
||||
if (*p++ != '.')
|
||||
parse_error ("parsing <uid>.<gid>");
|
||||
} else {
|
||||
struct passwd *pwd;
|
||||
char *p2 = strchr (p, '.');
|
||||
|
||||
if (!p2)
|
||||
parse_error ("parsing <uid>.<gid>");
|
||||
|
||||
*p2 = 0;
|
||||
pwd = getpwnam (p);
|
||||
|
||||
if (!pwd)
|
||||
parse_error ("invalid user name");
|
||||
|
||||
sct->m_uid = pwd->pw_uid;
|
||||
p = p2 + 1;
|
||||
}
|
||||
if (isdigit (*p))
|
||||
sct->m_gid = strtol (p, &p, 10);
|
||||
else {
|
||||
struct group *grp = getgrnam (p);
|
||||
|
||||
if (!grp)
|
||||
parse_error ("invalid group name");
|
||||
|
||||
sct->m_gid = grp->gr_gid;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: /* unknown - skip */
|
||||
break;
|
||||
}
|
||||
} else
|
||||
parse_error ("keyword not within section");
|
||||
}
|
||||
fclose (f);
|
||||
return 1;
|
||||
}
|
||||
if ((stat(config_file, &st) != 0) /* No config file? */
|
||||
|| !S_ISREG(st.st_mode) /* Not a regular file? */
|
||||
|| (st.st_uid != 0) /* Not owned by root? */
|
||||
|| (st.st_mode & (S_IWGRP | S_IWOTH)) /* Writable by non-root? */
|
||||
|| !(f = fopen(config_file, "r")) /* Can not open? */
|
||||
) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
return 0; /* no config file or not readable (not an error) */
|
||||
|
||||
pe_label:
|
||||
fprintf (stderr, "Parse error in %s, line %d: %s\n", CONFIG_FILE, lc, err);
|
||||
sct_head = NULL;
|
||||
section = lc = 0;
|
||||
|
||||
if (f)
|
||||
fclose (f);
|
||||
return 0;
|
||||
do {
|
||||
s = buffer;
|
||||
|
||||
if (!fgets(s, sizeof(buffer), f)) { /* Are we done? */
|
||||
if (ferror(f)) { /* Make sure it wasn't a read error. */
|
||||
parse_error("reading");
|
||||
}
|
||||
fclose(f);
|
||||
suid_config = sct_head; /* Success, so set the pointer. */
|
||||
return;
|
||||
}
|
||||
|
||||
lc++; /* Got a (partial) line. */
|
||||
|
||||
/* If a line is too long for our buffer, we consider it an error.
|
||||
* The following test does mistreat one corner case though.
|
||||
* If the final line of the file does not end with a newline and
|
||||
* yet exactly fills the buffer, it will be treated as too long
|
||||
* even though there isn't really a problem. But it isn't really
|
||||
* worth adding code to deal with such an unlikely situation, and
|
||||
* we do err on the side of caution. Besides, the line would be
|
||||
* too long if it did end with a newline. */
|
||||
if (!strchr(s, '\n') && !feof(f)) {
|
||||
parse_error("line too long");
|
||||
}
|
||||
|
||||
/* Trim leading and trailing whitespace, ignoring comments, and
|
||||
* check if the resulting string is empty. */
|
||||
if (!*(s = get_trimmed_slice(s, strchrnul(s, '#')))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Check for a section header. */
|
||||
|
||||
if (*s == '[') {
|
||||
/* Unlike the old code, we ignore leading and trailing
|
||||
* whitespace for the section name. We also require that
|
||||
* there are no stray characters after the closing bracket. */
|
||||
if (!(e = strchr(s, ']')) /* Missing right bracket? */
|
||||
|| e[1] /* Trailing characters? */
|
||||
|| !*(s = get_trimmed_slice(s+1, e)) /* Missing name? */
|
||||
) {
|
||||
parse_error("section header");
|
||||
}
|
||||
/* Right now we only have one section so just check it.
|
||||
* If more sections are added in the future, please don't
|
||||
* resort to cascading ifs with multiple strcasecmp calls.
|
||||
* That kind of bloated code is all too common. A loop
|
||||
* and a string table would be a better choice unless the
|
||||
* number of sections is very small. */
|
||||
if (strcasecmp(s, "SUID") == 0) {
|
||||
section = 1;
|
||||
continue;
|
||||
}
|
||||
section = -1; /* Unknown section so set to skip. */
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Process sections. */
|
||||
|
||||
if (section == 1) { /* SUID */
|
||||
/* Since we trimmed leading and trailing space above, we're
|
||||
* now looking for strings of the form
|
||||
* <key>[::space::]*=[::space::]*<value>
|
||||
* where both key and value could contain inner whitespace. */
|
||||
|
||||
/* First get the key (an applet name in our case). */
|
||||
if (!!(e = strchr(s, '='))) {
|
||||
s = get_trimmed_slice(s, e);
|
||||
}
|
||||
if (!e || !*s) { /* Missing '=' or empty key. */
|
||||
parse_error("keyword");
|
||||
}
|
||||
|
||||
/* Ok, we have an applet name. Process the rhs if this
|
||||
* applet is currently built in and ignore it otherwise.
|
||||
* Note: This can hide config file bugs which only pop
|
||||
* up when the busybox configuration is changed. */
|
||||
if ((applet = find_applet_by_name(s))) {
|
||||
/* Note: We currently don't check for duplicates!
|
||||
* The last config line for each applet will be the
|
||||
* one used since we insert at the head of the list.
|
||||
* I suppose this could be considered a feature. */
|
||||
sct = xmalloc(sizeof(struct BB_suid_config));
|
||||
sct->m_applet = applet;
|
||||
sct->m_mode = 0;
|
||||
sct->m_next = sct_head;
|
||||
sct_head = sct;
|
||||
|
||||
/* Get the specified mode. */
|
||||
|
||||
e = (char *) bb_skip_whitespace(e+1);
|
||||
|
||||
for (i=0 ; i < 3 ; i++) {
|
||||
const char *q;
|
||||
if (!*(q = strchrnul(mode_chars + 5*i, *e++))) {
|
||||
parse_error("mode");
|
||||
}
|
||||
/* Adjust by -i to account for nul. */
|
||||
sct->m_mode |= mode_mask[(q - mode_chars) - i];
|
||||
}
|
||||
|
||||
/* Now get the the user/group info. */
|
||||
|
||||
s = (char *) bb_skip_whitespace(e);
|
||||
|
||||
/* Note: We require whitespace between the mode and the
|
||||
* user/group info. */
|
||||
if ((s == e) || !(e = strchr(s, '.'))) {
|
||||
parse_error("<uid>.<gid>");
|
||||
}
|
||||
*e++ = 0;
|
||||
|
||||
/* We can't use get_ug_id here since it would exit()
|
||||
* if a uid or gid was not found. Oh well... */
|
||||
{
|
||||
char *e2;
|
||||
|
||||
sct->m_uid = strtoul(s, &e2, 10);
|
||||
if (*e2 || (s == e2)) {
|
||||
struct passwd *pwd;
|
||||
if (!(pwd = getpwnam(s))) {
|
||||
parse_error("user");
|
||||
}
|
||||
sct->m_uid = pwd->pw_uid;
|
||||
}
|
||||
|
||||
sct->m_gid = strtoul(e, &e2, 10);
|
||||
if (*e2 || (e == e2)) {
|
||||
struct group *grp;
|
||||
if (!(grp = getgrnam(e))) {
|
||||
parse_error("group");
|
||||
}
|
||||
sct->m_gid = grp->gr_gid;
|
||||
}
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Unknown sections are ignored. */
|
||||
|
||||
/* 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.
|
||||
* We may want to simply ignore such lines in case they
|
||||
* are used in some future version of busybox. */
|
||||
if (!section) {
|
||||
parse_error("keyword outside section");
|
||||
}
|
||||
|
||||
} while (1);
|
||||
|
||||
pe_label:
|
||||
fprintf(stderr, "Parse error in %s, line %d: %s\n",
|
||||
config_file, lc, err);
|
||||
|
||||
fclose(f);
|
||||
/* Release any allocated memory before returning. */
|
||||
while (sct_head) {
|
||||
sct = sct_head->m_next;
|
||||
free(sct_head);
|
||||
sct_head = sct;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -446,9 +491,9 @@ pe_label:
|
||||
|
||||
/* END CODE */
|
||||
/*
|
||||
Local Variables:
|
||||
c-file-style: "linux"
|
||||
c-basic-offset: 4
|
||||
tab-width: 4
|
||||
Local Variables:
|
||||
c-file-style: "linux"
|
||||
c-basic-offset: 4
|
||||
tab-width: 4
|
||||
End:
|
||||
*/
|
||||
+11
-2
@@ -135,6 +135,14 @@ int busybox_main(int argc, char **argv)
|
||||
/* If we've already been here once, exit now */
|
||||
if (been_there_done_that == 1 || argc < 1) {
|
||||
const struct BB_applet *a = applets;
|
||||
int output_width = 60;
|
||||
|
||||
#ifdef CONFIG_FEATURE_AUTOWIDTH
|
||||
/* Obtain the terminal width. */
|
||||
get_terminal_width_height(0, &output_width, NULL);
|
||||
/* leading tab and room to wrap */
|
||||
output_width -= 20;
|
||||
#endif
|
||||
|
||||
fprintf(stderr, "%s\n\n"
|
||||
"Usage: busybox [function] [arguments]...\n"
|
||||
@@ -149,7 +157,7 @@ int busybox_main(int argc, char **argv)
|
||||
col +=
|
||||
fprintf(stderr, "%s%s", ((col == 0) ? "\t" : ", "),
|
||||
(a++)->name);
|
||||
if (col > 60 && a->name != 0) {
|
||||
if (col > output_width && a->name != 0) {
|
||||
fprintf(stderr, ",\n");
|
||||
col = 0;
|
||||
}
|
||||
@@ -160,8 +168,9 @@ int busybox_main(int argc, char **argv)
|
||||
|
||||
/* Flag that we've been here already */
|
||||
been_there_done_that = 1;
|
||||
|
||||
|
||||
/* Move the command line down a notch */
|
||||
/* Preserve pointers so setproctitle() works consistently */
|
||||
len = argv[argc] + strlen(argv[argc]) - argv[1];
|
||||
memmove(argv[0], argv[1], len);
|
||||
memset(argv[0] + len, 0, argv[1] - argv[0]);
|
||||
|
||||
+59
-37
@@ -16,13 +16,14 @@ config CONFIG_AR
|
||||
The original files' contents, mode (permissions), timestamp, owner,
|
||||
and group are preserved in the archive, and can be restored on
|
||||
extraction.
|
||||
|
||||
The stored filename is limited to 15 characters. (for more information
|
||||
see long filename support).
|
||||
ar has 60 bytes of overheads for every stored file.
|
||||
|
||||
This implementation of ar can extract archives, it cannot create or
|
||||
modify them.
|
||||
On an x86 system, the ar applet adds about XXX bytes.
|
||||
On an x86 system, the ar applet adds about 1K.
|
||||
|
||||
Unless you have a specific application which requires ar, you should
|
||||
probably say N here.
|
||||
@@ -41,14 +42,14 @@ config CONFIG_BUNZIP2
|
||||
bool "bunzip2"
|
||||
default n
|
||||
help
|
||||
bunzip2 is an compression utility using the Burrows-Wheeler block
|
||||
bunzip2 is a compression utility using the Burrows-Wheeler block
|
||||
sorting text compression algorithm, and Huffman coding. Compression
|
||||
is generally considerably better than that achieved by more
|
||||
conventional LZ77/LZ78-based compressors, and approaches the
|
||||
performance of the PPM family of statistical compressors.
|
||||
|
||||
The BusyBox bunzip2 applet is limited to de-compression only.
|
||||
On an x86 system, this applet adds about XXX bytes.
|
||||
On an x86 system, this applet adds about 11K.
|
||||
|
||||
Unless you have a specific application which requires bunzip2, you
|
||||
should probably say N here.
|
||||
@@ -92,30 +93,10 @@ config CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY
|
||||
default n
|
||||
depends on CONFIG_DPKG_DEB
|
||||
help
|
||||
This reduced dpkg-deb to the equivalent of "ar -p <deb> data.tar.gz | tar -zx".
|
||||
This reduces dpkg-deb to the equivalent of "ar -p <deb> data.tar.gz | tar -zx".
|
||||
However it saves space as none of the extra dpkg-deb, ar or tar options are
|
||||
needed, they are linked to internally.
|
||||
|
||||
config CONFIG_FEATURE_DEB_TAR_GZ
|
||||
bool " gzip debian packages (normal)"
|
||||
default y if CONFIG_DPKG || CONFIG_DPKG_DEB
|
||||
depends on CONFIG_DPKG || CONFIG_DPKG_DEB
|
||||
help
|
||||
This is the default compression method inside the debian ar file.
|
||||
|
||||
If you want compatability with standard .deb's you should say yes here.
|
||||
|
||||
config CONFIG_FEATURE_DEB_TAR_BZ2
|
||||
bool " bzip2 debian packages"
|
||||
default n
|
||||
depends on CONFIG_DPKG || CONFIG_DPKG_DEB
|
||||
help
|
||||
This allows dpkg and dpkg-deb to extract deb's that are compressed internally
|
||||
with bzip2 instead of gzip.
|
||||
|
||||
You only want this is your are creating your own custom debian packages that
|
||||
use an internal control.tar.bz2 or data.tar.bz2.
|
||||
|
||||
config CONFIG_GUNZIP
|
||||
bool "gunzip"
|
||||
default n
|
||||
@@ -129,7 +110,7 @@ config CONFIG_FEATURE_GUNZIP_UNCOMPRESS
|
||||
default n
|
||||
depends on CONFIG_GUNZIP
|
||||
help
|
||||
If you want gunzip to have the ability to decompress
|
||||
Enable if you want gunzip to have the ability to decompress
|
||||
archives created by the program compress (not much
|
||||
used anymore).
|
||||
|
||||
@@ -138,7 +119,7 @@ config CONFIG_GZIP
|
||||
default n
|
||||
help
|
||||
gzip is used to compress files.
|
||||
It's probably the most used UNIX compression program.
|
||||
It's probably the most widely used UNIX compression program.
|
||||
|
||||
config CONFIG_RPM2CPIO
|
||||
bool "rpm2cpio"
|
||||
@@ -150,14 +131,14 @@ config CONFIG_RPM
|
||||
bool "rpm"
|
||||
default n
|
||||
help
|
||||
Mini RPM applet - querys and extracts
|
||||
Mini RPM applet - queries and extracts
|
||||
|
||||
config CONFIG_TAR
|
||||
bool "tar"
|
||||
default n
|
||||
help
|
||||
tar is an archiving program. It's commonly used with gzip to
|
||||
create compressed archives. It's probably the most used
|
||||
create compressed archives. It's probably the most widely used
|
||||
UNIX archive program.
|
||||
|
||||
config CONFIG_FEATURE_TAR_CREATE
|
||||
@@ -176,13 +157,13 @@ config CONFIG_FEATURE_TAR_BZIP2
|
||||
If you enable this option you'll be able to extract
|
||||
archives compressed with bzip2.
|
||||
|
||||
config CONFIG_FEATURE_TAR_EXCLUDE
|
||||
bool " Enable -X and --exclude options (exclude files)"
|
||||
config CONFIG_FEATURE_TAR_FROM
|
||||
bool " Enable -X (exclude from) and -T (include from) options)"
|
||||
default n
|
||||
depends on CONFIG_TAR
|
||||
help
|
||||
If you enable this option you'll be able to specify
|
||||
a list of files to exclude from an archive.
|
||||
a list of files to include or exclude from an archive.
|
||||
|
||||
config CONFIG_FEATURE_TAR_GZIP
|
||||
bool " Enable -z option"
|
||||
@@ -192,13 +173,21 @@ config CONFIG_FEATURE_TAR_GZIP
|
||||
If you enable this option tar will be able to call gzip,
|
||||
when creating or extracting tar gziped archives.
|
||||
|
||||
config CONFIG_FEATURE_TAR_COMPRESS
|
||||
bool " Enable -Z option"
|
||||
default n
|
||||
depends on CONFIG_TAR
|
||||
help
|
||||
If you enable this option tar will be able to call uncompress,
|
||||
when extracting .tar.Z archives.
|
||||
|
||||
config CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY
|
||||
bool " Enable support for old tar header format"
|
||||
default N
|
||||
depends on CONFIG_TAR
|
||||
help
|
||||
This option is required to unpack archives created with
|
||||
in the old GNU format, help to kill this old format by
|
||||
This option is required to unpack archives created in
|
||||
the old GNU format; help to kill this old format by
|
||||
repacking your ancient archives with the new format.
|
||||
|
||||
config CONFIG_FEATURE_TAR_GNU_EXTENSIONS
|
||||
@@ -209,12 +198,12 @@ config CONFIG_FEATURE_TAR_GNU_EXTENSIONS
|
||||
With this option busybox supports GNU long filenames and
|
||||
linknames.
|
||||
|
||||
config CONFIG_FEATURE_UNARCHIVE_TAPE
|
||||
bool " Enable tape drive support"
|
||||
config CONFIG_FEATURE_TAR_LONG_OPTIONS
|
||||
bool " Enable long options"
|
||||
default n
|
||||
depends on CONFIG_TAR || CONFIG_CPIO
|
||||
depends on CONFIG_TAR
|
||||
help
|
||||
I dont think this is needed anymore.
|
||||
Enable use of long options, increases size by about 400 Bytes
|
||||
|
||||
config CONFIG_UNCOMPRESS
|
||||
bool "uncompress"
|
||||
@@ -233,4 +222,37 @@ config CONFIG_UNZIP
|
||||
current directory. Use the `-d' option to extract to a
|
||||
directory of your choice.
|
||||
|
||||
comment "Common options for cpio and tar"
|
||||
depends on CONFIG_CPIO || CONFIG_TAR
|
||||
|
||||
config CONFIG_FEATURE_UNARCHIVE_TAPE
|
||||
bool " Enable tape drive support"
|
||||
default n
|
||||
depends on CONFIG_CPIO || CONFIG_TAR
|
||||
help
|
||||
I don't think this is needed anymore.
|
||||
|
||||
comment "Common options for dpkg and dpkg_deb"
|
||||
depends on CONFIG_DPKG || CONFIG_DPKG_DEB
|
||||
|
||||
config CONFIG_FEATURE_DEB_TAR_GZ
|
||||
bool " gzip debian packages (normal)"
|
||||
default y if CONFIG_DPKG || CONFIG_DPKG_DEB
|
||||
depends on CONFIG_DPKG || CONFIG_DPKG_DEB
|
||||
help
|
||||
This is the default compression method inside the debian ar file.
|
||||
|
||||
If you want compatibility with standard .deb's you should say yes here.
|
||||
|
||||
config CONFIG_FEATURE_DEB_TAR_BZ2
|
||||
bool " bzip2 debian packages"
|
||||
default n
|
||||
depends on CONFIG_DPKG || CONFIG_DPKG_DEB
|
||||
help
|
||||
This allows dpkg and dpkg-deb to extract deb's that are compressed internally
|
||||
with bzip2 instead of gzip.
|
||||
|
||||
You only want this if you are creating your own custom debian packages that
|
||||
use an internal control.tar.bz2 or data.tar.bz2.
|
||||
|
||||
endmenu
|
||||
+32
-70
@@ -21,20 +21,20 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* There is no signle standard to adhere to so ar may not portable
|
||||
* There is no single standard to adhere to so ar may not portable
|
||||
* between different systems
|
||||
* http://www.unix-systems.org/single_unix_specification_v2/xcu/ar.html
|
||||
*/
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <fnmatch.h>
|
||||
#include <getopt.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <utime.h>
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include "unarchive.h"
|
||||
#include "busybox.h"
|
||||
|
||||
@@ -50,87 +50,50 @@ 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);
|
||||
}
|
||||
|
||||
#if !defined CONFIG_TAR && !defined CONFIG_DPKG_DEB && !defined CONFIG_CPIO
|
||||
/* This is simpler than data_extract_all */
|
||||
static void data_extract_regular_file(archive_handle_t *archive_handle)
|
||||
{
|
||||
file_header_t *file_header;
|
||||
int dst_fd;
|
||||
|
||||
file_header = archive_handle->file_header;
|
||||
dst_fd = bb_xopen(file_header->name, O_WRONLY | O_CREAT);
|
||||
archive_copy_file(archive_handle, dst_fd);
|
||||
close(dst_fd);
|
||||
|
||||
chmod(file_header->name, file_header->mode);
|
||||
chown(file_header->name, file_header->uid, file_header->gid);
|
||||
|
||||
if (archive_handle->flags & ARCHIVE_PRESERVE_DATE) {
|
||||
struct utimbuf t;
|
||||
t.actime = t.modtime = file_header->mtime;
|
||||
utime(file_header->name, &t);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#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
|
||||
|
||||
extern int ar_main(int argc, char **argv)
|
||||
{
|
||||
archive_handle_t *archive_handle;
|
||||
int opt;
|
||||
|
||||
#if !defined CONFIG_DPKG_DEB && !defined CONFIG_DPKG
|
||||
unsigned long opt;
|
||||
char magic[8];
|
||||
#endif
|
||||
|
||||
archive_handle = init_handle();
|
||||
|
||||
while ((opt = getopt(argc, argv, "covtpxX")) != -1) {
|
||||
switch (opt) {
|
||||
case 'p': /* print */
|
||||
archive_handle->action_data = data_extract_to_stdout;
|
||||
break;
|
||||
case 't': /* list contents */
|
||||
archive_handle->action_header = header_list;
|
||||
break;
|
||||
case 'X':
|
||||
archive_handle->action_header = header_verbose_list_ar;
|
||||
case 'x': /* extract */
|
||||
#if defined CONFIG_TAR || defined CONFIG_DPKG_DEB || defined CONFIG_CPIO
|
||||
archive_handle->action_data = data_extract_all;
|
||||
#else
|
||||
archive_handle->action_data = data_extract_regular_file;
|
||||
#endif
|
||||
break;
|
||||
/* Modifiers */
|
||||
case 'o': /* preserve original dates */
|
||||
archive_handle->flags |= ARCHIVE_PRESERVE_DATE;
|
||||
break;
|
||||
case 'v': /* verbose */
|
||||
archive_handle->action_header = header_verbose_list_ar;
|
||||
break;
|
||||
default:
|
||||
bb_show_usage();
|
||||
}
|
||||
}
|
||||
|
||||
/* check the src filename was specified */
|
||||
if (optind == argc) {
|
||||
bb_opt_complementaly = "p~tx:t~px:x~pt";
|
||||
opt = bb_getopt_ulflags(argc, argv, "ptxov");
|
||||
|
||||
if ((opt & 0x80000000UL) || (optind == argc)) {
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
if (opt & AR_CTX_PRINT) {
|
||||
archive_handle->action_data = data_extract_to_stdout;
|
||||
}
|
||||
if (opt & AR_CTX_LIST) {
|
||||
archive_handle->action_header = header_list;
|
||||
}
|
||||
if (opt & AR_CTX_EXTRACT) {
|
||||
archive_handle->action_data = data_extract_all;
|
||||
}
|
||||
if (opt & AR_OPT_PRESERVE_DATE) {
|
||||
archive_handle->flags |= ARCHIVE_PRESERVE_DATE;
|
||||
}
|
||||
if (opt & AR_OPT_VERBOSE) {
|
||||
archive_handle->action_header = header_verbose_list_ar;
|
||||
}
|
||||
|
||||
archive_handle->src_fd = bb_xopen(argv[optind++], O_RDONLY);
|
||||
|
||||
/* TODO: This is the same as in tar, seperate function ? */
|
||||
while (optind < argc) {
|
||||
archive_handle->filter = filter_accept_list;
|
||||
archive_handle->accept = llist_add_to(archive_handle->accept, argv[optind]);
|
||||
optind++;
|
||||
archive_handle->accept = llist_add_to(archive_handle->accept, argv[optind++]);
|
||||
}
|
||||
|
||||
#if defined CONFIG_DPKG_DEB || defined CONFIG_DPKG
|
||||
unpack_ar_archive(archive_handle);
|
||||
#else
|
||||
archive_xread_all(archive_handle, magic, 7);
|
||||
if (strncmp(magic, "!<arch>", 7) != 0) {
|
||||
bb_error_msg_and_die("Invalid ar magic");
|
||||
@@ -138,7 +101,6 @@ extern int ar_main(int argc, char **argv)
|
||||
archive_handle->offset += 7;
|
||||
|
||||
while (get_header_ar(archive_handle) == EXIT_SUCCESS);
|
||||
#endif
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
+32
-46
@@ -27,76 +27,62 @@
|
||||
#include "busybox.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
#define BUNZIP2_OPT_STDOUT 1
|
||||
#define BUNZIP2_OPT_FORCE 2
|
||||
|
||||
int bunzip2_main(int argc, char **argv)
|
||||
{
|
||||
const int bunzip_to_stdout = 1;
|
||||
const int bunzip_force = 2;
|
||||
int flags = 0;
|
||||
int opt = 0;
|
||||
char *compressed_name;
|
||||
char *save_name;
|
||||
unsigned long opt;
|
||||
int status;
|
||||
|
||||
int src_fd;
|
||||
int dst_fd;
|
||||
char *save_name = NULL;
|
||||
char *delete_name = NULL;
|
||||
|
||||
/* if called as bzcat */
|
||||
if (strcmp(bb_applet_name, "bzcat") == 0)
|
||||
flags |= bunzip_to_stdout;
|
||||
opt = bb_getopt_ulflags(argc, argv, "cf");
|
||||
|
||||
while ((opt = getopt(argc, argv, "cfh")) != -1) {
|
||||
switch (opt) {
|
||||
case 'c':
|
||||
flags |= bunzip_to_stdout;
|
||||
break;
|
||||
case 'f':
|
||||
flags |= bunzip_force;
|
||||
break;
|
||||
case 'h':
|
||||
default:
|
||||
bb_show_usage(); /* exit's inside usage */
|
||||
}
|
||||
/* if called as bzcat force the stdout flag */
|
||||
if (bb_applet_name[2] == 'c') {
|
||||
opt |= BUNZIP2_OPT_STDOUT;
|
||||
}
|
||||
|
||||
/* Set input filename and number */
|
||||
if (argv[optind] == NULL || strcmp(argv[optind], "-") == 0) {
|
||||
flags |= bunzip_to_stdout;
|
||||
src_fd = fileno(stdin);
|
||||
} else {
|
||||
compressed_name = argv[optind];
|
||||
if ((compressed_name) && (compressed_name[0] != '-') && (compressed_name[1] != '\0')) {
|
||||
/* Open input file */
|
||||
src_fd = bb_xopen(argv[optind], O_RDONLY);
|
||||
|
||||
save_name = bb_xstrdup(argv[optind]);
|
||||
if (strcmp(save_name + strlen(save_name) - 4, ".bz2") != 0)
|
||||
bb_error_msg_and_die("Invalid extension");
|
||||
save_name[strlen(save_name) - 4] = '\0';
|
||||
src_fd = bb_xopen(compressed_name, O_RDONLY);
|
||||
} else {
|
||||
src_fd = fileno(stdin);
|
||||
opt |= BUNZIP2_OPT_STDOUT;
|
||||
}
|
||||
|
||||
/* Check that the input is sane. */
|
||||
if (isatty(src_fd) && (flags & bunzip_force) == 0) {
|
||||
if (isatty(src_fd) && (opt & BUNZIP2_OPT_FORCE) == 0) {
|
||||
bb_error_msg_and_die("compressed data not read from terminal. Use -f to force it.");
|
||||
}
|
||||
|
||||
if (flags & bunzip_to_stdout) {
|
||||
if (opt & BUNZIP2_OPT_STDOUT) {
|
||||
dst_fd = fileno(stdout);
|
||||
} else {
|
||||
int len = strlen(compressed_name) - 4;
|
||||
if (strcmp(compressed_name + len, ".bz2") != 0) {
|
||||
bb_error_msg_and_die("Invalid extension");
|
||||
}
|
||||
save_name = bb_xstrndup(compressed_name, len);
|
||||
dst_fd = bb_xopen(save_name, O_WRONLY | O_CREAT);
|
||||
}
|
||||
|
||||
if (uncompressStream(src_fd, dst_fd)) {
|
||||
if (!(flags & bunzip_to_stdout)) {
|
||||
delete_name = argv[optind];
|
||||
}
|
||||
status = EXIT_SUCCESS;
|
||||
} else {
|
||||
if (!(flags & bunzip_to_stdout)) {
|
||||
status = uncompressStream(src_fd, dst_fd);
|
||||
if(!(opt & BUNZIP2_OPT_STDOUT)) {
|
||||
char *delete_name;
|
||||
if (status) {
|
||||
delete_name = save_name;
|
||||
} else {
|
||||
delete_name = compressed_name;
|
||||
}
|
||||
if (unlink(delete_name) < 0) {
|
||||
bb_error_msg_and_die("Couldn't remove %s", delete_name);
|
||||
}
|
||||
status = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if ((delete_name) && (unlink(delete_name) < 0)) {
|
||||
bb_error_msg_and_die("Couldn't remove %s", delete_name);
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
+15
-5
@@ -40,8 +40,8 @@ extern int cpio_main(int argc, char **argv)
|
||||
archive_handle = init_handle();
|
||||
archive_handle->src_fd = fileno(stdin);
|
||||
archive_handle->seek = seek_by_char;
|
||||
archive_handle->action_header = header_list;
|
||||
|
||||
archive_handle->flags = ARCHIVE_EXTRACT_NEWER | ARCHIVE_PRESERVE_DATE;
|
||||
|
||||
while ((opt = getopt(argc, argv, "idmuvtF:")) != -1) {
|
||||
switch (opt) {
|
||||
case 'i': /* extract */
|
||||
@@ -50,17 +50,28 @@ extern int cpio_main(int argc, char **argv)
|
||||
case 'd': /* create _leading_ directories */
|
||||
archive_handle->flags |= ARCHIVE_CREATE_LEADING_DIRS;
|
||||
break;
|
||||
#if 0
|
||||
case 'm': /* preserve modification time */
|
||||
archive_handle->flags |= ARCHIVE_PRESERVE_DATE;
|
||||
break;
|
||||
#endif
|
||||
case 'v': /* verbosly list files */
|
||||
archive_handle->action_header = header_verbose_list;
|
||||
if (archive_handle->action_header == header_list) {
|
||||
archive_handle->action_header = header_verbose_list;
|
||||
} else {
|
||||
archive_handle->action_header = header_list;
|
||||
}
|
||||
break;
|
||||
case 'u': /* unconditional */
|
||||
archive_handle->flags |= ARCHIVE_EXTRACT_UNCONDITIONAL;
|
||||
archive_handle->flags &= ~ARCHIVE_EXTRACT_NEWER;
|
||||
break;
|
||||
case 't': /* list files */
|
||||
archive_handle->action_header = header_list;
|
||||
if (archive_handle->action_header == header_list) {
|
||||
archive_handle->action_header = header_verbose_list;
|
||||
} else {
|
||||
archive_handle->action_header = header_list;
|
||||
}
|
||||
break;
|
||||
case 'F':
|
||||
archive_handle->src_fd = bb_xopen(optarg, O_RDONLY);
|
||||
@@ -81,4 +92,3 @@ extern int cpio_main(int argc, char **argv)
|
||||
|
||||
return(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
+286
-106
@@ -27,11 +27,8 @@
|
||||
* 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.
|
||||
* - The <package>.control file is extracted and kept in the info dir.
|
||||
* - When installing a package the Status: field is placed at the end of the
|
||||
* section, rather than just after the Package: field.
|
||||
* - Packages with previously unknown status are inserted at the begining of
|
||||
* the status file
|
||||
*
|
||||
* Bugs that need to be fixed
|
||||
* - (unknown, please let me know when you find any)
|
||||
@@ -392,8 +389,54 @@ int search_package_hashtable(const unsigned int name, const unsigned int version
|
||||
return(probe_address);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* needle is the index into name_hashtable of the package we are
|
||||
* looking for.
|
||||
*
|
||||
* start_at is the index in the package_hashtable to start looking
|
||||
* at. If start_at is -1 then start at the beginning. This is to allow
|
||||
* for repeated searches since more than one package might provide
|
||||
* needle.
|
||||
*
|
||||
* FIXME: I don't think this is very efficient, but I thought I'd keep
|
||||
* it simple for now until it proves to be a problem.
|
||||
*/
|
||||
int search_for_provides(int needle, int start_at) {
|
||||
int i, j;
|
||||
common_node_t *p;
|
||||
for (i = start_at + 1; i < PACKAGE_HASH_PRIME; i++) {
|
||||
p = package_hashtable[i];
|
||||
if ( p == NULL ) continue;
|
||||
for(j = 0; j < p->num_of_edges; j++)
|
||||
if ( p->edge[j]->type == EDGE_PROVIDES && p->edge[j]->name == needle )
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add an edge to a node
|
||||
*/
|
||||
void add_edge_to_node(common_node_t *node, edge_t *edge)
|
||||
{
|
||||
node->num_of_edges++;
|
||||
node->edge = xrealloc(node->edge, sizeof(edge_t) * (node->num_of_edges + 1));
|
||||
node->edge[node->num_of_edges - 1] = edge;
|
||||
}
|
||||
|
||||
/*
|
||||
* Create one new node and one new edge for every dependency.
|
||||
*
|
||||
* Dependencies which contain multiple alternatives are represented as
|
||||
* an EDGE_OR_PRE_DEPENDS or EDGE_OR_DEPENDS node, followed by a
|
||||
* number of EDGE_PRE_DEPENDS or EDGE_DEPENDS nodes. The name field of
|
||||
* the OR edge contains the full dependency string while the version
|
||||
* field contains the number of EDGE nodes which follow as part of
|
||||
* this alternative.
|
||||
*/
|
||||
void add_split_dependencies(common_node_t *parent_node, const char *whole_line, unsigned int edge_type)
|
||||
{
|
||||
@@ -405,25 +448,33 @@ void add_split_dependencies(common_node_t *parent_node, const char *whole_line,
|
||||
char *field2;
|
||||
char *version;
|
||||
edge_t *edge;
|
||||
edge_t *or_edge;
|
||||
int offset_ch;
|
||||
int type;
|
||||
|
||||
field = strtok_r(line, ",", &line_ptr1);
|
||||
do {
|
||||
/* skip leading spaces */
|
||||
field += strspn(field, " ");
|
||||
line2 = bb_xstrdup(field);
|
||||
field2 = strtok_r(line2, "|", &line_ptr2);
|
||||
if ((edge_type == EDGE_DEPENDS) && (strcmp(field, field2) != 0)) {
|
||||
type = EDGE_OR_DEPENDS;
|
||||
}
|
||||
else if ((edge_type == EDGE_PRE_DEPENDS) && (strcmp(field, field2) != 0)) {
|
||||
type = EDGE_OR_PRE_DEPENDS;
|
||||
if ( (edge_type == EDGE_DEPENDS || edge_type == EDGE_PRE_DEPENDS) &&
|
||||
(strcmp(field, field2) != 0)) {
|
||||
or_edge = (edge_t *)xmalloc(sizeof(edge_t));
|
||||
or_edge->type = edge_type + 1;
|
||||
} else {
|
||||
type = edge_type;
|
||||
or_edge = NULL;
|
||||
}
|
||||
|
||||
if ( or_edge ) {
|
||||
or_edge->name = search_name_hashtable(field);
|
||||
or_edge->version = 0; // tracks the number of altenatives
|
||||
|
||||
add_edge_to_node(parent_node, or_edge);
|
||||
}
|
||||
|
||||
do {
|
||||
edge = (edge_t *) xmalloc(sizeof(edge_t));
|
||||
edge->type = type;
|
||||
edge->type = edge_type;
|
||||
|
||||
/* Skip any extra leading spaces */
|
||||
field2 += strspn(field2, " ");
|
||||
@@ -473,11 +524,11 @@ void add_split_dependencies(common_node_t *parent_node, const char *whole_line,
|
||||
/* Get the dependency name */
|
||||
field2[strcspn(field2, " (")] = '\0';
|
||||
edge->name = search_name_hashtable(field2);
|
||||
|
||||
/* link the new edge to the current node */
|
||||
parent_node->num_of_edges++;
|
||||
parent_node->edge = xrealloc(parent_node->edge, sizeof(edge_t) * (parent_node->num_of_edges + 1));
|
||||
parent_node->edge[parent_node->num_of_edges - 1] = edge;
|
||||
|
||||
if ( or_edge )
|
||||
or_edge->version++;
|
||||
|
||||
add_edge_to_node(parent_node, edge);
|
||||
} while ((field2 = strtok_r(NULL, "|", &line_ptr2)) != NULL);
|
||||
free(line2);
|
||||
} while ((field = strtok_r(NULL, ",", &line_ptr1)) != NULL);
|
||||
@@ -493,7 +544,8 @@ void free_package(common_node_t *node)
|
||||
for (i = 0; i < node->num_of_edges; i++) {
|
||||
free(node->edge[i]);
|
||||
}
|
||||
free(node->edge);
|
||||
if ( node->edge )
|
||||
free(node->edge);
|
||||
free(node);
|
||||
}
|
||||
}
|
||||
@@ -630,6 +682,31 @@ void set_status(const unsigned int status_node_num, const char *new_value, const
|
||||
return;
|
||||
}
|
||||
|
||||
const char *describe_status(int status_num) {
|
||||
int status_want, status_state ;
|
||||
if ( status_hashtable[status_num] == NULL || status_hashtable[status_num]->status == 0 )
|
||||
return "is not installed or flagged to be installed\n";
|
||||
|
||||
status_want = get_status(status_num, 1);
|
||||
status_state = get_status(status_num, 3);
|
||||
|
||||
if ( status_state == search_name_hashtable("installed") ) {
|
||||
if ( status_want == search_name_hashtable("install") )
|
||||
return "is installed";
|
||||
if ( status_want == search_name_hashtable("deinstall") )
|
||||
return "is marked to be removed";
|
||||
if ( status_want == search_name_hashtable("purge") )
|
||||
return "is marked to be purged";
|
||||
}
|
||||
if ( status_want == search_name_hashtable("unknown") )
|
||||
return "is in an indeterminate state";
|
||||
if ( status_want == search_name_hashtable("install") )
|
||||
return "is marked to be installed";
|
||||
|
||||
return "is not installed or flagged to be installed";
|
||||
}
|
||||
|
||||
|
||||
void index_status_file(const char *filename)
|
||||
{
|
||||
FILE *status_file;
|
||||
@@ -662,7 +739,7 @@ void index_status_file(const char *filename)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#if 0 /* this code is no longer used */
|
||||
char *get_depends_field(common_node_t *package, const int depends_type)
|
||||
{
|
||||
char *depends = NULL;
|
||||
@@ -733,6 +810,7 @@ char *get_depends_field(common_node_t *package, const int depends_type)
|
||||
}
|
||||
return(depends);
|
||||
}
|
||||
#endif
|
||||
|
||||
void write_buffer_no_status(FILE *new_status_file, const char *control_buffer)
|
||||
{
|
||||
@@ -893,13 +971,34 @@ void write_status_file(deb_file_t **deb_file)
|
||||
}
|
||||
}
|
||||
|
||||
/* This function returns TRUE if the given package can statisfy a
|
||||
* dependency of type depend_type.
|
||||
*
|
||||
* A pre-depends is statisfied only if a package is already installed,
|
||||
* which a regular depends can be satisfied by a package which we want
|
||||
* to install.
|
||||
*/
|
||||
int package_satisfies_dependency(int package, int depend_type)
|
||||
{
|
||||
int status_num = search_status_hashtable(name_hashtable[package_hashtable[package]->name]);
|
||||
|
||||
/* status could be unknown if package is a pure virtual
|
||||
* provides which cannot satisfy any dependency by itself.
|
||||
*/
|
||||
if ( status_hashtable[status_num] == NULL )
|
||||
return 0;
|
||||
|
||||
switch (depend_type) {
|
||||
case EDGE_PRE_DEPENDS: return get_status(status_num, 3) == search_name_hashtable("installed");
|
||||
case EDGE_DEPENDS: return get_status(status_num, 1) == search_name_hashtable("install");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
|
||||
{
|
||||
int *conflicts = NULL;
|
||||
int conflicts_num = 0;
|
||||
int state_status;
|
||||
int state_flag;
|
||||
int state_want;
|
||||
int i = deb_start;
|
||||
int j;
|
||||
|
||||
@@ -955,21 +1054,17 @@ int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
|
||||
|
||||
for (j = 0; j < package_node->num_of_edges; j++) {
|
||||
const edge_t *package_edge = package_node->edge[j];
|
||||
const unsigned int package_num =
|
||||
search_package_hashtable(package_edge->name,
|
||||
package_edge->version, package_edge->operator);
|
||||
|
||||
if (package_edge->type == EDGE_CONFLICTS) {
|
||||
const unsigned int package_num =
|
||||
search_package_hashtable(package_edge->name,
|
||||
package_edge->version,
|
||||
package_edge->operator);
|
||||
int result = 0;
|
||||
if (package_hashtable[package_num] != NULL) {
|
||||
status_num = search_status_hashtable(name_hashtable[package_hashtable[package_num]->name]);
|
||||
state_status = get_status(status_num, 3);
|
||||
state_flag = get_status(status_num, 1);
|
||||
|
||||
result = (state_status == search_name_hashtable("installed")) ||
|
||||
(state_flag == search_name_hashtable("want-install"));
|
||||
|
||||
if (result) {
|
||||
if (get_status(status_num, 1) == search_name_hashtable("install")) {
|
||||
result = test_version(package_hashtable[deb_file[i]->package]->version,
|
||||
package_edge->version, package_edge->operator);
|
||||
}
|
||||
@@ -987,66 +1082,123 @@ int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
|
||||
|
||||
|
||||
/* Check dependendcies */
|
||||
i = 0;
|
||||
while (deb_file[i] != NULL) {
|
||||
const common_node_t *package_node = package_hashtable[deb_file[i]->package];
|
||||
for (i = 0; i < PACKAGE_HASH_PRIME; i++) {
|
||||
int status_num = 0;
|
||||
int number_of_alternatives = 0;
|
||||
const edge_t * root_of_alternatives;
|
||||
const common_node_t *package_node = package_hashtable[i];
|
||||
|
||||
status_num = search_status_hashtable(name_hashtable[package_node->name]);
|
||||
state_status = get_status(status_num, 3);
|
||||
state_want = get_status(status_num, 1);
|
||||
/* If the package node does not exist then this
|
||||
* package is a virtual one. In which case there are
|
||||
* no dependencies to check.
|
||||
*/
|
||||
if ( package_node == NULL ) continue;
|
||||
|
||||
if (state_status == search_name_hashtable("installed")) {
|
||||
i++;
|
||||
status_num = search_status_hashtable(name_hashtable[package_node->name]);
|
||||
|
||||
/* If there is no status then this package is a
|
||||
* virtual one provided by something else. In which
|
||||
* case there are no dependencies to check.
|
||||
*/
|
||||
if ( status_hashtable[status_num] == NULL ) continue;
|
||||
|
||||
/* If we don't want this package installed then we may
|
||||
* as well ignore it's dependencies.
|
||||
*/
|
||||
if (get_status(status_num, 1) != search_name_hashtable("install")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (j = 0; j < package_hashtable[deb_file[i]->package]->num_of_edges; j++) {
|
||||
#if 0
|
||||
/* This might be needed so we don't complain about
|
||||
* things which are broken but unrelated to the
|
||||
* packages that are currently being installed
|
||||
*/
|
||||
if (state_status == search_name_hashtable("installed"))
|
||||
continue;
|
||||
#endif
|
||||
|
||||
/* This code is tested only for EDGE_DEPENDS, sine I
|
||||
* have no suitable pre-depends available. There is no
|
||||
* reason that it shouldn't work though :-)
|
||||
*/
|
||||
for (j = 0; j < package_node->num_of_edges; j++) {
|
||||
const edge_t *package_edge = package_node->edge[j];
|
||||
unsigned int package_num;
|
||||
|
||||
if ( package_edge->type == EDGE_OR_PRE_DEPENDS ||
|
||||
package_edge->type == EDGE_OR_DEPENDS ) { /* start an EDGE_OR_ list */
|
||||
number_of_alternatives = package_edge->version;
|
||||
root_of_alternatives = package_edge;
|
||||
continue;
|
||||
} else if ( number_of_alternatives == 0 ) { /* not in the middle of an EDGE_OR_ list */
|
||||
number_of_alternatives = 1;
|
||||
root_of_alternatives = NULL;
|
||||
}
|
||||
|
||||
package_num = search_package_hashtable(package_edge->name, package_edge->version, package_edge->operator);
|
||||
|
||||
switch (package_edge->type) {
|
||||
case(EDGE_PRE_DEPENDS):
|
||||
case(EDGE_OR_PRE_DEPENDS): {
|
||||
int result=1;
|
||||
/* It must be already installed */
|
||||
/* NOTE: This is untested, nothing apropriate in my status file */
|
||||
if (package_hashtable[package_num] != NULL) {
|
||||
status_num = search_status_hashtable(name_hashtable[package_hashtable[package_num]->name]);
|
||||
state_status = get_status(status_num, 3);
|
||||
state_want = get_status(status_num, 1);
|
||||
result = (state_status != search_name_hashtable("installed"));
|
||||
}
|
||||
if (package_edge->type == EDGE_PRE_DEPENDS ||
|
||||
package_edge->type == EDGE_DEPENDS ) {
|
||||
int result=1;
|
||||
status_num = 0;
|
||||
|
||||
if (result) {
|
||||
bb_error_msg_and_die("Package %s pre-depends on %s, but it is not installed",
|
||||
name_hashtable[package_node->name],
|
||||
name_hashtable[package_edge->name]);
|
||||
/* If we are inside an alternative then check
|
||||
* this edge is the right type.
|
||||
*
|
||||
* EDGE_DEPENDS == OR_DEPENDS -1
|
||||
* EDGE_PRE_DEPENDS == OR_PRE_DEPENDS -1
|
||||
*/
|
||||
if ( root_of_alternatives && package_edge->type != root_of_alternatives->type - 1)
|
||||
bb_error_msg_and_die("Fatal error. Package dependencies corrupt: %d != %d - 1 \n",
|
||||
package_edge->type, root_of_alternatives->type);
|
||||
|
||||
if (package_hashtable[package_num] != NULL)
|
||||
result = !package_satisfies_dependency(package_num, package_edge->type);
|
||||
|
||||
if (result) { /* check for other package which provide what we are looking for */
|
||||
int provider = -1;
|
||||
|
||||
while ( (provider = search_for_provides(package_edge->name, provider) ) > -1 ) {
|
||||
if ( package_hashtable[provider] == NULL ) {
|
||||
printf("Have a provider but no package information for it\n");
|
||||
continue;
|
||||
}
|
||||
result = !package_satisfies_dependency(provider, package_edge->type);
|
||||
|
||||
if ( result == 0 )
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case(EDGE_DEPENDS):
|
||||
case(EDGE_OR_DEPENDS): {
|
||||
int result=1;
|
||||
if (package_hashtable[package_num] != NULL) {
|
||||
status_num = search_status_hashtable(name_hashtable[package_hashtable[package_num]->name]);
|
||||
state_status = get_status(status_num, 3);
|
||||
state_want = get_status(status_num, 1);
|
||||
result=(state_status != search_name_hashtable("installed")) && (state_want != search_name_hashtable("want-install"));
|
||||
}
|
||||
/* It must be already installed, or to be installed */
|
||||
if (result) {
|
||||
bb_error_msg_and_die("Package %s depends on %s, but it is not installed, or flaged to be installed",
|
||||
|
||||
/* It must be already installed, or to be installed */
|
||||
number_of_alternatives--;
|
||||
if (result && number_of_alternatives == 0) {
|
||||
if ( root_of_alternatives )
|
||||
bb_error_msg_and_die(
|
||||
"Package %s %sdepends on %s, "
|
||||
"which cannot be satisfied",
|
||||
name_hashtable[package_node->name],
|
||||
name_hashtable[package_edge->name]);
|
||||
}
|
||||
break;
|
||||
package_edge->type == EDGE_PRE_DEPENDS ? "pre-" : "",
|
||||
name_hashtable[root_of_alternatives->name]);
|
||||
else
|
||||
bb_error_msg_and_die(
|
||||
"Package %s %sdepends on %s, which %s\n",
|
||||
name_hashtable[package_node->name],
|
||||
package_edge->type == EDGE_PRE_DEPENDS ? "pre-" : "",
|
||||
name_hashtable[package_edge->name],
|
||||
describe_status(status_num));
|
||||
} else if ( result == 0 && number_of_alternatives ) {
|
||||
/* we've found a package which
|
||||
* satisfies the dependency,
|
||||
* so skip over the rest of
|
||||
* the alternatives.
|
||||
*/
|
||||
j += number_of_alternatives;
|
||||
number_of_alternatives = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
free(conflicts);
|
||||
return(TRUE);
|
||||
@@ -1138,21 +1290,22 @@ int run_package_script(const char *package_name, const char *script_type)
|
||||
return(result);
|
||||
}
|
||||
|
||||
const char *all_control_files[] = {"preinst", "postinst", "prerm", "postrm",
|
||||
"list", "md5sums", "shlibs", "conffiles", "config", "templates", NULL };
|
||||
|
||||
char **all_control_list(const char *package_name)
|
||||
{
|
||||
const char *extensions[11] = {"preinst", "postinst", "prerm", "postrm",
|
||||
"list", "md5sums", "shlibs", "conffiles", "config", "templates", NULL };
|
||||
unsigned short i = 0;
|
||||
char **remove_files;
|
||||
|
||||
/* Create a list of all /var/lib/dpkg/info/<package> files */
|
||||
remove_files = malloc(sizeof(char *) * 11);
|
||||
while (extensions[i]) {
|
||||
remove_files[i] = xmalloc(strlen(package_name) + strlen(extensions[i]) + 21);
|
||||
sprintf(remove_files[i], "/var/lib/dpkg/info/%s.%s", package_name, extensions[i]);
|
||||
remove_files = malloc(sizeof(all_control_files));
|
||||
while (all_control_files[i]) {
|
||||
remove_files[i] = xmalloc(strlen(package_name) + strlen(all_control_files[i]) + 21);
|
||||
sprintf(remove_files[i], "/var/lib/dpkg/info/%s.%s", package_name, all_control_files[i]);
|
||||
i++;
|
||||
}
|
||||
remove_files[10] = NULL;
|
||||
remove_files[sizeof(all_control_files)/sizeof(char*) - 1] = NULL;
|
||||
|
||||
return(remove_files);
|
||||
}
|
||||
@@ -1211,9 +1364,10 @@ void list_packages(void)
|
||||
}
|
||||
}
|
||||
|
||||
void remove_package(const unsigned int package_num)
|
||||
void remove_package(const unsigned int package_num, int noisy)
|
||||
{
|
||||
const char *package_name = name_hashtable[package_hashtable[package_num]->name];
|
||||
const char *package_version = name_hashtable[package_hashtable[package_num]->version];
|
||||
const unsigned int status_num = search_status_hashtable(package_name);
|
||||
const int package_name_length = strlen(package_name);
|
||||
char **remove_files;
|
||||
@@ -1222,7 +1376,8 @@ void remove_package(const unsigned int package_num)
|
||||
char conffile_name[package_name_length + 30];
|
||||
int return_value;
|
||||
|
||||
printf("Removing %s ...\n", package_name);
|
||||
if ( noisy )
|
||||
printf("Removing %s (%s) ...\n", package_name, package_version);
|
||||
|
||||
/* run prerm script */
|
||||
return_value = run_package_script(package_name, "prerm");
|
||||
@@ -1260,18 +1415,20 @@ void remove_package(const unsigned int package_num)
|
||||
rename(conffile_name, list_name);
|
||||
|
||||
/* Change package status */
|
||||
set_status(status_num, "deinstall", 1);
|
||||
set_status(status_num, "config-files", 3);
|
||||
}
|
||||
|
||||
void purge_package(const unsigned int package_num)
|
||||
{
|
||||
const char *package_name = name_hashtable[package_hashtable[package_num]->name];
|
||||
const char *package_version = name_hashtable[package_hashtable[package_num]->version];
|
||||
const unsigned int status_num = search_status_hashtable(package_name);
|
||||
char **remove_files;
|
||||
char **exclude_files;
|
||||
char list_name[strlen(package_name) + 25];
|
||||
|
||||
printf("Purging %s (%s) ...\n", package_name, package_version);
|
||||
|
||||
/* run prerm script */
|
||||
if (run_package_script(package_name, "prerm") != 0) {
|
||||
bb_error_msg_and_die("script failed, prerm failure");
|
||||
@@ -1300,7 +1457,6 @@ void purge_package(const unsigned int package_num)
|
||||
}
|
||||
|
||||
/* Change package status */
|
||||
set_status(status_num, "purge", 1);
|
||||
set_status(status_num, "not-installed", 3);
|
||||
}
|
||||
|
||||
@@ -1322,7 +1478,6 @@ static void init_archive_deb_control(archive_handle_t *ar_handle)
|
||||
|
||||
/* Setup the tar archive handle */
|
||||
tar_handle = init_handle();
|
||||
tar_handle->filter = filter_accept_list;
|
||||
tar_handle->src_fd = ar_handle->src_fd;
|
||||
|
||||
/* We dont care about data.tar.* or debian-binary, just control.tar.* */
|
||||
@@ -1345,15 +1500,14 @@ static void init_archive_deb_data(archive_handle_t *ar_handle)
|
||||
|
||||
/* Setup the tar archive handle */
|
||||
tar_handle = init_handle();
|
||||
tar_handle->filter = filter_accept_all;
|
||||
tar_handle->src_fd = ar_handle->src_fd;
|
||||
|
||||
/* We dont care about data.tar.* or debian-binary, just control.tar.* */
|
||||
/* We dont care about control.tar.* or debian-binary, just data.tar.* */
|
||||
#ifdef CONFIG_FEATURE_DEB_TAR_GZ
|
||||
tar_handle->accept = llist_add_to(NULL, "data.tar.gz");
|
||||
ar_handle->accept = llist_add_to(NULL, "data.tar.gz");
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
|
||||
tar_handle->accept = llist_add_to(ar_handle->accept, "data.tar.bz2");
|
||||
ar_handle->accept = llist_add_to(ar_handle->accept, "data.tar.bz2");
|
||||
#endif
|
||||
|
||||
/* Assign the tar handle as a subarchive of the ar handle */
|
||||
@@ -1362,10 +1516,10 @@ static void init_archive_deb_data(archive_handle_t *ar_handle)
|
||||
return;
|
||||
}
|
||||
|
||||
static char *deb_extract_control_file_to_buffer(archive_handle_t *ar_handle, llist_t *accept)
|
||||
static char *deb_extract_control_file_to_buffer(archive_handle_t *ar_handle, llist_t *myaccept)
|
||||
{
|
||||
ar_handle->sub_archive->action_data = data_extract_to_buffer;
|
||||
ar_handle->sub_archive->accept = accept;
|
||||
ar_handle->sub_archive->accept = myaccept;
|
||||
|
||||
unpack_ar_archive(ar_handle);
|
||||
close(ar_handle->src_fd);
|
||||
@@ -1395,6 +1549,8 @@ static void unpack_package(deb_file_t *deb_file)
|
||||
char *info_prefix;
|
||||
archive_handle_t *archive_handle;
|
||||
FILE *out_stream;
|
||||
llist_t *accept_list = NULL;
|
||||
int i = 0;
|
||||
|
||||
/* If existing version, remove it first */
|
||||
if (strcmp(name_hashtable[get_status(status_num, 3)], "installed") == 0) {
|
||||
@@ -1402,7 +1558,7 @@ static void unpack_package(deb_file_t *deb_file)
|
||||
printf("Preparing to replace %s %s (using %s) ...\n", package_name,
|
||||
name_hashtable[package_hashtable[status_package_num]->version],
|
||||
deb_file->filename);
|
||||
remove_package(status_package_num);
|
||||
remove_package(status_package_num, 0);
|
||||
} else {
|
||||
printf("Unpacking %s (from %s) ...\n", package_name, deb_file->filename);
|
||||
}
|
||||
@@ -1412,8 +1568,18 @@ static void unpack_package(deb_file_t *deb_file)
|
||||
sprintf(info_prefix, "/var/lib/dpkg/info/%s.", package_name);
|
||||
archive_handle = init_archive_deb_ar(deb_file->filename);
|
||||
init_archive_deb_control(archive_handle);
|
||||
|
||||
while(all_control_files[i]) {
|
||||
char *c = (char *) xmalloc(3 + bb_strlen(all_control_files[i]));
|
||||
sprintf(c, "./%s", all_control_files[i]);
|
||||
accept_list= llist_add_to(accept_list, c);
|
||||
i++;
|
||||
}
|
||||
archive_handle->sub_archive->accept = accept_list;
|
||||
archive_handle->sub_archive->filter = filter_accept_list;
|
||||
archive_handle->sub_archive->action_data = data_extract_all_prefix;
|
||||
archive_handle->sub_archive->buffer = info_prefix;
|
||||
archive_handle->sub_archive->flags |= ARCHIVE_EXTRACT_UNCONDITIONAL;
|
||||
unpack_ar_archive(archive_handle);
|
||||
|
||||
/* Run the preinst prior to extracting */
|
||||
@@ -1425,16 +1591,19 @@ static void unpack_package(deb_file_t *deb_file)
|
||||
/* Extract data.tar.gz to the root directory */
|
||||
archive_handle = init_archive_deb_ar(deb_file->filename);
|
||||
init_archive_deb_data(archive_handle);
|
||||
archive_handle->sub_archive->action_data = data_extract_all_prefix;
|
||||
archive_handle->sub_archive->buffer = "/";
|
||||
archive_handle->sub_archive->flags |= ARCHIVE_EXTRACT_UNCONDITIONAL;
|
||||
unpack_ar_archive(archive_handle);
|
||||
|
||||
/* Create the list file */
|
||||
strcat(info_prefix, "list");
|
||||
out_stream = bb_xfopen(info_prefix, "w");
|
||||
while (archive_handle->passed) {
|
||||
/* blindly skip over the leading '.' */
|
||||
fputs(archive_handle->passed->data + 1, out_stream);
|
||||
while (archive_handle->sub_archive->passed) {
|
||||
/* the leading . has been stripped by data_extract_all_prefix already */
|
||||
fputs(archive_handle->sub_archive->passed->data, out_stream);
|
||||
fputc('\n', out_stream);
|
||||
archive_handle->passed = archive_handle->passed->link;
|
||||
archive_handle->sub_archive->passed = archive_handle->sub_archive->passed->link;
|
||||
}
|
||||
fclose(out_stream);
|
||||
|
||||
@@ -1451,7 +1620,7 @@ void configure_package(deb_file_t *deb_file)
|
||||
const char *package_version = name_hashtable[package_hashtable[deb_file->package]->version];
|
||||
const int status_num = search_status_hashtable(package_name);
|
||||
|
||||
printf("Setting up %s (%s)\n", package_name, package_version);
|
||||
printf("Setting up %s (%s) ...\n", package_name, package_version);
|
||||
|
||||
/* Run the postinst script */
|
||||
if (run_package_script(package_name, "postinst") != 0) {
|
||||
@@ -1485,6 +1654,7 @@ int dpkg_main(int argc, char **argv)
|
||||
if (strcmp(optarg, "depends") == 0) {
|
||||
dpkg_opt |= dpkg_opt_force_ignore_depends;
|
||||
}
|
||||
break;
|
||||
case 'i':
|
||||
dpkg_opt |= dpkg_opt_install;
|
||||
dpkg_opt |= dpkg_opt_filename;
|
||||
@@ -1550,19 +1720,20 @@ int dpkg_main(int argc, char **argv)
|
||||
|
||||
/* Add the package to the status hashtable */
|
||||
if ((dpkg_opt & dpkg_opt_unpack) || (dpkg_opt & dpkg_opt_install)) {
|
||||
status_node = (status_node_t *) xmalloc(sizeof(status_node_t));
|
||||
status_node->package = deb_file[deb_count]->package;
|
||||
/* Try and find a currently installed version of this package */
|
||||
status_num = search_status_hashtable(name_hashtable[package_hashtable[deb_file[deb_count]->package]->name]);
|
||||
/* If no previous entry was found initialise a new entry */
|
||||
if ((status_hashtable[status_num] == NULL) ||
|
||||
(status_hashtable[status_num]->status == 0)) {
|
||||
status_node = (status_node_t *) xmalloc(sizeof(status_node_t));
|
||||
status_node->package = deb_file[deb_count]->package;
|
||||
/* reinstreq isnt changed to "ok" until the package control info
|
||||
* is written to the status file*/
|
||||
status_node->status = search_name_hashtable("want-install reinstreq not-installed");
|
||||
status_node->status = search_name_hashtable("install reinstreq not-installed");
|
||||
status_hashtable[status_num] = status_node;
|
||||
} else {
|
||||
status_hashtable[status_num]->status = search_name_hashtable("want-install reinstreq not-installed");
|
||||
set_status(status_num, "install", 1);
|
||||
set_status(status_num, "reinstreq", 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1575,20 +1746,24 @@ int dpkg_main(int argc, char **argv)
|
||||
if (package_hashtable[deb_file[deb_count]->package] == NULL) {
|
||||
bb_error_msg_and_die("Package %s is uninstalled or unknown\n", argv[optind]);
|
||||
}
|
||||
state_status = get_status(search_status_hashtable(name_hashtable[package_hashtable[deb_file[deb_count]->package]->name]), 3);
|
||||
package_num = deb_file[deb_count]->package;
|
||||
status_num = search_status_hashtable(name_hashtable[package_hashtable[package_num]->name]);
|
||||
state_status = get_status(status_num, 3);
|
||||
|
||||
/* check package status is "installed" */
|
||||
if (dpkg_opt & dpkg_opt_remove) {
|
||||
if ((strcmp(name_hashtable[state_status], "not-installed") == 0) ||
|
||||
(strcmp(name_hashtable[state_status], "config-files") == 0)) {
|
||||
bb_error_msg_and_die("%s is already removed.", name_hashtable[package_hashtable[deb_file[deb_count]->package]->name]);
|
||||
bb_error_msg_and_die("%s is already removed.", name_hashtable[package_hashtable[package_num]->name]);
|
||||
}
|
||||
set_status(status_num, "deinstall", 1);
|
||||
}
|
||||
else if (dpkg_opt & dpkg_opt_purge) {
|
||||
/* if package status is "conf-files" then its ok */
|
||||
if (strcmp(name_hashtable[state_status], "not-installed") == 0) {
|
||||
bb_error_msg_and_die("%s is already purged.", name_hashtable[package_hashtable[deb_file[deb_count]->package]->name]);
|
||||
bb_error_msg_and_die("%s is already purged.", name_hashtable[package_hashtable[package_num]->name]);
|
||||
}
|
||||
set_status(status_num, "purge", 1);
|
||||
}
|
||||
}
|
||||
deb_count++;
|
||||
@@ -1597,17 +1772,17 @@ int dpkg_main(int argc, char **argv)
|
||||
deb_file[deb_count] = NULL;
|
||||
|
||||
/* Check that the deb file arguments are installable */
|
||||
/* TODO: check dependencies before removing */
|
||||
if ((dpkg_opt & dpkg_opt_force_ignore_depends) != dpkg_opt_force_ignore_depends) {
|
||||
if (!check_deps(deb_file, 0, deb_count)) {
|
||||
bb_error_msg_and_die("Dependency check failed");
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: install or remove packages in the correct dependency order */
|
||||
for (i = 0; i < deb_count; i++) {
|
||||
/* Remove or purge packages */
|
||||
if (dpkg_opt & dpkg_opt_remove) {
|
||||
remove_package(deb_file[i]->package);
|
||||
remove_package(deb_file[i]->package, 1);
|
||||
}
|
||||
else if (dpkg_opt & dpkg_opt_purge) {
|
||||
purge_package(deb_file[i]->package);
|
||||
@@ -1617,12 +1792,17 @@ int dpkg_main(int argc, char **argv)
|
||||
}
|
||||
else if (dpkg_opt & dpkg_opt_install) {
|
||||
unpack_package(deb_file[i]);
|
||||
configure_package(deb_file[i]);
|
||||
/* package is configured in second pass below */
|
||||
}
|
||||
else if (dpkg_opt & dpkg_opt_configure) {
|
||||
configure_package(deb_file[i]);
|
||||
}
|
||||
}
|
||||
/* configure installed packages */
|
||||
if (dpkg_opt & dpkg_opt_install) {
|
||||
for (i = 0; i < deb_count; i++)
|
||||
configure_package(deb_file[i]);
|
||||
}
|
||||
|
||||
write_status_file(deb_file);
|
||||
|
||||
|
||||
+49
-44
@@ -12,24 +12,32 @@
|
||||
* 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 <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include "unarchive.h"
|
||||
#include "busybox.h"
|
||||
|
||||
#define DPKG_DEB_OPT_CONTENTS 1
|
||||
#define DPKG_DEB_OPT_CONTROL 2
|
||||
#define DPKG_DEB_OPT_FIELD 4
|
||||
#define DPKG_DEB_OPT_EXTRACT 8
|
||||
#define DPKG_DEB_OPT_EXTRACT_VERBOSE 16
|
||||
|
||||
extern int dpkg_deb_main(int argc, char **argv)
|
||||
{
|
||||
archive_handle_t *ar_archive;
|
||||
archive_handle_t *tar_archive;
|
||||
int opt = 0;
|
||||
#ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY
|
||||
llist_t *control_tar_llist = NULL;
|
||||
#endif
|
||||
|
||||
unsigned long opt;
|
||||
char *extract_dir = NULL;
|
||||
short argcount = 1;
|
||||
|
||||
/* Setup the tar archive handle */
|
||||
tar_archive = init_handle();
|
||||
|
||||
@@ -40,53 +48,47 @@ extern int dpkg_deb_main(int argc, char **argv)
|
||||
|
||||
#ifdef CONFIG_FEATURE_DEB_TAR_GZ
|
||||
ar_archive->accept = llist_add_to(NULL, "data.tar.gz");
|
||||
# ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY
|
||||
control_tar_llist = llist_add_to(NULL, "control.tar.gz");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
|
||||
ar_archive->accept = llist_add_to(ar_archive->accept, "data.tar.bz2");
|
||||
# ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY
|
||||
control_tar_llist = llist_add_to(control_tar_llist, "control.tar.bz2");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY
|
||||
while ((opt = getopt(argc, argv, "cefXx")) != -1) {
|
||||
#else
|
||||
while ((opt = getopt(argc, argv, "x")) != -1) {
|
||||
#endif
|
||||
switch (opt) {
|
||||
#ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY
|
||||
case 'c':
|
||||
tar_archive->action_header = header_verbose_list;
|
||||
break;
|
||||
case 'e':
|
||||
ar_archive->accept = control_tar_llist;
|
||||
tar_archive->action_data = data_extract_all;
|
||||
break;
|
||||
case 'f':
|
||||
/* Print the entire control file
|
||||
* it should accept a second argument which specifies a
|
||||
* specific field to print */
|
||||
ar_archive->accept = control_tar_llist;
|
||||
tar_archive->accept = llist_add_to(NULL, "./control");;
|
||||
tar_archive->filter = filter_accept_list;
|
||||
tar_archive->action_data = data_extract_to_stdout;
|
||||
break;
|
||||
case 'X':
|
||||
tar_archive->action_header = header_list;
|
||||
#endif
|
||||
case 'x':
|
||||
tar_archive->action_data = data_extract_all;
|
||||
break;
|
||||
default:
|
||||
bb_show_usage();
|
||||
bb_opt_complementaly = "c~efXx:e~cfXx:f~ceXx:X~cefx:x~cefX";
|
||||
opt = bb_getopt_ulflags(argc, argv, "cefXx");
|
||||
|
||||
if (opt & DPKG_DEB_OPT_CONTENTS) {
|
||||
tar_archive->action_header = header_verbose_list;
|
||||
}
|
||||
if (opt & DPKG_DEB_OPT_CONTROL) {
|
||||
ar_archive->accept = control_tar_llist;
|
||||
tar_archive->action_data = data_extract_all;
|
||||
if (optind + 1 == argc) {
|
||||
extract_dir = "./DEBIAN";
|
||||
} else {
|
||||
argcount++;
|
||||
}
|
||||
}
|
||||
if (opt & DPKG_DEB_OPT_FIELD) {
|
||||
/* Print the entire control file
|
||||
* it should accept a second argument which specifies a
|
||||
* specific field to print */
|
||||
ar_archive->accept = control_tar_llist;
|
||||
tar_archive->accept = llist_add_to(NULL, "./control");;
|
||||
tar_archive->filter = filter_accept_list;
|
||||
tar_archive->action_data = data_extract_to_stdout;
|
||||
}
|
||||
if (opt & DPKG_DEB_OPT_EXTRACT) {
|
||||
tar_archive->action_header = header_list;
|
||||
}
|
||||
if (opt & (DPKG_DEB_OPT_EXTRACT_VERBOSE | DPKG_DEB_OPT_EXTRACT)) {
|
||||
tar_archive->action_data = data_extract_all;
|
||||
argcount = 2;
|
||||
}
|
||||
|
||||
if (optind + 2 < argc) {
|
||||
if ((optind + argcount != argc) || (opt & 0x80000000UL)) {
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
@@ -94,9 +96,13 @@ extern int dpkg_deb_main(int argc, char **argv)
|
||||
|
||||
/* Workout where to extract the files */
|
||||
/* 2nd argument is a dir name */
|
||||
mkdir(argv[optind], 0777);
|
||||
chdir(argv[optind]);
|
||||
|
||||
if (argv[optind]) {
|
||||
extract_dir = argv[optind];
|
||||
}
|
||||
if (extract_dir) {
|
||||
mkdir(extract_dir, 0777);
|
||||
chdir(extract_dir);
|
||||
}
|
||||
unpack_ar_archive(ar_archive);
|
||||
|
||||
/* Cleanup */
|
||||
@@ -104,4 +110,3 @@ extern int dpkg_deb_main(int argc, char **argv)
|
||||
|
||||
return(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
+12
-30
@@ -71,37 +71,20 @@ static char *license_msg[] = {
|
||||
#include "busybox.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
const char gunzip_to_stdout = 1;
|
||||
const char gunzip_force = 2;
|
||||
const char gunzip_test = 4;
|
||||
#define GUNZIP_OPT_STDOUT 1
|
||||
#define GUNZIP_OPT_FORCE 2
|
||||
#define GUNZIP_OPT_TEST 4
|
||||
#define GUNZIP_OPT_DECOMPRESS 8
|
||||
|
||||
extern int gunzip_main(int argc, char **argv)
|
||||
{
|
||||
char status = EXIT_SUCCESS;
|
||||
char flags = 0;
|
||||
int opt;
|
||||
unsigned long opt;
|
||||
|
||||
opt = bb_getopt_ulflags(argc, argv, "cftd");
|
||||
/* if called as zcat */
|
||||
if (strcmp(bb_applet_name, "zcat") == 0) {
|
||||
flags |= gunzip_to_stdout;
|
||||
}
|
||||
|
||||
while ((opt = getopt(argc, argv, "ctfhd")) != -1) {
|
||||
switch (opt) {
|
||||
case 'c':
|
||||
flags |= gunzip_to_stdout;
|
||||
break;
|
||||
case 'f':
|
||||
flags |= gunzip_force;
|
||||
break;
|
||||
case 't':
|
||||
flags |= gunzip_test;
|
||||
break;
|
||||
case 'd': /* Used to convert gzip to gunzip. */
|
||||
break;
|
||||
default:
|
||||
bb_show_usage(); /* exit's inside usage */
|
||||
}
|
||||
opt |= GUNZIP_OPT_STDOUT;
|
||||
}
|
||||
|
||||
do {
|
||||
@@ -116,7 +99,7 @@ extern int gunzip_main(int argc, char **argv)
|
||||
|
||||
if (old_path == NULL || strcmp(old_path, "-") == 0) {
|
||||
src_fd = fileno(stdin);
|
||||
flags |= gunzip_to_stdout;
|
||||
opt |= GUNZIP_OPT_STDOUT;
|
||||
} else {
|
||||
src_fd = bb_xopen(old_path, O_RDONLY);
|
||||
|
||||
@@ -127,15 +110,15 @@ extern int gunzip_main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* Check that the input is sane. */
|
||||
if (isatty(src_fd) && ((flags & gunzip_force) == 0)) {
|
||||
if (isatty(src_fd) && ((opt & GUNZIP_OPT_FORCE) == 0)) {
|
||||
bb_error_msg_and_die
|
||||
("compressed data not read from terminal. Use -f to force it.");
|
||||
}
|
||||
|
||||
/* Set output filename and number */
|
||||
if (flags & gunzip_test) {
|
||||
if (opt & GUNZIP_OPT_TEST) {
|
||||
dst_fd = bb_xopen("/dev/null", O_WRONLY); /* why does test use filenum 2 ? */
|
||||
} else if (flags & gunzip_to_stdout) {
|
||||
} else if (opt & GUNZIP_OPT_STDOUT) {
|
||||
dst_fd = fileno(stdout);
|
||||
} else {
|
||||
char *extension;
|
||||
@@ -179,11 +162,10 @@ extern int gunzip_main(int argc, char **argv)
|
||||
#endif
|
||||
if (magic2 == 0x8b) {
|
||||
check_header_gzip(src_fd);
|
||||
status = inflate(src_fd, dst_fd);
|
||||
status = inflate_gunzip(src_fd, dst_fd);
|
||||
if (status != 0) {
|
||||
bb_error_msg_and_die("Error inflating");
|
||||
}
|
||||
check_trailer_gzip(src_fd);
|
||||
} else {
|
||||
bb_error_msg_and_die("Invalid magic");
|
||||
}
|
||||
|
||||
+1
-4
@@ -305,8 +305,6 @@ DECLARE(ush, d_buf, DIST_BUFSIZE);
|
||||
DECLARE(uch, window, 2L * WSIZE);
|
||||
DECLARE(ush, tab_prefix, 1L << BITS);
|
||||
|
||||
static int crc_table_empty = 1;
|
||||
|
||||
static int foreground; /* set if program run in foreground */
|
||||
static int method = DEFLATED; /* compression method */
|
||||
static int exit_code = OK; /* program exit code */
|
||||
@@ -387,14 +385,13 @@ static ulg updcrc(uch * s, unsigned n)
|
||||
register ulg c; /* temporary variable */
|
||||
static unsigned long crc_32_tab[256];
|
||||
|
||||
if (crc_table_empty) {
|
||||
if (crc_32_tab[1] == 0x00000000L) {
|
||||
unsigned long csr; /* crc shift register */
|
||||
const unsigned long e = 0xedb88320L; /* polynomial exclusive-or pattern */
|
||||
int i; /* counter for all possible eight bit values */
|
||||
int k; /* byte being shifted into crc apparatus */
|
||||
|
||||
/* Compute table of CRC's. */
|
||||
crc_32_tab[0] = 0x00000000L;
|
||||
for (i = 1; i < 256; i++) {
|
||||
csr = i;
|
||||
/* The idea to initialize the register with the byte instead of
|
||||
|
||||
@@ -31,46 +31,47 @@ LIBUNARCHIVE-y:= \
|
||||
\
|
||||
filter_accept_all.o \
|
||||
filter_accept_list.o \
|
||||
filter_accept_list_reassign.o \
|
||||
filter_accept_reject_list.o \
|
||||
\
|
||||
get_header_ar.o \
|
||||
get_header_cpio.o \
|
||||
get_header_tar.o \
|
||||
get_header_tar_bz2.o \
|
||||
get_header_tar_gz.o \
|
||||
\
|
||||
header_skip.o \
|
||||
header_list.o \
|
||||
header_verbose_list.o \
|
||||
\
|
||||
archive_xread.o \
|
||||
archive_xread_all.o \
|
||||
archive_xread_all_eof.o \
|
||||
archive_xread_char.o \
|
||||
\
|
||||
seek_by_char.o \
|
||||
seek_by_jump.o \
|
||||
\
|
||||
archive_copy_file.o \
|
||||
\
|
||||
check_header_gzip.o \
|
||||
data_align.o \
|
||||
decompress_bunzip2.o \
|
||||
find_list_entry.o \
|
||||
init_handle.o \
|
||||
uncompress.o \
|
||||
unpack_ar_archive.o \
|
||||
unzip.o
|
||||
open_transformer.o \
|
||||
init_handle.o
|
||||
|
||||
LIBUNARCHIVE-$(CONFIG_DPKG) +=
|
||||
LIBUNARCHIVE-$(CONFIG_DPKG_DEB) +=
|
||||
LIBUNARCHIVE-$(CONFIG_AR) +=
|
||||
LIBUNARCHIVE-$(CONFIG_CPIO) +=
|
||||
LIBUNARCHIVE-$(CONFIG_GUNZIP) +=
|
||||
LIBUNARCHIVE-$(CONFIG_RPM2CPIO) +=
|
||||
LIBUNARCHIVE-$(CONFIG_TAR) +=
|
||||
LIBUNARCHIVE-$(CONFIG_UNZIP) +=
|
||||
GUNZIP_FILES:= check_header_gzip.o unzip.o
|
||||
DPKG_FILES:= \
|
||||
get_header_ar.o \
|
||||
unpack_ar_archive.o \
|
||||
get_header_tar.o \
|
||||
filter_accept_list_reassign.o
|
||||
|
||||
LIBUNARCHIVE-$(CONFIG_AR) += get_header_ar.o unpack_ar_archive.o
|
||||
LIBUNARCHIVE-$(CONFIG_BUNZIP2) += decompress_bunzip2.o
|
||||
LIBUNARCHIVE-$(CONFIG_CPIO) += get_header_cpio.o
|
||||
LIBUNARCHIVE-$(CONFIG_DPKG) += $(DPKG_FILES)
|
||||
LIBUNARCHIVE-$(CONFIG_DPKG_DEB) += $(DPKG_FILES)
|
||||
LIBUNARCHIVE-$(CONFIG_FEATURE_DEB_TAR_GZ) += $(GUNZIP_FILES) get_header_tar_gz.o
|
||||
LIBUNARCHIVE-$(CONFIG_FEATURE_DEB_TAR_BZ2) += decompress_bunzip2.o get_header_tar_bz2.o
|
||||
LIBUNARCHIVE-$(CONFIG_GUNZIP) += $(GUNZIP_FILES)
|
||||
LIBUNARCHIVE-$(CONFIG_FEATURE_GUNZIP_UNCOMPRESS) += uncompress.o
|
||||
LIBUNARCHIVE-$(CONFIG_RPM2CPIO) += $(GUNZIP_FILES) get_header_cpio.o
|
||||
LIBUNARCHIVE-$(CONFIG_RPM) += $(GUNZIP_FILES) get_header_cpio.o
|
||||
LIBUNARCHIVE-$(CONFIG_TAR) += get_header_tar.o
|
||||
LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_BZIP2) += decompress_bunzip2.o get_header_tar_bz2.o
|
||||
LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_GZIP) += $(GUNZIP_FILES) get_header_tar_gz.o
|
||||
LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_COMPRESS) += uncompress.o
|
||||
LIBUNARCHIVE-$(CONFIG_UNCOMPRESS) += uncompress.o
|
||||
LIBUNARCHIVE-$(CONFIG_UNZIP) += $(GUNZIP_FILES)
|
||||
|
||||
libraries-y+=$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR)
|
||||
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* 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 <unistd.h>
|
||||
|
||||
#include "libbb.h"
|
||||
#include "unarchive.h"
|
||||
|
||||
extern void archive_copy_file(const archive_handle_t *archive_handle, const int dst_fd)
|
||||
{
|
||||
char buffer[512];
|
||||
off_t chunksize = archive_handle->file_header->size;
|
||||
|
||||
while (chunksize != 0) {
|
||||
size_t size;
|
||||
if (chunksize > 512) {
|
||||
size = 512;
|
||||
} else {
|
||||
size = chunksize;
|
||||
}
|
||||
// archive_xread_all(archive_handle, buffer, size);
|
||||
size = archive_xread(archive_handle, buffer, size);
|
||||
|
||||
if (write(dst_fd, buffer, size) != size) {
|
||||
bb_error_msg_and_die ("Short write");
|
||||
}
|
||||
chunksize -= size;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -24,7 +24,7 @@ extern void archive_xread_all(const archive_handle_t *archive_handle, void *buf,
|
||||
{
|
||||
ssize_t size;
|
||||
|
||||
size = archive_xread(archive_handle, buf, count);
|
||||
size = bb_full_read(archive_handle->src_fd, buf, count);
|
||||
if (size != count) {
|
||||
bb_error_msg_and_die("Short read");
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ extern ssize_t archive_xread_all_eof(archive_handle_t *archive_handle, unsigned
|
||||
{
|
||||
ssize_t size;
|
||||
|
||||
size = archive_xread(archive_handle, buf, count);
|
||||
size = bb_full_read(archive_handle->src_fd, buf, count);
|
||||
if ((size != 0) && (size != count)) {
|
||||
bb_perror_msg_and_die("Short read, read %d of %d", size, count);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ extern void data_align(archive_handle_t *archive_handle, const unsigned short bo
|
||||
const unsigned short skip_amount = (boundary - (archive_handle->offset % boundary)) % boundary;
|
||||
|
||||
archive_handle->seek(archive_handle, skip_amount);
|
||||
|
||||
archive_handle->offset += skip_amount;
|
||||
|
||||
return;
|
||||
|
||||
@@ -39,58 +39,82 @@ extern void data_extract_all(archive_handle_t *archive_handle)
|
||||
free(name);
|
||||
}
|
||||
|
||||
/* Create the filesystem entry */
|
||||
switch(file_header->mode & S_IFMT) {
|
||||
case S_IFREG: {
|
||||
#ifdef CONFIG_CPIO
|
||||
if (file_header->link_name && file_header->size == 0) {
|
||||
/* hard link */
|
||||
res = link(file_header->link_name, file_header->name);
|
||||
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
|
||||
bb_perror_msg("Couldnt create hard link");
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
/* Regular file */
|
||||
unlink(file_header->name);
|
||||
dst_fd = bb_xopen(file_header->name, O_WRONLY | O_CREAT | O_EXCL);
|
||||
archive_copy_file(archive_handle, dst_fd);
|
||||
close(dst_fd);
|
||||
}
|
||||
break;
|
||||
/* Check if the file already exists */
|
||||
if (archive_handle->flags & ARCHIVE_EXTRACT_UNCONDITIONAL) {
|
||||
/* Remove the existing entry if it exists */
|
||||
if (((file_header->mode & S_IFMT) != S_IFDIR) && (unlink(file_header->name) == -1) && (errno != ENOENT)) {
|
||||
bb_perror_msg_and_die("Couldnt remove old file");
|
||||
}
|
||||
case S_IFDIR:
|
||||
unlink(file_header->name);
|
||||
res = mkdir(file_header->name, file_header->mode);
|
||||
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
|
||||
bb_perror_msg("extract_archive: %s", file_header->name);
|
||||
}
|
||||
else if (archive_handle->flags & ARCHIVE_EXTRACT_NEWER) {
|
||||
/* Remove the existing entry if its older than the extracted entry */
|
||||
struct stat statbuf;
|
||||
if (lstat(file_header->name, &statbuf) == -1) {
|
||||
if (errno != ENOENT) {
|
||||
bb_perror_msg_and_die("Couldnt stat old file");
|
||||
}
|
||||
break;
|
||||
case S_IFLNK:
|
||||
/* Symlink */
|
||||
unlink(file_header->name);
|
||||
res = symlink(file_header->link_name, file_header->name);
|
||||
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
|
||||
bb_perror_msg("Cannot create symlink from %s to '%s'", file_header->name, file_header->link_name);
|
||||
}
|
||||
else if (statbuf.st_mtime <= file_header->mtime) {
|
||||
if (!(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
|
||||
bb_error_msg("%s not created: newer or same age file exists", file_header->name);
|
||||
}
|
||||
break;
|
||||
case S_IFSOCK:
|
||||
case S_IFBLK:
|
||||
case S_IFCHR:
|
||||
case S_IFIFO:
|
||||
unlink(file_header->name);
|
||||
res = mknod(file_header->name, file_header->mode, file_header->device);
|
||||
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
|
||||
bb_perror_msg("Cannot create node %s", file_header->name);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
bb_error_msg_and_die("Unrecognised file type");
|
||||
data_skip(archive_handle);
|
||||
return;
|
||||
}
|
||||
else if ((unlink(file_header->name) == -1) && (errno != EISDIR)) {
|
||||
bb_perror_msg_and_die("Couldnt remove old file %s", file_header->name);
|
||||
}
|
||||
}
|
||||
|
||||
chmod(file_header->name, file_header->mode);
|
||||
chown(file_header->name, file_header->uid, file_header->gid);
|
||||
/* Handle hard links seperately
|
||||
* 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 */
|
||||
res = link(file_header->link_name, file_header->name);
|
||||
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
|
||||
bb_perror_msg("Couldnt create hard link");
|
||||
}
|
||||
} else {
|
||||
/* Create the filesystem entry */
|
||||
switch(file_header->mode & S_IFMT) {
|
||||
case S_IFREG: {
|
||||
/* Regular file */
|
||||
dst_fd = bb_xopen(file_header->name, O_WRONLY | O_CREAT | O_EXCL);
|
||||
bb_copyfd_size(archive_handle->src_fd, dst_fd, file_header->size);
|
||||
close(dst_fd);
|
||||
break;
|
||||
}
|
||||
case S_IFDIR:
|
||||
res = mkdir(file_header->name, file_header->mode);
|
||||
if ((errno != EISDIR) && (res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
|
||||
bb_perror_msg("extract_archive: %s", file_header->name);
|
||||
}
|
||||
break;
|
||||
case S_IFLNK:
|
||||
/* Symlink */
|
||||
res = symlink(file_header->link_name, file_header->name);
|
||||
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
|
||||
bb_perror_msg("Cannot create symlink from %s to '%s'", file_header->name, file_header->link_name);
|
||||
}
|
||||
break;
|
||||
case S_IFSOCK:
|
||||
case S_IFBLK:
|
||||
case S_IFCHR:
|
||||
case S_IFIFO:
|
||||
res = mknod(file_header->name, file_header->mode, file_header->device);
|
||||
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
|
||||
bb_perror_msg("Cannot create node %s", file_header->name);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
bb_error_msg_and_die("Unrecognised file type");
|
||||
}
|
||||
}
|
||||
|
||||
lchown(file_header->name, file_header->uid, file_header->gid);
|
||||
if ((file_header->mode & S_IFMT) != S_IFLNK) {
|
||||
chmod(file_header->name, file_header->mode);
|
||||
}
|
||||
|
||||
if (archive_handle->flags & ARCHIVE_PRESERVE_DATE) {
|
||||
struct utimbuf t;
|
||||
|
||||
@@ -18,5 +18,5 @@
|
||||
|
||||
extern void data_extract_to_stdout(archive_handle_t *archive_handle)
|
||||
{
|
||||
archive_copy_file(archive_handle, fileno(stdout));
|
||||
bb_copyfd_size(archive_handle->src_fd, fileno(stdout), archive_handle->file_header->size);
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,8 +1,6 @@
|
||||
#include "config.h"
|
||||
#include "libbb.h"
|
||||
|
||||
#if defined CONFIG_UNCOMPRESS || defined CONFIG_FEATURE_GUNZIP_UNCOMPRESS
|
||||
|
||||
/* uncompress for busybox -- (c) 2002 Robert Griebl
|
||||
*
|
||||
* based on the original compress42.c source
|
||||
@@ -166,7 +164,7 @@ extern int uncompress(int fd_in, int fd_out)
|
||||
}
|
||||
|
||||
if (insize < (int) sizeof(inbuf) - IBUFSIZ) {
|
||||
rsize = read(fd_in, inbuf + insize, IBUFSIZ);
|
||||
rsize = safe_read(fd_in, inbuf + insize, IBUFSIZ);
|
||||
insize += rsize;
|
||||
}
|
||||
|
||||
@@ -293,6 +291,3 @@ extern int uncompress(int fd_in, int fd_out)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -103,7 +103,7 @@ static unsigned int gunzip_bb; /* bit buffer */
|
||||
static unsigned char gunzip_bk; /* bits in bit buffer */
|
||||
|
||||
/* These control the size of the bytebuffer */
|
||||
#define BYTEBUFFER_MAX 0x8000
|
||||
static unsigned int bytebuffer_max = 0x8000;
|
||||
static unsigned char *bytebuffer = NULL;
|
||||
static unsigned int bytebuffer_offset = 0;
|
||||
static unsigned int bytebuffer_size = 0;
|
||||
@@ -144,21 +144,16 @@ static const unsigned char border[] = {
|
||||
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
|
||||
};
|
||||
|
||||
static void fill_bytebuffer(void)
|
||||
{
|
||||
if (bytebuffer_offset >= bytebuffer_size) {
|
||||
/* Leave the first 4 bytes empty so we can always unwind the bitbuffer
|
||||
* to the front of the bytebuffer, leave 4 bytes free at end of tail
|
||||
* so we can easily top up buffer in check_trailer_gzip() */
|
||||
bytebuffer_size = 4 + bb_xread(gunzip_src_fd, &bytebuffer[4], BYTEBUFFER_MAX - 8);
|
||||
bytebuffer_offset = 4;
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned int fill_bitbuffer(unsigned int bitbuffer, unsigned int *current, const unsigned int required)
|
||||
{
|
||||
while (*current < required) {
|
||||
fill_bytebuffer();
|
||||
if (bytebuffer_offset >= bytebuffer_size) {
|
||||
/* Leave the first 4 bytes empty so we can always unwind the bitbuffer
|
||||
* to the front of the bytebuffer, leave 4 bytes free at end of tail
|
||||
* so we can easily top up buffer in check_trailer_gzip() */
|
||||
bytebuffer_size = 4 + bb_xread(gunzip_src_fd, &bytebuffer[4], bytebuffer_max - 8);
|
||||
bytebuffer_offset = 4;
|
||||
}
|
||||
bitbuffer |= ((unsigned int) bytebuffer[bytebuffer_offset]) << *current;
|
||||
bytebuffer_offset++;
|
||||
*current += 8;
|
||||
@@ -861,9 +856,9 @@ static void calculate_gunzip_crc(void)
|
||||
|
||||
static int inflate_get_next_window(void)
|
||||
{
|
||||
static int needAnotherBlock = 1;
|
||||
static int method = -1; // Method == -1 for stored, -2 for codes
|
||||
static int e = 0;
|
||||
static int needAnotherBlock = 1;
|
||||
|
||||
gunzip_outbuf_count = 0;
|
||||
|
||||
@@ -873,6 +868,8 @@ static int inflate_get_next_window(void)
|
||||
if (needAnotherBlock) {
|
||||
if(e) {
|
||||
calculate_gunzip_crc();
|
||||
e = 0;
|
||||
needAnotherBlock = 1;
|
||||
return 0;
|
||||
} // Last block
|
||||
method = inflate_block(&e);
|
||||
@@ -895,54 +892,25 @@ static int inflate_get_next_window(void)
|
||||
/* Doesnt get here */
|
||||
}
|
||||
|
||||
/*
|
||||
* User functions
|
||||
*
|
||||
* read_gz, GZ_gzReadOpen, GZ_gzReadClose, inflate
|
||||
*/
|
||||
|
||||
extern ssize_t read_gz(int fd, void *buf, size_t count)
|
||||
/* Initialise bytebuffer, be carefull not to overfill the buffer */
|
||||
extern void inflate_init(unsigned int bufsize)
|
||||
{
|
||||
static int morebytes = 0, finished = 0;
|
||||
|
||||
if (morebytes) {
|
||||
int bytesRead = morebytes > count ? count : morebytes;
|
||||
memcpy(buf, gunzip_window + (gunzip_outbuf_count - morebytes), bytesRead);
|
||||
morebytes -= bytesRead;
|
||||
return bytesRead;
|
||||
} else if (finished) {
|
||||
return 0;
|
||||
} else if (count >= 0x8000) { // We can decompress direcly to the buffer, 32k at a time
|
||||
// Could decompress to larger buffer, but it must be a power of 2, and calculating that is probably more expensive than the benefit
|
||||
unsigned char *old_gunzip_window = gunzip_window; // Save old window
|
||||
gunzip_window = buf;
|
||||
if (inflate_get_next_window() == 0) finished = 1;
|
||||
gunzip_window = old_gunzip_window; // Restore old window
|
||||
return gunzip_outbuf_count;
|
||||
} else { // Oh well, need to split up the gunzip_window
|
||||
int bytesRead;
|
||||
if (inflate_get_next_window() == 0) finished = 1;
|
||||
morebytes = gunzip_outbuf_count;
|
||||
bytesRead = morebytes > count ? count : morebytes;
|
||||
memcpy(buf, gunzip_window, bytesRead);
|
||||
morebytes -= bytesRead;
|
||||
return bytesRead;
|
||||
}
|
||||
|
||||
/* Set the bytebuffer size, default is same as gunzip_wsize */
|
||||
bytebuffer_max = bufsize + 8;
|
||||
bytebuffer_offset = 4;
|
||||
bytebuffer_size = 0;
|
||||
}
|
||||
|
||||
extern void GZ_gzReadOpen(int fd, void *unused, int nUnused)
|
||||
extern int inflate_unzip(int in, int out)
|
||||
{
|
||||
ssize_t nwrote;
|
||||
typedef void (*sig_type) (int);
|
||||
|
||||
/* Allocate all global buffers (for DYN_ALLOC option) */
|
||||
gunzip_window = xmalloc(gunzip_wsize);
|
||||
gunzip_outbuf_count = 0;
|
||||
gunzip_bytes_out = 0;
|
||||
gunzip_src_fd = fd;
|
||||
|
||||
/* Input buffer */
|
||||
bytebuffer = xmalloc(BYTEBUFFER_MAX);
|
||||
gunzip_src_fd = in;
|
||||
|
||||
/* initialize gunzip_window, bit buffer */
|
||||
gunzip_bk = 0;
|
||||
@@ -950,10 +918,20 @@ extern void GZ_gzReadOpen(int fd, void *unused, int nUnused)
|
||||
|
||||
/* Create the crc table */
|
||||
make_gunzip_crc_table();
|
||||
}
|
||||
|
||||
extern void GZ_gzReadClose(void)
|
||||
{
|
||||
/* Allocate space for buffer */
|
||||
bytebuffer = xmalloc(bytebuffer_max);
|
||||
|
||||
while(1) {
|
||||
int ret = inflate_get_next_window();
|
||||
nwrote = bb_full_write(out, gunzip_window, gunzip_outbuf_count);
|
||||
if (nwrote == -1) {
|
||||
bb_perror_msg("write");
|
||||
return -1;
|
||||
}
|
||||
if (ret == 0) break;
|
||||
}
|
||||
|
||||
/* Cleanup */
|
||||
free(gunzip_window);
|
||||
free(gunzip_crc_table);
|
||||
@@ -967,57 +945,20 @@ extern void GZ_gzReadClose(void)
|
||||
gunzip_bb >>= 8;
|
||||
gunzip_bk -= 8;
|
||||
}
|
||||
}
|
||||
|
||||
/*extern int inflate(int in, int out) // Useful for testing read_gz
|
||||
{
|
||||
char buf[8192];
|
||||
ssize_t nread, nwrote;
|
||||
|
||||
GZ_gzReadOpen(in, 0, 0);
|
||||
while(1) { // Robbed from bb_copyfd.c
|
||||
nread = read_gz(in, buf, sizeof(buf));
|
||||
if (nread == 0) break; // no data to write
|
||||
else if (nread == -1) {
|
||||
bb_perror_msg("read");
|
||||
return -1;
|
||||
}
|
||||
nwrote = bb_full_write(out, buf, nread);
|
||||
if (nwrote == -1) {
|
||||
bb_perror_msg("write");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
GZ_gzReadClose();
|
||||
return 0;
|
||||
}*/
|
||||
|
||||
extern int inflate(int in, int out)
|
||||
{
|
||||
ssize_t nwrote;
|
||||
GZ_gzReadOpen(in, 0, 0);
|
||||
while(1) {
|
||||
int ret = inflate_get_next_window();
|
||||
nwrote = bb_full_write(out, gunzip_window, gunzip_outbuf_count);
|
||||
if (nwrote == -1) {
|
||||
bb_perror_msg("write");
|
||||
return -1;
|
||||
}
|
||||
if (ret == 0) break;
|
||||
}
|
||||
GZ_gzReadClose();
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern void check_trailer_gzip(int src_fd)
|
||||
extern int inflate_gunzip(int in, int out)
|
||||
{
|
||||
unsigned int stored_crc = 0;
|
||||
unsigned char count;
|
||||
|
||||
inflate_unzip(in, out);
|
||||
|
||||
/* top up the input buffer with the rest of the trailer */
|
||||
count = bytebuffer_size - bytebuffer_offset;
|
||||
if (count < 8) {
|
||||
bb_xread_all(src_fd, &bytebuffer[bytebuffer_size], 8 - count);
|
||||
bb_xread_all(in, &bytebuffer[bytebuffer_size], 8 - count);
|
||||
bytebuffer_size += 8 - count;
|
||||
}
|
||||
for (count = 0; count != 4; count++) {
|
||||
@@ -1027,14 +968,15 @@ extern void check_trailer_gzip(int src_fd)
|
||||
|
||||
/* Validate decompression - crc */
|
||||
if (stored_crc != (gunzip_crc ^ 0xffffffffL)) {
|
||||
bb_error_msg_and_die("crc error");
|
||||
bb_error_msg("crc error");
|
||||
}
|
||||
|
||||
/* Validate decompression - size */
|
||||
if (gunzip_bytes_out !=
|
||||
(bytebuffer[bytebuffer_offset] | (bytebuffer[bytebuffer_offset+1] << 8) |
|
||||
(bytebuffer[bytebuffer_offset+2] << 16) | (bytebuffer[bytebuffer_offset+3] << 24))) {
|
||||
bb_error_msg_and_die("Incorrect length, but crc is correct");
|
||||
bb_error_msg("Incorrect length");
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -40,16 +40,13 @@ extern char filter_accept_list_reassign(archive_handle_t *archive_handle)
|
||||
/* Modify the subarchive handler based on the extension */
|
||||
#ifdef CONFIG_FEATURE_DEB_TAR_GZ
|
||||
if (strcmp(name_ptr, ".gz") == 0) {
|
||||
archive_handle->sub_archive->read = read;
|
||||
archive_handle->action_data_subarchive = get_header_tar_gz;
|
||||
return(EXIT_SUCCESS);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
|
||||
if (strcmp(name_ptr, ".bz2") == 0) {
|
||||
archive_handle->sub_archive->read = read_bz2;
|
||||
BZ2_bzReadOpen(archive_handle->src_fd, NULL, 0);
|
||||
archive_handle->action_data_subarchive = get_header_tar;
|
||||
archive_handle->action_data_subarchive = get_header_tar_bz2;
|
||||
return(EXIT_SUCCESS);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -45,7 +45,7 @@ extern char get_header_ar(archive_handle_t *archive_handle)
|
||||
if (read(archive_handle->src_fd, ar.raw, 60) != 60) {
|
||||
/* End Of File */
|
||||
return(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Some ar entries have a trailing '\n' after the previous data entry */
|
||||
if (ar.raw[0] == '\n') {
|
||||
@@ -55,7 +55,7 @@ extern char get_header_ar(archive_handle_t *archive_handle)
|
||||
archive_handle->offset++;
|
||||
}
|
||||
archive_handle->offset += 60;
|
||||
|
||||
|
||||
/* align the headers based on the header magic */
|
||||
if ((ar.formated.magic[0] != '`') || (ar.formated.magic[1] != '\n')) {
|
||||
bb_error_msg_and_die("Invalid ar header");
|
||||
@@ -84,6 +84,7 @@ extern char get_header_ar(archive_handle_t *archive_handle)
|
||||
} else if (ar.formated.name[1] == ' ') {
|
||||
/* This is the index of symbols in the file for compilers */
|
||||
data_skip(archive_handle);
|
||||
archive_handle->offset += typed->size;
|
||||
return (get_header_ar(archive_handle)); /* Return next header */
|
||||
} else {
|
||||
/* The number after the '/' indicates the offset in the ar data section
|
||||
@@ -115,8 +116,9 @@ extern char get_header_ar(archive_handle_t *archive_handle)
|
||||
data_skip(archive_handle);
|
||||
}
|
||||
|
||||
archive_handle->offset += typed->size + 1;
|
||||
archive_handle->offset += typed->size;
|
||||
/* Set the file pointer to the correct spot, we may have been reading a compressed file */
|
||||
lseek(archive_handle->src_fd, archive_handle->offset, SEEK_SET);
|
||||
|
||||
return(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
|
||||
int namesize;
|
||||
char dummy[16];
|
||||
int major, minor, nlink, inode;
|
||||
char extract_flag;
|
||||
|
||||
if (pending_hardlinks) { /* Deal with any pending hardlinks */
|
||||
hardlinks_t *tmp;
|
||||
@@ -71,17 +70,7 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
|
||||
}
|
||||
archive_handle->offset += 110;
|
||||
|
||||
if (strncmp(&cpio_header[0], "07070", 5) != 0) {
|
||||
printf("cpio header is %x-%x-%x-%x-%x\n",
|
||||
cpio_header[0],
|
||||
cpio_header[1],
|
||||
cpio_header[2],
|
||||
cpio_header[3],
|
||||
cpio_header[4]);
|
||||
bb_error_msg_and_die("Unsupported cpio format");
|
||||
}
|
||||
|
||||
if ((cpio_header[5] != '1') && (cpio_header[5] != '2')) {
|
||||
if ((strncmp(&cpio_header[0], "07070", 5) != 0) || ((cpio_header[5] != '1') && (cpio_header[5] != '2'))) {
|
||||
bb_error_msg_and_die("Unsupported cpio format, use newc or crc");
|
||||
}
|
||||
|
||||
@@ -154,36 +143,13 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
|
||||
}
|
||||
file_header->device = (major << 8) | minor;
|
||||
|
||||
extract_flag = FALSE;
|
||||
if (archive_handle->filter(archive_handle) == EXIT_SUCCESS) {
|
||||
struct stat statbuf;
|
||||
|
||||
extract_flag = TRUE;
|
||||
|
||||
/* Check if the file already exists */
|
||||
if (lstat (file_header->name, &statbuf) == 0) {
|
||||
if ((archive_handle->flags & ARCHIVE_EXTRACT_UNCONDITIONAL) || (statbuf.st_mtime < file_header->mtime)) {
|
||||
/* Remove file if flag set or its older than the file to be extracted */
|
||||
if (unlink(file_header->name) == -1) {
|
||||
bb_perror_msg_and_die("Couldnt remove old file");
|
||||
}
|
||||
} else {
|
||||
if (! archive_handle->flags & ARCHIVE_EXTRACT_QUIET) {
|
||||
bb_error_msg("%s not created: newer or same age file exists", file_header->name);
|
||||
}
|
||||
extract_flag = FALSE;
|
||||
}
|
||||
}
|
||||
archive_handle->action_header(file_header);
|
||||
}
|
||||
|
||||
archive_handle->action_header(file_header);
|
||||
if (extract_flag) {
|
||||
archive_handle->action_data(archive_handle);
|
||||
archive_handle->action_header(archive_handle->file_header);
|
||||
} else {
|
||||
data_skip(archive_handle);
|
||||
data_skip(archive_handle);
|
||||
}
|
||||
|
||||
archive_handle->offset += file_header->size;
|
||||
return (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ extern char get_header_tar(archive_handle_t *archive_handle)
|
||||
{
|
||||
file_header_t *file_header = archive_handle->file_header;
|
||||
union {
|
||||
/* ustar header, Posix 1003.1 */
|
||||
unsigned char raw[512];
|
||||
struct {
|
||||
char name[100]; /* 0-99 */
|
||||
@@ -52,12 +53,11 @@ extern char get_header_tar(archive_handle_t *archive_handle)
|
||||
} tar;
|
||||
long sum = 0;
|
||||
long i;
|
||||
char *tmp;
|
||||
|
||||
/* Align header */
|
||||
data_align(archive_handle, 512);
|
||||
|
||||
if (archive_xread(archive_handle, tar.raw, 512) != 512) {
|
||||
if (bb_full_read(archive_handle->src_fd, tar.raw, 512) != 512) {
|
||||
/* Assume end of file */
|
||||
return(EXIT_FAILURE);
|
||||
}
|
||||
@@ -105,11 +105,15 @@ extern char get_header_tar(archive_handle_t *archive_handle)
|
||||
} else {
|
||||
file_header->name = concat_path_file(tar.formated.prefix, tar.formated.name);
|
||||
}
|
||||
tmp = last_char_is(archive_handle->file_header->name, '/');
|
||||
if (tmp) {
|
||||
*tmp = '\0';
|
||||
|
||||
{ /* Strip trailing '/' in directories */
|
||||
char *tmp = last_char_is(file_header->name, '/');
|
||||
if (tmp) {
|
||||
*tmp = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
file_header->mode = strtol(tar.formated.mode, NULL, 8);
|
||||
file_header->uid = strtol(tar.formated.uid, NULL, 8);
|
||||
file_header->gid = strtol(tar.formated.gid, NULL, 8);
|
||||
@@ -120,16 +124,17 @@ extern char get_header_tar(archive_handle_t *archive_handle)
|
||||
file_header->device = (dev_t) ((strtol(tar.formated.devmajor, NULL, 8) << 8) +
|
||||
strtol(tar.formated.devminor, NULL, 8));
|
||||
|
||||
#if defined CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY || defined CONFIG_FEATURE_TAR_GNU_EXTENSIONS
|
||||
/* Fix mode, used by the old format */
|
||||
switch (tar.formated.typeflag) {
|
||||
# ifdef CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY
|
||||
case 0:
|
||||
case '0':
|
||||
file_header->mode |= S_IFREG;
|
||||
if (last_char_is(file_header->name, '/')) {
|
||||
file_header->mode |= S_IFDIR;
|
||||
} else {
|
||||
file_header->mode |= S_IFREG;
|
||||
}
|
||||
break;
|
||||
case '1':
|
||||
bb_error_msg("WARNING: Converting hard link to symlink");
|
||||
case '2':
|
||||
file_header->mode |= S_IFLNK;
|
||||
break;
|
||||
@@ -146,6 +151,10 @@ extern char get_header_tar(archive_handle_t *archive_handle)
|
||||
file_header->mode |= S_IFIFO;
|
||||
break;
|
||||
# endif
|
||||
/* hard links are detected as regular files with 0 size and a link name */
|
||||
case '1':
|
||||
file_header->mode &= (S_IFREG | 07777);
|
||||
break;
|
||||
# ifdef CONFIG_FEATURE_TAR_GNU_EXTENSIONS
|
||||
case 'L': {
|
||||
longname = xmalloc(file_header->size + 1);
|
||||
@@ -172,17 +181,18 @@ extern char get_header_tar(archive_handle_t *archive_handle)
|
||||
bb_error_msg("Ignoring GNU extension type %c", tar.formated.typeflag);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
if (archive_handle->filter(archive_handle) == EXIT_SUCCESS) {
|
||||
archive_handle->action_header(archive_handle->file_header);
|
||||
archive_handle->flags |= ARCHIVE_EXTRACT_QUIET;
|
||||
archive_handle->action_data(archive_handle);
|
||||
archive_handle->passed = llist_add_to(archive_handle->passed, archive_handle->file_header->name);
|
||||
archive_handle->passed = llist_add_to(archive_handle->passed, file_header->name);
|
||||
} else {
|
||||
data_skip(archive_handle);
|
||||
}
|
||||
archive_handle->offset += file_header->size;
|
||||
|
||||
free(file_header->link_name);
|
||||
|
||||
return(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -25,18 +26,13 @@
|
||||
|
||||
extern char get_header_tar_bz2(archive_handle_t *archive_handle)
|
||||
{
|
||||
BZ2_bzReadOpen(archive_handle->src_fd, NULL, 0);
|
||||
|
||||
archive_handle->read = read_bz2;
|
||||
/* Cant lseek over pipe's */
|
||||
archive_handle->seek = seek_by_char;
|
||||
|
||||
archive_handle->src_fd = open_transformer(archive_handle->src_fd, uncompressStream);
|
||||
archive_handle->offset = 0;
|
||||
while (get_header_tar(archive_handle) == EXIT_SUCCESS);
|
||||
|
||||
/* Cleanup */
|
||||
BZ2_bzReadClose();
|
||||
|
||||
/* Can only do one tar.bz2 per archive */
|
||||
/* Can only do one file at a time */
|
||||
return(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ extern char get_header_tar_gz(archive_handle_t *archive_handle)
|
||||
{
|
||||
unsigned char magic[2];
|
||||
|
||||
/* Cant lseek over pipe's */
|
||||
archive_handle->seek = seek_by_char;
|
||||
|
||||
archive_xread_all(archive_handle, &magic, 2);
|
||||
if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
|
||||
bb_error_msg_and_die("Invalid gzip magic");
|
||||
@@ -30,20 +33,10 @@ extern char get_header_tar_gz(archive_handle_t *archive_handle)
|
||||
|
||||
check_header_gzip(archive_handle->src_fd);
|
||||
|
||||
GZ_gzReadOpen(archive_handle->src_fd, 0, 0);
|
||||
|
||||
archive_handle->read = read_gz;
|
||||
archive_handle->seek = seek_by_char;
|
||||
|
||||
archive_handle->src_fd = open_transformer(archive_handle->src_fd, inflate_gunzip);
|
||||
archive_handle->offset = 0;
|
||||
while (get_header_tar(archive_handle) == EXIT_SUCCESS);
|
||||
|
||||
/* Cleanup */
|
||||
GZ_gzReadClose();
|
||||
|
||||
check_trailer_gzip(archive_handle->src_fd);
|
||||
|
||||
/* Can only do one tar.bz2 per archive */
|
||||
/* Can only do one file at a time */
|
||||
return(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ archive_handle_t *init_handle(void)
|
||||
archive_handle->action_header = header_skip;
|
||||
archive_handle->action_data = data_skip;
|
||||
archive_handle->filter = filter_accept_all;
|
||||
archive_handle->read = bb_full_read;
|
||||
archive_handle->seek = seek_by_jump;
|
||||
|
||||
return(archive_handle);
|
||||
|
||||
@@ -14,20 +14,38 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "unarchive.h"
|
||||
#include <unistd.h>
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
extern ssize_t archive_xread(const archive_handle_t *archive_handle, unsigned char *buf, const size_t count)
|
||||
/* transformer(), more than meets the eye */
|
||||
extern int open_transformer(int src_fd, int (*transformer)(int src_fd, int dst_fd))
|
||||
{
|
||||
ssize_t size;
|
||||
int fd_pipe[2];
|
||||
int pid;
|
||||
|
||||
size = archive_handle->read(archive_handle->src_fd, buf, count);
|
||||
if (size < 0) {
|
||||
bb_perror_msg_and_die("Read error");
|
||||
if (pipe(fd_pipe) != 0) {
|
||||
bb_perror_msg_and_die("Can't create pipe");
|
||||
}
|
||||
|
||||
return(size);
|
||||
pid = fork();
|
||||
if (pid == -1) {
|
||||
bb_perror_msg_and_die("Fork failed");
|
||||
}
|
||||
|
||||
if (pid == 0) {
|
||||
/* child process */
|
||||
close(fd_pipe[0]); /* We don't wan't to read from the parent */
|
||||
transformer(src_fd, fd_pipe[1]);
|
||||
close(fd_pipe[1]); /* Send EOF */
|
||||
close(src_fd);
|
||||
exit(0);
|
||||
/* notreached */
|
||||
}
|
||||
|
||||
/* parent process */
|
||||
close(fd_pipe[1]); /* Don't want to write to the child */
|
||||
|
||||
return(fd_pipe[0]);
|
||||
}
|
||||
@@ -14,12 +14,19 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "unarchive.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
extern void seek_by_char(const archive_handle_t *archive_handle, const unsigned int amount)
|
||||
#include "unarchive.h"
|
||||
#include "busybox.h"
|
||||
|
||||
/* If we are reading through a pipe(), or from stdin then we cant lseek,
|
||||
* we must read and discard the data to skip over it.
|
||||
*
|
||||
* TODO: rename to seek_by_read
|
||||
*/
|
||||
extern void seek_by_char(const archive_handle_t *archive_handle, const unsigned int jump_size)
|
||||
{
|
||||
unsigned int i;
|
||||
for (i = 0; i < amount; i++) {
|
||||
archive_xread_char(archive_handle);
|
||||
if (jump_size) {
|
||||
bb_full_fd_action(archive_handle->src_fd, -1, jump_size, NULL);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "config.h"
|
||||
#include "libbb.h"
|
||||
|
||||
#if defined CONFIG_UNCOMPRESS || defined CONFIG_FEATURE_GUNZIP_UNCOMPRESS
|
||||
|
||||
/* uncompress for busybox -- (c) 2002 Robert Griebl
|
||||
*
|
||||
* based on the original compress42.c source
|
||||
@@ -166,7 +164,7 @@ extern int uncompress(int fd_in, int fd_out)
|
||||
}
|
||||
|
||||
if (insize < (int) sizeof(inbuf) - IBUFSIZ) {
|
||||
rsize = read(fd_in, inbuf + insize, IBUFSIZ);
|
||||
rsize = safe_read(fd_in, inbuf + insize, IBUFSIZ);
|
||||
insize += rsize;
|
||||
}
|
||||
|
||||
@@ -293,6 +291,3 @@ extern int uncompress(int fd_in, int fd_out)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -103,7 +103,7 @@ static unsigned int gunzip_bb; /* bit buffer */
|
||||
static unsigned char gunzip_bk; /* bits in bit buffer */
|
||||
|
||||
/* These control the size of the bytebuffer */
|
||||
#define BYTEBUFFER_MAX 0x8000
|
||||
static unsigned int bytebuffer_max = 0x8000;
|
||||
static unsigned char *bytebuffer = NULL;
|
||||
static unsigned int bytebuffer_offset = 0;
|
||||
static unsigned int bytebuffer_size = 0;
|
||||
@@ -144,21 +144,16 @@ static const unsigned char border[] = {
|
||||
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
|
||||
};
|
||||
|
||||
static void fill_bytebuffer(void)
|
||||
{
|
||||
if (bytebuffer_offset >= bytebuffer_size) {
|
||||
/* Leave the first 4 bytes empty so we can always unwind the bitbuffer
|
||||
* to the front of the bytebuffer, leave 4 bytes free at end of tail
|
||||
* so we can easily top up buffer in check_trailer_gzip() */
|
||||
bytebuffer_size = 4 + bb_xread(gunzip_src_fd, &bytebuffer[4], BYTEBUFFER_MAX - 8);
|
||||
bytebuffer_offset = 4;
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned int fill_bitbuffer(unsigned int bitbuffer, unsigned int *current, const unsigned int required)
|
||||
{
|
||||
while (*current < required) {
|
||||
fill_bytebuffer();
|
||||
if (bytebuffer_offset >= bytebuffer_size) {
|
||||
/* Leave the first 4 bytes empty so we can always unwind the bitbuffer
|
||||
* to the front of the bytebuffer, leave 4 bytes free at end of tail
|
||||
* so we can easily top up buffer in check_trailer_gzip() */
|
||||
bytebuffer_size = 4 + bb_xread(gunzip_src_fd, &bytebuffer[4], bytebuffer_max - 8);
|
||||
bytebuffer_offset = 4;
|
||||
}
|
||||
bitbuffer |= ((unsigned int) bytebuffer[bytebuffer_offset]) << *current;
|
||||
bytebuffer_offset++;
|
||||
*current += 8;
|
||||
@@ -861,9 +856,9 @@ static void calculate_gunzip_crc(void)
|
||||
|
||||
static int inflate_get_next_window(void)
|
||||
{
|
||||
static int needAnotherBlock = 1;
|
||||
static int method = -1; // Method == -1 for stored, -2 for codes
|
||||
static int e = 0;
|
||||
static int needAnotherBlock = 1;
|
||||
|
||||
gunzip_outbuf_count = 0;
|
||||
|
||||
@@ -873,6 +868,8 @@ static int inflate_get_next_window(void)
|
||||
if (needAnotherBlock) {
|
||||
if(e) {
|
||||
calculate_gunzip_crc();
|
||||
e = 0;
|
||||
needAnotherBlock = 1;
|
||||
return 0;
|
||||
} // Last block
|
||||
method = inflate_block(&e);
|
||||
@@ -895,54 +892,25 @@ static int inflate_get_next_window(void)
|
||||
/* Doesnt get here */
|
||||
}
|
||||
|
||||
/*
|
||||
* User functions
|
||||
*
|
||||
* read_gz, GZ_gzReadOpen, GZ_gzReadClose, inflate
|
||||
*/
|
||||
|
||||
extern ssize_t read_gz(int fd, void *buf, size_t count)
|
||||
/* Initialise bytebuffer, be carefull not to overfill the buffer */
|
||||
extern void inflate_init(unsigned int bufsize)
|
||||
{
|
||||
static int morebytes = 0, finished = 0;
|
||||
|
||||
if (morebytes) {
|
||||
int bytesRead = morebytes > count ? count : morebytes;
|
||||
memcpy(buf, gunzip_window + (gunzip_outbuf_count - morebytes), bytesRead);
|
||||
morebytes -= bytesRead;
|
||||
return bytesRead;
|
||||
} else if (finished) {
|
||||
return 0;
|
||||
} else if (count >= 0x8000) { // We can decompress direcly to the buffer, 32k at a time
|
||||
// Could decompress to larger buffer, but it must be a power of 2, and calculating that is probably more expensive than the benefit
|
||||
unsigned char *old_gunzip_window = gunzip_window; // Save old window
|
||||
gunzip_window = buf;
|
||||
if (inflate_get_next_window() == 0) finished = 1;
|
||||
gunzip_window = old_gunzip_window; // Restore old window
|
||||
return gunzip_outbuf_count;
|
||||
} else { // Oh well, need to split up the gunzip_window
|
||||
int bytesRead;
|
||||
if (inflate_get_next_window() == 0) finished = 1;
|
||||
morebytes = gunzip_outbuf_count;
|
||||
bytesRead = morebytes > count ? count : morebytes;
|
||||
memcpy(buf, gunzip_window, bytesRead);
|
||||
morebytes -= bytesRead;
|
||||
return bytesRead;
|
||||
}
|
||||
|
||||
/* Set the bytebuffer size, default is same as gunzip_wsize */
|
||||
bytebuffer_max = bufsize + 8;
|
||||
bytebuffer_offset = 4;
|
||||
bytebuffer_size = 0;
|
||||
}
|
||||
|
||||
extern void GZ_gzReadOpen(int fd, void *unused, int nUnused)
|
||||
extern int inflate_unzip(int in, int out)
|
||||
{
|
||||
ssize_t nwrote;
|
||||
typedef void (*sig_type) (int);
|
||||
|
||||
/* Allocate all global buffers (for DYN_ALLOC option) */
|
||||
gunzip_window = xmalloc(gunzip_wsize);
|
||||
gunzip_outbuf_count = 0;
|
||||
gunzip_bytes_out = 0;
|
||||
gunzip_src_fd = fd;
|
||||
|
||||
/* Input buffer */
|
||||
bytebuffer = xmalloc(BYTEBUFFER_MAX);
|
||||
gunzip_src_fd = in;
|
||||
|
||||
/* initialize gunzip_window, bit buffer */
|
||||
gunzip_bk = 0;
|
||||
@@ -950,10 +918,20 @@ extern void GZ_gzReadOpen(int fd, void *unused, int nUnused)
|
||||
|
||||
/* Create the crc table */
|
||||
make_gunzip_crc_table();
|
||||
}
|
||||
|
||||
extern void GZ_gzReadClose(void)
|
||||
{
|
||||
/* Allocate space for buffer */
|
||||
bytebuffer = xmalloc(bytebuffer_max);
|
||||
|
||||
while(1) {
|
||||
int ret = inflate_get_next_window();
|
||||
nwrote = bb_full_write(out, gunzip_window, gunzip_outbuf_count);
|
||||
if (nwrote == -1) {
|
||||
bb_perror_msg("write");
|
||||
return -1;
|
||||
}
|
||||
if (ret == 0) break;
|
||||
}
|
||||
|
||||
/* Cleanup */
|
||||
free(gunzip_window);
|
||||
free(gunzip_crc_table);
|
||||
@@ -967,57 +945,20 @@ extern void GZ_gzReadClose(void)
|
||||
gunzip_bb >>= 8;
|
||||
gunzip_bk -= 8;
|
||||
}
|
||||
}
|
||||
|
||||
/*extern int inflate(int in, int out) // Useful for testing read_gz
|
||||
{
|
||||
char buf[8192];
|
||||
ssize_t nread, nwrote;
|
||||
|
||||
GZ_gzReadOpen(in, 0, 0);
|
||||
while(1) { // Robbed from bb_copyfd.c
|
||||
nread = read_gz(in, buf, sizeof(buf));
|
||||
if (nread == 0) break; // no data to write
|
||||
else if (nread == -1) {
|
||||
bb_perror_msg("read");
|
||||
return -1;
|
||||
}
|
||||
nwrote = bb_full_write(out, buf, nread);
|
||||
if (nwrote == -1) {
|
||||
bb_perror_msg("write");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
GZ_gzReadClose();
|
||||
return 0;
|
||||
}*/
|
||||
|
||||
extern int inflate(int in, int out)
|
||||
{
|
||||
ssize_t nwrote;
|
||||
GZ_gzReadOpen(in, 0, 0);
|
||||
while(1) {
|
||||
int ret = inflate_get_next_window();
|
||||
nwrote = bb_full_write(out, gunzip_window, gunzip_outbuf_count);
|
||||
if (nwrote == -1) {
|
||||
bb_perror_msg("write");
|
||||
return -1;
|
||||
}
|
||||
if (ret == 0) break;
|
||||
}
|
||||
GZ_gzReadClose();
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern void check_trailer_gzip(int src_fd)
|
||||
extern int inflate_gunzip(int in, int out)
|
||||
{
|
||||
unsigned int stored_crc = 0;
|
||||
unsigned char count;
|
||||
|
||||
inflate_unzip(in, out);
|
||||
|
||||
/* top up the input buffer with the rest of the trailer */
|
||||
count = bytebuffer_size - bytebuffer_offset;
|
||||
if (count < 8) {
|
||||
bb_xread_all(src_fd, &bytebuffer[bytebuffer_size], 8 - count);
|
||||
bb_xread_all(in, &bytebuffer[bytebuffer_size], 8 - count);
|
||||
bytebuffer_size += 8 - count;
|
||||
}
|
||||
for (count = 0; count != 4; count++) {
|
||||
@@ -1027,14 +968,15 @@ extern void check_trailer_gzip(int src_fd)
|
||||
|
||||
/* Validate decompression - crc */
|
||||
if (stored_crc != (gunzip_crc ^ 0xffffffffL)) {
|
||||
bb_error_msg_and_die("crc error");
|
||||
bb_error_msg("crc error");
|
||||
}
|
||||
|
||||
/* Validate decompression - size */
|
||||
if (gunzip_bytes_out !=
|
||||
(bytebuffer[bytebuffer_offset] | (bytebuffer[bytebuffer_offset+1] << 8) |
|
||||
(bytebuffer[bytebuffer_offset+2] << 16) | (bytebuffer[bytebuffer_offset+3] << 24))) {
|
||||
bb_error_msg_and_die("Incorrect length, but crc is correct");
|
||||
bb_error_msg("Incorrect length");
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
+10
-13
@@ -82,10 +82,10 @@ enum rpm_functions_e {
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
u_int32_t tag; /* 4 byte tag */
|
||||
u_int32_t type; /* 4 byte type */
|
||||
u_int32_t offset; /* 4 byte offset */
|
||||
u_int32_t count; /* 4 byte count */
|
||||
uint32_t tag; /* 4 byte tag */
|
||||
uint32_t type; /* 4 byte type */
|
||||
uint32_t offset; /* 4 byte offset */
|
||||
uint32_t count; /* 4 byte count */
|
||||
} rpm_index;
|
||||
|
||||
static void *map;
|
||||
@@ -197,7 +197,6 @@ void extract_cpio_gz(int fd) {
|
||||
|
||||
/* Initialise */
|
||||
archive_handle = init_handle();
|
||||
archive_handle->read = read_gz;
|
||||
archive_handle->seek = seek_by_char;
|
||||
//archive_handle->action_header = header_list;
|
||||
archive_handle->action_data = data_extract_all;
|
||||
@@ -213,11 +212,9 @@ void extract_cpio_gz(int fd) {
|
||||
check_header_gzip(archive_handle->src_fd);
|
||||
chdir("/"); // Install RPM's to root
|
||||
|
||||
GZ_gzReadOpen(archive_handle->src_fd, 0, 0);
|
||||
archive_handle->src_fd = open_transformer(archive_handle->src_fd, inflate_gunzip);
|
||||
archive_handle->offset = 0;
|
||||
while (get_header_cpio(archive_handle) == EXIT_SUCCESS);
|
||||
GZ_gzReadClose();
|
||||
|
||||
check_trailer_gzip(archive_handle->src_fd);
|
||||
}
|
||||
|
||||
|
||||
@@ -230,10 +227,10 @@ rpm_index **rpm_gettags(int fd, int *num_tags)
|
||||
for (pass = 0; pass < 2; pass++) { /* 1st pass is the signature headers, 2nd is the main stuff */
|
||||
struct {
|
||||
char magic[3]; /* 3 byte magic: 0x8e 0xad 0xe8 */
|
||||
u_int8_t version; /* 1 byte version number */
|
||||
u_int32_t reserved; /* 4 bytes reserved */
|
||||
u_int32_t entries; /* Number of entries in header (4 bytes) */
|
||||
u_int32_t size; /* Size of store (4 bytes) */
|
||||
uint8_t version; /* 1 byte version number */
|
||||
uint32_t reserved; /* 4 bytes reserved */
|
||||
uint32_t entries; /* Number of entries in header (4 bytes) */
|
||||
uint32_t size; /* Size of store (4 bytes) */
|
||||
} header;
|
||||
rpm_index *tmpindex;
|
||||
int storepos;
|
||||
|
||||
+10
-11
@@ -31,21 +31,21 @@
|
||||
|
||||
struct rpm_lead {
|
||||
unsigned char magic[4];
|
||||
u_int8_t major, minor;
|
||||
u_int16_t type;
|
||||
u_int16_t archnum;
|
||||
uint8_t major, minor;
|
||||
uint16_t type;
|
||||
uint16_t archnum;
|
||||
char name[66];
|
||||
u_int16_t osnum;
|
||||
u_int16_t signature_type;
|
||||
uint16_t osnum;
|
||||
uint16_t signature_type;
|
||||
char reserved[16];
|
||||
};
|
||||
|
||||
struct rpm_header {
|
||||
char magic[3]; /* 3 byte magic: 0x8e 0xad 0xe8 */
|
||||
u_int8_t version; /* 1 byte version number */
|
||||
u_int32_t reserved; /* 4 bytes reserved */
|
||||
u_int32_t entries; /* Number of entries in header (4 bytes) */
|
||||
u_int32_t size; /* Size of store (4 bytes) */
|
||||
uint8_t version; /* 1 byte version number */
|
||||
uint32_t reserved; /* 4 bytes reserved */
|
||||
uint32_t entries; /* Number of entries in header (4 bytes) */
|
||||
uint32_t size; /* Size of store (4 bytes) */
|
||||
};
|
||||
|
||||
void skip_header(int rpm_fd)
|
||||
@@ -96,10 +96,9 @@ extern int rpm2cpio_main(int argc, char **argv)
|
||||
}
|
||||
|
||||
check_header_gzip(rpm_fd);
|
||||
if (inflate(rpm_fd, fileno(stdout)) != 0) {
|
||||
if (inflate_gunzip(rpm_fd, fileno(stdout)) != 0) {
|
||||
bb_error_msg("Error inflating");
|
||||
}
|
||||
check_trailer_gzip(rpm_fd);
|
||||
|
||||
close(rpm_fd);
|
||||
|
||||
|
||||
+222
-103
@@ -308,21 +308,18 @@ static inline int writeTarHeader(struct TarBallInfo *tbInfo,
|
||||
if (tbInfo->verboseFlag) {
|
||||
FILE *vbFd = stdout;
|
||||
|
||||
if (tbInfo->verboseFlag == 2) /* If the archive goes to stdout, verbose to stderr */
|
||||
if (tbInfo->tarFd == fileno(stdout)) /* If the archive goes to stdout, verbose to stderr */
|
||||
vbFd = stderr;
|
||||
|
||||
fprintf(vbFd, "%s\n", header.name);
|
||||
}
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
# if defined CONFIG_FEATURE_TAR_EXCLUDE
|
||||
# ifdef CONFIG_FEATURE_TAR_FROM
|
||||
static inline int exclude_file(const llist_t *excluded_files, const char *file)
|
||||
{
|
||||
if (excluded_files == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (excluded_files) {
|
||||
if (excluded_files->data[0] == '/') {
|
||||
if (fnmatch(excluded_files->data, file,
|
||||
@@ -343,7 +340,7 @@ static inline int exclude_file(const llist_t *excluded_files, const char *file)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
|
||||
static int writeFileToTarball(const char *fileName, struct stat *statbuf,
|
||||
void *userData)
|
||||
@@ -399,11 +396,11 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf,
|
||||
if (header_name[0] == '\0')
|
||||
return TRUE;
|
||||
|
||||
# if defined CONFIG_FEATURE_TAR_EXCLUDE
|
||||
# ifdef CONFIG_FEATURE_TAR_FROM
|
||||
if (exclude_file(tbInfo->excludeList, header_name)) {
|
||||
return SKIP;
|
||||
}
|
||||
# endif /* CONFIG_FEATURE_TAR_EXCLUDE */
|
||||
# endif /* CONFIG_FEATURE_TAR_FROM */
|
||||
|
||||
if (writeTarHeader(tbInfo, header_name, fileName, statbuf) == FALSE) {
|
||||
return (FALSE);
|
||||
@@ -413,8 +410,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf,
|
||||
if ((tbInfo->hlInfo == NULL)
|
||||
&& (S_ISREG(statbuf->st_mode))) {
|
||||
int inputFileFd;
|
||||
char buffer[BUFSIZ];
|
||||
ssize_t size = 0, readSize = 0;
|
||||
ssize_t readSize = 0;
|
||||
|
||||
/* open the file we want to archive, and make sure all is well */
|
||||
if ((inputFileFd = open(fileName, O_RDONLY)) < 0) {
|
||||
@@ -423,18 +419,8 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf,
|
||||
}
|
||||
|
||||
/* write the file to the archive */
|
||||
while ((size = bb_full_read(inputFileFd, buffer, sizeof(buffer))) > 0) {
|
||||
if (bb_full_write(tbInfo->tarFd, buffer, size) != size) {
|
||||
/* Output file seems to have a problem */
|
||||
bb_error_msg(bb_msg_io_error, fileName);
|
||||
return (FALSE);
|
||||
}
|
||||
readSize += size;
|
||||
}
|
||||
if (size == -1) {
|
||||
bb_error_msg(bb_msg_io_error, fileName);
|
||||
return (FALSE);
|
||||
}
|
||||
readSize = bb_copyfd_eof(inputFileFd, tbInfo->tarFd);
|
||||
|
||||
/* Pad the file up to the tar block size */
|
||||
for (; (readSize % TAR_BLOCK_SIZE) != 0; readSize++) {
|
||||
write(tbInfo->tarFd, "\0", 1);
|
||||
@@ -445,8 +431,9 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf,
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
static inline int writeTarFile(const char *tarName, const int verboseFlag,
|
||||
const llist_t *include, const llist_t *exclude, const int gzip)
|
||||
static inline int writeTarFile(const int tar_fd, const int verboseFlag,
|
||||
const unsigned long dereferenceFlag, const llist_t *include,
|
||||
const llist_t *exclude, const int gzip)
|
||||
{
|
||||
#ifdef CONFIG_FEATURE_TAR_GZIP
|
||||
int gzipDataPipe[2] = { -1, -1 };
|
||||
@@ -461,31 +448,14 @@ static inline int writeTarFile(const char *tarName, const int verboseFlag,
|
||||
|
||||
tbInfo.hlInfoHead = NULL;
|
||||
|
||||
/* Make sure there is at least one file to tar up. */
|
||||
if (include == NULL) {
|
||||
bb_error_msg_and_die("Cowardly refusing to create an empty archive");
|
||||
}
|
||||
|
||||
/* Open the tar file for writing. */
|
||||
if (tarName == NULL || (tarName[0] == '-' && tarName[1] == '\0')) {
|
||||
tbInfo.tarFd = fileno(stdout);
|
||||
tbInfo.verboseFlag = verboseFlag ? 2 : 0;
|
||||
} else {
|
||||
unlink(tarName);
|
||||
tbInfo.tarFd = open(tarName, O_WRONLY | O_CREAT | O_EXCL, 0644);
|
||||
tbInfo.verboseFlag = verboseFlag ? 1 : 0;
|
||||
}
|
||||
|
||||
if (tbInfo.tarFd < 0) {
|
||||
bb_perror_msg("%s: Cannot open", tarName);
|
||||
freeHardLinkInfo(&tbInfo.hlInfoHead);
|
||||
return (FALSE);
|
||||
}
|
||||
fchmod(tar_fd, 0644);
|
||||
tbInfo.tarFd = tar_fd;
|
||||
tbInfo.verboseFlag = verboseFlag;
|
||||
|
||||
/* Store the stat info for the tarball's file, so
|
||||
* can avoid including the tarball into itself.... */
|
||||
if (fstat(tbInfo.tarFd, &tbInfo.statBuf) < 0)
|
||||
bb_error_msg_and_die(bb_msg_io_error, tarName);
|
||||
bb_perror_msg_and_die("Couldnt stat tar file");
|
||||
|
||||
#ifdef CONFIG_FEATURE_TAR_GZIP
|
||||
if (gzip) {
|
||||
@@ -547,7 +517,7 @@ static inline int writeTarFile(const char *tarName, const int verboseFlag,
|
||||
|
||||
/* Read the directory/files and iterate over them one at a time */
|
||||
while (include) {
|
||||
if (!recursive_action(include->data, TRUE, FALSE, FALSE,
|
||||
if (!recursive_action(include->data, TRUE, dereferenceFlag, FALSE,
|
||||
writeFileToTarball, writeFileToTarball,
|
||||
(void *) &tbInfo)) {
|
||||
errorFlag = TRUE;
|
||||
@@ -582,7 +552,7 @@ static inline int writeTarFile(const char *tarName, const int verboseFlag,
|
||||
}
|
||||
#endif /* tar_create */
|
||||
|
||||
#ifdef CONFIG_FEATURE_TAR_EXCLUDE
|
||||
#ifdef CONFIG_FEATURE_TAR_FROM
|
||||
static llist_t *append_file_list_to_list(llist_t *list)
|
||||
{
|
||||
FILE *src_stream;
|
||||
@@ -605,29 +575,127 @@ static llist_t *append_file_list_to_list(llist_t *list)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_TAR_COMPRESS
|
||||
static char get_header_tar_Z(archive_handle_t *archive_handle)
|
||||
{
|
||||
/* Cant lseek over pipe's */
|
||||
archive_handle->seek = seek_by_char;
|
||||
|
||||
static const char tar_options[]="ctxjT:X:C:f:Opvz";
|
||||
#define CTX_CREATE 1
|
||||
#define CTX_TEST 2
|
||||
#define CTX_EXTRACT 4
|
||||
#define TAR_OPT_BZIP2 8
|
||||
#define TAR_OPT_INCLUDE 16
|
||||
#define TAR_OPT_EXCLUDE 32
|
||||
#define TAR_OPT_BASEDIR 64
|
||||
#define TAR_OPT_ARNAME 128
|
||||
#define TAR_OPT_2STDOUT 256
|
||||
#define TAR_OPT_P 512
|
||||
#define TAR_OPT_VERBOSE 1024
|
||||
#define TAR_OPT_GZIP 2048
|
||||
/* do the decompression, and cleanup */
|
||||
if ((bb_xread_char(archive_handle->src_fd) != 0x1f) || (bb_xread_char(archive_handle->src_fd) != 0x9d)) {
|
||||
bb_error_msg_and_die("Invalid magic");
|
||||
}
|
||||
|
||||
archive_handle->src_fd = open_transformer(archive_handle->src_fd, uncompress);
|
||||
archive_handle->offset = 0;
|
||||
while (get_header_tar(archive_handle) == EXIT_SUCCESS);
|
||||
|
||||
/* Can only do one file at a time */
|
||||
return(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define CTX_TEST (1 << 0)
|
||||
#define CTX_EXTRACT (1 << 1)
|
||||
#define TAR_OPT_BASEDIR (1 << 2)
|
||||
#define TAR_OPT_TARNAME (1 << 3)
|
||||
#define TAR_OPT_2STDOUT (1 << 4)
|
||||
#define TAR_OPT_P (1 << 5)
|
||||
#define TAR_OPT_VERBOSE (1 << 6)
|
||||
#define TAR_OPT_KEEP_OLD (1 << 7)
|
||||
|
||||
#ifdef CONFIG_FEATURE_TAR_CREATE
|
||||
# define CTX_CREATE (1 << 8)
|
||||
# define TAR_OPT_DEREFERNCE (1 << 9)
|
||||
# define TAR_OPT_STR_CREATE "ch"
|
||||
# define TAR_OPT_FLAG_CREATE 2
|
||||
#else
|
||||
//# define CTX_CREATE 0
|
||||
# define TAR_OPT_STR_CREATE ""
|
||||
# define TAR_OPT_FLAG_CREATE 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_TAR_BZIP2
|
||||
# define TAR_OPT_BZIP2 (1 << (8 + TAR_OPT_FLAG_CREATE))
|
||||
# define TAR_OPT_STR_BZIP2 "j"
|
||||
# define TAR_OPT_FLAG_BZIP2 1
|
||||
#else
|
||||
# define TAR_OPT_STR_BZIP2 ""
|
||||
# define TAR_OPT_FLAG_BZIP2 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_TAR_FROM
|
||||
# define TAR_OPT_FROM_FILE (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
|
||||
#else
|
||||
# define TAR_OPT_STR_FROM ""
|
||||
# define TAR_OPT_FLAG_FROM 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_TAR_GZIP
|
||||
# define TAR_OPT_GZIP (1 << (8 + TAR_OPT_FLAG_CREATE + TAR_OPT_FLAG_BZIP2 + TAR_OPT_FLAG_FROM))
|
||||
# define TAR_OPT_STR_GZIP "z"
|
||||
# define TAR_OPT_FLAG_GZIP 1
|
||||
#else
|
||||
# define TAR_OPT_STR_GZIP ""
|
||||
# define TAR_OPT_FLAG_GZIP 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_TAR_COMPRESS
|
||||
# define TAR_OPT_UNCOMPRESS (1 << (8 + TAR_OPT_FLAG_CREATE + TAR_OPT_FLAG_BZIP2 + TAR_OPT_FLAG_FROM + TAR_OPT_FLAG_GZIP))
|
||||
# define TAR_OPT_STR_COMPRESS "Z"
|
||||
#else
|
||||
# define TAR_OPT_STR_COMPRESS ""
|
||||
#endif
|
||||
|
||||
static const char tar_options[]="txC:f:Opvk" \
|
||||
TAR_OPT_STR_CREATE \
|
||||
TAR_OPT_STR_BZIP2 \
|
||||
TAR_OPT_STR_FROM \
|
||||
TAR_OPT_STR_GZIP \
|
||||
TAR_OPT_STR_COMPRESS;
|
||||
|
||||
#ifdef CONFIG_FEATURE_TAR_LONG_OPTIONS
|
||||
static const struct option tar_long_options[] = {
|
||||
{ "list", 0, NULL, 't' },
|
||||
{ "extract", 0, NULL, 'x' },
|
||||
{ "directory", 1, NULL, 'C' },
|
||||
{ "file", 1, NULL, 'f' },
|
||||
{ "to-stdout", 0, NULL, 'O' },
|
||||
{ "same-permissions", 0, NULL, 'p' },
|
||||
{ "verbose", 0, NULL, 'v' },
|
||||
{ "keep-old", 0, NULL, 'k' },
|
||||
# ifdef CONFIG_FEATURE_TAR_CREATE
|
||||
{ "create", 0, NULL, 'c' },
|
||||
{ "dereference", 0, NULL, 'h' },
|
||||
# endif
|
||||
# ifdef CONFIG_FEATURE_TAR_BZIP2
|
||||
{ "bzip2", 0, NULL, 'j' },
|
||||
# endif
|
||||
# ifdef CONFIG_FEATURE_TAR_FROM
|
||||
{ "from-file", 1, NULL, 'T' },
|
||||
{ "exclude-from", 1, NULL, 'X' },
|
||||
# endif
|
||||
# ifdef CONFIG_FEATURE_TAR_GZIP
|
||||
{ "gzip", 0, NULL, 'z' },
|
||||
# endif
|
||||
# ifdef CONFIG_FEATURE_TAR_COMPRESS
|
||||
{ "compress", 0, NULL, 'Z' },
|
||||
# endif
|
||||
{ 0, 0, 0, 0 }
|
||||
};
|
||||
#endif
|
||||
|
||||
int tar_main(int argc, char **argv)
|
||||
{
|
||||
char (*get_header_ptr)(archive_handle_t *) = get_header_tar;
|
||||
archive_handle_t *tar_handle;
|
||||
int opt;
|
||||
char *base_dir = NULL;
|
||||
const char *tar_filename = "-";
|
||||
unsigned char ctx_flag = 0;
|
||||
unsigned long opt;
|
||||
unsigned long ctx_flag = 0;
|
||||
|
||||
if (argc < 2) {
|
||||
bb_show_usage();
|
||||
@@ -643,59 +711,84 @@ int tar_main(int argc, char **argv)
|
||||
|
||||
/* Initialise default values */
|
||||
tar_handle = init_handle();
|
||||
tar_handle->flags = ARCHIVE_CREATE_LEADING_DIRS | ARCHIVE_PRESERVE_DATE;
|
||||
tar_handle->flags = ARCHIVE_CREATE_LEADING_DIRS | ARCHIVE_PRESERVE_DATE | ARCHIVE_EXTRACT_UNCONDITIONAL;
|
||||
|
||||
bb_opt_complementaly = "c~tx:t~cx:x~ct:X*:T*";
|
||||
#ifdef CONFIG_FEATURE_TAR_LONG_OPTIONS
|
||||
bb_applet_long_options = tar_long_options;
|
||||
#endif
|
||||
|
||||
bb_opt_complementaly = "c~tx:t~cx:x~ct:X*";
|
||||
opt = bb_getopt_ulflags(argc, argv, tar_options,
|
||||
NULL, /* T: arg is ignored by default
|
||||
a list is an include list */
|
||||
&(tar_handle->reject),
|
||||
&base_dir, /* Change to dir <optarg> */
|
||||
&tar_filename); /* archive filename */
|
||||
&tar_filename /* archive filename */
|
||||
#ifdef CONFIG_FEATURE_TAR_FROM
|
||||
, NULL,
|
||||
&(tar_handle->reject)
|
||||
#endif
|
||||
);
|
||||
|
||||
/* Check one and only one context option was given */
|
||||
if(opt & 0x80000000UL)
|
||||
if(opt & 0x80000000UL) {
|
||||
bb_show_usage();
|
||||
}
|
||||
#ifdef CONFIG_FEATURE_TAR_CREATE
|
||||
ctx_flag = opt & (CTX_CREATE | CTX_TEST | CTX_EXTRACT);
|
||||
#else
|
||||
ctx_flag = opt & (CTX_TEST | CTX_EXTRACT);
|
||||
#endif
|
||||
if (ctx_flag == 0) {
|
||||
bb_show_usage();
|
||||
}
|
||||
if(ctx_flag & CTX_TEST) {
|
||||
if ((tar_handle->action_header == header_list) ||
|
||||
(tar_handle->action_header == header_verbose_list)) {
|
||||
tar_handle->action_header = header_verbose_list;
|
||||
} else {
|
||||
tar_handle->action_header = header_list;
|
||||
}
|
||||
if ((tar_handle->action_header == header_list) ||
|
||||
(tar_handle->action_header == header_verbose_list)) {
|
||||
tar_handle->action_header = header_verbose_list;
|
||||
} else {
|
||||
tar_handle->action_header = header_list;
|
||||
}
|
||||
}
|
||||
if(ctx_flag & CTX_EXTRACT) {
|
||||
if (tar_handle->action_data != data_extract_to_stdout)
|
||||
tar_handle->action_data = data_extract_all;
|
||||
}
|
||||
tar_handle->action_data = data_extract_all;
|
||||
}
|
||||
if(opt & TAR_OPT_2STDOUT) {
|
||||
/* To stdout */
|
||||
tar_handle->action_data = data_extract_to_stdout;
|
||||
tar_handle->action_data = data_extract_to_stdout;
|
||||
}
|
||||
if(opt & TAR_OPT_VERBOSE) {
|
||||
if ((tar_handle->action_header == header_list) ||
|
||||
(tar_handle->action_header == header_verbose_list))
|
||||
{
|
||||
tar_handle->action_header = header_verbose_list;
|
||||
} else {
|
||||
tar_handle->action_header = header_list;
|
||||
}
|
||||
if ((tar_handle->action_header == header_list) ||
|
||||
(tar_handle->action_header == header_verbose_list))
|
||||
{
|
||||
tar_handle->action_header = header_verbose_list;
|
||||
} else {
|
||||
tar_handle->action_header = header_list;
|
||||
}
|
||||
}
|
||||
if (opt & TAR_OPT_KEEP_OLD) {
|
||||
tar_handle->flags &= ~ARCHIVE_EXTRACT_UNCONDITIONAL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FEATURE_TAR_GZIP
|
||||
if(opt & TAR_OPT_GZIP) {
|
||||
get_header_ptr = get_header_tar_gz;
|
||||
get_header_ptr = get_header_tar_gz;
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_TAR_BZIP2
|
||||
if(opt & TAR_OPT_BZIP2) {
|
||||
get_header_ptr = get_header_tar_bz2;
|
||||
get_header_ptr = get_header_tar_bz2;
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_TAR_EXCLUDE
|
||||
if(opt & TAR_OPT_EXCLUDE) {
|
||||
#ifdef CONFIG_FEATURE_TAR_COMPRESS
|
||||
if(opt & TAR_OPT_UNCOMPRESS) {
|
||||
get_header_ptr = get_header_tar_Z;
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_TAR_FROM
|
||||
if(opt & TAR_OPT_EXCLUDE_FROM) {
|
||||
tar_handle->reject = append_file_list_to_list(tar_handle->reject);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Check if we are reading from stdin */
|
||||
if ((argv[optind]) && (*argv[optind] == '-')) {
|
||||
/* Default is to read from stdin, so just skip to next arg */
|
||||
@@ -705,6 +798,10 @@ 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 ? */
|
||||
while (optind < argc) {
|
||||
char *filename_ptr = last_char_is(argv[optind], '/');
|
||||
if (filename_ptr) {
|
||||
*filename_ptr = '\0';
|
||||
}
|
||||
tar_handle->accept = llist_add_to(tar_handle->accept, argv[optind]);
|
||||
optind++;
|
||||
}
|
||||
@@ -713,9 +810,42 @@ int tar_main(int argc, char **argv)
|
||||
tar_handle->filter = filter_accept_reject_list;
|
||||
}
|
||||
|
||||
/* Open the tar file */
|
||||
{
|
||||
FILE *tar_stream;
|
||||
int flags;
|
||||
|
||||
#ifdef CONFIG_FEATURE_TAR_CREATE
|
||||
if (opt & CTX_CREATE) {
|
||||
/* Make sure there is at least one file to tar up. */
|
||||
if (tar_handle->accept == NULL) {
|
||||
bb_error_msg_and_die("Cowardly refusing to create an empty archive");
|
||||
}
|
||||
tar_stream = stdout;
|
||||
flags = O_WRONLY | O_CREAT | O_EXCL;
|
||||
unlink(tar_filename);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
tar_stream = stdin;
|
||||
flags = O_RDONLY;
|
||||
}
|
||||
|
||||
if ((tar_filename[0] == '-') && (tar_filename[1] == '\0')) {
|
||||
tar_handle->src_fd = fileno(tar_stream);
|
||||
tar_handle->seek = seek_by_char;
|
||||
} else {
|
||||
tar_handle->src_fd = bb_xopen(tar_filename, flags);
|
||||
}
|
||||
}
|
||||
|
||||
if ((base_dir) && (chdir(base_dir))) {
|
||||
bb_perror_msg_and_die("Couldnt chdir to %s", base_dir);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FEATURE_TAR_CREATE
|
||||
/* create an archive */
|
||||
if (ctx_flag == CTX_CREATE) {
|
||||
if (opt & CTX_CREATE) {
|
||||
int verboseFlag = FALSE;
|
||||
int gzipFlag = FALSE;
|
||||
|
||||
@@ -734,22 +864,11 @@ int tar_main(int argc, char **argv)
|
||||
(tar_handle->action_header == header_verbose_list)) {
|
||||
verboseFlag = TRUE;
|
||||
}
|
||||
writeTarFile(tar_filename, verboseFlag, tar_handle->accept,
|
||||
writeTarFile(tar_handle->src_fd, verboseFlag, opt & TAR_OPT_DEREFERNCE, tar_handle->accept,
|
||||
tar_handle->reject, gzipFlag);
|
||||
} else
|
||||
#endif /* CONFIG_FEATURE_TAR_CREATE */
|
||||
{
|
||||
if ((tar_filename[0] == '-') && (tar_filename[1] == '\0')) {
|
||||
tar_handle->src_fd = fileno(stdin);
|
||||
tar_handle->seek = seek_by_char;
|
||||
} else {
|
||||
tar_handle->src_fd = bb_xopen(tar_filename, O_RDONLY);
|
||||
}
|
||||
|
||||
if ((base_dir) && (chdir(base_dir))) {
|
||||
bb_perror_msg_and_die("Couldnt chdir");
|
||||
}
|
||||
|
||||
while (get_header_ptr(tar_handle) == EXIT_SUCCESS);
|
||||
|
||||
/* Ckeck that every file that should have been extracted was */
|
||||
|
||||
+4
-5
@@ -199,7 +199,8 @@ extern int unzip_main(int argc, char **argv)
|
||||
archive_handle->action_data(archive_handle);
|
||||
} else {
|
||||
dst_fd = bb_xopen(archive_handle->file_header->name, O_WRONLY | O_CREAT);
|
||||
inflate(archive_handle->src_fd, dst_fd);
|
||||
inflate_init(zip_header.formated.cmpsize);
|
||||
inflate_unzip(archive_handle->src_fd, dst_fd);
|
||||
close(dst_fd);
|
||||
chmod(archive_handle->file_header->name, archive_handle->file_header->mode);
|
||||
|
||||
@@ -227,10 +228,8 @@ extern int unzip_main(int argc, char **argv)
|
||||
/* Data descriptor section */
|
||||
if (zip_header.formated.flags & 4) {
|
||||
/* skip over duplicate crc, compressed size and uncompressed size */
|
||||
unsigned short i;
|
||||
for (i = 0; i != 12; i++) {
|
||||
archive_xread_char(archive_handle);
|
||||
}
|
||||
unsigned char data_description[12];
|
||||
archive_xread_all(archive_handle, data_description, 12);
|
||||
archive_handle->offset += 12;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,12 +31,6 @@ config CONFIG_DUMPKMAP
|
||||
This program dumps the kernel's keyboard translation table to
|
||||
stdout, in binary format. You can then use loadkmap to load it.
|
||||
|
||||
config CONFIG_LOADACM
|
||||
bool "loadacm"
|
||||
default n
|
||||
help
|
||||
This program loads an acm from standard input.
|
||||
|
||||
config CONFIG_LOADFONT
|
||||
bool "loadfont"
|
||||
default n
|
||||
|
||||
@@ -27,7 +27,6 @@ CONSOLETOOLS_DIR-$(CONFIG_CHVT) += chvt.o
|
||||
CONSOLETOOLS_DIR-$(CONFIG_CLEAR) += clear.o
|
||||
CONSOLETOOLS_DIR-$(CONFIG_DEALLOCVT) += deallocvt.o
|
||||
CONSOLETOOLS_DIR-$(CONFIG_DUMPKMAP) += dumpkmap.o
|
||||
CONSOLETOOLS_DIR-$(CONFIG_LOADACM) += loadacm.o
|
||||
CONSOLETOOLS_DIR-$(CONFIG_LOADFONT) += loadfont.o
|
||||
CONSOLETOOLS_DIR-$(CONFIG_LOADKMAP) += loadkmap.o
|
||||
CONSOLETOOLS_DIR-$(CONFIG_OPENVT) += openvt.o
|
||||
|
||||
+25
-7
@@ -1,11 +1,25 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* chvt.c - aeb - 940227 - Change virtual terminal
|
||||
* Mini chvt implementation for busybox
|
||||
*
|
||||
* busyboxed by Erik Andersen
|
||||
* Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* getopt not needed */
|
||||
/* no options, no getopt */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -22,14 +36,18 @@ int chvt_main(int argc, char **argv)
|
||||
{
|
||||
int fd, num;
|
||||
|
||||
if ((argc != 2) || (**(argv + 1) == '-'))
|
||||
if (argc != 2) {
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
fd = get_console_fd();
|
||||
num = atoi(argv[1]);
|
||||
if (ioctl(fd, VT_ACTIVATE, num))
|
||||
num = bb_xgetlarg(argv[1], 10, 0, INT_MAX);
|
||||
if (ioctl(fd, VT_ACTIVATE, num)) {
|
||||
bb_perror_msg_and_die("VT_ACTIVATE");
|
||||
if (ioctl(fd, VT_WAITACTIVE, num))
|
||||
}
|
||||
if (ioctl(fd, VT_WAITACTIVE, num)) {
|
||||
bb_perror_msg_and_die("VT_WAITACTIVE");
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* no options, no getopt */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "busybox.h"
|
||||
|
||||
+34
-24
@@ -1,8 +1,27 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* disalloc.c - aeb - 940501 - Disallocate virtual terminal(s)
|
||||
* Renamed deallocvt.
|
||||
* Disallocate virtual terminal(s)
|
||||
*
|
||||
* Copyright (C) 2003 by Tito Ragusa <farmatito@tiscali.it>
|
||||
* Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* no options, no getopt */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
@@ -15,32 +34,23 @@ static const int VT_DISALLOCATE = 0x5608; /* free memory associated to vt */
|
||||
|
||||
int deallocvt_main(int argc, char *argv[])
|
||||
{
|
||||
int fd, num=0;
|
||||
/* num = 0 deallocate all unused consoles */
|
||||
int num = 0;
|
||||
|
||||
if (argc > 2)
|
||||
bb_show_usage();
|
||||
|
||||
fd = get_console_fd();
|
||||
|
||||
/* num=0 deallocate all unused consoles */
|
||||
if (argc == 1)
|
||||
goto disallocate_all;
|
||||
|
||||
num=bb_xgetlarg(argv[1], 10, 0, INT_MAX);
|
||||
|
||||
switch(num)
|
||||
switch(argc)
|
||||
{
|
||||
case 0:
|
||||
bb_error_msg("0: illegal VT number");
|
||||
break;
|
||||
case 2:
|
||||
if((num = bb_xgetlarg(argv[1], 10, 0, INT_MAX)) == 0)
|
||||
bb_error_msg_and_die("0: illegal VT number");
|
||||
/* Falltrough */
|
||||
case 1:
|
||||
bb_error_msg("VT 1 cannot be deallocated");
|
||||
break;
|
||||
default:
|
||||
disallocate_all:
|
||||
if (ioctl(fd, VT_DISALLOCATE, num))
|
||||
bb_perror_msg_and_die("VT_DISALLOCATE");
|
||||
return EXIT_SUCCESS;
|
||||
bb_show_usage();
|
||||
}
|
||||
return EXIT_FAILURE;
|
||||
|
||||
if (ioctl( get_console_fd(), VT_DISALLOCATE, num )) {
|
||||
bb_perror_msg_and_die("VT_DISALLOCATE");
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -51,11 +51,7 @@ int dumpkmap_main(int argc, char **argv)
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
fd = open(CURRENT_VC, O_RDWR);
|
||||
if (fd < 0) {
|
||||
bb_perror_msg("Error opening " CURRENT_VC);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
fd=bb_xopen(CURRENT_VC, O_RDWR);
|
||||
|
||||
write(1, magic, 7);
|
||||
|
||||
|
||||
@@ -1,357 +0,0 @@
|
||||
/* vi: set sw=4 ts=4: */
|
||||
/*
|
||||
* Derived from
|
||||
* mapscrn.c - version 0.92
|
||||
*
|
||||
* Was taken from console-tools and adapted by
|
||||
* Peter Novodvorsky <petya@logic.ru>
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <memory.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <sys/kd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include "busybox.h"
|
||||
|
||||
typedef unsigned short unicode;
|
||||
|
||||
static long int ctoi(unsigned char *s, int *is_unicode);
|
||||
static int old_screen_map_read_ascii(FILE * fp, unsigned char buf[]);
|
||||
static int uni_screen_map_read_ascii(FILE * fp, unicode buf[], int *is_unicode);
|
||||
static unicode utf8_to_ucs2(char *buf);
|
||||
static int screen_map_load(int fd, FILE * fp);
|
||||
|
||||
int loadacm_main(int argc, char **argv)
|
||||
{
|
||||
int fd;
|
||||
|
||||
if (argc>=2 && *argv[1]=='-') {
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
fd = open(CURRENT_VC, O_RDWR);
|
||||
if (fd < 0) {
|
||||
bb_perror_msg_and_die("Error opening " CURRENT_VC);
|
||||
}
|
||||
|
||||
if (screen_map_load(fd, stdin)) {
|
||||
bb_perror_msg_and_die("Error loading acm");
|
||||
}
|
||||
|
||||
write(fd, "\033(K", 3);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
static int screen_map_load(int fd, FILE * fp)
|
||||
{
|
||||
struct stat stbuf;
|
||||
unicode wbuf[E_TABSZ];
|
||||
unsigned char buf[E_TABSZ];
|
||||
int parse_failed = 0;
|
||||
int is_unicode;
|
||||
|
||||
if (fstat(fileno(fp), &stbuf))
|
||||
bb_perror_msg_and_die("Cannot stat map file");
|
||||
|
||||
/* first try a UTF screen-map: either ASCII (no restriction) or binary (regular file) */
|
||||
if (!
|
||||
(parse_failed =
|
||||
(-1 == uni_screen_map_read_ascii(fp, wbuf, &is_unicode)))
|
||||
|| (S_ISREG(stbuf.st_mode) && (stbuf.st_size == (sizeof(unicode) * E_TABSZ)))) { /* test for binary UTF map by size */
|
||||
if (parse_failed) {
|
||||
if (-1 == fseek(fp, 0, SEEK_SET)) {
|
||||
if (errno == ESPIPE)
|
||||
bb_error_msg_and_die("16bit screen-map MUST be a regular file.");
|
||||
else
|
||||
bb_perror_msg_and_die("fseek failed reading binary 16bit screen-map");
|
||||
}
|
||||
|
||||
if (fread(wbuf, sizeof(unicode) * E_TABSZ, 1, fp) != 1)
|
||||
bb_perror_msg_and_die("Cannot read [new] map from file");
|
||||
#if 0
|
||||
else
|
||||
bb_error_msg("Input screen-map is binary.");
|
||||
#endif
|
||||
}
|
||||
|
||||
/* if it was effectively a 16-bit ASCII, OK, else try to read as 8-bit map */
|
||||
/* same if it was binary, ie. if parse_failed */
|
||||
if (parse_failed || is_unicode) {
|
||||
if (ioctl(fd, PIO_UNISCRNMAP, wbuf))
|
||||
bb_perror_msg_and_die("PIO_UNISCRNMAP ioctl");
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* rewind... */
|
||||
if (-1 == fseek(fp, 0, SEEK_SET)) {
|
||||
if (errno == ESPIPE)
|
||||
bb_error_msg("Assuming 8bit screen-map - MUST be a regular file."),
|
||||
exit(1);
|
||||
else
|
||||
bb_perror_msg_and_die("fseek failed assuming 8bit screen-map");
|
||||
}
|
||||
|
||||
/* ... and try an old 8-bit screen-map */
|
||||
if (!(parse_failed = (-1 == old_screen_map_read_ascii(fp, buf))) ||
|
||||
(S_ISREG(stbuf.st_mode) && (stbuf.st_size == E_TABSZ))) { /* test for binary old 8-bit map by size */
|
||||
if (parse_failed) {
|
||||
if (-1 == fseek(fp, 0, SEEK_SET)) {
|
||||
if (errno == ESPIPE)
|
||||
/* should not - it succedeed above */
|
||||
bb_error_msg_and_die("fseek() returned ESPIPE !");
|
||||
else
|
||||
bb_perror_msg_and_die("fseek for binary 8bit screen-map");
|
||||
}
|
||||
|
||||
if (fread(buf, E_TABSZ, 1, fp) != 1)
|
||||
bb_perror_msg_and_die("Cannot read [old] map from file");
|
||||
#if 0
|
||||
else
|
||||
bb_error_msg("Input screen-map is binary.");
|
||||
#endif
|
||||
}
|
||||
|
||||
if (ioctl(fd, PIO_SCRNMAP, buf))
|
||||
bb_perror_msg_and_die("PIO_SCRNMAP ioctl");
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
bb_error_msg("Error parsing symbolic map");
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* - reads `fp' as a 16-bit ASCII SFM file.
|
||||
* - returns -1 on error.
|
||||
* - returns it in `unicode' in an E_TABSZ-elements array.
|
||||
* - sets `*is_unicode' flagiff there were any non-8-bit
|
||||
* (ie. real 16-bit) mapping.
|
||||
*
|
||||
* FIXME: ignores everything after second word
|
||||
*/
|
||||
static int uni_screen_map_read_ascii(FILE * fp, unicode buf[], int *is_unicode)
|
||||
{
|
||||
char buffer[256]; /* line buffer reading file */
|
||||
char *p, *q; /* 1st + 2nd words in line */
|
||||
int in, on; /* the same, as numbers */
|
||||
int tmp_is_unicode; /* tmp for is_unicode calculation */
|
||||
int i; /* loop index - result holder */
|
||||
int ret_code = 0; /* return code */
|
||||
sigset_t acmsigset, old_sigset;
|
||||
|
||||
assert(is_unicode);
|
||||
|
||||
*is_unicode = 0;
|
||||
|
||||
/* first 128 codes defaults to ASCII */
|
||||
for (i = 0; i < 128; i++)
|
||||
buf[i] = i;
|
||||
/* remaining defaults to replacement char (usually E_TABSZ = 256) */
|
||||
for (; i < E_TABSZ; i++)
|
||||
buf[i] = 0xfffd;
|
||||
|
||||
/* block SIGCHLD */
|
||||
sigemptyset(&acmsigset);
|
||||
sigaddset(&acmsigset, SIGCHLD);
|
||||
sigprocmask(SIG_BLOCK, &acmsigset, &old_sigset);
|
||||
|
||||
do {
|
||||
if (NULL == fgets(buffer, sizeof(buffer), fp)) {
|
||||
if (feof(fp))
|
||||
break;
|
||||
else
|
||||
bb_perror_msg_and_die("uni_screen_map_read_ascii() can't read line");
|
||||
}
|
||||
|
||||
/* get "charset-relative charcode", stripping leading spaces */
|
||||
p = strtok(buffer, " \t\n");
|
||||
|
||||
/* skip empty lines and comments */
|
||||
if (!p || *p == '#')
|
||||
continue;
|
||||
|
||||
/* get unicode mapping */
|
||||
q = strtok(NULL, " \t\n");
|
||||
if (q) {
|
||||
in = ctoi(p, NULL);
|
||||
if (in < 0 || in > 255) {
|
||||
ret_code = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
on = ctoi(q, &tmp_is_unicode);
|
||||
if (in < 0 && on > 65535) {
|
||||
ret_code = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
*is_unicode |= tmp_is_unicode;
|
||||
buf[in] = on;
|
||||
} else {
|
||||
ret_code = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (1); /* terminated by break on feof() */
|
||||
|
||||
/* restore sig mask */
|
||||
sigprocmask(SIG_SETMASK, &old_sigset, NULL);
|
||||
|
||||
return ret_code;
|
||||
}
|
||||
|
||||
|
||||
static int old_screen_map_read_ascii(FILE * fp, unsigned char buf[])
|
||||
{
|
||||
char buffer[256];
|
||||
int in, on;
|
||||
char *p, *q;
|
||||
|
||||
for (in = 0; in < 256; in++)
|
||||
buf[in] = in;
|
||||
|
||||
while (fgets(buffer, sizeof(buffer) - 1, fp)) {
|
||||
p = strtok(buffer, " \t\n");
|
||||
|
||||
if (!p || *p == '#')
|
||||
continue;
|
||||
|
||||
q = strtok(NULL, " \t\n#");
|
||||
if (q) {
|
||||
in = ctoi(p, NULL);
|
||||
if (in < 0 || in > 255)
|
||||
return -1;
|
||||
|
||||
on = ctoi(q, NULL);
|
||||
if (in < 0 && on > 255)
|
||||
return -1;
|
||||
|
||||
buf[in] = on;
|
||||
} else
|
||||
return -1;
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* - converts a string into an int.
|
||||
* - supports dec and hex bytes, hex UCS2, single-quoted byte and UTF8 chars.
|
||||
* - returns the converted value
|
||||
* - if `is_unicode != NULL', use it to tell whether it was unicode
|
||||
*
|
||||
* CAVEAT: will report valid UTF mappings using only 1 byte as 8-bit ones.
|
||||
*/
|
||||
static long int ctoi(unsigned char *s, int *is_unicode)
|
||||
{
|
||||
int i;
|
||||
size_t ls;
|
||||
|
||||
ls = strlen(s);
|
||||
if (is_unicode)
|
||||
*is_unicode = 0;
|
||||
|
||||
/* hex-specified UCS2 */
|
||||
if ((strncmp(s, "U+", 2) == 0) &&
|
||||
(strspn(s + 2, "0123456789abcdefABCDEF") == ls - 2)) {
|
||||
sscanf(s + 2, "%x", &i);
|
||||
if (is_unicode)
|
||||
*is_unicode = 1;
|
||||
}
|
||||
|
||||
/* hex-specified byte */
|
||||
else if ((ls <= 4) && (strncmp(s, "0x", 2) == 0) &&
|
||||
(strspn(s + 2, "0123456789abcdefABCDEF") == ls - 2))
|
||||
sscanf(s + 2, "%x", &i);
|
||||
|
||||
/* oct-specified number (byte) */
|
||||
else if ((*s == '0') && (strspn(s, "01234567") == ls))
|
||||
sscanf(s, "%o", &i);
|
||||
|
||||
/* dec-specified number (byte) */
|
||||
else if (strspn(s, "0123456789") == ls)
|
||||
sscanf(s, "%d", &i);
|
||||
|
||||
/* single-byte quoted char */
|
||||
else if ((strlen(s) == 3) && (s[0] == '\'') && (s[2] == '\''))
|
||||
i = s[1];
|
||||
|
||||
/* multi-byte UTF8 quoted char */
|
||||
else if ((s[0] == '\'') && (s[ls - 1] == '\'')) {
|
||||
s[ls - 1] = 0; /* ensure we'll not "parse UTF too far" */
|
||||
i = utf8_to_ucs2(s + 1);
|
||||
if (is_unicode)
|
||||
*is_unicode = 1;
|
||||
} else
|
||||
return (-1);
|
||||
|
||||
return (i);
|
||||
}
|
||||
|
||||
|
||||
static unicode utf8_to_ucs2(char *buf)
|
||||
{
|
||||
int utf_count = 0;
|
||||
long utf_char = 0;
|
||||
unicode tc = 0;
|
||||
unsigned char c;
|
||||
|
||||
do {
|
||||
c = *buf;
|
||||
buf++;
|
||||
|
||||
/* if byte should be part of multi-byte sequence */
|
||||
if (c & 0x80) {
|
||||
/* if we have already started to parse a UTF8 sequence */
|
||||
if (utf_count > 0 && (c & 0xc0) == 0x80) {
|
||||
utf_char = (utf_char << 6) | (c & 0x3f);
|
||||
utf_count--;
|
||||
if (utf_count == 0)
|
||||
tc = utf_char;
|
||||
else
|
||||
continue;
|
||||
} else { /* Possibly 1st char of a UTF8 sequence */
|
||||
|
||||
if ((c & 0xe0) == 0xc0) {
|
||||
utf_count = 1;
|
||||
utf_char = (c & 0x1f);
|
||||
} else if ((c & 0xf0) == 0xe0) {
|
||||
utf_count = 2;
|
||||
utf_char = (c & 0x0f);
|
||||
} else if ((c & 0xf8) == 0xf0) {
|
||||
utf_count = 3;
|
||||
utf_char = (c & 0x07);
|
||||
} else if ((c & 0xfc) == 0xf8) {
|
||||
utf_count = 4;
|
||||
utf_char = (c & 0x03);
|
||||
} else if ((c & 0xfe) == 0xfc) {
|
||||
utf_count = 5;
|
||||
utf_char = (c & 0x01);
|
||||
} else
|
||||
utf_count = 0;
|
||||
continue;
|
||||
}
|
||||
} else { /* not part of multi-byte sequence - treat as ASCII
|
||||
* this makes incomplete sequences to be ignored
|
||||
*/
|
||||
tc = c;
|
||||
utf_count = 0;
|
||||
}
|
||||
}
|
||||
while (utf_count);
|
||||
|
||||
return tc;
|
||||
}
|
||||
@@ -46,9 +46,7 @@ extern int loadfont_main(int argc, char **argv)
|
||||
if (argc != 1)
|
||||
bb_show_usage();
|
||||
|
||||
fd = open(CURRENT_VC, O_RDWR);
|
||||
if (fd < 0)
|
||||
bb_perror_msg_and_die("Error opening " CURRENT_VC);
|
||||
fd = bb_xopen(CURRENT_VC, O_RDWR);
|
||||
loadnewfont(fd);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
+13
-20
@@ -37,43 +37,35 @@ struct kbentry {
|
||||
unsigned char kb_index;
|
||||
unsigned short kb_value;
|
||||
};
|
||||
static const int KDSKBENT = 0x4B47; /* sets one entry in translation table */
|
||||
/* sets one entry in translation table */
|
||||
#define KDSKBENT 0x4B47
|
||||
|
||||
/* From <linux/keyboard.h> */
|
||||
static const int NR_KEYS = 128;
|
||||
static const int MAX_NR_KEYMAPS = 256;
|
||||
#define NR_KEYS 128
|
||||
#define MAX_NR_KEYMAPS 256
|
||||
|
||||
int loadkmap_main(int argc, char **argv)
|
||||
{
|
||||
struct kbentry ke;
|
||||
u_short *ibuff;
|
||||
int i, j, fd, readsz, pos, ibuffsz = NR_KEYS * sizeof(u_short);
|
||||
char flags[MAX_NR_KEYMAPS], buff[7];
|
||||
int i, j, fd;
|
||||
u_short ibuff[NR_KEYS];
|
||||
char flags[MAX_NR_KEYMAPS];
|
||||
char buff[7];
|
||||
|
||||
if (argc != 1)
|
||||
bb_show_usage();
|
||||
|
||||
fd = open(CURRENT_VC, O_RDWR);
|
||||
if (fd < 0)
|
||||
bb_perror_msg_and_die("Error opening " CURRENT_VC);
|
||||
fd = bb_xopen(CURRENT_VC, O_RDWR);
|
||||
|
||||
read(0, buff, 7);
|
||||
if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7))
|
||||
if ((bb_full_read(0, buff, 7) != 7) || (strncmp(buff, BINARY_KEYMAP_MAGIC, 7) != 0))
|
||||
bb_error_msg_and_die("This is not a valid binary keymap.");
|
||||
|
||||
if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS))
|
||||
if (bb_full_read(0, flags, MAX_NR_KEYMAPS) != MAX_NR_KEYMAPS)
|
||||
bb_perror_msg_and_die("Error reading keymap flags");
|
||||
|
||||
ibuff = (u_short *) xmalloc(ibuffsz);
|
||||
|
||||
for (i = 0; i < MAX_NR_KEYMAPS; i++) {
|
||||
if (flags[i] == 1) {
|
||||
pos = 0;
|
||||
while (pos < ibuffsz) {
|
||||
if ((readsz = read(0, (char *) ibuff + pos, ibuffsz - pos)) < 0)
|
||||
bb_perror_msg_and_die("Error reading keymap");
|
||||
pos += readsz;
|
||||
}
|
||||
bb_full_read(0, ibuff, NR_KEYS * sizeof(u_short));
|
||||
for (j = 0; j < NR_KEYS; j++) {
|
||||
ke.kb_index = j;
|
||||
ke.kb_table = i;
|
||||
@@ -82,6 +74,7 @@ int loadkmap_main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Don't bother to close files. Exit does that
|
||||
* automagically, so we can save a few bytes */
|
||||
/* close(fd); */
|
||||
|
||||
+5
-18
@@ -32,34 +32,22 @@
|
||||
|
||||
#include "busybox.h"
|
||||
|
||||
#define VTNAME "/dev/tty%d"
|
||||
|
||||
int openvt_main(int argc, char **argv)
|
||||
{
|
||||
int pid;
|
||||
int fd;
|
||||
int vtno;
|
||||
char vtname[sizeof VTNAME + 2];
|
||||
char vtname[sizeof VC_FORMAT + 2];
|
||||
|
||||
|
||||
if (argc < 3)
|
||||
bb_show_usage();
|
||||
|
||||
if (!isdigit(argv[1][0]))
|
||||
bb_show_usage();
|
||||
|
||||
vtno = (int) atol(argv[1]);
|
||||
|
||||
/* if (vtno <= 0 || vtno > 63) */
|
||||
if (vtno <= 0 || vtno > 12)
|
||||
bb_error_msg_and_die("Illegal vt number (%d)", vtno);
|
||||
|
||||
sprintf(vtname, VTNAME, vtno);
|
||||
/* check for Illegal vt number: < 1 or > 12 */
|
||||
sprintf(vtname, VC_FORMAT,(int)bb_xgetlarg(argv[1], 10, 1, 12));
|
||||
|
||||
argv+=2;
|
||||
argc-=2;
|
||||
|
||||
if((pid = fork()) == 0) {
|
||||
if(fork() == 0) {
|
||||
/* leave current vt */
|
||||
|
||||
#ifdef ESIX_5_3_2_D
|
||||
@@ -73,8 +61,7 @@ int openvt_main(int argc, char **argv)
|
||||
close(0); /* so that new vt becomes stdin */
|
||||
|
||||
/* and grab new one */
|
||||
if ((fd = open(vtname, O_RDWR)) == -1)
|
||||
bb_perror_msg_and_die("could not open %s", vtname);
|
||||
fd = bb_xopen(vtname, O_RDWR);
|
||||
|
||||
/* Reassign stdout and sterr */
|
||||
close(1);
|
||||
|
||||
+14
-2
@@ -21,13 +21,25 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* no options, no getopt */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include "busybox.h"
|
||||
|
||||
extern int reset_main(int argc, char **argv)
|
||||
{
|
||||
printf("\033[?25h\033c\033[J");
|
||||
return EXIT_SUCCESS;
|
||||
if (isatty(0) || isatty(0) || isatty(0)) {
|
||||
/* See 'man 4 console_codes' for details:
|
||||
* "ESC c" -- Reset
|
||||
* "ESC ( K" -- Select user mapping
|
||||
* "ESC [ J" -- Erase display
|
||||
* "ESC [ 0 m" -- Reset all Graphics Rendition display attributes
|
||||
* "ESC [ ? 25 h" -- Make cursor visible.
|
||||
*/
|
||||
printf("\033c\033(K\033[J\033[0m\033[?25h");
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
+36
-33
@@ -17,7 +17,7 @@ config CONFIG_CAL
|
||||
bool "cal"
|
||||
default n
|
||||
help
|
||||
cal is used to display a montly calender.
|
||||
cal is used to display a monthly calender.
|
||||
|
||||
config CONFIG_CAT
|
||||
bool "cat"
|
||||
@@ -30,7 +30,7 @@ config CONFIG_CHGRP
|
||||
bool "chgrp"
|
||||
default n
|
||||
help
|
||||
chgrp is used to change the group owership of files.
|
||||
chgrp is used to change the group ownership of files.
|
||||
|
||||
config CONFIG_CHMOD
|
||||
bool "chmod"
|
||||
@@ -42,7 +42,7 @@ config CONFIG_CHOWN
|
||||
bool "chown"
|
||||
default n
|
||||
help
|
||||
chown is used too change the user and/or group ownership
|
||||
chown is used to change the user and/or group ownership
|
||||
of files.
|
||||
|
||||
config CONFIG_CHROOT
|
||||
@@ -114,14 +114,14 @@ config CONFIG_DIRNAME
|
||||
bool "dirname"
|
||||
default n
|
||||
help
|
||||
dirname is used to strip a non directory suffix from
|
||||
dirname is used to strip a non-directory suffix from
|
||||
a file name.
|
||||
|
||||
config CONFIG_DOS2UNIX
|
||||
bool "dos2unix/unix2dos"
|
||||
default n
|
||||
help
|
||||
dos2unix is uses to convert a text file from DOS format to
|
||||
dos2unix is used to convert a text file from DOS format to
|
||||
UNIX format, and vice versa.
|
||||
|
||||
config CONFIG_UNIX2DOS
|
||||
@@ -161,7 +161,7 @@ config CONFIG_ENV
|
||||
default n
|
||||
help
|
||||
env is used to set an environment variable and run
|
||||
a command, without options it displays the current
|
||||
a command; without options it displays the current
|
||||
environment.
|
||||
|
||||
config CONFIG_EXPR
|
||||
@@ -218,6 +218,12 @@ config CONFIG_ID
|
||||
help
|
||||
id displays the current user and group ID names.
|
||||
|
||||
config CONFIG_INSTALL
|
||||
bool "install"
|
||||
default n
|
||||
help
|
||||
Copy files and set attributes.
|
||||
|
||||
config CONFIG_LENGTH
|
||||
bool "length"
|
||||
default n
|
||||
@@ -347,7 +353,7 @@ config CONFIG_REALPATH
|
||||
default n
|
||||
help
|
||||
Return the canonicalized absolute pathname.
|
||||
This isnt provided by GNU shellutils, but where else does it belong.
|
||||
This isn't provided by GNU shellutils, but where else does it belong.
|
||||
|
||||
config CONFIG_RM
|
||||
bool "rm"
|
||||
@@ -361,19 +367,18 @@ config CONFIG_RMDIR
|
||||
help
|
||||
rmdir is used to remove empty directories.
|
||||
|
||||
config CONFIG_SEQ
|
||||
bool "seq"
|
||||
default n
|
||||
help
|
||||
print a sequence of numbers
|
||||
|
||||
config CONFIG_SHA1SUM
|
||||
bool "sha1sum"
|
||||
default n
|
||||
help
|
||||
Compute and check SHA1 message digest
|
||||
|
||||
config CONFIG_FEATURE_SHA1SUM_CHECK
|
||||
bool " Enale -c and -w options"
|
||||
default n
|
||||
help
|
||||
Enabling the -c and -w options allow files to be checked
|
||||
against pre-calculated hash values.
|
||||
|
||||
config CONFIG_SLEEP
|
||||
bool "sleep (single integer arg with no suffix)"
|
||||
default n
|
||||
@@ -393,22 +398,6 @@ config CONFIG_SORT
|
||||
help
|
||||
sort is used to sort lines of text in specified files.
|
||||
|
||||
config CONFIG_FEATURE_SORT_REVERSE
|
||||
bool " Enable reverse sort"
|
||||
default y
|
||||
depends on CONFIG_SORT
|
||||
help
|
||||
Enable the `-r' option that allows sort to sort lines of
|
||||
text in reverse.
|
||||
|
||||
config CONFIG_FEATURE_SORT_UNIQUE
|
||||
bool " Enable unique sort"
|
||||
default y
|
||||
depends on CONFIG_SORT
|
||||
help
|
||||
Enable the `-u' option that allows sort to only sort lines
|
||||
that are uniq.
|
||||
|
||||
config CONFIG_STTY
|
||||
bool "stty"
|
||||
default n
|
||||
@@ -429,11 +418,12 @@ config CONFIG_TAIL
|
||||
from files.
|
||||
|
||||
config CONFIG_FEATURE_FANCY_TAIL
|
||||
bool " Enable extra tail options (-c, -q, -s, and -v)"
|
||||
bool " Enable extra tail options (-q, -s, and -v)"
|
||||
default y
|
||||
depends on CONFIG_TAIL
|
||||
help
|
||||
Enable tail options (-c, -q, -s, and -v).
|
||||
The options (-q, -s, and -v) are provided by GNU tail, but
|
||||
are not specific in the SUSv3 standard.
|
||||
|
||||
config CONFIG_TEE
|
||||
bool "tee"
|
||||
@@ -462,7 +452,7 @@ if !CONFIG_ASH && !CONFIG_HUSH && !CONFIG_LASH && !CONFIG_MSH
|
||||
help
|
||||
test is used to check file types and compare values,
|
||||
returning an appropriate exit code. The shells (ash
|
||||
and bash have test builtin).
|
||||
and bash) have test builtin.
|
||||
endif
|
||||
|
||||
config CONFIG_TOUCH
|
||||
@@ -599,4 +589,17 @@ config CONFIG_FEATURE_HUMAN_READABLE
|
||||
help
|
||||
Allow df, du, and ls to have human readable output.
|
||||
|
||||
comment "Common options for md5sum, sha1sum"
|
||||
depends on CONFIG_MD5SUM || CONFIG_SHA1SUM
|
||||
|
||||
config CONFIG_FEATURE_MD5_SHA1_SUM_CHECK
|
||||
bool " Enable -c, -s and -w options"
|
||||
default n
|
||||
depends on CONFIG_MD5SUM || CONFIG_SHA1SUM
|
||||
help
|
||||
Enabling the -c options allows files to be checked
|
||||
against pre-calculated hash values.
|
||||
|
||||
-s and -w are useful options when verifying checksums.
|
||||
|
||||
endmenu
|
||||
+60
-59
@@ -23,70 +23,71 @@ COREUTILS_DIR:=$(TOPDIR)coreutils/
|
||||
endif
|
||||
|
||||
COREUTILS-y:=
|
||||
COREUTILS-$(CONFIG_BASENAME) += basename.o
|
||||
COREUTILS-$(CONFIG_CAL) += cal.o
|
||||
COREUTILS-$(CONFIG_CAT) += cat.o
|
||||
COREUTILS-$(CONFIG_CHGRP) += chgrp.o
|
||||
COREUTILS-$(CONFIG_CHMOD) += chmod.o
|
||||
COREUTILS-$(CONFIG_CHOWN) += chown.o
|
||||
COREUTILS-$(CONFIG_CHROOT) += chroot.o
|
||||
COREUTILS-$(CONFIG_CMP) += cmp.o
|
||||
COREUTILS-$(CONFIG_CP) += cp.o
|
||||
COREUTILS-$(CONFIG_CUT) += cut.o
|
||||
COREUTILS-$(CONFIG_DATE) += date.o
|
||||
COREUTILS-$(CONFIG_DD) += dd.o
|
||||
COREUTILS-$(CONFIG_DF) += df.o
|
||||
COREUTILS-$(CONFIG_DIRNAME) += dirname.o
|
||||
COREUTILS-$(CONFIG_BASENAME) += basename.o
|
||||
COREUTILS-$(CONFIG_CAL) += cal.o
|
||||
COREUTILS-$(CONFIG_CAT) += cat.o
|
||||
COREUTILS-$(CONFIG_CHGRP) += chgrp.o
|
||||
COREUTILS-$(CONFIG_CHMOD) += chmod.o
|
||||
COREUTILS-$(CONFIG_CHOWN) += chown.o
|
||||
COREUTILS-$(CONFIG_CHROOT) += chroot.o
|
||||
COREUTILS-$(CONFIG_CMP) += cmp.o
|
||||
COREUTILS-$(CONFIG_CP) += cp.o
|
||||
COREUTILS-$(CONFIG_CUT) += cut.o
|
||||
COREUTILS-$(CONFIG_DATE) += date.o
|
||||
COREUTILS-$(CONFIG_DD) += dd.o
|
||||
COREUTILS-$(CONFIG_DF) += df.o
|
||||
COREUTILS-$(CONFIG_DIRNAME) += dirname.o
|
||||
COREUTILS-$(CONFIG_DOS2UNIX) += dos2unix.o
|
||||
COREUTILS-$(CONFIG_DU) += du.o
|
||||
COREUTILS-$(CONFIG_ECHO) += echo.o
|
||||
COREUTILS-$(CONFIG_ENV) += env.o
|
||||
COREUTILS-$(CONFIG_EXPR) += expr.o
|
||||
COREUTILS-$(CONFIG_FALSE) += false.o
|
||||
COREUTILS-$(CONFIG_FOLD) += fold.o
|
||||
COREUTILS-$(CONFIG_HEAD) += head.o
|
||||
COREUTILS-$(CONFIG_HOSTID) += hostid.o
|
||||
COREUTILS-$(CONFIG_ID) += id.o
|
||||
COREUTILS-$(CONFIG_LENGTH) += length.o
|
||||
COREUTILS-$(CONFIG_LN) += ln.o
|
||||
COREUTILS-$(CONFIG_LOGNAME) += logname.o
|
||||
COREUTILS-$(CONFIG_LS) += ls.o
|
||||
COREUTILS-$(CONFIG_MD5SUM) += md5sum.o
|
||||
COREUTILS-$(CONFIG_MKDIR) += mkdir.o
|
||||
COREUTILS-$(CONFIG_MKFIFO) += mkfifo.o
|
||||
COREUTILS-$(CONFIG_MKNOD) += mknod.o
|
||||
COREUTILS-$(CONFIG_MV) += mv.o
|
||||
COREUTILS-$(CONFIG_OD) += od.o
|
||||
COREUTILS-$(CONFIG_PRINTF) += printf.o
|
||||
COREUTILS-$(CONFIG_PWD) += pwd.o
|
||||
COREUTILS-$(CONFIG_REALPATH) += realpath.o
|
||||
COREUTILS-$(CONFIG_RM) += rm.o
|
||||
COREUTILS-$(CONFIG_RMDIR) += rmdir.o
|
||||
COREUTILS-$(CONFIG_SHA1SUM) += sha1sum.o
|
||||
COREUTILS-$(CONFIG_SLEEP) += sleep.o
|
||||
COREUTILS-$(CONFIG_SORT) += sort.o
|
||||
COREUTILS-$(CONFIG_STTY) += stty.o
|
||||
COREUTILS-$(CONFIG_SYNC) += sync.o
|
||||
COREUTILS-$(CONFIG_TAIL) += tail.o
|
||||
COREUTILS-$(CONFIG_TEE) += tee.o
|
||||
COREUTILS-$(CONFIG_TEST) += test.o
|
||||
COREUTILS-$(CONFIG_TOUCH) += touch.o
|
||||
COREUTILS-$(CONFIG_TR) += tr.o
|
||||
COREUTILS-$(CONFIG_TRUE) += true.o
|
||||
COREUTILS-$(CONFIG_TTY) += tty.o
|
||||
COREUTILS-$(CONFIG_UNAME) += uname.o
|
||||
COREUTILS-$(CONFIG_UNIQ) += uniq.o
|
||||
COREUTILS-$(CONFIG_USLEEP) += usleep.o
|
||||
COREUTILS-$(CONFIG_DU) += du.o
|
||||
COREUTILS-$(CONFIG_ECHO) += echo.o
|
||||
COREUTILS-$(CONFIG_ENV) += env.o
|
||||
COREUTILS-$(CONFIG_EXPR) += expr.o
|
||||
COREUTILS-$(CONFIG_FALSE) += false.o
|
||||
COREUTILS-$(CONFIG_FOLD) += fold.o
|
||||
COREUTILS-$(CONFIG_HEAD) += head.o
|
||||
COREUTILS-$(CONFIG_HOSTID) += hostid.o
|
||||
COREUTILS-$(CONFIG_ID) += id.o
|
||||
COREUTILS-$(CONFIG_INSTALL) += install.o
|
||||
COREUTILS-$(CONFIG_LENGTH) += length.o
|
||||
COREUTILS-$(CONFIG_LN) += ln.o
|
||||
COREUTILS-$(CONFIG_LOGNAME) += logname.o
|
||||
COREUTILS-$(CONFIG_LS) += ls.o
|
||||
COREUTILS-$(CONFIG_MD5SUM) += md5_sha1_sum.o
|
||||
COREUTILS-$(CONFIG_MKDIR) += mkdir.o
|
||||
COREUTILS-$(CONFIG_MKFIFO) += mkfifo.o
|
||||
COREUTILS-$(CONFIG_MKNOD) += mknod.o
|
||||
COREUTILS-$(CONFIG_MV) += mv.o
|
||||
COREUTILS-$(CONFIG_OD) += od.o
|
||||
COREUTILS-$(CONFIG_PRINTF) += printf.o
|
||||
COREUTILS-$(CONFIG_PWD) += pwd.o
|
||||
COREUTILS-$(CONFIG_REALPATH) += realpath.o
|
||||
COREUTILS-$(CONFIG_RM) += rm.o
|
||||
COREUTILS-$(CONFIG_RMDIR) += rmdir.o
|
||||
COREUTILS-$(CONFIG_SEQ) += seq.o
|
||||
COREUTILS-$(CONFIG_SHA1SUM) += md5_sha1_sum.o
|
||||
COREUTILS-$(CONFIG_SLEEP) += sleep.o
|
||||
COREUTILS-$(CONFIG_SORT) += sort.o
|
||||
COREUTILS-$(CONFIG_STTY) += stty.o
|
||||
COREUTILS-$(CONFIG_SYNC) += sync.o
|
||||
COREUTILS-$(CONFIG_TAIL) += tail.o
|
||||
COREUTILS-$(CONFIG_TEE) += tee.o
|
||||
COREUTILS-$(CONFIG_TEST) += test.o
|
||||
COREUTILS-$(CONFIG_TOUCH) += touch.o
|
||||
COREUTILS-$(CONFIG_TR) += tr.o
|
||||
COREUTILS-$(CONFIG_TRUE) += true.o
|
||||
COREUTILS-$(CONFIG_TTY) += tty.o
|
||||
COREUTILS-$(CONFIG_UNAME) += uname.o
|
||||
COREUTILS-$(CONFIG_UNIQ) += uniq.o
|
||||
COREUTILS-$(CONFIG_USLEEP) += usleep.o
|
||||
COREUTILS-$(CONFIG_UUDECODE) += uudecode.o
|
||||
COREUTILS-$(CONFIG_UUENCODE) += uuencode.o
|
||||
COREUTILS-$(CONFIG_WATCH) += watch.o
|
||||
COREUTILS-$(CONFIG_WC) += wc.o
|
||||
COREUTILS-$(CONFIG_WHO) += who.o
|
||||
COREUTILS-$(CONFIG_WHOAMI) += whoami.o
|
||||
COREUTILS-$(CONFIG_YES) += yes.o
|
||||
COREUTILS-$(CONFIG_WATCH) += watch.o
|
||||
COREUTILS-$(CONFIG_WC) += wc.o
|
||||
COREUTILS-$(CONFIG_WHO) += who.o
|
||||
COREUTILS-$(CONFIG_WHOAMI) += whoami.o
|
||||
COREUTILS-$(CONFIG_YES) += yes.o
|
||||
|
||||
libraries-y+=$(COREUTILS_DIR)$(COREUTILS_AR)
|
||||
|
||||
$(COREUTILS_DIR)$(COREUTILS_AR): $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y))
|
||||
$(AR) -ro $@ $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y))
|
||||
|
||||
+1
-14
@@ -1,19 +1,6 @@
|
||||
/* NOTE:
|
||||
*
|
||||
* Apparently, all "Steven J. Merrifield" did was grab the util-linux cal applet,
|
||||
* spend maybe 5 minutes integrating it into busybox, slapped a copyright on it,
|
||||
* and submitted it. I certainly saw no evidence of any attempt at size reduction.
|
||||
* Not only do I consider his copyright below meaningless, I also consider his
|
||||
* actions shameful.
|
||||
*
|
||||
* Manuel Novoa III (mjn3@codepoet.org)
|
||||
*/
|
||||
|
||||
/*
|
||||
* Calendar implementation for busybox
|
||||
*
|
||||
* Copyright (C) 2001 by Steven J. Merrifield <steve@labyrinth.net.au>
|
||||
*
|
||||
* See original copyright at the end of this file
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -337,7 +324,7 @@ static char *build_row(char *p, int *dp)
|
||||
do {
|
||||
if ((day = *dp++) != SPACE) {
|
||||
if (julian) {
|
||||
*++p;
|
||||
++p;
|
||||
if (day >= 100) {
|
||||
*p = '0';
|
||||
p[-1] = (day / 100) + '0';
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ extern int cat_main(int argc, char **argv)
|
||||
|
||||
do {
|
||||
if ((f = bb_wfopen_input(*argv)) != NULL) {
|
||||
int r = bb_copyfd(fileno(f), STDOUT_FILENO, 0);
|
||||
int r = bb_copyfd_eof(fileno(f), STDOUT_FILENO);
|
||||
bb_fclose_nonstdin(f);
|
||||
if (r >= 0) {
|
||||
continue;
|
||||
|
||||
+1
-5
@@ -48,7 +48,6 @@ int chgrp_main(int argc, char **argv)
|
||||
long gid;
|
||||
int recursiveFlag;
|
||||
int retval = EXIT_SUCCESS;
|
||||
char *p;
|
||||
|
||||
recursiveFlag = bb_getopt_ulflags(argc, argv, "R");
|
||||
|
||||
@@ -59,10 +58,7 @@ int chgrp_main(int argc, char **argv)
|
||||
argv += optind;
|
||||
|
||||
/* Find the selected group */
|
||||
gid = strtoul(*argv, &p, 10); /* maybe it's already numeric */
|
||||
if (*p || (p == *argv)) { /* trailing chars or nonnumeric */
|
||||
gid = my_getgrnam(*argv);
|
||||
}
|
||||
gid = get_ug_id(*argv, my_getgrnam);
|
||||
++argv;
|
||||
|
||||
/* Ok, ready to do the deed now */
|
||||
|
||||
+1
-13
@@ -43,6 +43,7 @@ static int (*chown_func)(const char *, uid_t, gid_t) = chown;
|
||||
static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
|
||||
{
|
||||
if (chown_func(fileName, uid, (gid == -1) ? statbuf->st_gid : gid) == 0) {
|
||||
chmod(fileName, statbuf->st_mode);
|
||||
return (TRUE);
|
||||
}
|
||||
bb_perror_msg("%s", fileName); /* Avoid multibyte problems. */
|
||||
@@ -52,19 +53,6 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
|
||||
#define FLAG_R 1
|
||||
#define FLAG_h 2
|
||||
|
||||
static unsigned long get_ug_id(const char *s, long (*my_getxxnam)(const char *))
|
||||
{
|
||||
unsigned long r;
|
||||
char *p;
|
||||
|
||||
r = strtoul(s, &p, 10);
|
||||
if (*p || (s == p)) {
|
||||
r = my_getxxnam(s);
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
int chown_main(int argc, char **argv)
|
||||
{
|
||||
int flags;
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ int chroot_main(int argc, char **argv)
|
||||
if (argc == 2) {
|
||||
argv -= 2;
|
||||
if (!(*argv = getenv("SHELL"))) {
|
||||
*argv = (char *) "/bin/sh";
|
||||
*argv = (char *) DEFAULT_SHELL;
|
||||
}
|
||||
argv[1] = (char *) "-i";
|
||||
}
|
||||
|
||||
+8
-1
@@ -41,7 +41,8 @@
|
||||
#include "busybox.h"
|
||||
#include "libcoreutils/coreutils.h"
|
||||
|
||||
static const char cp_opts[] = "pdRfia"; /* WARNING!! ORDER IS IMPORTANT!! */
|
||||
/* WARNING!! ORDER IS IMPORTANT!! */
|
||||
static const char cp_opts[] = "pdRfiar";
|
||||
|
||||
extern int cp_main(int argc, char **argv)
|
||||
{
|
||||
@@ -66,6 +67,12 @@ extern int cp_main(int argc, char **argv)
|
||||
if (flags & 32) {
|
||||
flags |= (FILEUTILS_PRESERVE_STATUS | FILEUTILS_RECUR | FILEUTILS_DEREFERENCE);
|
||||
}
|
||||
if (flags & 64) {
|
||||
/* Make -r a synonym for -R,
|
||||
* -r was marked as obsolete in SUSv3, but is included for compatability
|
||||
*/
|
||||
flags |= FILEUTILS_RECUR;
|
||||
}
|
||||
|
||||
flags ^= FILEUTILS_DEREFERENCE; /* The sense of this flag was reversed. */
|
||||
|
||||
|
||||
+4
-4
@@ -57,7 +57,7 @@ int dd_main(int argc, char **argv)
|
||||
off_t skip = 0;
|
||||
int sync_flag = FALSE;
|
||||
int noerror = FALSE;
|
||||
int trunc = TRUE;
|
||||
int trunc_flag = TRUE;
|
||||
int oflag;
|
||||
int ifd;
|
||||
int ofd;
|
||||
@@ -83,7 +83,7 @@ int dd_main(int argc, char **argv)
|
||||
buf = argv[i]+5;
|
||||
while (1) {
|
||||
if (strncmp("notrunc", buf, 7) == 0) {
|
||||
trunc = FALSE;
|
||||
trunc_flag = FALSE;
|
||||
buf += 7;
|
||||
} else if (strncmp("sync", buf, 4) == 0) {
|
||||
sync_flag = TRUE;
|
||||
@@ -115,7 +115,7 @@ int dd_main(int argc, char **argv)
|
||||
if (outfile != NULL) {
|
||||
oflag = O_WRONLY | O_CREAT;
|
||||
|
||||
if (!seek && trunc) {
|
||||
if (!seek && trunc_flag) {
|
||||
oflag |= O_TRUNC;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ int dd_main(int argc, char **argv)
|
||||
bb_perror_msg_and_die("%s", outfile);
|
||||
}
|
||||
|
||||
if (seek && trunc) {
|
||||
if (seek && trunc_flag) {
|
||||
if (ftruncate(ofd, seek * bs) < 0) {
|
||||
struct stat st;
|
||||
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ extern int env_main(int argc, char** argv)
|
||||
char **ep, *p;
|
||||
char *cleanenv[1] = { NULL };
|
||||
unsigned long opt;
|
||||
llist_t *unset_env;
|
||||
llist_t *unset_env = NULL;
|
||||
extern char **environ;
|
||||
|
||||
bb_opt_complementaly = "u*";
|
||||
|
||||
+80
-81
@@ -7,6 +7,7 @@
|
||||
*
|
||||
* Busybox modifications
|
||||
* 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
|
||||
@@ -40,6 +41,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <regex.h>
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include "busybox.h"
|
||||
|
||||
|
||||
@@ -115,7 +117,7 @@ static VALUE *str_value (char *s)
|
||||
|
||||
v = xmalloc (sizeof(VALUE));
|
||||
v->type = string;
|
||||
v->u.s = strdup (s);
|
||||
v->u.s = bb_xstrdup (s);
|
||||
return v;
|
||||
}
|
||||
|
||||
@@ -135,10 +137,8 @@ static int null (VALUE *v)
|
||||
switch (v->type) {
|
||||
case integer:
|
||||
return v->u.i == 0;
|
||||
case string:
|
||||
default: /* string: */
|
||||
return v->u.s[0] == '\0' || strcmp (v->u.s, "0") == 0;
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,24 +156,20 @@ static void tostring (VALUE *v)
|
||||
|
||||
static int toarith (VALUE *v)
|
||||
{
|
||||
int i;
|
||||
if(v->type == string) {
|
||||
int i;
|
||||
char *e;
|
||||
|
||||
switch (v->type) {
|
||||
case integer:
|
||||
return 1;
|
||||
case string:
|
||||
i = 0;
|
||||
/* Don't interpret the empty string as an integer. */
|
||||
if (v->u.s == 0)
|
||||
return 0;
|
||||
i = atoi(v->u.s);
|
||||
free (v->u.s);
|
||||
v->u.i = i;
|
||||
v->type = integer;
|
||||
return 1;
|
||||
default:
|
||||
abort ();
|
||||
/* Don't interpret the empty string as an integer. */
|
||||
/* Currently does not worry about overflow or int/long differences. */
|
||||
i = (int) strtol(v->u.s, &e, 10);
|
||||
if ((v->u.s == e) || *e)
|
||||
return 0;
|
||||
free (v->u.s);
|
||||
v->u.i = i;
|
||||
v->type = integer;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Return nonzero if the next token matches STR exactly.
|
||||
@@ -189,56 +185,59 @@ nextarg (char *str)
|
||||
|
||||
/* The comparison operator handling functions. */
|
||||
|
||||
#define cmpf(name, rel) \
|
||||
static int name (VALUE *l, VALUE *r) \
|
||||
{ \
|
||||
if (l->type == string || r->type == string) { \
|
||||
tostring (l); \
|
||||
tostring (r); \
|
||||
return strcmp (l->u.s, r->u.s) rel 0; \
|
||||
} \
|
||||
else \
|
||||
return l->u.i rel r->u.i; \
|
||||
}
|
||||
cmpf (less_than, <)
|
||||
cmpf (less_equal, <=)
|
||||
cmpf (equal, ==)
|
||||
cmpf (not_equal, !=)
|
||||
cmpf (greater_equal, >=)
|
||||
cmpf (greater_than, >)
|
||||
static int cmp_common (VALUE *l, VALUE *r, int op)
|
||||
{
|
||||
int cmpval;
|
||||
|
||||
#undef cmpf
|
||||
if (l->type == string || r->type == string) {
|
||||
tostring (l);
|
||||
tostring (r);
|
||||
cmpval = strcmp (l->u.s, r->u.s);
|
||||
}
|
||||
else
|
||||
cmpval = l->u.i - r->u.i;
|
||||
switch(op) {
|
||||
case '<':
|
||||
return cmpval < 0;
|
||||
case ('L'+'E'):
|
||||
return cmpval <= 0;
|
||||
case '=':
|
||||
return cmpval == 0;
|
||||
case '!':
|
||||
return cmpval != 0;
|
||||
case '>':
|
||||
return cmpval > 0;
|
||||
default: /* >= */
|
||||
return cmpval >= 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* The arithmetic operator handling functions. */
|
||||
|
||||
#define arithf(name, op) \
|
||||
static \
|
||||
int name (VALUE *l, VALUE *r) \
|
||||
{ \
|
||||
if (!toarith (l) || !toarith (r)) \
|
||||
bb_error_msg_and_die ("non-numeric argument"); \
|
||||
return l->u.i op r->u.i; \
|
||||
static int arithmetic_common (VALUE *l, VALUE *r, int op)
|
||||
{
|
||||
int li, ri;
|
||||
|
||||
if (!toarith (l) || !toarith (r))
|
||||
bb_error_msg_and_die ("non-numeric argument");
|
||||
li = l->u.i;
|
||||
ri = r->u.i;
|
||||
if((op == '/' || op == '%') && ri == 0)
|
||||
bb_error_msg_and_die ( "division by zero");
|
||||
switch(op) {
|
||||
case '+':
|
||||
return li + ri;
|
||||
case '-':
|
||||
return li - ri;
|
||||
case '*':
|
||||
return li * ri;
|
||||
case '/':
|
||||
return li / ri;
|
||||
default:
|
||||
return li % ri;
|
||||
}
|
||||
}
|
||||
|
||||
#define arithdivf(name, op) \
|
||||
static int name (VALUE *l, VALUE *r) \
|
||||
{ \
|
||||
if (!toarith (l) || !toarith (r)) \
|
||||
bb_error_msg_and_die ( "non-numeric argument"); \
|
||||
if (r->u.i == 0) \
|
||||
bb_error_msg_and_die ( "division by zero"); \
|
||||
return l->u.i op r->u.i; \
|
||||
}
|
||||
|
||||
arithf (plus, +)
|
||||
arithf (minus, -)
|
||||
arithf (multiply, *)
|
||||
arithdivf (divide, /)
|
||||
arithdivf (mod, %)
|
||||
|
||||
#undef arithf
|
||||
#undef arithdivf
|
||||
|
||||
/* Do the : operator.
|
||||
SV is the VALUE for the lhs (the string),
|
||||
PV is the VALUE for the rhs (the pattern). */
|
||||
@@ -408,21 +407,21 @@ static VALUE *eval5 (void)
|
||||
static VALUE *eval4 (void)
|
||||
{
|
||||
VALUE *l, *r;
|
||||
int (*fxn) (VALUE *, VALUE *), val;
|
||||
int op, val;
|
||||
|
||||
l = eval5 ();
|
||||
while (1) {
|
||||
if (nextarg ("*"))
|
||||
fxn = multiply;
|
||||
op = '*';
|
||||
else if (nextarg ("/"))
|
||||
fxn = divide;
|
||||
op = '/';
|
||||
else if (nextarg ("%"))
|
||||
fxn = mod;
|
||||
op = '%';
|
||||
else
|
||||
return l;
|
||||
args++;
|
||||
r = eval5 ();
|
||||
val = (*fxn) (l, r);
|
||||
val = arithmetic_common (l, r, op);
|
||||
freev (l);
|
||||
freev (r);
|
||||
l = int_value (val);
|
||||
@@ -434,19 +433,19 @@ static VALUE *eval4 (void)
|
||||
static VALUE *eval3 (void)
|
||||
{
|
||||
VALUE *l, *r;
|
||||
int (*fxn) (VALUE *, VALUE *), val;
|
||||
int op, val;
|
||||
|
||||
l = eval4 ();
|
||||
while (1) {
|
||||
if (nextarg ("+"))
|
||||
fxn = plus;
|
||||
op = '+';
|
||||
else if (nextarg ("-"))
|
||||
fxn = minus;
|
||||
op = '-';
|
||||
else
|
||||
return l;
|
||||
args++;
|
||||
r = eval4 ();
|
||||
val = (*fxn) (l, r);
|
||||
val = arithmetic_common (l, r, op);
|
||||
freev (l);
|
||||
freev (r);
|
||||
l = int_value (val);
|
||||
@@ -458,29 +457,29 @@ static VALUE *eval3 (void)
|
||||
static VALUE *eval2 (void)
|
||||
{
|
||||
VALUE *l, *r;
|
||||
int (*fxn) (VALUE *, VALUE *), val;
|
||||
int op, val;
|
||||
|
||||
l = eval3 ();
|
||||
while (1) {
|
||||
if (nextarg ("<"))
|
||||
fxn = less_than;
|
||||
op = '<';
|
||||
else if (nextarg ("<="))
|
||||
fxn = less_equal;
|
||||
op = 'L'+'E';
|
||||
else if (nextarg ("=") || nextarg ("=="))
|
||||
fxn = equal;
|
||||
op = '=';
|
||||
else if (nextarg ("!="))
|
||||
fxn = not_equal;
|
||||
op = '!';
|
||||
else if (nextarg (">="))
|
||||
fxn = greater_equal;
|
||||
op = 'G'+'E';
|
||||
else if (nextarg (">"))
|
||||
fxn = greater_than;
|
||||
op = '>';
|
||||
else
|
||||
return l;
|
||||
args++;
|
||||
r = eval3 ();
|
||||
toarith (l);
|
||||
toarith (r);
|
||||
val = (*fxn) (l, r);
|
||||
val = cmp_common (l, r, op);
|
||||
freev (l);
|
||||
freev (r);
|
||||
l = int_value (val);
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
* Copyright (C) 2003 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 Library 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.
|
||||
*
|
||||
*
|
||||
* TODO: -d option, need a way of recursively making directories and changing
|
||||
* owner/group, will probably modify bb_make_directory(...)
|
||||
*/
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "busybox.h"
|
||||
#include "libcoreutils/coreutils.h"
|
||||
|
||||
#define INSTALL_OPT_CMD 1
|
||||
#define INSTALL_OPT_DIRECTORY 2
|
||||
#define INSTALL_OPT_PRESERVE_TIME 4
|
||||
#define INSTALL_OPT_STRIP 8
|
||||
#define INSTALL_OPT_GROUP 16
|
||||
#define INSTALL_OPT_MODE 32
|
||||
#define INSTALL_OPT_OWNER 64
|
||||
|
||||
static const struct option install_long_options[] = {
|
||||
{ "directory", 0, NULL, 'd' },
|
||||
{ "preserve-timestamps", 0, NULL, 'p' },
|
||||
{ "strip", 0, NULL, 's' },
|
||||
{ "group", 0, NULL, 'g' },
|
||||
{ "mode", 0, NULL, 'm' },
|
||||
{ "owner", 0, NULL, 'o' },
|
||||
{ 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
extern int install_main(int argc, char **argv)
|
||||
{
|
||||
struct stat statbuf;
|
||||
mode_t mode;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
char *gid_str = "-1";
|
||||
char *uid_str = "-1";
|
||||
char *mode_str = "0755";
|
||||
int copy_flags = FILEUTILS_DEREFERENCE | FILEUTILS_FORCE;
|
||||
int ret = EXIT_SUCCESS;
|
||||
int flags;
|
||||
int i;
|
||||
|
||||
bb_applet_long_options = install_long_options;
|
||||
bb_opt_complementaly = "s~d:d~s";
|
||||
/* -c exists for backwards compatability, its needed */
|
||||
flags = bb_getopt_ulflags(argc, argv, "cdpsg:m:o:", &gid_str, &mode_str, &uid_str); /* 'a' must be 2nd */
|
||||
|
||||
/* Check valid options were given */
|
||||
if(flags & 0x80000000UL) {
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
/* preserve access and modification time, this is GNU behaviour, BSD only preserves modification time */
|
||||
if (flags & INSTALL_OPT_PRESERVE_TIME) {
|
||||
copy_flags |= FILEUTILS_PRESERVE_STATUS;
|
||||
}
|
||||
bb_parse_mode(mode_str, &mode);
|
||||
gid = get_ug_id(gid_str, my_getgrnam);
|
||||
uid = get_ug_id(uid_str, my_getpwnam);
|
||||
umask(0);
|
||||
|
||||
/* Create directories
|
||||
* dont use bb_make_directory() as it cant change uid or gid
|
||||
* perhaps bb_make_directory() should be improved.
|
||||
*/
|
||||
if (flags & INSTALL_OPT_DIRECTORY) {
|
||||
for (argv += optind; *argv; argv++) {
|
||||
char *old_argv_ptr = *argv + 1;
|
||||
char *argv_ptr;
|
||||
do {
|
||||
argv_ptr = strchr(old_argv_ptr, '/');
|
||||
old_argv_ptr = argv_ptr;
|
||||
if (argv_ptr) {
|
||||
*argv_ptr = '\0';
|
||||
old_argv_ptr++;
|
||||
}
|
||||
if (mkdir(*argv, mode) == -1) {
|
||||
if (errno != EEXIST) {
|
||||
bb_perror_msg("coulnt create %s", *argv);
|
||||
ret = EXIT_FAILURE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (lchown(*argv, uid, gid) == -1) {
|
||||
bb_perror_msg("cannot change ownership of %s", *argv);
|
||||
ret = EXIT_FAILURE;
|
||||
break;
|
||||
}
|
||||
if (argv_ptr) {
|
||||
*argv_ptr = '/';
|
||||
}
|
||||
} while (old_argv_ptr);
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
|
||||
cp_mv_stat2(argv[argc - 1], &statbuf, lstat);
|
||||
for (i = optind; i < argc - 1; i++) {
|
||||
unsigned char *dest;
|
||||
|
||||
if (S_ISDIR(statbuf.st_mode)) {
|
||||
dest = concat_path_file(argv[argc - 1], basename(argv[i]));
|
||||
} else {
|
||||
dest = argv[argc - 1];
|
||||
}
|
||||
ret |= copy_file(argv[i], dest, copy_flags);
|
||||
|
||||
/* Set the file mode */
|
||||
if (chmod(dest, mode) == -1) {
|
||||
bb_perror_msg("cannot change permissions of %s", dest);
|
||||
ret = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/* Set the user and group id */
|
||||
if (lchown(dest, uid, gid) == -1) {
|
||||
bb_perror_msg("cannot change ownership of %s", dest);
|
||||
ret = EXIT_FAILURE;
|
||||
}
|
||||
if (flags & INSTALL_OPT_STRIP) {
|
||||
if (execlp("strip", "strip", dest, NULL) == -1) {
|
||||
bb_error_msg("strip failed");
|
||||
ret = EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
+11
-14
@@ -43,7 +43,8 @@ extern int ln_main(int argc, char **argv)
|
||||
int flag;
|
||||
char *last;
|
||||
char *src_name;
|
||||
const char *src;
|
||||
char *src;
|
||||
struct stat statbuf;
|
||||
int (*link_func)(const char *, const char *);
|
||||
|
||||
flag = bb_getopt_ulflags(argc, argv, "sfn");
|
||||
@@ -61,7 +62,7 @@ extern int ln_main(int argc, char **argv)
|
||||
}
|
||||
|
||||
do {
|
||||
src_name = 0;
|
||||
src_name = NULL;
|
||||
src = last;
|
||||
|
||||
if (is_directory(src,
|
||||
@@ -70,7 +71,13 @@ extern int ln_main(int argc, char **argv)
|
||||
src_name = bb_xstrdup(*argv);
|
||||
src = concat_path_file(src, bb_get_last_path_component(src_name));
|
||||
free(src_name);
|
||||
src_name = (char *)src;
|
||||
src_name = src;
|
||||
}
|
||||
if (!(flag & LN_SYMLINK) && stat(*argv, &statbuf)) {
|
||||
bb_perror_msg(*argv);
|
||||
status = EXIT_FAILURE;
|
||||
free(src_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (flag & LN_FORCE) {
|
||||
@@ -84,7 +91,7 @@ extern int ln_main(int argc, char **argv)
|
||||
|
||||
if (link_func(*argv, src) != 0) {
|
||||
bb_perror_msg(src);
|
||||
status = EXIT_FAILURE;;
|
||||
status = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
free(src_name);
|
||||
@@ -93,13 +100,3 @@ extern int ln_main(int argc, char **argv)
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+161
-122
@@ -203,7 +203,7 @@ static int is_flask_enabled_flag;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_AUTOWIDTH
|
||||
static unsigned short terminal_width = TERMINAL_WIDTH;
|
||||
static int terminal_width = TERMINAL_WIDTH;
|
||||
static unsigned short tabstops = COLUMN_GAP;
|
||||
#else
|
||||
#define tabstops COLUMN_GAP
|
||||
@@ -717,21 +717,21 @@ static int list_single(struct dnode *dn)
|
||||
break;
|
||||
#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
|
||||
case LIST_FULLTIME:
|
||||
printf("%24.24s ", filetime);
|
||||
column += 25;
|
||||
break;
|
||||
case LIST_DATE_TIME:
|
||||
if (all_fmt & LIST_FULLTIME) {
|
||||
printf("%24.24s ", filetime);
|
||||
column += 25;
|
||||
break;
|
||||
if ((all_fmt & LIST_FULLTIME) == 0) {
|
||||
age = time(NULL) - ttime;
|
||||
printf("%6.6s ", filetime + 4);
|
||||
if (age < 3600L * 24 * 365 / 2 && age > -15 * 60) {
|
||||
/* hh:mm if less than 6 months old */
|
||||
printf("%5.5s ", filetime + 11);
|
||||
} else {
|
||||
printf(" %4.4s ", filetime + 20);
|
||||
}
|
||||
column += 13;
|
||||
}
|
||||
age = time(NULL) - ttime;
|
||||
printf("%6.6s ", filetime + 4);
|
||||
if (age < 3600L * 24 * 365 / 2 && age > -15 * 60) {
|
||||
/* hh:mm if less than 6 months old */
|
||||
printf("%5.5s ", filetime + 11);
|
||||
} else {
|
||||
printf(" %4.4s ", filetime + 20);
|
||||
}
|
||||
column += 13;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_SELINUX
|
||||
@@ -808,93 +808,134 @@ static int list_single(struct dnode *dn)
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
static const char ls_opts[] = "1AaCdgilnsx"
|
||||
#ifdef CONFIG_FEATURE_LS_FILETYPES
|
||||
"Fp"
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_RECURSIVE
|
||||
"R"
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_SORTFILES
|
||||
"rSvX"
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
|
||||
"ecut"
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_FOLLOWLINKS
|
||||
"L"
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_HUMAN_READABLE
|
||||
"h"
|
||||
#endif
|
||||
"k"
|
||||
#ifdef CONFIG_SELINUX
|
||||
"K"
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_AUTOWIDTH
|
||||
"T:w:"
|
||||
#endif
|
||||
;
|
||||
/* "[-]Cadil1", POSIX mandated options, busybox always supports */
|
||||
/* "[-]gnsx", POSIX non-mandated options, busybox always supports */
|
||||
/* "[-]Ak" GNU options, busybox always supports */
|
||||
/* "[-]FLRctur", POSIX mandated options, busybox optionally supports */
|
||||
/* "[-]p", POSIX non-mandated options, busybox optionally supports */
|
||||
/* "[-]SXvThw", GNU options, busybox optionally supports */
|
||||
/* "[-]K", SELinux mandated options, busybox optionally supports */
|
||||
/* "[-]e", I think we made this one up */
|
||||
|
||||
#define LIST_MASK_TRIGGER LIST_SHORT
|
||||
#define STYLE_MASK_TRIGGER STYLE_MASK
|
||||
#define SORT_MASK_TRIGGER SORT_MASK
|
||||
#define DISP_MASK_TRIGGER DISP_ROWS
|
||||
#define TIME_MASK_TRIGGER TIME_MASK
|
||||
#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
|
||||
# define LS_STR_TIMESTAMPS "cetu"
|
||||
#else
|
||||
# define LS_STR_TIMESTAMPS ""
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_LS_SORTFILES
|
||||
# define LS_STR_SORTFILES "SXrv"
|
||||
#else
|
||||
# define LS_STR_SORTFILES ""
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_LS_FILETYPES
|
||||
# define LS_STR_FILETYPES "Fp"
|
||||
#else
|
||||
# define LS_STR_FILETYPES ""
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_LS_FOLLOWLINKS
|
||||
# define LS_STR_FOLLOW_LINKS "L"
|
||||
#else
|
||||
# define LS_STR_FOLLOW_LINKS ""
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_LS_RECURSIVE
|
||||
# define LS_STR_RECURSIVE "R"
|
||||
#else
|
||||
# define LS_STR_RECURSIVE ""
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_HUMAN_READABLE
|
||||
# define LS_STR_HUMAN_READABLE "h"
|
||||
#else
|
||||
# define LS_STR_HUMAN_READABLE ""
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SELINUX
|
||||
# define LS_STR_SELINUX "K"
|
||||
#else
|
||||
# define LS_STR_SELINUX ""
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_AUTOWIDTH
|
||||
# define LS_STR_AUTOWIDTH "T:w:"
|
||||
#else
|
||||
# define LS_STR_AUTOWIDTH ""
|
||||
#endif
|
||||
|
||||
static const char ls_options[]="Cadil1gnsxAk" \
|
||||
LS_STR_TIMESTAMPS \
|
||||
LS_STR_SORTFILES \
|
||||
LS_STR_FILETYPES \
|
||||
LS_STR_FOLLOW_LINKS \
|
||||
LS_STR_RECURSIVE \
|
||||
LS_STR_HUMAN_READABLE \
|
||||
LS_STR_SELINUX \
|
||||
LS_STR_AUTOWIDTH;
|
||||
|
||||
#define LIST_MASK_TRIGGER LIST_SHORT
|
||||
#define STYLE_MASK_TRIGGER STYLE_MASK
|
||||
#define SORT_MASK_TRIGGER SORT_MASK
|
||||
#define DISP_MASK_TRIGGER DISP_ROWS
|
||||
#define TIME_MASK_TRIGGER TIME_MASK
|
||||
|
||||
static const unsigned opt_flags[] = {
|
||||
LIST_SHORT | STYLE_SINGLE, /* 1 */
|
||||
DISP_HIDDEN, /* A */
|
||||
DISP_HIDDEN | DISP_DOT, /* a */
|
||||
LIST_SHORT | STYLE_COLUMNS, /* C */
|
||||
DISP_NOLIST, /* d */
|
||||
0, /* g - ingored */
|
||||
LIST_INO, /* i */
|
||||
LIST_LONG | STYLE_LONG, /* l - remember LS_DISP_HR in mask! */
|
||||
LIST_ID_NUMERIC, /* n */
|
||||
LIST_BLOCKS, /* s */
|
||||
DISP_ROWS, /* x */
|
||||
#ifdef CONFIG_FEATURE_LS_FILETYPES
|
||||
LIST_FILETYPE | LIST_EXEC, /* F */
|
||||
LIST_FILETYPE, /* p */
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_RECURSIVE
|
||||
DISP_RECURSIVE, /* R */
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_SORTFILES
|
||||
SORT_ORDER_REVERSE, /* r */
|
||||
SORT_SIZE, /* S */
|
||||
SORT_VERSION, /* v */
|
||||
SORT_EXT, /* v */
|
||||
DISP_HIDDEN | DISP_DOT, /* a */
|
||||
DISP_NOLIST, /* d */
|
||||
LIST_INO, /* i */
|
||||
LIST_LONG | STYLE_LONG, /* l - remember LS_DISP_HR in mask! */
|
||||
LIST_SHORT | STYLE_SINGLE, /* 1 */
|
||||
0, /* g - ingored */
|
||||
LIST_ID_NUMERIC, /* n */
|
||||
LIST_BLOCKS, /* s */
|
||||
DISP_ROWS, /* x */
|
||||
DISP_HIDDEN, /* A */
|
||||
#ifdef CONFIG_SELINUX
|
||||
LIST_CONTEXT, /* k */
|
||||
#else
|
||||
0, /* k - ingored */
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
|
||||
LIST_FULLTIME, /* e */
|
||||
#ifdef CONFIG_FEATURE_LS_SORTFILES
|
||||
# ifdef CONFIG_FEATURE_LS_SORTFILES
|
||||
TIME_CHANGE | SORT_CTIME, /* c */
|
||||
#else
|
||||
TIME_CHANGE, /* c */
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_SORTFILES
|
||||
# else
|
||||
TIME_CHANGE, /* c */
|
||||
# endif
|
||||
LIST_FULLTIME, /* e */
|
||||
# ifdef CONFIG_FEATURE_LS_SORTFILES
|
||||
SORT_MTIME, /* t */
|
||||
# else
|
||||
0, /* t - ignored -- is this correct? */
|
||||
# endif
|
||||
# ifdef CONFIG_FEATURE_LS_SORTFILES
|
||||
TIME_ACCESS | SORT_ATIME, /* u */
|
||||
#else
|
||||
TIME_ACCESS, /* u */
|
||||
# else
|
||||
TIME_ACCESS, /* u */
|
||||
# endif
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_SORTFILES
|
||||
SORT_MTIME, /* t */
|
||||
#else
|
||||
0, /* t - ignored -- is this correct? */
|
||||
SORT_ORDER_REVERSE, /* r */
|
||||
SORT_SIZE, /* S */
|
||||
SORT_VERSION, /* v */
|
||||
SORT_EXT, /* v */
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_FILETYPES
|
||||
LIST_FILETYPE | LIST_EXEC, /* F */
|
||||
LIST_FILETYPE, /* p */
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_FOLLOWLINKS
|
||||
FOLLOW_LINKS, /* L */
|
||||
FOLLOW_LINKS, /* L */
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_RECURSIVE
|
||||
DISP_RECURSIVE, /* R */
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_HUMAN_READABLE
|
||||
LS_DISP_HR, /* h */
|
||||
LS_DISP_HR, /* h */
|
||||
#endif
|
||||
#ifndef CONFIG_SELINUX
|
||||
0, /* k - ingored */
|
||||
#else
|
||||
LIST_CONTEXT, /* k */
|
||||
#ifdef CONFIG_SELINUX
|
||||
LIST_MODEBITS|LIST_NLINKS|LIST_CONTEXT|LIST_SIZE|LIST_DATE_TIME, /* K */
|
||||
#endif
|
||||
};
|
||||
@@ -904,19 +945,26 @@ LS_DISP_HR, /* h */
|
||||
|
||||
extern int ls_main(int argc, char **argv)
|
||||
{
|
||||
struct dnode **dnf, **dnd;
|
||||
int dnfiles, dndirs;
|
||||
struct dnode *dn, *cur, **dnp;
|
||||
int i, nfiles;
|
||||
int opt;
|
||||
int oi, ac;
|
||||
struct dnode **dnd;
|
||||
struct dnode **dnf;
|
||||
struct dnode **dnp;
|
||||
struct dnode *dn;
|
||||
struct dnode *cur;
|
||||
long opt;
|
||||
int nfiles = 0;
|
||||
int dnfiles;
|
||||
int dndirs;
|
||||
int oi;
|
||||
int ac;
|
||||
int i;
|
||||
char **av;
|
||||
#ifdef CONFIG_SELINUX
|
||||
is_flask_enabled_flag = is_flask_enabled();
|
||||
#ifdef CONFIG_FEATURE_AUTOWIDTH
|
||||
char *tabstops_str = NULL;
|
||||
char *terminal_width_str = NULL;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_AUTOWIDTH
|
||||
struct winsize win = { 0, 0, 0, 0 };
|
||||
#ifdef CONFIG_SELINUX
|
||||
is_flask_enabled_flag = is_flask_enabled();
|
||||
#endif
|
||||
|
||||
all_fmt = LIST_SHORT | DISP_NORMAL | STYLE_AUTO
|
||||
@@ -927,12 +975,13 @@ extern int ls_main(int argc, char **argv)
|
||||
| SORT_NAME | SORT_ORDER_FORWARD
|
||||
#endif
|
||||
;
|
||||
|
||||
#ifdef CONFIG_FEATURE_AUTOWIDTH
|
||||
ioctl(fileno(stdout), TIOCGWINSZ, &win);
|
||||
if (win.ws_col > 0)
|
||||
terminal_width = win.ws_col - 1;
|
||||
/* Obtain the terminal width. */
|
||||
get_terminal_width_height(0, &terminal_width, NULL);
|
||||
/* Go one less... */
|
||||
terminal_width--;
|
||||
#endif
|
||||
nfiles = 0;
|
||||
|
||||
#ifdef CONFIG_FEATURE_LS_COLOR
|
||||
if (isatty(fileno(stdout)))
|
||||
@@ -940,27 +989,21 @@ extern int ls_main(int argc, char **argv)
|
||||
#endif
|
||||
|
||||
/* process options */
|
||||
while ((opt = getopt(argc, argv, ls_opts)) > 0) {
|
||||
#ifdef CONFIG_FEATURE_AUTOWIDTH
|
||||
if (opt == 'T') {
|
||||
tabstops = atoi(optarg);
|
||||
continue;
|
||||
}
|
||||
if (opt == 'w') {
|
||||
terminal_width = atoi(optarg);
|
||||
continue;
|
||||
}
|
||||
if (opt == ':') {
|
||||
goto print_usage_message;
|
||||
}
|
||||
opt = bb_getopt_ulflags(argc, argv, ls_options, &tabstops_str, &terminal_width_str);
|
||||
if (tabstops_str) {
|
||||
tabstops = atoi(tabstops_str);
|
||||
}
|
||||
if (terminal_width_str) {
|
||||
terminal_width = atoi(terminal_width_str);
|
||||
}
|
||||
#else
|
||||
opt = bb_getopt_ulflags(argc, argv, ls_options);
|
||||
#endif
|
||||
{
|
||||
unsigned int flags;
|
||||
const char *p = strchr(ls_opts, opt);
|
||||
if (!p) { /* shouldn't be necessary */
|
||||
goto print_usage_message;
|
||||
}
|
||||
flags = opt_flags[(int)(p - ls_opts)];
|
||||
/* 16 = maximum options minus tabsize and screewn width */
|
||||
for (i = 0; i < 16; i++) {
|
||||
if (opt & (1 << i)) {
|
||||
unsigned int flags = opt_flags[i];
|
||||
if (flags & LIST_MASK_TRIGGER) {
|
||||
all_fmt &= ~LIST_MASK;
|
||||
}
|
||||
@@ -992,7 +1035,6 @@ extern int ls_main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* sort out which command line options take precedence */
|
||||
#ifdef CONFIG_FEATURE_LS_RECURSIVE
|
||||
if (all_fmt & DISP_NOLIST)
|
||||
@@ -1091,7 +1133,4 @@ extern int ls_main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
return (status);
|
||||
|
||||
print_usage_message:
|
||||
bb_show_usage();
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
/*
|
||||
* Copyright (C) 2003 Glenn L. McGrath
|
||||
* Copyright (C) 2003 Erik Andersen
|
||||
*
|
||||
* 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 <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "busybox.h"
|
||||
|
||||
|
||||
#define FLAG_SILENT 1
|
||||
#define FLAG_CHECK 2
|
||||
#define FLAG_WARN 4
|
||||
|
||||
/* This might be usefull elsewhere */
|
||||
static unsigned char *hash_bin_to_hex(unsigned char *hash_value,
|
||||
unsigned char hash_length)
|
||||
{
|
||||
int x, len, max;
|
||||
unsigned char *hex_value;
|
||||
|
||||
max = (hash_length * 2) + 2;
|
||||
hex_value = xmalloc(max);
|
||||
for (x = len = 0; x < hash_length; x++) {
|
||||
len += snprintf(hex_value + len, max - len, "%02x", hash_value[x]);
|
||||
}
|
||||
return (hex_value);
|
||||
}
|
||||
|
||||
static uint8_t *hash_file(const char *filename, uint8_t hash_algo)
|
||||
{
|
||||
uint8_t *hash_value_bin;
|
||||
uint8_t *hash_value = NULL;
|
||||
uint8_t hash_length;
|
||||
int src_fd;
|
||||
|
||||
if (strcmp(filename, "-") == 0) {
|
||||
src_fd = fileno(stdin);
|
||||
} else {
|
||||
src_fd = open(filename, O_RDONLY);
|
||||
}
|
||||
|
||||
if (hash_algo == HASH_MD5) {
|
||||
hash_length = 16;
|
||||
} else {
|
||||
hash_length = 20;
|
||||
}
|
||||
|
||||
hash_value_bin = xmalloc(hash_length);
|
||||
|
||||
if ((src_fd != -1) && (hash_fd(src_fd, -1, hash_algo, hash_value_bin) != -2)) {
|
||||
hash_value = hash_bin_to_hex(hash_value_bin, hash_length);
|
||||
} else {
|
||||
bb_perror_msg("%s", filename);
|
||||
}
|
||||
|
||||
close(src_fd);
|
||||
|
||||
return(hash_value);
|
||||
}
|
||||
|
||||
/* This could become a common function for md5 as well, by using md5_stream */
|
||||
extern int hash_files(int argc, char **argv, const uint8_t hash_algo)
|
||||
{
|
||||
int return_value = EXIT_SUCCESS;
|
||||
uint8_t *hash_value;
|
||||
|
||||
#ifdef CONFIG_FEATURE_MD5_SHA1_SUM_CHECK
|
||||
unsigned int flags;
|
||||
|
||||
flags = bb_getopt_ulflags(argc, argv, "scw");
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_MD5_SHA1_SUM_CHECK
|
||||
if (!(flags & FLAG_CHECK)) {
|
||||
if (flags & FLAG_SILENT) {
|
||||
bb_error_msg_and_die
|
||||
("the -s option is meaningful only when verifying checksums");
|
||||
} else if (flags & FLAG_WARN) {
|
||||
bb_error_msg_and_die
|
||||
("the -w option is meaningful only when verifying checksums");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (argc == optind) {
|
||||
argv[argc++] = "-";
|
||||
}
|
||||
#ifdef CONFIG_FEATURE_MD5_SHA1_SUM_CHECK
|
||||
if (flags & FLAG_CHECK) {
|
||||
FILE *pre_computed_stream;
|
||||
int count_total = 0;
|
||||
int count_failed = 0;
|
||||
unsigned char *file_ptr = argv[optind];
|
||||
char *line;
|
||||
|
||||
if (optind + 1 != argc) {
|
||||
bb_error_msg_and_die
|
||||
("only one argument may be specified when using -c");
|
||||
}
|
||||
|
||||
if (strcmp(file_ptr, "-") == 0) {
|
||||
pre_computed_stream = stdin;
|
||||
} else {
|
||||
pre_computed_stream = bb_xfopen(file_ptr, "r");
|
||||
}
|
||||
|
||||
while ((line = bb_get_chomped_line_from_file(pre_computed_stream)) != NULL) {
|
||||
char *filename_ptr;
|
||||
|
||||
count_total++;
|
||||
filename_ptr = strstr(line, " ");
|
||||
if (filename_ptr == NULL) {
|
||||
if (flags & FLAG_WARN) {
|
||||
bb_error_msg("Invalid format");
|
||||
}
|
||||
free(line);
|
||||
continue;
|
||||
}
|
||||
*filename_ptr = '\0';
|
||||
filename_ptr += 2;
|
||||
|
||||
hash_value = hash_file(filename_ptr, hash_algo);
|
||||
|
||||
if (hash_value && (strcmp(hash_value, line) == 0)) {
|
||||
if (!(flags & FLAG_SILENT))
|
||||
printf("%s: OK\n", filename_ptr);
|
||||
} else {
|
||||
if (!(flags & FLAG_SILENT))
|
||||
printf("%s: FAILED\n", filename_ptr);
|
||||
count_failed++;
|
||||
}
|
||||
/* possible free(NULL) */
|
||||
free(hash_value);
|
||||
free(line);
|
||||
}
|
||||
if (count_failed && !(flags & FLAG_SILENT)) {
|
||||
bb_error_msg("WARNING: %d of %d computed checksums did NOT match",
|
||||
count_failed, count_total);
|
||||
}
|
||||
if (bb_fclose_nonstdin(pre_computed_stream) == EOF) {
|
||||
bb_perror_msg_and_die("Couldnt close file %s", file_ptr);
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
uint8_t hash_length;
|
||||
|
||||
if (hash_algo == HASH_MD5) {
|
||||
hash_length = 16;
|
||||
} else {
|
||||
hash_length = 20;
|
||||
}
|
||||
hash_value = xmalloc(hash_length);
|
||||
|
||||
while (optind < argc) {
|
||||
unsigned char *file_ptr = argv[optind++];
|
||||
|
||||
hash_value = hash_file(file_ptr, hash_algo);
|
||||
if (hash_value == NULL) {
|
||||
return_value++;
|
||||
} else {
|
||||
printf("%s %s\n", hash_value, file_ptr);
|
||||
free(hash_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return (return_value);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MD5SUM
|
||||
extern int md5sum_main(int argc, char **argv)
|
||||
{
|
||||
return(hash_files(argc, argv, HASH_MD5));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SHA1SUM
|
||||
extern int sha1sum_main(int argc, char **argv)
|
||||
{
|
||||
return(hash_files(argc, argv, HASH_SHA1));
|
||||
}
|
||||
#endif
|
||||
-1102
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -411,7 +411,7 @@ static unsigned long xstrtoul(char *arg)
|
||||
assert(arg!=NULL);
|
||||
|
||||
errno = 0;
|
||||
result = strtoul(arg, &endptr, 10);
|
||||
result = strtoul(arg, &endptr, 0);
|
||||
if (errno != 0 || *endptr!='\0' || endptr==arg)
|
||||
fprintf(stderr, "%s", arg);
|
||||
//errno = errno_save;
|
||||
@@ -427,7 +427,7 @@ static long xstrtol(char *arg)
|
||||
assert(arg!=NULL);
|
||||
|
||||
errno = 0;
|
||||
result = strtoul(arg, &endptr, 10);
|
||||
result = strtoul(arg, &endptr, 0);
|
||||
if (errno != 0 || *endptr!='\0' || endptr==arg)
|
||||
fprintf(stderr, "%s", arg);
|
||||
//errno = errno_save;
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* 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 Library 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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "busybox.h"
|
||||
|
||||
extern int seq_main(int argc, char **argv)
|
||||
{
|
||||
double last;
|
||||
double first = 1;
|
||||
double increment = 1;
|
||||
double i;
|
||||
|
||||
if (argc == 4) {
|
||||
first = atof(argv[1]);
|
||||
increment = atof(argv[2]);
|
||||
}
|
||||
else if (argc == 3) {
|
||||
first = atof(argv[1]);
|
||||
}
|
||||
else if (argc != 2) {
|
||||
bb_show_usage();
|
||||
}
|
||||
last = atof(argv[argc - 1]);
|
||||
|
||||
for (i = first; ((first <= last) ? (i <= last): (i >= last));i += increment) {
|
||||
printf("%g\n", i);
|
||||
}
|
||||
|
||||
return(EXIT_SUCCESS);
|
||||
}
|
||||
@@ -1,492 +0,0 @@
|
||||
/*
|
||||
* Based on shasum from http://www.netsw.org/crypto/hash/
|
||||
* Majorly hacked up to use Dr Brian Gladman's sha1 code
|
||||
*
|
||||
* Copyright (C) 1999 Scott G. Miller
|
||||
* Copyright (C) 2003 Glenn L. McGrath
|
||||
* Copyright (C) 2003 Erik Andersen
|
||||
*
|
||||
* 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 <stdio.h>
|
||||
#include <getopt.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#include <endian.h>
|
||||
#include <byteswap.h>
|
||||
#include "busybox.h"
|
||||
|
||||
|
||||
/*
|
||||
---------------------------------------------------------------------------
|
||||
Begin Dr. Gladman's sha1 code
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
---------------------------------------------------------------------------
|
||||
Copyright (c) 2002, Dr Brian Gladman <brg@gladman.me.uk>, Worcester, UK.
|
||||
All rights reserved.
|
||||
|
||||
LICENSE TERMS
|
||||
|
||||
The free distribution and use of this software in both source and binary
|
||||
form is allowed (with or without changes) provided that:
|
||||
|
||||
1. distributions of this source code include the above copyright
|
||||
notice, this list of conditions and the following disclaimer;
|
||||
|
||||
2. distributions in binary form include the above copyright
|
||||
notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other associated materials;
|
||||
|
||||
3. the copyright holder's name is not used to endorse products
|
||||
built using this software without specific written permission.
|
||||
|
||||
ALTERNATIVELY, provided that this notice is retained in full, this product
|
||||
may be distributed under the terms of the GNU General Public License (GPL),
|
||||
in which case the provisions of the GPL apply INSTEAD OF those given above.
|
||||
|
||||
DISCLAIMER
|
||||
|
||||
This software is provided 'as is' with no explicit or implied warranties
|
||||
in respect of its properties, including, but not limited to, correctness
|
||||
and/or fitness for purpose.
|
||||
---------------------------------------------------------------------------
|
||||
Issue Date: 10/11/2002
|
||||
|
||||
This is a byte oriented version of SHA1 that operates on arrays of bytes
|
||||
stored in memory. It runs at 22 cycles per byte on a Pentium P4 processor
|
||||
*/
|
||||
|
||||
#define SHA1_BLOCK_SIZE 64
|
||||
#define SHA1_DIGEST_SIZE 20
|
||||
#define SHA1_HASH_SIZE SHA1_DIGEST_SIZE
|
||||
#define SHA2_GOOD 0
|
||||
#define SHA2_BAD 1
|
||||
|
||||
/* type to hold the SHA1 context */
|
||||
typedef struct
|
||||
{ uint32_t count[2];
|
||||
uint32_t hash[5];
|
||||
uint32_t wbuf[16];
|
||||
} sha1_ctx;
|
||||
|
||||
#define rotl32(x,n) (((x) << n) | ((x) >> (32 - n)))
|
||||
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
# define swap_b32(x) (x)
|
||||
#elif defined(bswap_32)
|
||||
# define swap_b32(x) bswap_32(x)
|
||||
#else
|
||||
# define swap_b32(x) ((rotl32((x), 8) & 0x00ff00ff) | (rotl32((x), 24) & 0xff00ff00))
|
||||
#endif
|
||||
|
||||
#define SHA1_MASK (SHA1_BLOCK_SIZE - 1)
|
||||
|
||||
/* reverse byte order in 32-bit words */
|
||||
#define ch(x,y,z) (((x) & (y)) ^ (~(x) & (z)))
|
||||
#define parity(x,y,z) ((x) ^ (y) ^ (z))
|
||||
#define maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
|
||||
|
||||
/* A normal version as set out in the FIPS. This version uses */
|
||||
/* partial loop unrolling and is optimised for the Pentium 4 */
|
||||
#define rnd(f,k) \
|
||||
t = a; a = rotl32(a,5) + f(b,c,d) + e + k + w[i]; \
|
||||
e = d; d = c; c = rotl32(b, 30); b = t
|
||||
|
||||
void sha1_compile(sha1_ctx ctx[1])
|
||||
{
|
||||
uint32_t w[80], i, a, b, c, d, e, t;
|
||||
|
||||
/* note that words are compiled from the buffer into 32-bit */
|
||||
/* words in big-endian order so an order reversal is needed */
|
||||
/* here on little endian machines */
|
||||
for(i = 0; i < SHA1_BLOCK_SIZE / 4; ++i)
|
||||
w[i] = swap_b32(ctx->wbuf[i]);
|
||||
|
||||
for(i = SHA1_BLOCK_SIZE / 4; i < 80; ++i)
|
||||
w[i] = rotl32(w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16], 1);
|
||||
|
||||
a = ctx->hash[0];
|
||||
b = ctx->hash[1];
|
||||
c = ctx->hash[2];
|
||||
d = ctx->hash[3];
|
||||
e = ctx->hash[4];
|
||||
|
||||
for(i = 0; i < 20; ++i)
|
||||
{
|
||||
rnd(ch, 0x5a827999);
|
||||
}
|
||||
|
||||
for(i = 20; i < 40; ++i)
|
||||
{
|
||||
rnd(parity, 0x6ed9eba1);
|
||||
}
|
||||
|
||||
for(i = 40; i < 60; ++i)
|
||||
{
|
||||
rnd(maj, 0x8f1bbcdc);
|
||||
}
|
||||
|
||||
for(i = 60; i < 80; ++i)
|
||||
{
|
||||
rnd(parity, 0xca62c1d6);
|
||||
}
|
||||
|
||||
ctx->hash[0] += a;
|
||||
ctx->hash[1] += b;
|
||||
ctx->hash[2] += c;
|
||||
ctx->hash[3] += d;
|
||||
ctx->hash[4] += e;
|
||||
}
|
||||
|
||||
void sha1_begin(sha1_ctx ctx[1])
|
||||
{
|
||||
ctx->count[0] = ctx->count[1] = 0;
|
||||
ctx->hash[0] = 0x67452301;
|
||||
ctx->hash[1] = 0xefcdab89;
|
||||
ctx->hash[2] = 0x98badcfe;
|
||||
ctx->hash[3] = 0x10325476;
|
||||
ctx->hash[4] = 0xc3d2e1f0;
|
||||
}
|
||||
|
||||
/* SHA1 hash data in an array of bytes into hash buffer and call the */
|
||||
/* hash_compile function as required. */
|
||||
void sha1_hash(const unsigned char data[], unsigned int len, sha1_ctx ctx[1])
|
||||
{
|
||||
uint32_t pos = (uint32_t)(ctx->count[0] & SHA1_MASK),
|
||||
freeb = SHA1_BLOCK_SIZE - pos;
|
||||
const unsigned char *sp = data;
|
||||
|
||||
if((ctx->count[0] += len) < len)
|
||||
++(ctx->count[1]);
|
||||
|
||||
while(len >= freeb) /* tranfer whole blocks while possible */
|
||||
{
|
||||
memcpy(((unsigned char*)ctx->wbuf) + pos, sp, freeb);
|
||||
sp += freeb; len -= freeb; freeb = SHA1_BLOCK_SIZE; pos = 0;
|
||||
sha1_compile(ctx);
|
||||
}
|
||||
|
||||
memcpy(((unsigned char*)ctx->wbuf) + pos, sp, len);
|
||||
}
|
||||
|
||||
/* SHA1 Final padding and digest calculation */
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
static uint32_t mask[4] =
|
||||
{ 0x00000000, 0x000000ff, 0x0000ffff, 0x00ffffff };
|
||||
static uint32_t bits[4] =
|
||||
{ 0x00000080, 0x00008000, 0x00800000, 0x80000000 };
|
||||
#else
|
||||
static uint32_t mask[4] =
|
||||
{ 0x00000000, 0xff000000, 0xffff0000, 0xffffff00 };
|
||||
static uint32_t bits[4] =
|
||||
{ 0x80000000, 0x00800000, 0x00008000, 0x00000080 };
|
||||
#endif
|
||||
|
||||
void sha1_end(unsigned char hval[], sha1_ctx ctx[1])
|
||||
{
|
||||
uint32_t i, cnt = (uint32_t)(ctx->count[0] & SHA1_MASK);
|
||||
|
||||
/* mask out the rest of any partial 32-bit word and then set */
|
||||
/* the next byte to 0x80. On big-endian machines any bytes in */
|
||||
/* the buffer will be at the top end of 32 bit words, on little */
|
||||
/* endian machines they will be at the bottom. Hence the AND */
|
||||
/* and OR masks above are reversed for little endian systems */
|
||||
ctx->wbuf[cnt >> 2] = (ctx->wbuf[cnt >> 2] & mask[cnt & 3]) | bits[cnt & 3];
|
||||
|
||||
/* we need 9 or more empty positions, one for the padding byte */
|
||||
/* (above) and eight for the length count. If there is not */
|
||||
/* enough space pad and empty the buffer */
|
||||
if(cnt > SHA1_BLOCK_SIZE - 9)
|
||||
{
|
||||
if(cnt < 60) ctx->wbuf[15] = 0;
|
||||
sha1_compile(ctx);
|
||||
cnt = 0;
|
||||
}
|
||||
else /* compute a word index for the empty buffer positions */
|
||||
cnt = (cnt >> 2) + 1;
|
||||
|
||||
while(cnt < 14) /* and zero pad all but last two positions */
|
||||
ctx->wbuf[cnt++] = 0;
|
||||
|
||||
/* assemble the eight byte counter in the buffer in big-endian */
|
||||
/* format */
|
||||
|
||||
ctx->wbuf[14] = swap_b32((ctx->count[1] << 3) | (ctx->count[0] >> 29));
|
||||
ctx->wbuf[15] = swap_b32(ctx->count[0] << 3);
|
||||
|
||||
sha1_compile(ctx);
|
||||
|
||||
/* extract the hash value as bytes in case the hash buffer is */
|
||||
/* misaligned for 32-bit words */
|
||||
|
||||
for(i = 0; i < SHA1_DIGEST_SIZE; ++i)
|
||||
hval[i] = (unsigned char)(ctx->hash[i >> 2] >> 8 * (~i & 3));
|
||||
}
|
||||
|
||||
#if 0
|
||||
void sha1(unsigned char hval[], const unsigned char data[], unsigned int len)
|
||||
{ sha1_ctx cx[1];
|
||||
|
||||
sha1_begin(cx); sha1_hash(data, len, cx); sha1_end(hval, cx);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
---------------------------------------------------------------------------
|
||||
End of Dr. Gladman's sha1 code
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* Using a larger blocksize can make things _much_ faster
|
||||
* by avoiding a zillion tiny little reads */
|
||||
#define BLOCKSIZE 65536
|
||||
/* Ensure that BLOCKSIZE is a multiple of 64. */
|
||||
#if BLOCKSIZE % SHA1_BLOCK_SIZE != 0
|
||||
# error "BLOCKSIZE not a multiple of 64"
|
||||
#endif
|
||||
|
||||
static int sha1sum_stream(FILE *stream, unsigned char *hashval)
|
||||
{
|
||||
int result = 0;
|
||||
sha1_ctx cx[1];
|
||||
size_t sum, n;
|
||||
RESERVE_CONFIG_BUFFER(buffer, BLOCKSIZE + 72);
|
||||
|
||||
/* Initialize the computation context. */
|
||||
sha1_begin(cx);
|
||||
|
||||
/* Iterate over full file contents. */
|
||||
while (1)
|
||||
{
|
||||
/* We read the file in blocks of BLOCKSIZE bytes. One call of the
|
||||
computation function processes the whole buffer so that with the
|
||||
next round of the loop another block can be read. */
|
||||
sum = 0;
|
||||
|
||||
/* Read block. Take care for partial reads. */
|
||||
while (1)
|
||||
{
|
||||
n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
|
||||
sum += n;
|
||||
|
||||
if (sum == BLOCKSIZE)
|
||||
break;
|
||||
|
||||
if (n == 0) {
|
||||
/* Check for the error flag IFF N == 0, so that we don't
|
||||
exit the loop after a partial read due to e.g., EAGAIN
|
||||
or EWOULDBLOCK. */
|
||||
if (feof (stream)) {
|
||||
sum = 0;
|
||||
goto process_partial_block;
|
||||
}
|
||||
if (ferror (stream)) {
|
||||
result++;
|
||||
goto all_done;
|
||||
}
|
||||
goto process_partial_block;
|
||||
}
|
||||
|
||||
/* We've read at least one byte, so ignore errors. But always
|
||||
check for EOF, since feof may be true even though N > 0.
|
||||
Otherwise, we could end up calling fread after EOF. */
|
||||
if (feof (stream))
|
||||
goto process_partial_block;
|
||||
}
|
||||
|
||||
/* Process buffer */
|
||||
sha1_hash(buffer, BLOCKSIZE, cx);
|
||||
}
|
||||
|
||||
process_partial_block:
|
||||
|
||||
/* Process any remaining bytes. */
|
||||
if (sum > 0)
|
||||
sha1_hash(buffer, sum, cx);
|
||||
|
||||
/* Finalize and write the hash into our buffer. */
|
||||
sha1_end(hashval, cx);
|
||||
|
||||
all_done:
|
||||
|
||||
RELEASE_CONFIG_BUFFER(buffer);
|
||||
return result;
|
||||
}
|
||||
|
||||
#define FLAG_SILENT 1
|
||||
#define FLAG_CHECK 2
|
||||
#define FLAG_WARN 4
|
||||
|
||||
static unsigned char *hash_bin_to_hex(unsigned char *hash_value, unsigned char hash_length)
|
||||
{
|
||||
int x, len, max;
|
||||
unsigned char *hex_value;
|
||||
|
||||
max = (hash_length * 2) + 2;
|
||||
hex_value = xmalloc(max);
|
||||
for (x = len = 0; x < hash_length; x++) {
|
||||
len += snprintf(hex_value+len, max-len, "%02x", hash_value[x]);
|
||||
}
|
||||
return(hex_value);
|
||||
}
|
||||
|
||||
FILE *wfopen_file_or_stdin(const char *file_ptr)
|
||||
{
|
||||
FILE *stream;
|
||||
|
||||
if ((file_ptr[0] == '-') && (file_ptr[1] == '\0')) {
|
||||
stream = stdin;
|
||||
} else {
|
||||
stream = bb_wfopen(file_ptr, "r");
|
||||
}
|
||||
|
||||
return(stream);
|
||||
}
|
||||
|
||||
/* This could become a common function for md5 as well, by using md5_stream */
|
||||
extern int authenticate(int argc, char **argv,
|
||||
int (*hash_ptr)(FILE *stream, unsigned char *hashval),
|
||||
const unsigned char hash_length)
|
||||
{
|
||||
unsigned char hash_value[hash_length];
|
||||
unsigned int flags;
|
||||
int return_value = EXIT_SUCCESS;
|
||||
|
||||
#ifdef CONFIG_FEATURE_SHA1SUM_CHECK
|
||||
flags = bb_getopt_ulflags(argc, argv, "scw");
|
||||
#else
|
||||
flags = bb_getopt_ulflags(argc, argv, "s");
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_SHA1SUM_CHECK
|
||||
if (!(flags & FLAG_CHECK)) {
|
||||
if (flags & FLAG_SILENT) {
|
||||
bb_error_msg_and_die("the -s option is meaningful only when verifying checksums");
|
||||
}
|
||||
else if (flags & FLAG_WARN) {
|
||||
bb_error_msg_and_die("the -w option is meaningful only when verifying checksums");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (argc == optind) {
|
||||
argv[argc++] = "-";
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FEATURE_SHA1SUM_CHECK
|
||||
if (flags & FLAG_CHECK) {
|
||||
FILE *pre_computed_stream;
|
||||
int count_total = 0;
|
||||
int count_failed = 0;
|
||||
unsigned char *file_ptr = argv[optind];
|
||||
|
||||
if (optind + 1 != argc) {
|
||||
bb_error_msg_and_die("only one argument may be specified when using -c");
|
||||
}
|
||||
pre_computed_stream = wfopen_file_or_stdin(file_ptr);
|
||||
while (!feof(pre_computed_stream) && !ferror(pre_computed_stream)) {
|
||||
FILE *stream;
|
||||
char *line;
|
||||
char *line_ptr;
|
||||
char *hex_value;
|
||||
|
||||
line = bb_get_chomped_line_from_file(pre_computed_stream);
|
||||
if (line == NULL) {
|
||||
break;
|
||||
}
|
||||
count_total++;
|
||||
line_ptr = strchr(line, ' ');
|
||||
if (line_ptr == NULL) {
|
||||
if (flags & FLAG_WARN) {
|
||||
bb_error_msg("Invalid format");
|
||||
}
|
||||
free(line);
|
||||
continue;
|
||||
}
|
||||
*line_ptr = '\0';
|
||||
line_ptr++;
|
||||
if ((flags & FLAG_WARN) && (*line_ptr != ' ')) {
|
||||
bb_error_msg("Invalid format");
|
||||
free(line);
|
||||
continue;
|
||||
}
|
||||
line_ptr++;
|
||||
stream = bb_wfopen(line_ptr, "r");
|
||||
if (hash_ptr(stream, hash_value) == EXIT_FAILURE) {
|
||||
bb_perror_msg("%s", file_ptr);
|
||||
return_value = EXIT_FAILURE;
|
||||
}
|
||||
if (fclose(stream) == EOF) {
|
||||
bb_perror_msg("Couldnt close file %s", file_ptr);
|
||||
}
|
||||
hex_value = hash_bin_to_hex(hash_value, hash_length);
|
||||
printf("%s: ", line_ptr);
|
||||
if (strcmp(hex_value, line) != 0) {
|
||||
puts("FAILED");
|
||||
count_failed++;
|
||||
} else {
|
||||
puts("ok");
|
||||
}
|
||||
free(line);
|
||||
}
|
||||
if (count_failed) {
|
||||
bb_error_msg("WARNING: %d of %d computed checksum did NOT match", count_failed, count_total);
|
||||
}
|
||||
if (bb_fclose_nonstdin(pre_computed_stream) == EOF) {
|
||||
bb_perror_msg_and_die("Couldnt close file %s", file_ptr);
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
while (optind < argc) {
|
||||
FILE *stream;
|
||||
unsigned char *file_ptr = argv[optind];
|
||||
|
||||
optind++;
|
||||
|
||||
stream = wfopen_file_or_stdin(file_ptr);
|
||||
if (stream == NULL) {
|
||||
return_value = EXIT_FAILURE;
|
||||
continue;
|
||||
}
|
||||
if (hash_ptr(stream, hash_value) == EXIT_FAILURE) {
|
||||
bb_perror_msg("%s", file_ptr);
|
||||
return_value = EXIT_FAILURE;
|
||||
}
|
||||
else if (!flags & FLAG_SILENT) {
|
||||
char *hex_value = hash_bin_to_hex(hash_value, hash_length);
|
||||
printf("%s %s\n", hex_value, file_ptr);
|
||||
free(hex_value);
|
||||
}
|
||||
|
||||
if (bb_fclose_nonstdin(stream) == EOF) {
|
||||
bb_perror_msg("Couldnt close file %s", file_ptr);
|
||||
return_value = EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
return(return_value);
|
||||
}
|
||||
|
||||
extern int sha1sum_main(int argc, char **argv)
|
||||
{
|
||||
return (authenticate(argc, argv, sha1sum_stream, SHA1_HASH_SIZE));
|
||||
}
|
||||
+6
-16
@@ -89,9 +89,9 @@ static ssize_t tail_read(int fd, char *buf, size_t count)
|
||||
}
|
||||
|
||||
static const char tail_opts[] =
|
||||
"fn:"
|
||||
"fn:c:"
|
||||
#ifdef CONFIG_FEATURE_FANCY_TAIL
|
||||
"c:qs:v"
|
||||
"qs:v"
|
||||
#endif
|
||||
;
|
||||
|
||||
@@ -104,9 +104,7 @@ int tail_main(int argc, char **argv)
|
||||
int from_top = 0;
|
||||
int follow = 0;
|
||||
int header_threshhold = 1;
|
||||
#ifdef CONFIG_FEATURE_FANCY_TAIL
|
||||
int count_bytes = 0;
|
||||
#endif
|
||||
|
||||
char *tailbuf;
|
||||
size_t tailbufsize;
|
||||
@@ -132,11 +130,9 @@ int tail_main(int argc, char **argv)
|
||||
case 'f':
|
||||
follow = 1;
|
||||
break;
|
||||
#ifdef CONFIG_FEATURE_FANCY_TAIL
|
||||
case 'c':
|
||||
count_bytes = 1;
|
||||
/* FALLS THROUGH */
|
||||
#endif
|
||||
case 'n':
|
||||
GET_COUNT:
|
||||
count = bb_xgetlarg10_sfx(optarg, tail_suffixes);
|
||||
@@ -201,7 +197,7 @@ int tail_main(int argc, char **argv)
|
||||
}
|
||||
|
||||
tailbufsize = BUFSIZ;
|
||||
#ifdef CONFIG_FEATURE_FANCY_TAIL
|
||||
|
||||
/* tail the files */
|
||||
if (from_top < count_bytes) { /* Each is 0 or 1, so true iff 0 < 1. */
|
||||
/* Hence, !from_top && count_bytes */
|
||||
@@ -209,7 +205,7 @@ int tail_main(int argc, char **argv)
|
||||
tailbufsize = count + BUFSIZ;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
buf = tailbuf = xmalloc(tailbufsize);
|
||||
|
||||
fmt = header_fmt + 1; /* Skip header leading newline on first output. */
|
||||
@@ -237,13 +233,10 @@ int tail_main(int argc, char **argv)
|
||||
if (from_top) {
|
||||
nwrite = nread;
|
||||
if (seen < count) {
|
||||
#ifdef CONFIG_FEATURE_FANCY_TAIL
|
||||
if (count_bytes) {
|
||||
nwrite -= (count - seen);
|
||||
seen = count;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
} else {
|
||||
s = buf;
|
||||
do {
|
||||
--nwrite;
|
||||
@@ -255,16 +248,13 @@ int tail_main(int argc, char **argv)
|
||||
}
|
||||
tail_xbb_full_write(buf + nread - nwrite, nwrite);
|
||||
} else if (count) {
|
||||
#ifdef CONFIG_FEATURE_FANCY_TAIL
|
||||
if (count_bytes) {
|
||||
taillen += nread;
|
||||
if (taillen > count) {
|
||||
memmove(tailbuf, tailbuf + taillen - count, count);
|
||||
taillen = count;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
} else {
|
||||
int k = nread;
|
||||
int nbuf = 0;
|
||||
|
||||
|
||||
@@ -89,6 +89,7 @@ int tee_main(int argc, char **argv)
|
||||
#endif
|
||||
|
||||
#else
|
||||
setvbuf(stdout, NULL, _IONBF, 0);
|
||||
while ((c = getchar()) != EOF) {
|
||||
for (p=files ; *p ; p++) {
|
||||
putc(c, *p);
|
||||
|
||||
+160
-312
@@ -1,353 +1,201 @@
|
||||
/* uudecode.c -- uudecode utility.
|
||||
* Copyright (C) 1994, 1995 Free Software Foundation, Inc.
|
||||
/*
|
||||
* GPLv2
|
||||
* Copyright 2003, Glenn McGrath <bug1@optushome.com.au>
|
||||
*
|
||||
* This product 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, or (at your option)
|
||||
* any later version.
|
||||
* 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
|
||||
* by the Free Software Foundation; either version 2 of the License.
|
||||
*
|
||||
* This product 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 Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this product; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 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.
|
||||
*
|
||||
* Reworked to GNU style by Ian Lance Taylor, ian@airs.com, August 93.
|
||||
* Based on specification from
|
||||
* http://www.opengroup.org/onlinepubs/007904975/utilities/uuencode.html
|
||||
*
|
||||
* Original copyright notice is retained at the end of this file.
|
||||
* Bugs: the spec doesnt mention anything about "`\n`\n" prior to the "end" line
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "busybox.h"
|
||||
#include "pwd_.h"
|
||||
#include "grp_.h"
|
||||
|
||||
/*struct passwd *getpwnam();*/
|
||||
#include "libbb.h"
|
||||
|
||||
/* Single character decode. */
|
||||
#define DEC(Char) (((Char) - ' ') & 077)
|
||||
|
||||
static int read_stduu (const char *inname)
|
||||
static int read_stduu(FILE *src_stream, FILE *dst_stream)
|
||||
{
|
||||
char buf[2 * BUFSIZ];
|
||||
char *line;
|
||||
|
||||
while (1) {
|
||||
int n;
|
||||
char *p;
|
||||
while ((line = bb_get_chomped_line_from_file(src_stream)) != NULL) {
|
||||
int length;
|
||||
char *line_ptr = line;
|
||||
|
||||
if (fgets (buf, sizeof(buf), stdin) == NULL) {
|
||||
bb_error_msg("%s: Short file", inname);
|
||||
return FALSE;
|
||||
}
|
||||
p = buf;
|
||||
if (strcmp(line, "end") == 0) {
|
||||
return(EXIT_SUCCESS);
|
||||
}
|
||||
length = ((*line_ptr - 0x20) & 0x3f)* 4 / 3;
|
||||
|
||||
/* N is used to avoid writing out all the characters at the end of
|
||||
the file. */
|
||||
n = DEC (*p);
|
||||
if (n <= 0)
|
||||
break;
|
||||
for (++p; n > 0; p += 4, n -= 3) {
|
||||
char ch;
|
||||
if (length <= 0) {
|
||||
/* Ignore the "`\n" line, why is it even in the encode file ? */
|
||||
continue;
|
||||
}
|
||||
if (length > 60) {
|
||||
bb_error_msg_and_die("Line too long");
|
||||
}
|
||||
|
||||
line_ptr++;
|
||||
/* Tolerate an overly long line to acomadate a possible exta '`' */
|
||||
if (strlen(line_ptr) < length) {
|
||||
bb_error_msg_and_die("Short file");
|
||||
}
|
||||
|
||||
if (n >= 3) {
|
||||
ch = DEC (p[0]) << 2 | DEC (p[1]) >> 4;
|
||||
putchar (ch);
|
||||
ch = DEC (p[1]) << 4 | DEC (p[2]) >> 2;
|
||||
putchar (ch);
|
||||
ch = DEC (p[2]) << 6 | DEC (p[3]);
|
||||
putchar (ch);
|
||||
} else {
|
||||
if (n >= 1) {
|
||||
ch = DEC (p[0]) << 2 | DEC (p[1]) >> 4;
|
||||
putchar (ch);
|
||||
}
|
||||
if (n >= 2) {
|
||||
ch = DEC (p[1]) << 4 | DEC (p[2]) >> 2;
|
||||
putchar (ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
while (length > 0) {
|
||||
/* Merge four 6 bit chars to three 8 bit chars */
|
||||
fputc(((line_ptr[0] - 0x20) & 077) << 2 | ((line_ptr[1] - 0x20) & 077) >> 4, dst_stream);
|
||||
line_ptr++;
|
||||
length--;
|
||||
if (length == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (fgets (buf, sizeof(buf), stdin) == NULL
|
||||
|| strcmp (buf, "end\n")) {
|
||||
bb_error_msg("%s: No `end' line", inname);
|
||||
return FALSE;
|
||||
}
|
||||
fputc(((line_ptr[0] - 0x20) & 077) << 4 | ((line_ptr[1] - 0x20) & 077) >> 2, dst_stream);
|
||||
line_ptr++;
|
||||
length--;
|
||||
if (length == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
fputc(((line_ptr[0] - 0x20) & 077) << 6 | ((line_ptr[1] - 0x20) & 077), dst_stream);
|
||||
line_ptr += 2;
|
||||
length -= 2;
|
||||
}
|
||||
free(line);
|
||||
}
|
||||
bb_error_msg_and_die("Short file");
|
||||
}
|
||||
|
||||
static int read_base64 (const char *inname)
|
||||
static int read_base64(FILE *src_stream, FILE *dst_stream)
|
||||
{
|
||||
static const char b64_tab[256] = {
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*000-007*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*010-017*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*020-027*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*030-037*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*040-047*/
|
||||
'\177', '\177', '\177', '\76', '\177', '\177', '\177', '\77', /*050-057*/
|
||||
'\64', '\65', '\66', '\67', '\70', '\71', '\72', '\73', /*060-067*/
|
||||
'\74', '\75', '\177', '\177', '\177', '\100', '\177', '\177', /*070-077*/
|
||||
'\177', '\0', '\1', '\2', '\3', '\4', '\5', '\6', /*100-107*/
|
||||
'\7', '\10', '\11', '\12', '\13', '\14', '\15', '\16', /*110-117*/
|
||||
'\17', '\20', '\21', '\22', '\23', '\24', '\25', '\26', /*120-127*/
|
||||
'\27', '\30', '\31', '\177', '\177', '\177', '\177', '\177', /*130-137*/
|
||||
'\177', '\32', '\33', '\34', '\35', '\36', '\37', '\40', /*140-147*/
|
||||
'\41', '\42', '\43', '\44', '\45', '\46', '\47', '\50', /*150-157*/
|
||||
'\51', '\52', '\53', '\54', '\55', '\56', '\57', '\60', /*160-167*/
|
||||
'\61', '\62', '\63', '\177', '\177', '\177', '\177', '\177', /*170-177*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*200-207*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*210-217*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*220-227*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*230-237*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*240-247*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*250-257*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*260-267*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*270-277*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*300-307*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*310-317*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*320-327*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*330-337*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*340-347*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*350-357*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*360-367*/
|
||||
'\177', '\177', '\177', '\177', '\177', '\177', '\177', '\177', /*370-377*/
|
||||
};
|
||||
unsigned char buf[2 * BUFSIZ];
|
||||
const char *base64_table =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n";
|
||||
char term_count = 0;
|
||||
|
||||
while (1) {
|
||||
int last_data = 0;
|
||||
unsigned char *p;
|
||||
while (1) {
|
||||
char translated[4];
|
||||
int count = 0;
|
||||
|
||||
if (fgets (buf, sizeof(buf), stdin) == NULL) {
|
||||
bb_error_msg("%s: Short file", inname);
|
||||
return FALSE;
|
||||
}
|
||||
p = buf;
|
||||
while (count < 4) {
|
||||
char *table_ptr;
|
||||
char ch;
|
||||
|
||||
if (memcmp (buf, "====", 4) == 0)
|
||||
break;
|
||||
if (last_data != 0) {
|
||||
bb_error_msg("%s: data following `=' padding character", inname);
|
||||
return FALSE;
|
||||
}
|
||||
/* Get next _valid_ character */
|
||||
do {
|
||||
ch = fgetc(src_stream);
|
||||
if (ch == EOF) {
|
||||
bb_error_msg_and_die("Short file");
|
||||
}
|
||||
} while ((table_ptr = strchr(base64_table, ch)) == NULL);
|
||||
|
||||
/* The following implementation of the base64 decoding might look
|
||||
a bit clumsy but I only try to follow the POSIX standard:
|
||||
``All line breaks or other characters not found in the table
|
||||
[with base64 characters] shall be ignored by decoding
|
||||
software.'' */
|
||||
while (*p != '\n') {
|
||||
char c1, c2, c3;
|
||||
/* Convert encoded charcter to decimal */
|
||||
ch = table_ptr - base64_table;
|
||||
|
||||
while ((b64_tab[*p] & '\100') != 0)
|
||||
if (*p == '\n' || *p++ == '=')
|
||||
break;
|
||||
if (*p == '\n')
|
||||
/* This leaves the loop. */
|
||||
continue;
|
||||
c1 = b64_tab[*p++];
|
||||
if (*table_ptr == '=') {
|
||||
if (term_count == 0) {
|
||||
translated[count] = 0;
|
||||
break;
|
||||
}
|
||||
term_count++;
|
||||
}
|
||||
else if (*table_ptr == '\n') {
|
||||
/* Check for terminating line */
|
||||
if (term_count == 5) {
|
||||
return(EXIT_SUCCESS);
|
||||
}
|
||||
term_count = 1;
|
||||
continue;
|
||||
} else {
|
||||
translated[count] = ch;
|
||||
count++;
|
||||
term_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
while ((b64_tab[*p] & '\100') != 0)
|
||||
if (*p == '\n' || *p++ == '=') {
|
||||
bb_error_msg("%s: illegal line", inname);
|
||||
return FALSE;
|
||||
}
|
||||
c2 = b64_tab[*p++];
|
||||
|
||||
while (b64_tab[*p] == '\177')
|
||||
if (*p++ == '\n') {
|
||||
bb_error_msg("%s: illegal line", inname);
|
||||
return FALSE;
|
||||
}
|
||||
if (*p == '=') {
|
||||
putchar (c1 << 2 | c2 >> 4);
|
||||
last_data = 1;
|
||||
break;
|
||||
}
|
||||
c3 = b64_tab[*p++];
|
||||
|
||||
while (b64_tab[*p] == '\177')
|
||||
if (*p++ == '\n') {
|
||||
bb_error_msg("%s: illegal line", inname);
|
||||
return FALSE;
|
||||
}
|
||||
putchar (c1 << 2 | c2 >> 4);
|
||||
putchar (c2 << 4 | c3 >> 2);
|
||||
if (*p == '=') {
|
||||
last_data = 1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
putchar (c3 << 6 | b64_tab[*p++]);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
/* Merge 6 bit chars to 8 bit */
|
||||
fputc(translated[0] << 2 | translated[1] >> 4, dst_stream);
|
||||
if (count > 2) {
|
||||
fputc(translated[1] << 4 | translated[2] >> 2, dst_stream);
|
||||
}
|
||||
if (count > 3) {
|
||||
fputc(translated[2] << 6 | translated[3], dst_stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int decode (const char *inname,
|
||||
const char *forced_outname)
|
||||
extern int uudecode_main(int argc, char **argv)
|
||||
{
|
||||
struct passwd *pw;
|
||||
register char *p;
|
||||
int mode;
|
||||
char buf[2 * BUFSIZ];
|
||||
char *outname;
|
||||
int do_base64 = 0;
|
||||
int res;
|
||||
int dofre;
|
||||
int (*decode_fn_ptr) (FILE * src, FILE * dst);
|
||||
FILE *src_stream;
|
||||
char *outname = NULL;
|
||||
char *line;
|
||||
int opt;
|
||||
|
||||
/* Search for header line. */
|
||||
opt = bb_getopt_ulflags(argc, argv, "o:", &outname);
|
||||
|
||||
while (1) {
|
||||
if (fgets (buf, sizeof (buf), stdin) == NULL) {
|
||||
bb_error_msg("%s: No `begin' line", inname);
|
||||
return FALSE;
|
||||
}
|
||||
if (optind == argc) {
|
||||
src_stream = stdin;
|
||||
} else if (optind + 1 == argc) {
|
||||
src_stream = bb_xfopen(argv[optind], "r");
|
||||
} else {
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
if (strncmp (buf, "begin", 5) == 0) {
|
||||
if (sscanf (buf, "begin-base64 %o %s", &mode, buf) == 2) {
|
||||
do_base64 = 1;
|
||||
break;
|
||||
} else if (sscanf (buf, "begin %o %s", &mode, buf) == 2)
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* Search for the start of the encoding */
|
||||
while ((line = bb_get_chomped_line_from_file(src_stream)) != NULL) {
|
||||
char *line_ptr = NULL;
|
||||
|
||||
/* If the output file name is given on the command line this rules. */
|
||||
dofre = FALSE;
|
||||
if (forced_outname != NULL)
|
||||
outname = (char *) forced_outname;
|
||||
else {
|
||||
/* Handle ~user/file format. */
|
||||
if (buf[0] != '~')
|
||||
outname = buf;
|
||||
else {
|
||||
p = buf + 1;
|
||||
while (*p != '/')
|
||||
++p;
|
||||
if (*p == '\0') {
|
||||
bb_error_msg("%s: Illegal ~user", inname);
|
||||
return FALSE;
|
||||
}
|
||||
*p++ = '\0';
|
||||
pw = getpwnam (buf + 1);
|
||||
if (pw == NULL) {
|
||||
bb_error_msg("%s: No user `%s'", inname, buf + 1);
|
||||
return FALSE;
|
||||
}
|
||||
outname = concat_path_file(pw->pw_dir, p);
|
||||
dofre = TRUE;
|
||||
}
|
||||
}
|
||||
if (line == NULL) {
|
||||
break;
|
||||
} else if (strncmp(line, "begin-base64 ", 13) == 0) {
|
||||
line_ptr = line + 13;
|
||||
decode_fn_ptr = read_base64;
|
||||
} else if (strncmp(line, "begin ", 6) == 0) {
|
||||
line_ptr = line + 6;
|
||||
decode_fn_ptr = read_stduu;
|
||||
}
|
||||
|
||||
/* Create output file and set mode. */
|
||||
if (strcmp (outname, "/dev/stdout") != 0 && strcmp (outname, "-") != 0
|
||||
&& (freopen (outname, "w", stdout) == NULL
|
||||
|| chmod (outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO))
|
||||
)) {
|
||||
bb_perror_msg("%s", outname); /* */
|
||||
if (dofre)
|
||||
free(outname);
|
||||
return FALSE;
|
||||
}
|
||||
if (line_ptr) {
|
||||
FILE *dst_stream;
|
||||
int mode;
|
||||
int ret;
|
||||
|
||||
/* We differenciate decoding standard UU encoding and base64. A
|
||||
common function would only slow down the program. */
|
||||
|
||||
/* For each input line: */
|
||||
if (do_base64)
|
||||
res = read_base64 (inname);
|
||||
else
|
||||
res = read_stduu (inname);
|
||||
if (dofre)
|
||||
free(outname);
|
||||
return res;
|
||||
mode = strtoul(line_ptr, NULL, 8);
|
||||
if (outname == NULL) {
|
||||
outname = strchr(line_ptr, ' ');
|
||||
if ((outname == NULL) || (*outname == '\0')) {
|
||||
break;
|
||||
}
|
||||
outname++;
|
||||
}
|
||||
if (strcmp(outname, "-") == 0) {
|
||||
dst_stream = stdout;
|
||||
} else {
|
||||
dst_stream = bb_xfopen(outname, "w");
|
||||
chmod(outname, mode & (S_IRWXU | S_IRWXG | S_IRWXO));
|
||||
}
|
||||
free(line);
|
||||
ret = decode_fn_ptr(src_stream, dst_stream);
|
||||
bb_fclose_nonstdin(src_stream);
|
||||
return(ret);
|
||||
}
|
||||
free(line);
|
||||
}
|
||||
bb_error_msg_and_die("No `begin' line");
|
||||
}
|
||||
|
||||
int uudecode_main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
int opt;
|
||||
int exit_status;
|
||||
const char *outname;
|
||||
outname = NULL;
|
||||
|
||||
while ((opt = getopt(argc, argv, "o:")) != EOF) {
|
||||
switch (opt) {
|
||||
case 0:
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
outname = optarg;
|
||||
break;
|
||||
|
||||
default:
|
||||
bb_show_usage();
|
||||
}
|
||||
}
|
||||
|
||||
if (optind == argc)
|
||||
exit_status = decode ("stdin", outname) == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
else {
|
||||
exit_status = EXIT_SUCCESS;
|
||||
do {
|
||||
if (freopen (argv[optind], "r", stdin) != NULL) {
|
||||
if (decode (argv[optind], outname) != 0)
|
||||
exit_status = FALSE;
|
||||
} else {
|
||||
bb_perror_msg("%s", argv[optind]);
|
||||
exit_status = EXIT_FAILURE;
|
||||
}
|
||||
optind++;
|
||||
}
|
||||
while (optind < argc);
|
||||
}
|
||||
return(exit_status);
|
||||
}
|
||||
|
||||
/* Copyright (c) 1983 Regents of the University of California.
|
||||
* 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. <BSD Advertising Clause omitted per the July 22, 1999 licensing change
|
||||
* ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>
|
||||
*
|
||||
* 4. Neither the name of the University 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 THE REGENTS 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 THE REGENTS 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.
|
||||
*/
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ static const char tbl_std[65] = {
|
||||
* buffer of at least 1+BASE64_LENGTH(length) bytes.
|
||||
* where BASE64_LENGTH(len) = (4 * ((LENGTH + 2) / 3))
|
||||
*/
|
||||
static void uuencode (const char *s, const char *store, const int length, const char *tbl)
|
||||
static void uuencode (const unsigned char *s, const char *store, const int length, const char *tbl)
|
||||
{
|
||||
int i;
|
||||
unsigned char *p = (unsigned char *)store;
|
||||
|
||||
Vendored
-13
@@ -1,13 +0,0 @@
|
||||
BusyBox for Debian
|
||||
----------------------
|
||||
|
||||
BusyBox is being developed and maintained by Erik Andersen
|
||||
<andersen@codepoet.org>.
|
||||
|
||||
If you find any bugs, please submit a detailed bug report to the busybox
|
||||
mailing list at <busybox@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. Bug reports
|
||||
lacking such detail may never be fixed...
|
||||
|
||||
Erik Andersen <andersen@codepoet.org>, Sun, 18 Jun 2000 21:52:00 -0600
|
||||
Vendored
+192
-2
@@ -1,9 +1,199 @@
|
||||
busybox-cvs (20031212-3) unstable; urgency=low
|
||||
|
||||
* debian/config-udeb-linux:
|
||||
- Enable freeramdisk. (closes: #225360)
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Tue, 30 Dec 2003 22:36:50 +0100
|
||||
|
||||
busybox-cvs (20031212-2) unstable; urgency=low
|
||||
|
||||
* debian/config-udeb:
|
||||
- Enable freeramdisk
|
||||
* archival/libunarchive/data_extract_to_stdout.c:
|
||||
- Don't extract to much (upstream).
|
||||
* archival/libunarchive/data_extract_all.c:
|
||||
- Don't set permissions on symlinks (upstream).
|
||||
* editors/sed.c:
|
||||
- Fix (upstream). (closes: #224676)
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Tue, 23 Dec 2003 16:59:13 +0100
|
||||
|
||||
busybox-cvs (20031212-1) unstable; urgency=low
|
||||
|
||||
* new cvs version
|
||||
- fixes IOR in fdisk. (closes: #223773)
|
||||
* debian/config*
|
||||
- update
|
||||
- remove mtab support from mount in busybox-static. (closes: #222386)
|
||||
- enable progress bar for wget. (closes: #223770)
|
||||
* modutils/obj/obj_s390{,x}.c
|
||||
- fix abi change, R_390_GOTOFF -> R_390_GOTOFF32. (closes: #216528)
|
||||
* acknowledge nmu. (closes: #216950, #216756, #215169, #215613)
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Fri, 12 Dec 2003 21:19:41 +0100
|
||||
|
||||
busybox-cvs (20030926-2.1) unstable; urgency=low
|
||||
|
||||
* NMU
|
||||
* Remove /sbin/init from the udebs, while still leaving init support
|
||||
compiled in. rootskel takes over providing init, but then calls bb init.
|
||||
Remove linuxrc support from the udebs entirely. Closes: #216756
|
||||
* config-floppy-udeb-linux: add minimal find, grep. Closes: #215169
|
||||
* net-udeb-linux-i386: add loopback mount support. Closes: #215613
|
||||
|
||||
-- Joey Hess <joeyh@debian.org> Tue, 21 Oct 2003 12:47:52 -0400
|
||||
|
||||
busybox-cvs (20030926-2) unstable; urgency=low
|
||||
|
||||
* debian/config-floppy-udeb-linux
|
||||
- update for new floppy images (closes: #212986, #214102)
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Thu, 09 Oct 2003 12:25:49 +0200
|
||||
|
||||
busybox-cvs (20030926-1) unstable; urgency=low
|
||||
|
||||
* new cvs version
|
||||
* Makefile
|
||||
- fix libpwdgrp link (upstream) (closes: #211675)
|
||||
* Rules.mak.in
|
||||
- fix optimization (closes: #212485)
|
||||
* debian/config*
|
||||
- update
|
||||
* debian/config*udeb*
|
||||
- move linux-i386 to linux (enable modutils on any linux arch)
|
||||
- rename net to floppy
|
||||
- enable wget status bar (closes: #211457)
|
||||
* init/init.c
|
||||
- workaround race conditions (closes: #212764)
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Fri, 26 Sep 2003 15:10:14 +0200
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030819-3) unstable; urgency=low
|
||||
|
||||
* shell/ash.c
|
||||
- fix signal handling (upstream)
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Mon, 15 Sep 2003 18:12:09 +0200
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030819-2) unstable; urgency=low
|
||||
|
||||
* Fix configure permisions
|
||||
* Set source Section to embedded
|
||||
|
||||
-- Glenn McGrath <bug1@debian.org> Mon, 25 Aug 2003 06:33:19 +0000
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030819-1) unstable; urgency=low
|
||||
|
||||
* new cvs version
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Tue, 19 Aug 2003 13:18:54 +0200
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030426-10) unstable; urgency=low
|
||||
|
||||
* archival/libunarchive/*
|
||||
- add hardlink support (pending)
|
||||
* debian/config-*udeb*
|
||||
- add support for oldgnu tar format
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Tue, 10 Jun 2003 12:06:41 +0200
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030426-9) unstable; urgency=low
|
||||
|
||||
* modutils/depmod.c
|
||||
- fix base_dir for modules.dep
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Sat, 07 Jun 2003 14:52:54 +0200
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030426-8) unstable; urgency=low
|
||||
|
||||
* util-linux/fdisk.c
|
||||
- fix syscalls. (pending)
|
||||
* libpwd/*
|
||||
- don't build setgroups.o
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Tue, 03 Jun 2003 11:26:28 +0200
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030426-7) unstable; urgency=low
|
||||
|
||||
* libbb/*syscallc.c
|
||||
- fix syscalls. (upstream) (closes: #194631)
|
||||
* modutils/*
|
||||
- update complete objects code from upstream. (pending)
|
||||
* debian/config-*udeb*
|
||||
- update to busybox-applets.txt:1.14
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Thu, 29 May 2003 16:17:14 +0200
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030426-6) unstable; urgency=low
|
||||
|
||||
* modutils/Makefile.in
|
||||
- don't build anything if deactivated
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Sat, 24 May 2003 18:57:14 +0200
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030426-5) unstable; urgency=low
|
||||
|
||||
* debian/config-*udeb*
|
||||
- revert changes (closes: #192717, #192753)
|
||||
- readd initrd support (workaround)
|
||||
- make init quiet
|
||||
* archival/tar.c
|
||||
- fix usage of tar -O (upstream) (closes: #193788)
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Sat, 24 May 2003 13:25:36 +0200
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030426-4) unstable; urgency=low
|
||||
|
||||
* debian/config-*udeb*
|
||||
- update to busybox-applets.txt:1.12
|
||||
* debian/rules
|
||||
- use system instead of arch to determine which config file to use
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Fri, 09 May 2003 11:21:13 +0200
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030426-3) unstable; urgency=low
|
||||
|
||||
* debian/config-udeb*
|
||||
- update to busybox-applets.txt:1.11
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Wed, 07 May 2003 10:37:40 +0200
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030426-2) unstable; urgency=low
|
||||
|
||||
* modutils/*
|
||||
- modprobe failes gracefully if the module is already loaded. (pending)
|
||||
- implement depmod. (pending)
|
||||
* debian/config*
|
||||
- update
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Wed, 30 Apr 2003 14:12:36 +0200
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030426-1) unstable; urgency=low
|
||||
|
||||
* new cvs version
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Sat, 26 Apr 2003 18:33:17 +0200
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030420-4) unstable; urgency=low
|
||||
|
||||
* network/libiproute/iproute.c
|
||||
- fix usage of ip route flush (upstream)
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Fri, 25 Apr 2003 16:48:43 +0200
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030420-3) unstable; urgency=low
|
||||
|
||||
* debian/config-*udeb*
|
||||
- update to busybox-applets.txt:1.10
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Fri, 25 Apr 2003 14:03:23 +0200
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030420-2) unstable; urgency=low
|
||||
|
||||
* archival/tar.c
|
||||
* archival/tar.c, archival/libunarchive/data_extract_all.c
|
||||
- unlink files first (upstream patch)
|
||||
|
||||
-- Bastian Blank <waldi@debian.org> Mon, 21 Apr 2003 12:06:57 +0200
|
||||
-- Bastian Blank <waldi@debian.org> Mon, 21 Apr 2003 12:42:06 +0200
|
||||
|
||||
busybox-cvs (0.60.99.cvs20030420-1) unstable; urgency=low
|
||||
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
4
|
||||
Vendored
+25
-11
@@ -16,6 +16,7 @@ CONFIG_FEATURE_INSTALLER=y
|
||||
# CONFIG_FEATURE_DEVPTS is not set
|
||||
# CONFIG_FEATURE_CLEAN_UP is not set
|
||||
# CONFIG_FEATURE_SUID is not set
|
||||
# CONFIG_SELINUX is not set
|
||||
|
||||
#
|
||||
# Build Options
|
||||
@@ -50,12 +51,17 @@ CONFIG_FEATURE_TAR_CREATE=y
|
||||
# CONFIG_FEATURE_TAR_BZIP2 is not set
|
||||
# CONFIG_FEATURE_TAR_EXCLUDE is not set
|
||||
CONFIG_FEATURE_TAR_GZIP=y
|
||||
# CONFIG_FEATURE_TAR_COMPRESS is not set
|
||||
# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
|
||||
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
|
||||
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
|
||||
# CONFIG_UNCOMPRESS is not set
|
||||
# CONFIG_UNZIP is not set
|
||||
|
||||
#
|
||||
# Common options for cpio and tar
|
||||
#
|
||||
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
|
||||
|
||||
#
|
||||
# Coreutils
|
||||
#
|
||||
@@ -80,10 +86,12 @@ CONFIG_FEATURE_FANCY_ECHO=y
|
||||
# CONFIG_ENV is not set
|
||||
CONFIG_EXPR=y
|
||||
CONFIG_FALSE=y
|
||||
# CONFIG_FOLD is not set
|
||||
CONFIG_HEAD=y
|
||||
# CONFIG_FEATURE_FANCY_HEAD is not set
|
||||
# CONFIG_HOSTID is not set
|
||||
CONFIG_ID=y
|
||||
# CONFIG_INSTALL is not set
|
||||
# CONFIG_LENGTH is not set
|
||||
CONFIG_LN=y
|
||||
# CONFIG_LOGNAME is not set
|
||||
@@ -110,8 +118,6 @@ CONFIG_RMDIR=y
|
||||
CONFIG_SLEEP=y
|
||||
# CONFIG_FEATURE_FANCY_SLEEP is not set
|
||||
CONFIG_SORT=y
|
||||
# CONFIG_FEATURE_SORT_REVERSE is not set
|
||||
# CONFIG_FEATURE_SORT_UNIQUE is not set
|
||||
# CONFIG_STTY is not set
|
||||
CONFIG_SYNC=y
|
||||
CONFIG_TAIL=y
|
||||
@@ -148,6 +154,11 @@ CONFIG_FEATURE_AUTOWIDTH=y
|
||||
#
|
||||
CONFIG_FEATURE_HUMAN_READABLE=y
|
||||
|
||||
#
|
||||
# Common options for md5sum, sha1sum
|
||||
#
|
||||
# CONFIG_FEATURE_MD5_SHA1_SUM_CHECK is not set
|
||||
|
||||
#
|
||||
# Console Utilities
|
||||
#
|
||||
@@ -166,16 +177,18 @@ CONFIG_RESET=y
|
||||
# Debian Utilities
|
||||
#
|
||||
# CONFIG_MKTEMP is not set
|
||||
# CONFIG_PIPE_PROGRESS is not set
|
||||
# CONFIG_READLINK is not set
|
||||
# CONFIG_RUN_PARTS is not set
|
||||
# CONFIG_START_STOP_DAEMON is not set
|
||||
CONFIG_WHICH=y
|
||||
|
||||
#
|
||||
# Editors
|
||||
#
|
||||
# CONFIG_AWK is not set
|
||||
# CONFIG_PATCH is not set
|
||||
CONFIG_SED=y
|
||||
# CONFIG_FEATURE_SED_EMBEDED_NEWLINE is not set
|
||||
# CONFIG_VI is not set
|
||||
|
||||
#
|
||||
@@ -190,6 +203,7 @@ CONFIG_FEATURE_FIND_NEWER=y
|
||||
CONFIG_FEATURE_FIND_INUM=y
|
||||
CONFIG_GREP=y
|
||||
# CONFIG_FEATURE_GREP_EGREP_ALIAS is not set
|
||||
CONFIG_FEATURE_GREP_FGREP_ALIAS=y
|
||||
# CONFIG_FEATURE_GREP_CONTEXT is not set
|
||||
# CONFIG_XARGS is not set
|
||||
|
||||
@@ -204,7 +218,6 @@ CONFIG_FEATURE_INITRD=y
|
||||
CONFIG_HALT=y
|
||||
CONFIG_POWEROFF=y
|
||||
CONFIG_REBOOT=y
|
||||
# CONFIG_START_STOP_DAEMON is not set
|
||||
# CONFIG_MESG is not set
|
||||
|
||||
#
|
||||
@@ -229,17 +242,19 @@ CONFIG_REBOOT=y
|
||||
# CONFIG_CROND is not set
|
||||
# CONFIG_CRONTAB is not set
|
||||
# CONFIG_DC is not set
|
||||
# CONFIG_DUTMP is not set
|
||||
# CONFIG_DEVFSD is not set
|
||||
# CONFIG_LAST is not set
|
||||
# CONFIG_HDPARM is not set
|
||||
# CONFIG_MAKEDEVS is not set
|
||||
# CONFIG_MT is not set
|
||||
# CONFIG_STRINGS is not set
|
||||
# CONFIG_TIME is not set
|
||||
# CONFIG_UPDATE is not set
|
||||
# CONFIG_WATCHDOG is not set
|
||||
|
||||
#
|
||||
# Linux Module Utilities
|
||||
#
|
||||
# CONFIG_DEPMOD is not set
|
||||
# CONFIG_INSMOD is not set
|
||||
# CONFIG_LSMOD is not set
|
||||
# CONFIG_MODPROBE is not set
|
||||
@@ -283,6 +298,7 @@ CONFIG_ROUTE=y
|
||||
CONFIG_WGET=y
|
||||
CONFIG_FEATURE_WGET_STATUSBAR=y
|
||||
CONFIG_FEATURE_WGET_AUTHENTICATION=y
|
||||
CONFIG_FEATURE_WGET_IP6_LITERAL=y
|
||||
|
||||
#
|
||||
# udhcp Server/Client
|
||||
@@ -319,6 +335,7 @@ CONFIG_FEATURE_SH_IS_NONE=y
|
||||
# System Logging Utilities
|
||||
#
|
||||
CONFIG_SYSLOGD=y
|
||||
# CONFIG_FEATURE_ROTATE_LOGFILE is not set
|
||||
# CONFIG_FEATURE_REMOTE_LOG is not set
|
||||
# CONFIG_FEATURE_IPC_SYSLOG is not set
|
||||
CONFIG_KLOGD=y
|
||||
@@ -330,6 +347,7 @@ CONFIG_LOGGER=y
|
||||
CONFIG_DMESG=y
|
||||
# CONFIG_FBSET is not set
|
||||
# CONFIG_FDFLUSH is not set
|
||||
# CONFIG_FDFORMAT is not set
|
||||
# CONFIG_FDISK is not set
|
||||
# CONFIG_FREERAMDISK is not set
|
||||
# CONFIG_FSCK_MINIX is not set
|
||||
@@ -341,10 +359,6 @@ CONFIG_LOSETUP=y
|
||||
CONFIG_MKSWAP=y
|
||||
CONFIG_MORE=y
|
||||
CONFIG_FEATURE_USE_TERMIOS=y
|
||||
|
||||
#
|
||||
# Common options for ls and more
|
||||
#
|
||||
# CONFIG_PIVOT_ROOT is not set
|
||||
# CONFIG_RDATE is not set
|
||||
CONFIG_SWAPONOFF=y
|
||||
|
||||
+59
-69
@@ -16,12 +16,13 @@ CONFIG_FEATURE_DEVFS=y
|
||||
CONFIG_FEATURE_DEVPTS=y
|
||||
# CONFIG_FEATURE_CLEAN_UP is not set
|
||||
# CONFIG_FEATURE_SUID is not set
|
||||
# CONFIG_SELINUX is not set
|
||||
|
||||
#
|
||||
# Build Options
|
||||
#
|
||||
# CONFIG_STATIC is not set
|
||||
# CONFIG_LFS is not set
|
||||
CONFIG_LFS=y
|
||||
# USING_CROSS_COMPILER is not set
|
||||
EXTRA_CFLAGS_OPTIONS=""
|
||||
|
||||
@@ -34,8 +35,7 @@ PREFIX="./_install"
|
||||
#
|
||||
# Archival Utilities
|
||||
#
|
||||
CONFIG_AR=y
|
||||
# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
|
||||
# CONFIG_AR is not set
|
||||
# CONFIG_BUNZIP2 is not set
|
||||
# CONFIG_CPIO is not set
|
||||
# CONFIG_DPKG is not set
|
||||
@@ -45,14 +45,7 @@ CONFIG_GUNZIP=y
|
||||
# CONFIG_GZIP is not set
|
||||
# CONFIG_RPM2CPIO is not set
|
||||
# CONFIG_RPM is not set
|
||||
CONFIG_TAR=y
|
||||
# CONFIG_FEATURE_TAR_CREATE is not set
|
||||
# CONFIG_FEATURE_TAR_BZIP2 is not set
|
||||
# CONFIG_FEATURE_TAR_EXCLUDE is not set
|
||||
CONFIG_FEATURE_TAR_GZIP=y
|
||||
# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
|
||||
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
|
||||
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
|
||||
# CONFIG_TAR is not set
|
||||
# CONFIG_UNCOMPRESS is not set
|
||||
# CONFIG_UNZIP is not set
|
||||
|
||||
@@ -64,11 +57,11 @@ CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
|
||||
CONFIG_CAT=y
|
||||
# CONFIG_CHGRP is not set
|
||||
# CONFIG_CHMOD is not set
|
||||
CONFIG_CHOWN=y
|
||||
# CONFIG_CHOWN is not set
|
||||
CONFIG_CHROOT=y
|
||||
# CONFIG_CMP is not set
|
||||
# CONFIG_CP is not set
|
||||
CONFIG_CUT=y
|
||||
CONFIG_CP=y
|
||||
# CONFIG_CUT is not set
|
||||
# CONFIG_DATE is not set
|
||||
# CONFIG_DD is not set
|
||||
# CONFIG_DF is not set
|
||||
@@ -76,19 +69,21 @@ CONFIG_CUT=y
|
||||
# CONFIG_DOS2UNIX is not set
|
||||
# CONFIG_DU is not set
|
||||
CONFIG_ECHO=y
|
||||
# CONFIG_FEATURE_FANCY_ECHO is not set
|
||||
CONFIG_FEATURE_FANCY_ECHO=y
|
||||
# CONFIG_ENV is not set
|
||||
# CONFIG_EXPR is not set
|
||||
CONFIG_FALSE=y
|
||||
# CONFIG_FALSE is not set
|
||||
# CONFIG_FOLD is not set
|
||||
# CONFIG_HEAD is not set
|
||||
# CONFIG_HOSTID is not set
|
||||
# CONFIG_ID is not set
|
||||
# CONFIG_INSTALL is not set
|
||||
# CONFIG_LENGTH is not set
|
||||
CONFIG_LN=y
|
||||
# CONFIG_LOGNAME is not set
|
||||
# CONFIG_LS is not set
|
||||
CONFIG_MD5SUM=y
|
||||
CONFIG_MKDIR=y
|
||||
# CONFIG_MD5SUM is not set
|
||||
# CONFIG_MKDIR is not set
|
||||
# CONFIG_MKFIFO is not set
|
||||
# CONFIG_MKNOD is not set
|
||||
# CONFIG_MV is not set
|
||||
@@ -99,10 +94,11 @@ CONFIG_MKDIR=y
|
||||
CONFIG_RM=y
|
||||
# CONFIG_RMDIR is not set
|
||||
# CONFIG_SHA1SUM is not set
|
||||
# CONFIG_SLEEP is not set
|
||||
CONFIG_SLEEP=y
|
||||
# CONFIG_FEATURE_FANCY_SLEEP is not set
|
||||
# CONFIG_SORT is not set
|
||||
# CONFIG_STTY is not set
|
||||
CONFIG_SYNC=y
|
||||
# CONFIG_SYNC is not set
|
||||
# CONFIG_TAIL is not set
|
||||
# CONFIG_TEE is not set
|
||||
CONFIG_TEST=y
|
||||
@@ -110,9 +106,9 @@ CONFIG_TEST=y
|
||||
#
|
||||
# test (forced enabled for use with shell)
|
||||
#
|
||||
CONFIG_TOUCH=y
|
||||
# CONFIG_TOUCH is not set
|
||||
# CONFIG_TR is not set
|
||||
CONFIG_TRUE=y
|
||||
# CONFIG_TRUE is not set
|
||||
# CONFIG_TTY is not set
|
||||
# CONFIG_UNAME is not set
|
||||
# CONFIG_UNIQ is not set
|
||||
@@ -125,6 +121,11 @@ CONFIG_TRUE=y
|
||||
# CONFIG_WHOAMI is not set
|
||||
# CONFIG_YES is not set
|
||||
|
||||
#
|
||||
# Common options for cp and mv
|
||||
#
|
||||
CONFIG_FEATURE_PRESERVE_HARDLINKS=y
|
||||
|
||||
#
|
||||
# Console Utilities
|
||||
#
|
||||
@@ -143,39 +144,44 @@ CONFIG_TRUE=y
|
||||
# Debian Utilities
|
||||
#
|
||||
# CONFIG_MKTEMP is not set
|
||||
# CONFIG_PIPE_PROGRESS is not set
|
||||
# CONFIG_READLINK is not set
|
||||
# CONFIG_RUN_PARTS is not set
|
||||
# CONFIG_START_STOP_DAEMON is not set
|
||||
# CONFIG_WHICH is not set
|
||||
|
||||
#
|
||||
# Editors
|
||||
#
|
||||
# CONFIG_AWK is not set
|
||||
CONFIG_SED=y
|
||||
# CONFIG_FEATURE_SED_EMBEDED_NEWLINE is not set
|
||||
# CONFIG_PATCH is not set
|
||||
# CONFIG_SED is not set
|
||||
# CONFIG_VI is not set
|
||||
|
||||
#
|
||||
# Finding Utilities
|
||||
#
|
||||
# CONFIG_FIND is not set
|
||||
CONFIG_FIND=y
|
||||
# CONFIG_FEATURE_FIND_MTIME is not set
|
||||
# CONFIG_FEATURE_FIND_PERM is not set
|
||||
# CONFIG_FEATURE_FIND_TYPE is not set
|
||||
# CONFIG_FEATURE_FIND_XDEV is not set
|
||||
# CONFIG_FEATURE_FIND_NEWER is not set
|
||||
# CONFIG_FEATURE_FIND_INUM is not set
|
||||
CONFIG_GREP=y
|
||||
# CONFIG_FEATURE_GREP_EGREP_ALIAS is not set
|
||||
# CONFIG_FEATURE_GREP_FGREP_ALIAS is not set
|
||||
# CONFIG_FEATURE_GREP_CONTEXT is not set
|
||||
# CONFIG_XARGS is not set
|
||||
|
||||
#
|
||||
# Init Utilities
|
||||
#
|
||||
CONFIG_INIT=y
|
||||
CONFIG_FEATURE_USE_INITTAB=y
|
||||
# CONFIG_FEATURE_INITRD is not set
|
||||
# CONFIG_FEATURE_INIT_COREDUMPS is not set
|
||||
# CONFIG_FEATURE_EXTRA_QUIET is not set
|
||||
# CONFIG_INIT is not set
|
||||
# CONFIG_HALT is not set
|
||||
# CONFIG_POWEROFF is not set
|
||||
CONFIG_REBOOT=y
|
||||
# CONFIG_START_STOP_DAEMON is not set
|
||||
# CONFIG_REBOOT is not set
|
||||
# CONFIG_MINIT is not set
|
||||
# CONFIG_MESG is not set
|
||||
|
||||
#
|
||||
@@ -200,32 +206,31 @@ CONFIG_USE_BB_PWD_GRP=y
|
||||
# CONFIG_CROND is not set
|
||||
# CONFIG_CRONTAB is not set
|
||||
# CONFIG_DC is not set
|
||||
# CONFIG_DUTMP is not set
|
||||
# CONFIG_DEVFSD is not set
|
||||
# CONFIG_LAST is not set
|
||||
# CONFIG_HDPARM is not set
|
||||
# CONFIG_MAKEDEVS is not set
|
||||
# CONFIG_MT is not set
|
||||
# CONFIG_STRINGS is not set
|
||||
# CONFIG_TIME is not set
|
||||
# CONFIG_UPDATE is not set
|
||||
# CONFIG_WATCHDOG is not set
|
||||
|
||||
#
|
||||
# Linux Module Utilities
|
||||
#
|
||||
CONFIG_MODUTILS_OBJ=y
|
||||
# CONFIG_DEPMOD is not set
|
||||
CONFIG_INSMOD=y
|
||||
# CONFIG_FEATURE_OLD_MODULE_INTERFACE is not set
|
||||
CONFIG_FEATURE_NEW_MODULE_INTERFACE=y
|
||||
|
||||
#
|
||||
# Support new (post 2.1) Linux kernels (Forced enabled)
|
||||
#
|
||||
# CONFIG_FEATURE_2_2_MODULES is not set
|
||||
CONFIG_FEATURE_2_4_MODULES=y
|
||||
# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
|
||||
# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
|
||||
# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
|
||||
# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
|
||||
# CONFIG_LSMOD is not set
|
||||
# CONFIG_MODPROBE is not set
|
||||
CONFIG_MODPROBE=y
|
||||
# CONFIG_RMMOD is not set
|
||||
# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set
|
||||
CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
|
||||
|
||||
#
|
||||
# Networking Utilities
|
||||
@@ -239,11 +244,7 @@ CONFIG_FEATURE_NEW_MODULE_INTERFACE=y
|
||||
# CONFIG_IFCONFIG is not set
|
||||
# CONFIG_IFUPDOWN is not set
|
||||
# CONFIG_INETD is not set
|
||||
CONFIG_IP=y
|
||||
CONFIG_FEATURE_IP_ADDRESS=y
|
||||
CONFIG_FEATURE_IP_LINK=y
|
||||
CONFIG_FEATURE_IP_ROUTE=y
|
||||
# CONFIG_FEATURE_IP_TUNNEL is not set
|
||||
# CONFIG_IP is not set
|
||||
# CONFIG_IPCALC is not set
|
||||
# CONFIG_IPADDR is not set
|
||||
# CONFIG_IPLINK is not set
|
||||
@@ -260,17 +261,13 @@ CONFIG_FEATURE_IP_ROUTE=y
|
||||
# CONFIG_TFTP is not set
|
||||
# CONFIG_TRACEROUTE is not set
|
||||
# CONFIG_VCONFIG is not set
|
||||
CONFIG_WGET=y
|
||||
# CONFIG_FEATURE_WGET_STATUSBAR is not set
|
||||
# CONFIG_FEATURE_WGET_AUTHENTICATION is not set
|
||||
# CONFIG_WGET is not set
|
||||
|
||||
#
|
||||
# udhcp Server/Client
|
||||
#
|
||||
# CONFIG_UDHCPD is not set
|
||||
CONFIG_UDHCPC=y
|
||||
CONFIG_FEATURE_UDHCP_SYSLOG=y
|
||||
# CONFIG_FEATURE_UDHCP_DEBUG is not set
|
||||
# CONFIG_UDHCPC is not set
|
||||
|
||||
#
|
||||
# Process Utilities
|
||||
@@ -293,16 +290,12 @@ CONFIG_FEATURE_SH_IS_ASH=y
|
||||
# CONFIG_FEATURE_SH_IS_NONE is not set
|
||||
CONFIG_ASH=y
|
||||
|
||||
#
|
||||
# ash (forced enabled as default shell)
|
||||
#
|
||||
|
||||
#
|
||||
# Ash Shell Options
|
||||
#
|
||||
CONFIG_ASH_JOB_CONTROL=y
|
||||
CONFIG_ASH_ALIAS=y
|
||||
CONFIG_ASH_MATH_SUPPORT=y
|
||||
# CONFIG_ASH_JOB_CONTROL is not set
|
||||
# CONFIG_ASH_ALIAS is not set
|
||||
# CONFIG_ASH_MATH_SUPPORT is not set
|
||||
# CONFIG_ASH_GETOPTS is not set
|
||||
# CONFIG_ASH_CMDCMD is not set
|
||||
# CONFIG_ASH_MAIL is not set
|
||||
@@ -314,23 +307,19 @@ CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
|
||||
#
|
||||
# Bourne Shell Options
|
||||
#
|
||||
CONFIG_FEATURE_COMMAND_EDITING=y
|
||||
# CONFIG_FEATURE_COMMAND_EDITING is not set
|
||||
# CONFIG_FEATURE_COMMAND_SAVEHISTORY is not set
|
||||
CONFIG_FEATURE_COMMAND_TAB_COMPLETION=y
|
||||
# CONFIG_FEATURE_COMMAND_TAB_COMPLETION is not set
|
||||
# CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION is not set
|
||||
CONFIG_FEATURE_COMMAND_HISTORY=15
|
||||
# CONFIG_FEATURE_SH_STANDALONE_SHELL is not set
|
||||
# CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN is not set
|
||||
# CONFIG_FEATURE_SH_FANCY_PROMPT is not set
|
||||
# CONFIG_FEATURE_SH_EXTRA_QUIET is not set
|
||||
|
||||
#
|
||||
# System Logging Utilities
|
||||
#
|
||||
CONFIG_SYSLOGD=y
|
||||
# CONFIG_FEATURE_REMOTE_LOG is not set
|
||||
# CONFIG_FEATURE_IPC_SYSLOG is not set
|
||||
CONFIG_KLOGD=y
|
||||
# CONFIG_SYSLOGD is not set
|
||||
# CONFIG_LOGGER is not set
|
||||
|
||||
#
|
||||
@@ -339,6 +328,7 @@ CONFIG_KLOGD=y
|
||||
# CONFIG_DMESG is not set
|
||||
# CONFIG_FBSET is not set
|
||||
# CONFIG_FDFLUSH is not set
|
||||
# CONFIG_FDFORMAT is not set
|
||||
# CONFIG_FDISK is not set
|
||||
# CONFIG_FREERAMDISK is not set
|
||||
# CONFIG_FSCK_MINIX is not set
|
||||
@@ -355,12 +345,12 @@ CONFIG_PIVOT_ROOT=y
|
||||
CONFIG_MOUNT=y
|
||||
# CONFIG_NFSMOUNT is not set
|
||||
CONFIG_UMOUNT=y
|
||||
# CONFIG_FEATURE_MOUNT_FORCE is not set
|
||||
CONFIG_FEATURE_MOUNT_FORCE=y
|
||||
|
||||
#
|
||||
# Common options for mount/umount
|
||||
#
|
||||
# CONFIG_FEATURE_MOUNT_LOOP is not set
|
||||
CONFIG_FEATURE_MOUNT_LOOP=y
|
||||
# CONFIG_FEATURE_MTAB_SUPPORT is not set
|
||||
|
||||
#
|
||||
Vendored
-374
@@ -1,374 +0,0 @@
|
||||
#
|
||||
# Automatically generated make config: don't edit
|
||||
#
|
||||
HAVE_DOT_CONFIG=y
|
||||
|
||||
#
|
||||
# General Configuration
|
||||
#
|
||||
# CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set
|
||||
CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y
|
||||
# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
|
||||
# CONFIG_FEATURE_VERBOSE_USAGE is not set
|
||||
# CONFIG_FEATURE_INSTALLER is not set
|
||||
# CONFIG_LOCALE_SUPPORT is not set
|
||||
CONFIG_FEATURE_DEVFS=y
|
||||
CONFIG_FEATURE_DEVPTS=y
|
||||
# CONFIG_FEATURE_CLEAN_UP is not set
|
||||
# CONFIG_FEATURE_SUID is not set
|
||||
|
||||
#
|
||||
# Build Options
|
||||
#
|
||||
# CONFIG_STATIC is not set
|
||||
CONFIG_LFS=y
|
||||
# USING_CROSS_COMPILER is not set
|
||||
EXTRA_CFLAGS_OPTIONS=""
|
||||
|
||||
#
|
||||
# Installation Options
|
||||
#
|
||||
# CONFIG_INSTALL_NO_USR is not set
|
||||
PREFIX="./_install"
|
||||
|
||||
#
|
||||
# Archival Utilities
|
||||
#
|
||||
CONFIG_AR=y
|
||||
# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
|
||||
# CONFIG_BUNZIP2 is not set
|
||||
# CONFIG_CPIO is not set
|
||||
# CONFIG_DPKG is not set
|
||||
# CONFIG_DPKG_DEB is not set
|
||||
CONFIG_GUNZIP=y
|
||||
# CONFIG_FEATURE_GUNZIP_UNCOMPRESS is not set
|
||||
# CONFIG_GZIP is not set
|
||||
# CONFIG_RPM2CPIO is not set
|
||||
# CONFIG_RPM is not set
|
||||
CONFIG_TAR=y
|
||||
# CONFIG_FEATURE_TAR_CREATE is not set
|
||||
# CONFIG_FEATURE_TAR_BZIP2 is not set
|
||||
# CONFIG_FEATURE_TAR_EXCLUDE is not set
|
||||
CONFIG_FEATURE_TAR_GZIP=y
|
||||
# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
|
||||
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
|
||||
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
|
||||
# CONFIG_UNCOMPRESS is not set
|
||||
# CONFIG_UNZIP is not set
|
||||
|
||||
#
|
||||
# Coreutils
|
||||
#
|
||||
# CONFIG_BASENAME is not set
|
||||
# CONFIG_CAL is not set
|
||||
CONFIG_CAT=y
|
||||
# CONFIG_CHGRP is not set
|
||||
# CONFIG_CHMOD is not set
|
||||
CONFIG_CHOWN=y
|
||||
CONFIG_CHROOT=y
|
||||
# CONFIG_CMP is not set
|
||||
# CONFIG_CP is not set
|
||||
CONFIG_CUT=y
|
||||
# CONFIG_DATE is not set
|
||||
# CONFIG_DD is not set
|
||||
# CONFIG_DF is not set
|
||||
# CONFIG_DIRNAME is not set
|
||||
# CONFIG_DOS2UNIX is not set
|
||||
# CONFIG_DU is not set
|
||||
CONFIG_ECHO=y
|
||||
CONFIG_FEATURE_FANCY_ECHO=y
|
||||
# CONFIG_ENV is not set
|
||||
# CONFIG_EXPR is not set
|
||||
CONFIG_FALSE=y
|
||||
# CONFIG_HEAD is not set
|
||||
# CONFIG_HOSTID is not set
|
||||
# CONFIG_ID is not set
|
||||
# CONFIG_LENGTH is not set
|
||||
CONFIG_LN=y
|
||||
# CONFIG_LOGNAME is not set
|
||||
# CONFIG_LS is not set
|
||||
CONFIG_MD5SUM=y
|
||||
CONFIG_MKDIR=y
|
||||
# CONFIG_MKFIFO is not set
|
||||
# CONFIG_MKNOD is not set
|
||||
# CONFIG_MV is not set
|
||||
# CONFIG_OD is not set
|
||||
# CONFIG_PRINTF is not set
|
||||
# CONFIG_PWD is not set
|
||||
# CONFIG_REALPATH is not set
|
||||
CONFIG_RM=y
|
||||
# CONFIG_RMDIR is not set
|
||||
# CONFIG_SHA1SUM is not set
|
||||
# CONFIG_SLEEP is not set
|
||||
# CONFIG_SORT is not set
|
||||
# CONFIG_STTY is not set
|
||||
CONFIG_SYNC=y
|
||||
# CONFIG_TAIL is not set
|
||||
# CONFIG_TEE is not set
|
||||
CONFIG_TEST=y
|
||||
|
||||
#
|
||||
# test (forced enabled for use with shell)
|
||||
#
|
||||
CONFIG_TOUCH=y
|
||||
# CONFIG_TR is not set
|
||||
CONFIG_TRUE=y
|
||||
# CONFIG_TTY is not set
|
||||
# CONFIG_UNAME is not set
|
||||
# CONFIG_UNIQ is not set
|
||||
# CONFIG_USLEEP is not set
|
||||
# CONFIG_UUDECODE is not set
|
||||
# CONFIG_UUENCODE is not set
|
||||
# CONFIG_WATCH is not set
|
||||
CONFIG_WC=y
|
||||
# CONFIG_WHO is not set
|
||||
# CONFIG_WHOAMI is not set
|
||||
# CONFIG_YES is not set
|
||||
|
||||
#
|
||||
# Console Utilities
|
||||
#
|
||||
# CONFIG_CHVT is not set
|
||||
# CONFIG_CLEAR is not set
|
||||
# CONFIG_DEALLOCVT is not set
|
||||
# CONFIG_DUMPKMAP is not set
|
||||
# CONFIG_LOADACM is not set
|
||||
# CONFIG_LOADFONT is not set
|
||||
# CONFIG_LOADKMAP is not set
|
||||
# CONFIG_OPENVT is not set
|
||||
# CONFIG_RESET is not set
|
||||
# CONFIG_SETKEYCODES is not set
|
||||
|
||||
#
|
||||
# Debian Utilities
|
||||
#
|
||||
# CONFIG_MKTEMP is not set
|
||||
# CONFIG_READLINK is not set
|
||||
# CONFIG_RUN_PARTS is not set
|
||||
# CONFIG_WHICH is not set
|
||||
|
||||
#
|
||||
# Editors
|
||||
#
|
||||
# CONFIG_AWK is not set
|
||||
CONFIG_SED=y
|
||||
# CONFIG_FEATURE_SED_EMBEDED_NEWLINE is not set
|
||||
# CONFIG_VI is not set
|
||||
|
||||
#
|
||||
# Finding Utilities
|
||||
#
|
||||
# CONFIG_FIND is not set
|
||||
CONFIG_GREP=y
|
||||
# CONFIG_FEATURE_GREP_EGREP_ALIAS is not set
|
||||
# CONFIG_FEATURE_GREP_CONTEXT is not set
|
||||
# CONFIG_XARGS is not set
|
||||
|
||||
#
|
||||
# Init Utilities
|
||||
#
|
||||
CONFIG_INIT=y
|
||||
CONFIG_FEATURE_USE_INITTAB=y
|
||||
# CONFIG_FEATURE_INITRD is not set
|
||||
# CONFIG_FEATURE_INIT_COREDUMPS is not set
|
||||
# CONFIG_FEATURE_EXTRA_QUIET is not set
|
||||
# CONFIG_HALT is not set
|
||||
# CONFIG_POWEROFF is not set
|
||||
CONFIG_REBOOT=y
|
||||
# CONFIG_START_STOP_DAEMON is not set
|
||||
# CONFIG_MESG is not set
|
||||
|
||||
#
|
||||
# Login/Password Management Utilities
|
||||
#
|
||||
CONFIG_USE_BB_PWD_GRP=y
|
||||
# CONFIG_ADDGROUP is not set
|
||||
# CONFIG_DELGROUP is not set
|
||||
# CONFIG_ADDUSER is not set
|
||||
# CONFIG_DELUSER is not set
|
||||
# CONFIG_GETTY is not set
|
||||
# CONFIG_LOGIN is not set
|
||||
# CONFIG_PASSWD is not set
|
||||
# CONFIG_SU is not set
|
||||
# CONFIG_SULOGIN is not set
|
||||
# CONFIG_VLOCK is not set
|
||||
|
||||
#
|
||||
# Miscellaneous Utilities
|
||||
#
|
||||
# CONFIG_ADJTIMEX is not set
|
||||
# CONFIG_CROND is not set
|
||||
# CONFIG_CRONTAB is not set
|
||||
# CONFIG_DC is not set
|
||||
# CONFIG_DUTMP is not set
|
||||
# CONFIG_MAKEDEVS is not set
|
||||
# CONFIG_MT is not set
|
||||
# CONFIG_STRINGS is not set
|
||||
# CONFIG_TIME is not set
|
||||
# CONFIG_UPDATE is not set
|
||||
# CONFIG_WATCHDOG is not set
|
||||
|
||||
#
|
||||
# Linux Module Utilities
|
||||
#
|
||||
CONFIG_INSMOD=y
|
||||
# CONFIG_FEATURE_OLD_MODULE_INTERFACE is not set
|
||||
CONFIG_FEATURE_NEW_MODULE_INTERFACE=y
|
||||
|
||||
#
|
||||
# Support new (post 2.1) Linux kernels (Forced enabled)
|
||||
#
|
||||
# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
|
||||
# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
|
||||
# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
|
||||
# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
|
||||
# CONFIG_LSMOD is not set
|
||||
# CONFIG_MODPROBE is not set
|
||||
# CONFIG_RMMOD is not set
|
||||
CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
|
||||
|
||||
#
|
||||
# Networking Utilities
|
||||
#
|
||||
# CONFIG_FEATURE_IPV6 is not set
|
||||
# CONFIG_ARPING is not set
|
||||
# CONFIG_FTPGET is not set
|
||||
# CONFIG_FTPPUT is not set
|
||||
# CONFIG_HOSTNAME is not set
|
||||
# CONFIG_HTTPD is not set
|
||||
CONFIG_IFCONFIG=y
|
||||
CONFIG_FEATURE_IFCONFIG_STATUS=y
|
||||
# CONFIG_FEATURE_IFCONFIG_SLIP is not set
|
||||
# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
|
||||
# CONFIG_FEATURE_IFCONFIG_HW is not set
|
||||
# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
|
||||
# CONFIG_IFUPDOWN is not set
|
||||
# CONFIG_INETD is not set
|
||||
CONFIG_IP=y
|
||||
CONFIG_FEATURE_IP_ADDRESS=y
|
||||
CONFIG_FEATURE_IP_LINK=y
|
||||
CONFIG_FEATURE_IP_ROUTE=y
|
||||
# CONFIG_FEATURE_IP_TUNNEL is not set
|
||||
# CONFIG_IPCALC is not set
|
||||
# CONFIG_IPADDR is not set
|
||||
# CONFIG_IPLINK is not set
|
||||
# CONFIG_IPROUTE is not set
|
||||
# CONFIG_IPTUNNEL is not set
|
||||
# CONFIG_NAMEIF is not set
|
||||
# CONFIG_NC is not set
|
||||
# CONFIG_NETSTAT is not set
|
||||
# CONFIG_NSLOOKUP is not set
|
||||
# CONFIG_PING is not set
|
||||
CONFIG_ROUTE=y
|
||||
# CONFIG_TELNET is not set
|
||||
# CONFIG_TELNETD is not set
|
||||
# CONFIG_TFTP is not set
|
||||
# CONFIG_TRACEROUTE is not set
|
||||
# CONFIG_VCONFIG is not set
|
||||
CONFIG_WGET=y
|
||||
# CONFIG_FEATURE_WGET_STATUSBAR is not set
|
||||
CONFIG_FEATURE_WGET_AUTHENTICATION=y
|
||||
|
||||
#
|
||||
# udhcp Server/Client
|
||||
#
|
||||
# CONFIG_UDHCPD is not set
|
||||
CONFIG_UDHCPC=y
|
||||
CONFIG_FEATURE_UDHCP_SYSLOG=y
|
||||
# CONFIG_FEATURE_UDHCP_DEBUG is not set
|
||||
|
||||
#
|
||||
# Process Utilities
|
||||
#
|
||||
# CONFIG_FREE is not set
|
||||
# CONFIG_KILL is not set
|
||||
# CONFIG_PIDOF is not set
|
||||
# CONFIG_PS is not set
|
||||
# CONFIG_RENICE is not set
|
||||
# CONFIG_TOP is not set
|
||||
# CONFIG_UPTIME is not set
|
||||
|
||||
#
|
||||
# Another Bourne-like Shell
|
||||
#
|
||||
CONFIG_FEATURE_SH_IS_ASH=y
|
||||
# CONFIG_FEATURE_SH_IS_HUSH is not set
|
||||
# CONFIG_FEATURE_SH_IS_LASH is not set
|
||||
# CONFIG_FEATURE_SH_IS_MSH is not set
|
||||
# CONFIG_FEATURE_SH_IS_NONE is not set
|
||||
CONFIG_ASH=y
|
||||
|
||||
#
|
||||
# ash (forced enabled as default shell)
|
||||
#
|
||||
|
||||
#
|
||||
# Ash Shell Options
|
||||
#
|
||||
# CONFIG_ASH_JOB_CONTROL is not set
|
||||
# CONFIG_ASH_ALIAS is not set
|
||||
CONFIG_ASH_MATH_SUPPORT=y
|
||||
# CONFIG_ASH_GETOPTS is not set
|
||||
# CONFIG_ASH_CMDCMD is not set
|
||||
# CONFIG_ASH_MAIL is not set
|
||||
CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
|
||||
# CONFIG_HUSH is not set
|
||||
# CONFIG_LASH is not set
|
||||
# CONFIG_MSH is not set
|
||||
|
||||
#
|
||||
# Bourne Shell Options
|
||||
#
|
||||
CONFIG_FEATURE_COMMAND_EDITING=y
|
||||
# CONFIG_FEATURE_COMMAND_SAVEHISTORY is not set
|
||||
# CONFIG_FEATURE_COMMAND_TAB_COMPLETION is not set
|
||||
# CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION is not set
|
||||
CONFIG_FEATURE_COMMAND_HISTORY=15
|
||||
# CONFIG_FEATURE_SH_STANDALONE_SHELL is not set
|
||||
# CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN is not set
|
||||
# CONFIG_FEATURE_SH_FANCY_PROMPT is not set
|
||||
# CONFIG_FEATURE_SH_EXTRA_QUIET is not set
|
||||
|
||||
#
|
||||
# System Logging Utilities
|
||||
#
|
||||
CONFIG_SYSLOGD=y
|
||||
# CONFIG_FEATURE_REMOTE_LOG is not set
|
||||
# CONFIG_FEATURE_IPC_SYSLOG is not set
|
||||
CONFIG_KLOGD=y
|
||||
CONFIG_LOGGER=y
|
||||
|
||||
#
|
||||
# Linux System Utilities
|
||||
#
|
||||
# CONFIG_DMESG is not set
|
||||
# CONFIG_FBSET is not set
|
||||
# CONFIG_FDFLUSH is not set
|
||||
# CONFIG_FDISK is not set
|
||||
# CONFIG_FREERAMDISK is not set
|
||||
# CONFIG_FSCK_MINIX is not set
|
||||
# CONFIG_MKFS_MINIX is not set
|
||||
# CONFIG_GETOPT is not set
|
||||
# CONFIG_HEXDUMP is not set
|
||||
# CONFIG_HWCLOCK is not set
|
||||
# CONFIG_LOSETUP is not set
|
||||
# CONFIG_MKSWAP is not set
|
||||
# CONFIG_MORE is not set
|
||||
CONFIG_PIVOT_ROOT=y
|
||||
# CONFIG_RDATE is not set
|
||||
# CONFIG_SWAPONOFF is not set
|
||||
CONFIG_MOUNT=y
|
||||
# CONFIG_NFSMOUNT is not set
|
||||
CONFIG_UMOUNT=y
|
||||
CONFIG_FEATURE_MOUNT_FORCE=y
|
||||
|
||||
#
|
||||
# Common options for mount/umount
|
||||
#
|
||||
# CONFIG_FEATURE_MOUNT_LOOP is not set
|
||||
# CONFIG_FEATURE_MTAB_SUPPORT is not set
|
||||
|
||||
#
|
||||
# Debugging Options
|
||||
#
|
||||
# CONFIG_DEBUG is not set
|
||||
Vendored
+41
-26
@@ -16,6 +16,7 @@ CONFIG_FEATURE_DEVFS=y
|
||||
CONFIG_FEATURE_DEVPTS=y
|
||||
# CONFIG_FEATURE_CLEAN_UP is not set
|
||||
# CONFIG_FEATURE_SUID is not set
|
||||
# CONFIG_SELINUX is not set
|
||||
|
||||
#
|
||||
# Build Options
|
||||
@@ -53,12 +54,17 @@ CONFIG_FEATURE_TAR_CREATE=y
|
||||
CONFIG_FEATURE_TAR_BZIP2=y
|
||||
CONFIG_FEATURE_TAR_EXCLUDE=y
|
||||
CONFIG_FEATURE_TAR_GZIP=y
|
||||
# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
|
||||
# CONFIG_FEATURE_TAR_COMPRESS is not set
|
||||
CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
|
||||
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
|
||||
CONFIG_FEATURE_UNARCHIVE_TAPE=y
|
||||
CONFIG_UNCOMPRESS=y
|
||||
CONFIG_UNZIP=y
|
||||
|
||||
#
|
||||
# Common options for cpio and tar
|
||||
#
|
||||
CONFIG_FEATURE_UNARCHIVE_TAPE=y
|
||||
|
||||
#
|
||||
# Coreutils
|
||||
#
|
||||
@@ -82,6 +88,7 @@ CONFIG_DD=y
|
||||
CONFIG_DF=y
|
||||
CONFIG_DIRNAME=y
|
||||
CONFIG_DOS2UNIX=y
|
||||
CONFIG_UNIX2DOS=y
|
||||
CONFIG_DU=y
|
||||
CONFIG_FEATURE_DU_DEFALT_BLOCKSIZE_1K=y
|
||||
CONFIG_ECHO=y
|
||||
@@ -89,10 +96,12 @@ CONFIG_FEATURE_FANCY_ECHO=y
|
||||
CONFIG_ENV=y
|
||||
CONFIG_EXPR=y
|
||||
CONFIG_FALSE=y
|
||||
CONFIG_FOLD=y
|
||||
CONFIG_HEAD=y
|
||||
# CONFIG_FEATURE_FANCY_HEAD is not set
|
||||
CONFIG_FEATURE_FANCY_HEAD=y
|
||||
CONFIG_HOSTID=y
|
||||
CONFIG_ID=y
|
||||
# CONFIG_INSTALL is not set
|
||||
CONFIG_LENGTH=y
|
||||
CONFIG_LN=y
|
||||
CONFIG_LOGNAME=y
|
||||
@@ -112,21 +121,19 @@ CONFIG_MV=y
|
||||
CONFIG_OD=y
|
||||
CONFIG_PRINTF=y
|
||||
CONFIG_PWD=y
|
||||
# CONFIG_REALPATH is not set
|
||||
CONFIG_REALPATH=y
|
||||
CONFIG_RM=y
|
||||
CONFIG_RMDIR=y
|
||||
# CONFIG_SHA1SUM is not set
|
||||
CONFIG_SHA1SUM=y
|
||||
CONFIG_SLEEP=y
|
||||
# CONFIG_FEATURE_FANCY_SLEEP is not set
|
||||
CONFIG_FEATURE_FANCY_SLEEP=y
|
||||
CONFIG_SORT=y
|
||||
CONFIG_FEATURE_SORT_REVERSE=y
|
||||
CONFIG_FEATURE_SORT_UNIQUE=y
|
||||
CONFIG_STTY=y
|
||||
CONFIG_SYNC=y
|
||||
CONFIG_TAIL=y
|
||||
CONFIG_FEATURE_FANCY_TAIL=y
|
||||
CONFIG_TEE=y
|
||||
# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set
|
||||
CONFIG_FEATURE_TEE_USE_BLOCK_IO=y
|
||||
CONFIG_TEST=y
|
||||
|
||||
#
|
||||
@@ -162,6 +169,11 @@ CONFIG_FEATURE_AUTOWIDTH=y
|
||||
#
|
||||
CONFIG_FEATURE_HUMAN_READABLE=y
|
||||
|
||||
#
|
||||
# Common options for md5sum, sha1sum
|
||||
#
|
||||
# CONFIG_FEATURE_MD5_SHA1_SUM_CHECK is not set
|
||||
|
||||
#
|
||||
# Console Utilities
|
||||
#
|
||||
@@ -180,8 +192,10 @@ CONFIG_SETKEYCODES=y
|
||||
# Debian Utilities
|
||||
#
|
||||
CONFIG_MKTEMP=y
|
||||
# CONFIG_PIPE_PROGRESS is not set
|
||||
CONFIG_READLINK=y
|
||||
CONFIG_RUN_PARTS=y
|
||||
CONFIG_START_STOP_DAEMON=y
|
||||
CONFIG_WHICH=y
|
||||
|
||||
#
|
||||
@@ -189,8 +203,8 @@ CONFIG_WHICH=y
|
||||
#
|
||||
CONFIG_AWK=y
|
||||
CONFIG_FEATURE_AWK_MATH=y
|
||||
CONFIG_PATCH=y
|
||||
CONFIG_SED=y
|
||||
# CONFIG_FEATURE_SED_EMBEDED_NEWLINE is not set
|
||||
CONFIG_VI=y
|
||||
CONFIG_FEATURE_VI_COLON=y
|
||||
CONFIG_FEATURE_VI_YANKMARK=y
|
||||
@@ -215,8 +229,13 @@ CONFIG_FEATURE_FIND_NEWER=y
|
||||
CONFIG_FEATURE_FIND_INUM=y
|
||||
CONFIG_GREP=y
|
||||
CONFIG_FEATURE_GREP_EGREP_ALIAS=y
|
||||
CONFIG_FEATURE_GREP_FGREP_ALIAS=y
|
||||
CONFIG_FEATURE_GREP_CONTEXT=y
|
||||
CONFIG_XARGS=y
|
||||
# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set
|
||||
# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set
|
||||
# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set
|
||||
# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set
|
||||
|
||||
#
|
||||
# Init Utilities
|
||||
@@ -229,7 +248,6 @@ CONFIG_FEATURE_INITRD=y
|
||||
CONFIG_HALT=y
|
||||
CONFIG_POWEROFF=y
|
||||
CONFIG_REBOOT=y
|
||||
CONFIG_START_STOP_DAEMON=y
|
||||
CONFIG_MESG=y
|
||||
|
||||
#
|
||||
@@ -259,19 +277,22 @@ CONFIG_USE_BB_SHADOW=y
|
||||
#
|
||||
CONFIG_ADJTIMEX=y
|
||||
CONFIG_CROND=y
|
||||
CONFIG_FEATURE_CROND_CALL_SENDMAIL=y
|
||||
CONFIG_CRONTAB=y
|
||||
CONFIG_DC=y
|
||||
CONFIG_DUTMP=y
|
||||
# CONFIG_DEVFSD is not set
|
||||
CONFIG_LAST=y
|
||||
# CONFIG_HDPARM is not set
|
||||
CONFIG_MAKEDEVS=y
|
||||
CONFIG_MT=y
|
||||
CONFIG_STRINGS=y
|
||||
CONFIG_TIME=y
|
||||
CONFIG_UPDATE=y
|
||||
CONFIG_WATCHDOG=y
|
||||
|
||||
#
|
||||
# Linux Module Utilities
|
||||
#
|
||||
# CONFIG_DEPMOD is not set
|
||||
# CONFIG_INSMOD is not set
|
||||
# CONFIG_LSMOD is not set
|
||||
# CONFIG_MODPROBE is not set
|
||||
@@ -288,11 +309,11 @@ CONFIG_HOSTNAME=y
|
||||
CONFIG_HTTPD=y
|
||||
# CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY is not set
|
||||
CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
|
||||
# CONFIG_FEATURE_HTTPD_CGI is not set
|
||||
# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
|
||||
# CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP is not set
|
||||
# CONFIG_FEATURE_HTTPD_SETUID is not set
|
||||
# CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES is not set
|
||||
# CONFIG_FEATURE_HTTPD_DECODE_URL_STR is not set
|
||||
# CONFIG_FEATURE_HTTPD_CGI is not set
|
||||
# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
|
||||
CONFIG_IFCONFIG=y
|
||||
CONFIG_FEATURE_IFCONFIG_STATUS=y
|
||||
@@ -302,6 +323,7 @@ CONFIG_FEATURE_IFCONFIG_HW=y
|
||||
CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y
|
||||
CONFIG_IFUPDOWN=y
|
||||
# CONFIG_FEATURE_IFUPDOWN_IP is not set
|
||||
CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN=y
|
||||
CONFIG_FEATURE_IFUPDOWN_IPV4=y
|
||||
CONFIG_FEATURE_IFUPDOWN_IPV6=y
|
||||
CONFIG_FEATURE_IFUPDOWN_IPX=y
|
||||
@@ -354,11 +376,11 @@ CONFIG_FEATURE_TFTP_BLOCKSIZE=y
|
||||
CONFIG_FEATURE_TFTP_DEBUG=y
|
||||
CONFIG_TRACEROUTE=y
|
||||
CONFIG_FEATURE_TRACEROUTE_VERBOSE=y
|
||||
CONFIG_FEATURE_TRACEROUTE_SO_DEBUG=y
|
||||
# CONFIG_VCONFIG is not set
|
||||
CONFIG_WGET=y
|
||||
CONFIG_FEATURE_WGET_STATUSBAR=y
|
||||
CONFIG_FEATURE_WGET_AUTHENTICATION=y
|
||||
CONFIG_FEATURE_WGET_IP6_LITERAL=y
|
||||
|
||||
#
|
||||
# udhcp Server/Client
|
||||
@@ -392,10 +414,6 @@ CONFIG_FEATURE_SH_IS_ASH=y
|
||||
# CONFIG_FEATURE_SH_IS_NONE is not set
|
||||
CONFIG_ASH=y
|
||||
|
||||
#
|
||||
# ash (forced enabled as default shell)
|
||||
#
|
||||
|
||||
#
|
||||
# Ash Shell Options
|
||||
#
|
||||
@@ -427,6 +445,7 @@ CONFIG_FEATURE_SH_FANCY_PROMPT=y
|
||||
# System Logging Utilities
|
||||
#
|
||||
CONFIG_SYSLOGD=y
|
||||
# CONFIG_FEATURE_ROTATE_LOGFILE is not set
|
||||
CONFIG_FEATURE_REMOTE_LOG=y
|
||||
CONFIG_FEATURE_IPC_SYSLOG=y
|
||||
CONFIG_LOGREAD=y
|
||||
@@ -441,6 +460,7 @@ CONFIG_FBSET=y
|
||||
CONFIG_FEATURE_FBSET_FANCY=y
|
||||
CONFIG_FEATURE_FBSET_READMODE=y
|
||||
CONFIG_FDFLUSH=y
|
||||
# CONFIG_FDFORMAT is not set
|
||||
CONFIG_FDISK=y
|
||||
CONFIG_FEATURE_FDISK_WRITABLE=y
|
||||
CONFIG_FEATURE_AIX_LABEL=y
|
||||
@@ -464,10 +484,6 @@ CONFIG_LOSETUP=y
|
||||
CONFIG_MKSWAP=y
|
||||
CONFIG_MORE=y
|
||||
CONFIG_FEATURE_USE_TERMIOS=y
|
||||
|
||||
#
|
||||
# Common options for ls and more
|
||||
#
|
||||
CONFIG_PIVOT_ROOT=y
|
||||
CONFIG_RDATE=y
|
||||
CONFIG_SWAPONOFF=y
|
||||
@@ -480,8 +496,7 @@ CONFIG_FEATURE_MOUNT_FORCE=y
|
||||
# Common options for mount/umount
|
||||
#
|
||||
CONFIG_FEATURE_MOUNT_LOOP=y
|
||||
CONFIG_FEATURE_MTAB_SUPPORT=y
|
||||
CONFIG_FEATURE_MTAB_FILENAME="/etc/mtab"
|
||||
# CONFIG_FEATURE_MTAB_SUPPORT is not set
|
||||
|
||||
#
|
||||
# Debugging Options
|
||||
|
||||
Vendored
+31
-21
@@ -16,6 +16,7 @@ CONFIG_FEATURE_DEVFS=y
|
||||
CONFIG_FEATURE_DEVPTS=y
|
||||
# CONFIG_FEATURE_CLEAN_UP is not set
|
||||
# CONFIG_FEATURE_SUID is not set
|
||||
# CONFIG_SELINUX is not set
|
||||
|
||||
#
|
||||
# Build Options
|
||||
@@ -50,12 +51,17 @@ CONFIG_TAR=y
|
||||
# CONFIG_FEATURE_TAR_BZIP2 is not set
|
||||
# CONFIG_FEATURE_TAR_EXCLUDE is not set
|
||||
CONFIG_FEATURE_TAR_GZIP=y
|
||||
# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
|
||||
# CONFIG_FEATURE_TAR_COMPRESS is not set
|
||||
CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
|
||||
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
|
||||
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
|
||||
# CONFIG_UNCOMPRESS is not set
|
||||
# CONFIG_UNZIP is not set
|
||||
|
||||
#
|
||||
# Common options for cpio and tar
|
||||
#
|
||||
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
|
||||
|
||||
#
|
||||
# Coreutils
|
||||
#
|
||||
@@ -80,10 +86,12 @@ CONFIG_FEATURE_FANCY_ECHO=y
|
||||
CONFIG_ENV=y
|
||||
CONFIG_EXPR=y
|
||||
CONFIG_FALSE=y
|
||||
# CONFIG_FOLD is not set
|
||||
CONFIG_HEAD=y
|
||||
# CONFIG_FEATURE_FANCY_HEAD is not set
|
||||
# CONFIG_HOSTID is not set
|
||||
CONFIG_ID=y
|
||||
# CONFIG_INSTALL is not set
|
||||
# CONFIG_LENGTH is not set
|
||||
CONFIG_LN=y
|
||||
# CONFIG_LOGNAME is not set
|
||||
@@ -101,7 +109,7 @@ CONFIG_MKDIR=y
|
||||
CONFIG_MKNOD=y
|
||||
CONFIG_MV=y
|
||||
# CONFIG_OD is not set
|
||||
# CONFIG_PRINTF is not set
|
||||
CONFIG_PRINTF=y
|
||||
CONFIG_PWD=y
|
||||
CONFIG_REALPATH=y
|
||||
CONFIG_RM=y
|
||||
@@ -109,8 +117,6 @@ CONFIG_RMDIR=y
|
||||
# CONFIG_SHA1SUM is not set
|
||||
# CONFIG_SLEEP is not set
|
||||
CONFIG_SORT=y
|
||||
# CONFIG_FEATURE_SORT_REVERSE is not set
|
||||
# CONFIG_FEATURE_SORT_UNIQUE is not set
|
||||
# CONFIG_STTY is not set
|
||||
CONFIG_SYNC=y
|
||||
CONFIG_TAIL=y
|
||||
@@ -151,6 +157,11 @@ CONFIG_FEATURE_AUTOWIDTH=y
|
||||
#
|
||||
CONFIG_FEATURE_HUMAN_READABLE=y
|
||||
|
||||
#
|
||||
# Common options for md5sum, sha1sum
|
||||
#
|
||||
# CONFIG_FEATURE_MD5_SHA1_SUM_CHECK is not set
|
||||
|
||||
#
|
||||
# Console Utilities
|
||||
#
|
||||
@@ -169,16 +180,18 @@ CONFIG_FEATURE_HUMAN_READABLE=y
|
||||
# Debian Utilities
|
||||
#
|
||||
# CONFIG_MKTEMP is not set
|
||||
# CONFIG_PIPE_PROGRESS is not set
|
||||
CONFIG_READLINK=y
|
||||
# CONFIG_RUN_PARTS is not set
|
||||
# CONFIG_START_STOP_DAEMON is not set
|
||||
# CONFIG_WHICH is not set
|
||||
|
||||
#
|
||||
# Editors
|
||||
#
|
||||
# CONFIG_AWK is not set
|
||||
# CONFIG_PATCH is not set
|
||||
CONFIG_SED=y
|
||||
# CONFIG_FEATURE_SED_EMBEDED_NEWLINE is not set
|
||||
# CONFIG_VI is not set
|
||||
|
||||
#
|
||||
@@ -193,6 +206,7 @@ CONFIG_FEATURE_FIND_NEWER=y
|
||||
CONFIG_FEATURE_FIND_INUM=y
|
||||
CONFIG_GREP=y
|
||||
# CONFIG_FEATURE_GREP_EGREP_ALIAS is not set
|
||||
# CONFIG_FEATURE_GREP_FGREP_ALIAS is not set
|
||||
# CONFIG_FEATURE_GREP_CONTEXT is not set
|
||||
# CONFIG_XARGS is not set
|
||||
|
||||
@@ -203,11 +217,10 @@ CONFIG_INIT=y
|
||||
CONFIG_FEATURE_USE_INITTAB=y
|
||||
# CONFIG_FEATURE_INITRD is not set
|
||||
# CONFIG_FEATURE_INIT_COREDUMPS is not set
|
||||
# CONFIG_FEATURE_EXTRA_QUIET is not set
|
||||
CONFIG_FEATURE_EXTRA_QUIET=y
|
||||
CONFIG_HALT=y
|
||||
# CONFIG_POWEROFF is not set
|
||||
CONFIG_REBOOT=y
|
||||
# CONFIG_START_STOP_DAEMON is not set
|
||||
# CONFIG_MESG is not set
|
||||
|
||||
#
|
||||
@@ -232,17 +245,19 @@ CONFIG_USE_BB_PWD_GRP=y
|
||||
# CONFIG_CROND is not set
|
||||
# CONFIG_CRONTAB is not set
|
||||
# CONFIG_DC is not set
|
||||
# CONFIG_DUTMP is not set
|
||||
# CONFIG_DEVFSD is not set
|
||||
# CONFIG_LAST is not set
|
||||
# CONFIG_HDPARM is not set
|
||||
# CONFIG_MAKEDEVS is not set
|
||||
# CONFIG_MT is not set
|
||||
# CONFIG_STRINGS is not set
|
||||
# CONFIG_TIME is not set
|
||||
# CONFIG_UPDATE is not set
|
||||
# CONFIG_WATCHDOG is not set
|
||||
|
||||
#
|
||||
# Linux Module Utilities
|
||||
#
|
||||
# CONFIG_DEPMOD is not set
|
||||
# CONFIG_INSMOD is not set
|
||||
# CONFIG_LSMOD is not set
|
||||
# CONFIG_MODPROBE is not set
|
||||
@@ -287,8 +302,9 @@ CONFIG_ROUTE=y
|
||||
# CONFIG_TRACEROUTE is not set
|
||||
# CONFIG_VCONFIG is not set
|
||||
CONFIG_WGET=y
|
||||
# CONFIG_FEATURE_WGET_STATUSBAR is not set
|
||||
CONFIG_FEATURE_WGET_STATUSBAR=y
|
||||
CONFIG_FEATURE_WGET_AUTHENTICATION=y
|
||||
CONFIG_FEATURE_WGET_IP6_LITERAL=y
|
||||
|
||||
#
|
||||
# udhcp Server/Client
|
||||
@@ -320,10 +336,6 @@ CONFIG_FEATURE_SH_IS_ASH=y
|
||||
# CONFIG_FEATURE_SH_IS_NONE is not set
|
||||
CONFIG_ASH=y
|
||||
|
||||
#
|
||||
# ash (forced enabled as default shell)
|
||||
#
|
||||
|
||||
#
|
||||
# Ash Shell Options
|
||||
#
|
||||
@@ -355,6 +367,7 @@ CONFIG_FEATURE_SH_FANCY_PROMPT=y
|
||||
# System Logging Utilities
|
||||
#
|
||||
CONFIG_SYSLOGD=y
|
||||
# CONFIG_FEATURE_ROTATE_LOGFILE is not set
|
||||
# CONFIG_FEATURE_REMOTE_LOG is not set
|
||||
# CONFIG_FEATURE_IPC_SYSLOG is not set
|
||||
CONFIG_KLOGD=y
|
||||
@@ -366,8 +379,9 @@ CONFIG_LOGGER=y
|
||||
CONFIG_DMESG=y
|
||||
# CONFIG_FBSET is not set
|
||||
# CONFIG_FDFLUSH is not set
|
||||
# CONFIG_FDFORMAT is not set
|
||||
# CONFIG_FDISK is not set
|
||||
# CONFIG_FREERAMDISK is not set
|
||||
CONFIG_FREERAMDISK=y
|
||||
# CONFIG_FSCK_MINIX is not set
|
||||
# CONFIG_MKFS_MINIX is not set
|
||||
# CONFIG_GETOPT is not set
|
||||
@@ -377,10 +391,6 @@ CONFIG_DMESG=y
|
||||
CONFIG_MKSWAP=y
|
||||
CONFIG_MORE=y
|
||||
CONFIG_FEATURE_USE_TERMIOS=y
|
||||
|
||||
#
|
||||
# Common options for ls and more
|
||||
#
|
||||
CONFIG_PIVOT_ROOT=y
|
||||
# CONFIG_RDATE is not set
|
||||
CONFIG_SWAPONOFF=y
|
||||
@@ -392,7 +402,7 @@ CONFIG_FEATURE_MOUNT_FORCE=y
|
||||
#
|
||||
# Common options for mount/umount
|
||||
#
|
||||
# CONFIG_FEATURE_MOUNT_LOOP is not set
|
||||
CONFIG_FEATURE_MOUNT_LOOP=y
|
||||
# CONFIG_FEATURE_MTAB_SUPPORT is not set
|
||||
|
||||
#
|
||||
|
||||
+34
-27
@@ -16,6 +16,7 @@ CONFIG_FEATURE_DEVFS=y
|
||||
CONFIG_FEATURE_DEVPTS=y
|
||||
# CONFIG_FEATURE_CLEAN_UP is not set
|
||||
# CONFIG_FEATURE_SUID is not set
|
||||
# CONFIG_SELINUX is not set
|
||||
|
||||
#
|
||||
# Build Options
|
||||
@@ -50,12 +51,17 @@ CONFIG_TAR=y
|
||||
# CONFIG_FEATURE_TAR_BZIP2 is not set
|
||||
# CONFIG_FEATURE_TAR_EXCLUDE is not set
|
||||
CONFIG_FEATURE_TAR_GZIP=y
|
||||
# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
|
||||
# CONFIG_FEATURE_TAR_COMPRESS is not set
|
||||
CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
|
||||
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
|
||||
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
|
||||
# CONFIG_UNCOMPRESS is not set
|
||||
# CONFIG_UNZIP is not set
|
||||
|
||||
#
|
||||
# Common options for cpio and tar
|
||||
#
|
||||
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
|
||||
|
||||
#
|
||||
# Coreutils
|
||||
#
|
||||
@@ -80,10 +86,12 @@ CONFIG_FEATURE_FANCY_ECHO=y
|
||||
CONFIG_ENV=y
|
||||
CONFIG_EXPR=y
|
||||
CONFIG_FALSE=y
|
||||
# CONFIG_FOLD is not set
|
||||
CONFIG_HEAD=y
|
||||
# CONFIG_FEATURE_FANCY_HEAD is not set
|
||||
# CONFIG_HOSTID is not set
|
||||
CONFIG_ID=y
|
||||
# CONFIG_INSTALL is not set
|
||||
# CONFIG_LENGTH is not set
|
||||
CONFIG_LN=y
|
||||
# CONFIG_LOGNAME is not set
|
||||
@@ -101,7 +109,7 @@ CONFIG_MKDIR=y
|
||||
CONFIG_MKNOD=y
|
||||
CONFIG_MV=y
|
||||
# CONFIG_OD is not set
|
||||
# CONFIG_PRINTF is not set
|
||||
CONFIG_PRINTF=y
|
||||
CONFIG_PWD=y
|
||||
CONFIG_REALPATH=y
|
||||
CONFIG_RM=y
|
||||
@@ -109,8 +117,6 @@ CONFIG_RMDIR=y
|
||||
# CONFIG_SHA1SUM is not set
|
||||
# CONFIG_SLEEP is not set
|
||||
CONFIG_SORT=y
|
||||
# CONFIG_FEATURE_SORT_REVERSE is not set
|
||||
# CONFIG_FEATURE_SORT_UNIQUE is not set
|
||||
# CONFIG_STTY is not set
|
||||
CONFIG_SYNC=y
|
||||
CONFIG_TAIL=y
|
||||
@@ -151,6 +157,11 @@ CONFIG_FEATURE_AUTOWIDTH=y
|
||||
#
|
||||
CONFIG_FEATURE_HUMAN_READABLE=y
|
||||
|
||||
#
|
||||
# Common options for md5sum, sha1sum
|
||||
#
|
||||
# CONFIG_FEATURE_MD5_SHA1_SUM_CHECK is not set
|
||||
|
||||
#
|
||||
# Console Utilities
|
||||
#
|
||||
@@ -169,16 +180,18 @@ CONFIG_FEATURE_HUMAN_READABLE=y
|
||||
# Debian Utilities
|
||||
#
|
||||
# CONFIG_MKTEMP is not set
|
||||
# CONFIG_PIPE_PROGRESS is not set
|
||||
CONFIG_READLINK=y
|
||||
# CONFIG_RUN_PARTS is not set
|
||||
# CONFIG_START_STOP_DAEMON is not set
|
||||
# CONFIG_WHICH is not set
|
||||
|
||||
#
|
||||
# Editors
|
||||
#
|
||||
# CONFIG_AWK is not set
|
||||
# CONFIG_PATCH is not set
|
||||
CONFIG_SED=y
|
||||
# CONFIG_FEATURE_SED_EMBEDED_NEWLINE is not set
|
||||
# CONFIG_VI is not set
|
||||
|
||||
#
|
||||
@@ -193,6 +206,7 @@ CONFIG_FEATURE_FIND_NEWER=y
|
||||
CONFIG_FEATURE_FIND_INUM=y
|
||||
CONFIG_GREP=y
|
||||
# CONFIG_FEATURE_GREP_EGREP_ALIAS is not set
|
||||
# CONFIG_FEATURE_GREP_FGREP_ALIAS is not set
|
||||
# CONFIG_FEATURE_GREP_CONTEXT is not set
|
||||
# CONFIG_XARGS is not set
|
||||
|
||||
@@ -203,11 +217,10 @@ CONFIG_INIT=y
|
||||
CONFIG_FEATURE_USE_INITTAB=y
|
||||
# CONFIG_FEATURE_INITRD is not set
|
||||
# CONFIG_FEATURE_INIT_COREDUMPS is not set
|
||||
# CONFIG_FEATURE_EXTRA_QUIET is not set
|
||||
CONFIG_FEATURE_EXTRA_QUIET=y
|
||||
CONFIG_HALT=y
|
||||
# CONFIG_POWEROFF is not set
|
||||
CONFIG_REBOOT=y
|
||||
# CONFIG_START_STOP_DAEMON is not set
|
||||
# CONFIG_MESG is not set
|
||||
|
||||
#
|
||||
@@ -232,24 +245,23 @@ CONFIG_USE_BB_PWD_GRP=y
|
||||
# CONFIG_CROND is not set
|
||||
# CONFIG_CRONTAB is not set
|
||||
# CONFIG_DC is not set
|
||||
# CONFIG_DUTMP is not set
|
||||
# CONFIG_DEVFSD is not set
|
||||
# CONFIG_LAST is not set
|
||||
# CONFIG_HDPARM is not set
|
||||
# CONFIG_MAKEDEVS is not set
|
||||
# CONFIG_MT is not set
|
||||
# CONFIG_STRINGS is not set
|
||||
# CONFIG_TIME is not set
|
||||
# CONFIG_UPDATE is not set
|
||||
# CONFIG_WATCHDOG is not set
|
||||
|
||||
#
|
||||
# Linux Module Utilities
|
||||
#
|
||||
CONFIG_MODUTILS_OBJ=y
|
||||
CONFIG_DEPMOD=y
|
||||
CONFIG_INSMOD=y
|
||||
# CONFIG_FEATURE_OLD_MODULE_INTERFACE is not set
|
||||
CONFIG_FEATURE_NEW_MODULE_INTERFACE=y
|
||||
|
||||
#
|
||||
# Support new (post 2.1) Linux kernels (Forced enabled)
|
||||
#
|
||||
# CONFIG_FEATURE_2_2_MODULES is not set
|
||||
CONFIG_FEATURE_2_4_MODULES=y
|
||||
# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
|
||||
# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
|
||||
# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
|
||||
@@ -299,8 +311,9 @@ CONFIG_ROUTE=y
|
||||
# CONFIG_TRACEROUTE is not set
|
||||
# CONFIG_VCONFIG is not set
|
||||
CONFIG_WGET=y
|
||||
# CONFIG_FEATURE_WGET_STATUSBAR is not set
|
||||
CONFIG_FEATURE_WGET_STATUSBAR=y
|
||||
CONFIG_FEATURE_WGET_AUTHENTICATION=y
|
||||
CONFIG_FEATURE_WGET_IP6_LITERAL=y
|
||||
|
||||
#
|
||||
# udhcp Server/Client
|
||||
@@ -332,10 +345,6 @@ CONFIG_FEATURE_SH_IS_ASH=y
|
||||
# CONFIG_FEATURE_SH_IS_NONE is not set
|
||||
CONFIG_ASH=y
|
||||
|
||||
#
|
||||
# ash (forced enabled as default shell)
|
||||
#
|
||||
|
||||
#
|
||||
# Ash Shell Options
|
||||
#
|
||||
@@ -367,6 +376,7 @@ CONFIG_FEATURE_SH_FANCY_PROMPT=y
|
||||
# System Logging Utilities
|
||||
#
|
||||
CONFIG_SYSLOGD=y
|
||||
# CONFIG_FEATURE_ROTATE_LOGFILE is not set
|
||||
# CONFIG_FEATURE_REMOTE_LOG is not set
|
||||
# CONFIG_FEATURE_IPC_SYSLOG is not set
|
||||
CONFIG_KLOGD=y
|
||||
@@ -378,8 +388,9 @@ CONFIG_LOGGER=y
|
||||
CONFIG_DMESG=y
|
||||
# CONFIG_FBSET is not set
|
||||
# CONFIG_FDFLUSH is not set
|
||||
# CONFIG_FDFORMAT is not set
|
||||
# CONFIG_FDISK is not set
|
||||
# CONFIG_FREERAMDISK is not set
|
||||
CONFIG_FREERAMDISK=y
|
||||
# CONFIG_FSCK_MINIX is not set
|
||||
# CONFIG_MKFS_MINIX is not set
|
||||
# CONFIG_GETOPT is not set
|
||||
@@ -389,10 +400,6 @@ CONFIG_DMESG=y
|
||||
CONFIG_MKSWAP=y
|
||||
CONFIG_MORE=y
|
||||
CONFIG_FEATURE_USE_TERMIOS=y
|
||||
|
||||
#
|
||||
# Common options for ls and more
|
||||
#
|
||||
CONFIG_PIVOT_ROOT=y
|
||||
# CONFIG_RDATE is not set
|
||||
CONFIG_SWAPONOFF=y
|
||||
@@ -404,7 +411,7 @@ CONFIG_FEATURE_MOUNT_FORCE=y
|
||||
#
|
||||
# Common options for mount/umount
|
||||
#
|
||||
# CONFIG_FEATURE_MOUNT_LOOP is not set
|
||||
CONFIG_FEATURE_MOUNT_LOOP=y
|
||||
# CONFIG_FEATURE_MTAB_SUPPORT is not set
|
||||
|
||||
#
|
||||
Vendored
+5
-4
@@ -2,8 +2,8 @@ Source: busybox-cvs
|
||||
Priority: optional
|
||||
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
|
||||
Uploaders: Erik Andersen <andersee@debian.org>, Bastian Blank <waldi@debian.org>, Tollef Fog Heen <tfheen@debian.org>, Glenn McGrath <bug1@debian.org>
|
||||
Build-Depends: debhelper (>= 2.1.18)
|
||||
Standards-Version: 3.5.7.0
|
||||
Build-Depends: debhelper (>= 4.0.0)
|
||||
Standards-Version: 3.6.0
|
||||
|
||||
Package: busybox-cvs
|
||||
Architecture: any
|
||||
@@ -52,6 +52,7 @@ Architecture: any
|
||||
Depends: ${shlibs:Depends}
|
||||
Section: debian-installer
|
||||
Conflicts: busybox-udeb
|
||||
Enhances: busybox-cvs-floppy-udeb
|
||||
Priority: extra
|
||||
Description: Tiny utilities for the debian-installer
|
||||
BusyBox combines tiny versions of many common UNIX utilities into a single
|
||||
@@ -66,13 +67,13 @@ Description: Tiny utilities for the debian-installer
|
||||
on the debian-installer, this package is not for you. Installing this
|
||||
on your Debian system is a very, very bad idea. You have been warned.
|
||||
|
||||
Package: busybox-cvs-net-udeb
|
||||
Package: busybox-cvs-floppy-udeb
|
||||
Architecture: i386
|
||||
Depends: ${shlibs:Depends}
|
||||
Section: debian-installer
|
||||
Conflicts: busybox-udeb
|
||||
Priority: extra
|
||||
Description: Tiny utilities for the debian-installer network images
|
||||
Description: Tiny utilities for the debian-installer floppy images
|
||||
BusyBox combines tiny versions of many common UNIX utilities into a single
|
||||
small executable. It provides minimalist replacements for the most common
|
||||
utilities you would usually find on your desktop system (i.e., ls, cp, mv,
|
||||
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
awk "BEGIN { i = 0; } { if (/^Package: $2/) i = 1; if (/^\s*\$/) i = 0; if (/$1:/ && i) print }" < debian/control | sed -e "s,^$1: ,,"
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
This package was debianized by Erik Andersen <andersen@codepoet.org> on
|
||||
This package was debianized by Erik Andersen <andersee@debian.org> on
|
||||
Sun, 18 Jun 2000 23:31:02 -0600
|
||||
|
||||
It was downloaded from ftp://ftp.busybox.net/busybox
|
||||
|
||||
Vendored
+82
-59
@@ -3,10 +3,9 @@
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
# This is the debhelper compatibility version to use.
|
||||
export DH_COMPAT=3
|
||||
|
||||
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
|
||||
DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
|
||||
DEB_HOST_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
|
||||
|
||||
VERSION = $(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
|
||||
|
||||
@@ -18,25 +17,39 @@ endif
|
||||
|
||||
PACKAGE_PREFIX = busybox-cvs
|
||||
|
||||
ARCH_FLOPPY_UDEB = $(shell sh debian/control-extract Architecture $(PACKAGE_PREFIX)-floppy-udeb)
|
||||
|
||||
PACKAGES_DEB = $(PACKAGE_PREFIX) $(PACKAGE_PREFIX)-static
|
||||
PACKAGES_UDEB = $(PACKAGE_PREFIX)-udeb
|
||||
ifneq ($(wildcard ./debian/config-net-udeb-$(DEB_HOST_ARCH)),)
|
||||
PACKAGES_UDEB += $(PACKAGE_PREFIX)-net-udeb
|
||||
ifneq ($(filter $(DEB_HOST_ARCH),$(ARCH_FLOPPY_UDEB)),)
|
||||
PACKAGES_UDEB += $(PACKAGE_PREFIX)-floppy-udeb
|
||||
endif
|
||||
PACKAGES = $(PACKAGES_DEB) $(PACKAGES_UDEB)
|
||||
DEBHELPER_PACKAGES_DEB = $(patsubst %,-p%,$(PACKAGES_DEB))
|
||||
|
||||
build-arch: build-arch-deb build-arch-static build-arch-udeb build-arch-net-udeb build-arch-doc
|
||||
DEBHELPER_PACKAGES_DEB = $(patsubst %,-p%,$(PACKAGES_DEB))
|
||||
DEBHELPER_PACKAGES_UDEB = $(patsubst %,-p%,$(PACKAGES_UDEB))
|
||||
|
||||
CONFIG = $(firstword $(wildcard ./debian/config-$(1)-$(DEB_HOST_GNU_SYSTEM)-$(DEB_HOST_GNU_CPU) ./debian/config-$(1)-$(DEB_HOST_GNU_SYSTEM) ./debian/config-$(1)))
|
||||
CONFIG_DEB = $(call CONFIG,deb)
|
||||
CONFIG_STATIC = $(call CONFIG,static)
|
||||
CONFIG_UDEB = $(call CONFIG,udeb)
|
||||
CONFIG_FLOPPY_UDEB = $(call CONFIG,floppy-udeb)
|
||||
|
||||
configure: configure-stamp
|
||||
configure-stamp:
|
||||
sh ./configure
|
||||
|
||||
touch $@
|
||||
|
||||
build-arch: build-arch-deb-all build-arch-udeb-all
|
||||
build-arch-deb-all: build-arch-deb build-arch-static build-arch-doc
|
||||
build-arch-udeb-all: build-arch-udeb build-arch-floppy-udeb
|
||||
|
||||
build-arch-deb: build-arch-deb-stamp
|
||||
build-arch-deb-stamp:
|
||||
build-arch-deb-stamp: configure-stamp
|
||||
$(MAKE) clean
|
||||
|
||||
ifeq ($(wildcard ./debian/config-deb-$(DEB_HOST_ARCH)),)
|
||||
cp ./debian/config-deb .config
|
||||
else
|
||||
cp ./debian/config-deb-$(DEB_HOST_ARCH) .config
|
||||
endif
|
||||
cp $(CONFIG_DEB) .config
|
||||
|
||||
$(MAKE) dep
|
||||
$(MAKE) CONFIG_DEBUG=$(CONFIG_DEBUG)
|
||||
@@ -47,14 +60,10 @@ endif
|
||||
touch $@
|
||||
|
||||
build-arch-static: build-arch-static-stamp
|
||||
build-arch-static-stamp:
|
||||
build-arch-static-stamp: configure-stamp
|
||||
$(MAKE) clean
|
||||
|
||||
ifeq ($(wildcard ./debian/config-static-$(DEB_HOST_ARCH)),)
|
||||
cp ./debian/config-static .config
|
||||
else
|
||||
cp ./debian/config-static-$(DEB_HOST_ARCH) .config
|
||||
endif
|
||||
cp $(CONFIG_STATIC) .config
|
||||
|
||||
$(MAKE) dep
|
||||
$(MAKE) CONFIG_DEBUG=$(CONFIG_DEBUG)
|
||||
@@ -65,39 +74,38 @@ endif
|
||||
touch $@
|
||||
|
||||
build-arch-udeb: build-arch-udeb-stamp
|
||||
build-arch-udeb-stamp:
|
||||
build-arch-udeb-stamp: configure-stamp
|
||||
$(MAKE) clean
|
||||
|
||||
ifeq ($(wildcard ./debian/config-udeb-$(DEB_HOST_ARCH)),)
|
||||
cp ./debian/config-udeb .config
|
||||
else
|
||||
cp ./debian/config-udeb-$(DEB_HOST_ARCH) .config
|
||||
endif
|
||||
cp $(CONFIG_UDEB) .config
|
||||
|
||||
$(MAKE) dep
|
||||
$(MAKE) CONFIG_DEBUG=$(CONFIG_DEBUG)
|
||||
|
||||
$(MAKE) PREFIX=$(CURDIR)/install-$(PACKAGE_PREFIX)-udeb install
|
||||
# Remove init link, but init support is still compiled in to be
|
||||
# used.
|
||||
rm -f $(CURDIR)/install-$(PACKAGE_PREFIX)-udeb/sbin/init
|
||||
|
||||
touch $@
|
||||
|
||||
build-arch-net-udeb: build-arch-net-udeb-stamp
|
||||
build-arch-net-udeb-stamp:
|
||||
ifneq ($(wildcard ./debian/config-net-udeb-$(DEB_HOST_ARCH)),)
|
||||
build-arch-floppy-udeb: build-arch-floppy-udeb-stamp
|
||||
build-arch-floppy-udeb-stamp: configure-stamp
|
||||
ifneq ($(filter $(DEB_HOST_ARCH),$(ARCH_FLOPPY_UDEB)),)
|
||||
$(MAKE) clean
|
||||
|
||||
cp ./debian/config-net-udeb-$(DEB_HOST_ARCH) .config
|
||||
cp $(CONFIG_FLOPPY_UDEB) .config
|
||||
|
||||
$(MAKE) dep
|
||||
$(MAKE) CONFIG_DEBUG=$(CONFIG_DEBUG)
|
||||
|
||||
$(MAKE) PREFIX=$(CURDIR)/install-$(PACKAGE_PREFIX)-net-udeb install
|
||||
$(MAKE) PREFIX=$(CURDIR)/install-$(PACKAGE_PREFIX)-floppy-udeb install
|
||||
endif
|
||||
|
||||
touch $@
|
||||
|
||||
build-arch-doc: build-arch-doc-stamp
|
||||
build-arch-doc-stamp:
|
||||
build-arch-doc-stamp: configure-stamp
|
||||
$(MAKE) docs/BusyBox.1
|
||||
|
||||
cp docs/BusyBox.1 busybox.1
|
||||
@@ -109,20 +117,20 @@ build: build-arch
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -f build-*-stamp debian/files~
|
||||
rm -f build-*-stamp configure-stamp debian/files~
|
||||
|
||||
$(MAKE) distclean
|
||||
-$(MAKE) distclean
|
||||
-rm -rf busybox-deb busybox-static install* busybox.1
|
||||
|
||||
dh_clean
|
||||
|
||||
install: build-arch
|
||||
install-deb: build-arch-deb-all
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
dh_clean -k $(DEBHELPER_PACKAGES_DEB)
|
||||
dh_installdirs $(DEBHELPER_PACKAGES_DEB)
|
||||
|
||||
for i in $(PACKAGES); do \
|
||||
for i in $(PACKAGES_DEB); do \
|
||||
( \
|
||||
cd install-$$i; \
|
||||
find -type d -exec install -d $(CURDIR)/debian/$$i/{} \;; \
|
||||
@@ -133,36 +141,51 @@ install: build-arch
|
||||
install -m644 debian/$(PACKAGE_PREFIX)-static.override \
|
||||
debian/$(PACKAGE_PREFIX)-static/usr/share/lintian/overrides/$(PACKAGE_PREFIX)-static
|
||||
|
||||
install-udeb: build-arch-udeb-all
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -k $(DEBHELPER_PACKAGES_UDEB)
|
||||
dh_installdirs $(DEBHELPER_PACKAGES_UDEB)
|
||||
|
||||
for i in $(PACKAGES_UDEB); do \
|
||||
( \
|
||||
cd install-$$i; \
|
||||
find -type d -exec install -d $(CURDIR)/debian/$$i/{} \;; \
|
||||
find \( -type f -o -type l \) -exec cp -a {} $(CURDIR)/debian/$$i/{} \;; \
|
||||
); \
|
||||
done
|
||||
|
||||
binary-arch: binary-arch-deb binary-arch-udeb
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch: build-arch install
|
||||
dh_testdir -a
|
||||
dh_testroot -a
|
||||
# dh_installdebconf -a
|
||||
binary-arch-deb: build-arch-deb-all install-deb
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installdocs $(DEBHELPER_PACKAGES_DEB)
|
||||
# dh_installexamples -a
|
||||
# dh_installmenu -a
|
||||
# dh_installlogrotate -a
|
||||
# dh_installemacsen -a
|
||||
# dh_installpam -a
|
||||
# dh_installmime -a
|
||||
# dh_installinit -a
|
||||
# dh_installcron -a
|
||||
dh_installman $(DEBHELPER_PACKAGES_DEB)
|
||||
# dh_installinfo -a
|
||||
# dh_undocumented -a
|
||||
dh_installchangelogs Changelog $(DEBHELPER_PACKAGES_DEB)
|
||||
dh_strip -a
|
||||
dh_link -a
|
||||
dh_compress -a
|
||||
dh_fixperms -a
|
||||
# dh_makeshlibs -a
|
||||
dh_installdeb -a
|
||||
# dh_perl -a
|
||||
dh_shlibdeps -a
|
||||
dh_strip $(DEBHELPER_PACKAGES_DEB)
|
||||
dh_link $(DEBHELPER_PACKAGES_DEB)
|
||||
dh_compress $(DEBHELPER_PACKAGES_DEB)
|
||||
dh_fixperms $(DEBHELPER_PACKAGES_DEB)
|
||||
dh_installdeb $(DEBHELPER_PACKAGES_DEB)
|
||||
dh_shlibdeps $(DEBHELPER_PACKAGES_DEB)
|
||||
dh_gencontrol $(DEBHELPER_PACKAGES_DEB)
|
||||
dh_md5sums $(DEBHELPER_PACKAGES_DEB)
|
||||
dh_builddeb $(DEBHELPER_PACKAGES_DEB)
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch-udeb: build-arch-udeb-all install-udeb
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_strip $(DEBHELPER_PACKAGES_UDEB)
|
||||
dh_link $(DEBHELPER_PACKAGES_UDEB)
|
||||
dh_compress $(DEBHELPER_PACKAGES_UDEB)
|
||||
dh_fixperms $(DEBHELPER_PACKAGES_UDEB)
|
||||
dh_installdeb $(DEBHELPER_PACKAGES_UDEB)
|
||||
dh_shlibdeps $(DEBHELPER_PACKAGES_UDEB)
|
||||
dh_gencontrol $(DEBHELPER_PACKAGES_DEB)
|
||||
|
||||
$(foreach PACKAGE, $(PACKAGES_UDEB), \
|
||||
dh_gencontrol -p$(PACKAGE) -- -fdebian/files~; \
|
||||
dpkg-distaddfile $(PACKAGE)_$(VERSION)_$(DEB_HOST_ARCH).udeb debian-installer extra; \
|
||||
|
||||
@@ -11,6 +11,12 @@ config CONFIG_MKTEMP
|
||||
help
|
||||
mktemp is used to create unique temporary files
|
||||
|
||||
config CONFIG_PIPE_PROGRESS
|
||||
bool "pipe_progress"
|
||||
default n
|
||||
help
|
||||
Display a dot to indicate pipe activity.
|
||||
|
||||
config CONFIG_READLINK
|
||||
bool "readlink"
|
||||
default n
|
||||
@@ -27,8 +33,8 @@ config CONFIG_RUN_PARTS
|
||||
It is useful to set up a directory like cron.daily, where you need to
|
||||
execute all the scripts in that directory.
|
||||
|
||||
This implementation of run-parts does not accept long options, and
|
||||
some features (such as report mode) are not implemented.
|
||||
In this implementation of run-parts some features (such as report mode)
|
||||
are not implemented.
|
||||
|
||||
Unless you know that run-parts is used in some of your scripts
|
||||
you can safely say N here.
|
||||
|
||||
@@ -25,6 +25,7 @@ endif
|
||||
|
||||
DEBIANUTILS-y:=
|
||||
DEBIANUTILS-$(CONFIG_MKTEMP) += mktemp.o
|
||||
DEBIANUTILS-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o
|
||||
DEBIANUTILS-$(CONFIG_READLINK) += readlink.o
|
||||
DEBIANUTILS-$(CONFIG_RUN_PARTS) += run_parts.o
|
||||
DEBIANUTILS-$(CONFIG_START_STOP_DAEMON) += start_stop_daemon.o
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Monitor a pipe with a simple progress display.
|
||||
*
|
||||
* Copyright (C) 2003 by Rob Landley <rob@landley.net>, Joey Hess
|
||||
*
|
||||
* 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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "busybox.h"
|
||||
|
||||
#define PIPE_PROGRESS_SIZE 4096
|
||||
|
||||
/* Read a block of data from stdin, write it to stdout.
|
||||
* Activity is indicated by a '.' to stderr
|
||||
*/
|
||||
extern int pipe_progress_main(int argc, char **argv)
|
||||
{
|
||||
RESERVE_CONFIG_BUFFER(buf, PIPE_PROGRESS_SIZE);
|
||||
time_t t = time(NULL);
|
||||
size_t len;
|
||||
|
||||
while ((len = fread(buf, 1, PIPE_PROGRESS_SIZE, stdin)) > 0) {
|
||||
time_t new_time = time(NULL);
|
||||
if (new_time != t) {
|
||||
t = new_time;
|
||||
fputc('.', stderr);
|
||||
}
|
||||
fwrite(buf, len, 1, stdout);
|
||||
}
|
||||
|
||||
fputc('\n', stderr);
|
||||
|
||||
#ifdef CONFIG_FEATURE_CLEAN_UP
|
||||
RELEASE_CONFIG_BUFFER(buf);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -21,15 +21,11 @@
|
||||
#include "busybox.h"
|
||||
#include "pwd_.h"
|
||||
|
||||
static int start = 0;
|
||||
static int stop = 0;
|
||||
static int fork_before_exec = 0;
|
||||
static int signal_nr = 15;
|
||||
static int user_id = -1;
|
||||
static char *userspec = NULL;
|
||||
static char *cmdname = NULL;
|
||||
static char *execname = NULL;
|
||||
static char *startas = NULL;
|
||||
|
||||
typedef struct pid_list {
|
||||
struct pid_list *next;
|
||||
@@ -195,35 +191,39 @@ static const struct option ssd_long_options[] = {
|
||||
{ 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
#define SSD_CTX_STOP 1
|
||||
#define SSD_CTX_START 2
|
||||
#define SSD_OPT_BACKGROUND 4
|
||||
|
||||
int
|
||||
start_stop_daemon_main(int argc, char **argv)
|
||||
{
|
||||
int flags;
|
||||
unsigned long opt;
|
||||
char *signame = NULL;
|
||||
char *startas = NULL;
|
||||
|
||||
bb_applet_long_options = ssd_long_options;
|
||||
|
||||
flags = bb_getopt_ulflags(argc, argv, "KSba:n:s:u:x:",
|
||||
bb_opt_complementaly = "K~S:S~K";
|
||||
opt = bb_getopt_ulflags(argc, argv, "KSba:n:s:u:x:",
|
||||
&startas, &cmdname, &signame, &userspec, &execname);
|
||||
|
||||
/* Be sneaky and avoid branching */
|
||||
stop = (flags & 1);
|
||||
start = (flags & 2);
|
||||
fork_before_exec = (flags & 4);
|
||||
/* Check one and only one context option was given */
|
||||
if ((opt & 0x80000000UL) || (opt & (SSD_CTX_STOP | SSD_CTX_START)) == 0) {
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
if (signame) {
|
||||
signal_nr = bb_xgetlarg(signame, 10, 0, NSIG);
|
||||
}
|
||||
|
||||
if (start == stop)
|
||||
bb_error_msg_and_die ("need exactly one of -S or -K");
|
||||
|
||||
if (!execname && !userspec)
|
||||
bb_error_msg_and_die ("need at least one of -x or -u");
|
||||
|
||||
if (!startas)
|
||||
startas = execname;
|
||||
|
||||
if (start && !startas)
|
||||
if ((opt & SSD_CTX_START) && !startas)
|
||||
bb_error_msg_and_die ("-S needs -x or -a");
|
||||
|
||||
argc -= optind;
|
||||
@@ -234,7 +234,7 @@ start_stop_daemon_main(int argc, char **argv)
|
||||
|
||||
do_procfs();
|
||||
|
||||
if (stop) {
|
||||
if (opt & SSD_CTX_STOP) {
|
||||
do_stop();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -244,7 +244,7 @@ start_stop_daemon_main(int argc, char **argv)
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
*--argv = startas;
|
||||
if (fork_before_exec) {
|
||||
if (opt & SSD_OPT_BACKGROUND) {
|
||||
if (daemon(0, 0) == -1)
|
||||
bb_perror_msg_and_die ("unable to fork");
|
||||
}
|
||||
@@ -252,4 +252,3 @@ start_stop_daemon_main(int argc, char **argv)
|
||||
execv(startas, argv);
|
||||
bb_perror_msg_and_die ("unable to start %s", startas);
|
||||
}
|
||||
|
||||
+32
-12
@@ -26,10 +26,21 @@
|
||||
#include <stdlib.h>
|
||||
#include "busybox.h"
|
||||
|
||||
static int file_exists(char *file)
|
||||
{
|
||||
struct stat filestat;
|
||||
|
||||
if (stat(file, &filestat) == 0 &&
|
||||
S_ISREG(filestat.st_mode) &&
|
||||
filestat.st_mode & S_IXUSR)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern int which_main(int argc, char **argv)
|
||||
{
|
||||
char *path_list, *path_n;
|
||||
struct stat filestat;
|
||||
int i, count=1, found, status = EXIT_SUCCESS;
|
||||
|
||||
if (argc <= 1 || **(argv + 1) == '-')
|
||||
@@ -49,21 +60,30 @@ extern int which_main(int argc, char **argv)
|
||||
}
|
||||
|
||||
while(argc-- > 0) {
|
||||
char *buf;
|
||||
path_n = path_list;
|
||||
argv++;
|
||||
found = 0;
|
||||
for (i = 0; i < count; i++) {
|
||||
char *buf;
|
||||
buf = concat_path_file(path_n, *argv);
|
||||
if (stat (buf, &filestat) == 0
|
||||
&& filestat.st_mode & S_IXUSR)
|
||||
{
|
||||
puts(buf);
|
||||
found = 1;
|
||||
break;
|
||||
|
||||
/*
|
||||
* Check if we were given the full path, first.
|
||||
* Otherwise see if the file exists in our $PATH.
|
||||
*/
|
||||
buf = *argv;
|
||||
if (file_exists(buf)) {
|
||||
puts(buf);
|
||||
found = 1;
|
||||
} else {
|
||||
for (i = 0; i < count; i++) {
|
||||
buf = concat_path_file(path_n, *argv);
|
||||
if (file_exists(buf)) {
|
||||
puts(buf);
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
free(buf);
|
||||
path_n += (strlen(path_n) + 1);
|
||||
}
|
||||
free(buf);
|
||||
path_n += (strlen(path_n) + 1);
|
||||
}
|
||||
if (!found)
|
||||
status = EXIT_FAILURE;
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<!--#include file="header.html" -->
|
||||
|
||||
|
||||
<!-- Begin Introduction section -->
|
||||
|
||||
<h3>BusyBox: The Swiss Army Knife of Embedded Linux</h3>
|
||||
|
||||
|
||||
BusyBox combines tiny versions of many common UNIX utilities into a single
|
||||
small executable. It provides replacements for most of the utilities you
|
||||
usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox
|
||||
generally have fewer options than their full-featured GNU cousins; however,
|
||||
the options that are included provide the expected functionality and behave
|
||||
very much like their GNU counterparts. BusyBox provides a fairly complete
|
||||
environment for any small or embedded system.
|
||||
|
||||
<p>
|
||||
|
||||
BusyBox has been written with size-optimization and limited resources in
|
||||
mind. It is also extremely modular so you can easily include or exclude
|
||||
commands (or features) at compile time. This makes it easy to customize
|
||||
your embedded systems. To create a working system, just add some device
|
||||
nodes in /dev, a few configuration files in /etc, and a Linux kernel.
|
||||
|
||||
<p>
|
||||
|
||||
BusyBox is maintained by <a href=
|
||||
"http://codepoet.org/andersen/erik/erik.html">Erik Andersen</a>, and
|
||||
licensed under the
|
||||
<a href= "http://www.gnu.org/copyleft/gpl.html">GNU GENERAL PUBLIC LICENSE</a>
|
||||
|
||||
<p>
|
||||
<p>
|
||||
|
||||
<h3>Sponsors</h3>
|
||||
|
||||
Please visit our sponsors and thank them for their
|
||||
support! They have provided money for equipment and
|
||||
bandwidth. Next time you need help with a project,
|
||||
consider these fine companies!
|
||||
|
||||
|
||||
<ul>
|
||||
<li><a href="http://www.penguru.net">Penguru Consulting</a><br>
|
||||
Custom development for embedded Linux systems and multimedia platforms
|
||||
</li>
|
||||
|
||||
<li><a href="http://opensource.se/">opensource.se</a><br>
|
||||
Embedded open source consulting in Europe.
|
||||
</li>
|
||||
|
||||
<li><a href="http://www.codepoet-consulting.com">Codepoet Consulting</a><br>
|
||||
Custom Linux, embedded Linux, BusyBox, and uClibc
|
||||
development.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
If you wish to be a sponsor, or if you have already contributed and would like
|
||||
your name added here, email <a href= "mailto:andersen@codepoet.org">Erik</a>.
|
||||
|
||||
|
||||
<!--#include file="footer.html" -->
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
The code and graphics on this website (and it's mirror sites, if any) are
|
||||
Copyright (c) 1999-2003 by Erik Andersen. All rights reserved.
|
||||
|
||||
Documents on this Web site including their graphical elements, design, and
|
||||
layout are protected by trade dress and other laws and MAY BE COPIED OR
|
||||
IMITATED IN WHOLE OR IN PART. THIS WEBSITE IS LICENSED FREE OF CHARGE, THERE
|
||||
IS NO WARRANTY FOR THE WEBSITE TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
SHOULD THIS WEBSITE PROVE DEFECTIVE, YOU MAY ASSUME THAT SOMEONE MIGHT GET
|
||||
AROUND TO SERVICING, REPAIRING OR CORRECTING IT SOMETIME WHEN THEY HAVE NOTHING
|
||||
BETTER TO DO. REGARDLESS, YOU GET TO KEEP BOTH PIECES.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
|
||||
COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THIS
|
||||
WEBSITE AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
|
||||
INABILITY TO USE THIS WEBSITE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
|
||||
LOSS OF HAIR, LOSS OF LIFE, LOSS OF MEMORY, LOSS OF YOUR CARKEYS, MISPLACEMENT
|
||||
OF YOUR PAYCHECK, OR COMMANDER DATA BEING RENDERED UNABLE TO ASSIST THE
|
||||
STARFLEET OFFICERS ABORD THE STARSHIP ENTERPRISE TO RECALIBRATE THE MAIN
|
||||
DEFLECTOR ARRAY, LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
|
||||
WEBSITE TO OPERATE WITH YOUR WEBBROWSER), EVEN IF SUCH HOLDER OR OTHER PARTY
|
||||
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
You have been warned.
|
||||
|
||||
You can contact the webmaster at <andersen@codepoet.org> if you have some sort
|
||||
of problem with this.
|
||||
|
||||
@@ -1,39 +1,7 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<title>BusyBox Anonymous CVS Instructions</title>
|
||||
</HEAD>
|
||||
|
||||
<body text="#000000" alink="#660000" link="#660000" bgcolor="#dee2de" vlink="#660000">
|
||||
|
||||
<basefont face="lucida, helvetica, arial" size="3">
|
||||
<!--#include file="header.html" -->
|
||||
|
||||
|
||||
<H3>Accessing the Busybox CVS Repository</H3>
|
||||
|
||||
<CENTER>
|
||||
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2>
|
||||
<TR>
|
||||
<td bgcolor="#000000">
|
||||
<FONT FACE="lucida, helvetica" COLOR="#ccccc0">
|
||||
<B>B u s y B o x</B>
|
||||
</FONT>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<a href="/"><IMG SRC="images/busybox2.jpg" alt="BusyBox" border="0" width="360" height="230"></a><BR>
|
||||
|
||||
|
||||
</CENTER>
|
||||
|
||||
<TABLE WIDTH="95%" CELLSPACING=1 CELLPADDING=4 BORDER=1>
|
||||
<TR><TD BGCOLOR="#ccccc0" ALIGN=center>
|
||||
<A NAME="intro"> <BIG><B>
|
||||
Anonymous CVS
|
||||
</B></BIG></A>
|
||||
</TD></TR>
|
||||
<TR><TD BGCOLOR="#eeeee0">
|
||||
<h3>Anonymous CVS</h3>
|
||||
|
||||
We allow anonymous (read-only) CVS access to everyone. The first command you
|
||||
need to run for anonymous CVS access is:
|
||||
@@ -59,6 +27,10 @@ This will create a directory called <b>busybox</b> and a directory called
|
||||
<b>tinylogin</b> in the current directory. These directories contain the
|
||||
latest and greatest source code for busybox and tinylogin.
|
||||
|
||||
<p>
|
||||
If you are not already familiar with using CVS, I recommend you visit
|
||||
this quick <a href="/cvs_howto.html">Introduction to CVS</a>.
|
||||
|
||||
<p>
|
||||
I usually create a ~/.cvsrc file with the following things in it, and I
|
||||
recommend you should use the same:
|
||||
@@ -78,59 +50,8 @@ cvs update</pre>
|
||||
|
||||
Because you've only been granted anonymous access to the tree, you won't be
|
||||
able to commit any changes. Changes can be submitted for inclusion by posting
|
||||
them to the appropriate <a href="http://busybox.net/mailman/listinfo">mailing list</a>.
|
||||
|
||||
|
||||
<!-- End of Table -->
|
||||
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
|
||||
|
||||
<!-- Footer -->
|
||||
<HR>
|
||||
<TABLE WIDTH="100%">
|
||||
<TR>
|
||||
<TD>
|
||||
<font size="-1" face="arial, helvetica, sans-serif">
|
||||
Mail all comments, insults, suggestions and bribes to
|
||||
<a href="mailto:andersen@codepoet.org">Erik Andersen</a><BR>
|
||||
The Busybox logo is copyright 1999-2002, Erik Andersen.
|
||||
</font>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<a href="http://www.vim.org"><img border=0 width=90 height=36
|
||||
src="images/written.in.vi.png"
|
||||
alt="This site created with the vi editor"></a>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<a href="http://www.gimp.org/"><img border=0 width=90 height=36
|
||||
src="images/gfx_by_gimp.png" alt="Graphics by GIMP"></a>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<a href="http://www.linuxtoday.com"><img width=90 height=36
|
||||
src="images/ltbutton2.png" alt="Linux Today"></a>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<p><a href="http://slashdot.org"><img width=90 height=36
|
||||
src="images/sdsmall.png" alt="Slashdot"></a>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<a href="http://freshmeat.net"><img width=90 height=36
|
||||
src="images/fm.mini.png" alt="Freshmeat"></a>
|
||||
</TD>
|
||||
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
them to the appropriate mailing list. For those that are actively contributing
|
||||
<a href="cvs_write.html">CVS write access</a> can be made available.
|
||||
|
||||
<!--#include file="footer.html" -->
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<!--#include file="header.html" -->
|
||||
|
||||
|
||||
<h3>How to use CVS</h3>
|
||||
|
||||
|
||||
If you want to know all the gory details, you will want to visit
|
||||
<a href="http://www.cvshome.org/">the CVS main web page</a>.<p>
|
||||
For the impatient, the following is probably about all you need to know:
|
||||
<p>
|
||||
|
||||
<dl>
|
||||
<dt><pre>cvs checkout -c</pre>
|
||||
<dd>Will list the modules available for checkout
|
||||
<dt><pre>cvs checkout < module name ></pre>
|
||||
<dd>Will checkout the named module
|
||||
<dt><pre>cvs co < module name ></pre>
|
||||
<dd>Same thing
|
||||
<dt><pre>cvs update</pre>
|
||||
|
||||
<dd>Updates your local archive so it is in sync with the repository
|
||||
-- your local updates are left intact. Tries to merge upstream updates
|
||||
into your local updates. You will see the following tags when it is
|
||||
updating your local repository: C means conflict, U means update,
|
||||
P means patched, and M means modified.
|
||||
<dt><pre>cvs up</pre>
|
||||
<dd>Same thing
|
||||
<dt><pre>cvs update < file name ></pre>
|
||||
<dd>Same thing but for just the named file(s)/directory(s).
|
||||
<dt><pre>cvs commit</pre>
|
||||
<dd>Will check in all your work.
|
||||
<dt><pre>cvs add < file name ></pre>
|
||||
|
||||
<dd>Adds the named file/directory into CVS
|
||||
<dt><pre>cvs remove < file name ></pre>
|
||||
<dd>Removes the named file/directory from the upstream repository.
|
||||
<dt><pre>cvs rm < file name ></pre>
|
||||
<dd>Same thing
|
||||
<dt><pre>cvs log < file name ></pre>
|
||||
</dl>
|
||||
|
||||
|
||||
<!--#include file="footer.html" -->
|
||||
|
||||
@@ -1,40 +1,7 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<title>BusyBox CVS Read/Write Instructions</title>
|
||||
</HEAD>
|
||||
|
||||
<body text="#000000" alink="#660000" link="#660000" bgcolor="#dee2de" vlink="#660000">
|
||||
|
||||
<basefont face="lucida, helvetica, arial" size="3">
|
||||
<!--#include file="header.html" -->
|
||||
|
||||
|
||||
<H3>Accessing the Busybox CVS Repository</H3>
|
||||
|
||||
<CENTER>
|
||||
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2>
|
||||
<TR>
|
||||
<td bgcolor="#000000">
|
||||
<FONT FACE="lucida, helvetica" COLOR="#ccccc0">
|
||||
<B>B u s y B o x</B>
|
||||
</FONT>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<a href="/"><IMG SRC="images/busybox2.jpg" alt="BusyBox" border="0" width="360" height="230"></a><BR>
|
||||
|
||||
|
||||
</CENTER>
|
||||
|
||||
<TABLE WIDTH="95%" CELLSPACING=1 CELLPADDING=4 BORDER=1>
|
||||
<TR><TD BGCOLOR="#ccccc0" ALIGN=center>
|
||||
<A NAME="intro"> <BIG><B>
|
||||
CVS Read/Write Access
|
||||
</B></BIG></A>
|
||||
</TD></TR>
|
||||
<TR><TD BGCOLOR="#eeeee0">
|
||||
|
||||
<h3>CVS Read/Write Access</h3>
|
||||
|
||||
If you want to be able to commit things to CVS, first contribute some
|
||||
stuff to show you are serious. Then, very nicely ask
|
||||
@@ -60,58 +27,6 @@ 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>.
|
||||
|
||||
|
||||
<!-- End of Table -->
|
||||
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
|
||||
|
||||
<!-- Footer -->
|
||||
<HR>
|
||||
<TABLE WIDTH="100%">
|
||||
<TR>
|
||||
<TD>
|
||||
<font size="-1" face="arial, helvetica, sans-serif">
|
||||
Mail all comments, insults, suggestions and bribes to
|
||||
<a href="mailto:andersen@codepoet.org">Erik Andersen</a><BR>
|
||||
The Busybox logo is copyright 1999-2002, Erik Andersen.
|
||||
</font>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<a href="http://www.vim.org"><img border=0 width=90 height=36
|
||||
src="images/written.in.vi.png"
|
||||
alt="This site created with the vi editor"></a>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<a href="http://www.gimp.org/"><img border=0 width=90 height=36
|
||||
src="images/gfx_by_gimp.png" alt="Graphics by GIMP"></a>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<a href="http://www.linuxtoday.com"><img width=90 height=36
|
||||
src="images/ltbutton2.png" alt="Linux Today"></a>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<p><a href="http://slashdot.org"><img width=90 height=36
|
||||
src="images/sdsmall.png" alt="Slashdot"></a>
|
||||
</TD>
|
||||
|
||||
<TD>
|
||||
<a href="http://freshmeat.net"><img width=90 height=36
|
||||
src="images/fm.mini.png" alt="Freshmeat"></a>
|
||||
</TD>
|
||||
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
<!--#include file="footer.html" -->
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<!--#include file="header.html" -->
|
||||
|
||||
|
||||
<h3>Documentation</h3>
|
||||
Current documentation for BusyBox includes:
|
||||
|
||||
<ul>
|
||||
<li><a href=
|
||||
"downloads/BusyBox.html">BusyBox.html</a>. This is a
|
||||
list of the all the available commands in BusyBox
|
||||
with complete usage information and examples of how
|
||||
to use each app. I have spent a <em>lot</em> of time
|
||||
updating these docs and trying to make them fairly
|
||||
comprehensive. If you find any errors (factual,
|
||||
grammatical, whatever) please let me know.</li>
|
||||
|
||||
<li><a href="downloads/README">README</a>. This is
|
||||
the README file included in the busybox source
|
||||
release.</li>
|
||||
|
||||
<li>If you need more help, the BusyBox <a href=
|
||||
"lists/busybox/">mailing list</a> is a good place to
|
||||
start.</li>
|
||||
</ul>
|
||||
|
||||
<!--#include file="footer.html" -->
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<!--#include file="header.html" -->
|
||||
|
||||
|
||||
|
||||
<h3>Download</h3>
|
||||
|
||||
Source for the latest release can always be
|
||||
downloaded from <a href="downloads">http://www.busybox.net/downloads</a>.
|
||||
|
||||
<p>
|
||||
You can also obtain <a href= "downloads/snapshots/">Daily Snapshots</a> of
|
||||
the latest stable, and the latest development CVS source trees.
|
||||
|
||||
<p>
|
||||
BusyBox now has <b>two</b> CVS trees. The "busybox-stable" tree
|
||||
contains the older 0.60.x stable series. The "busybox" tree contains
|
||||
the latest 1.0.0-preX development version of busybox.<br>
|
||||
|
||||
<ul>
|
||||
<li> Click here to browse the <a href="/cgi-bin/cvsweb/busybox/">
|
||||
CVS tree for the 1.0.0-preX development version of BusyBox</a>
|
||||
</li>
|
||||
|
||||
<li>Click here to browse the <a href="/cgi-bin/cvsweb/busybox.stable/">
|
||||
CVS tree for the stable 0.60.x version of BusyBox</a>.
|
||||
</li>
|
||||
|
||||
<li>Anonymous <a href="cvs_anon.html">CVS access</a> is available.
|
||||
</li>
|
||||
|
||||
<li>For those that are actively contributing there is
|
||||
even <a href="cvs_write.html">CVS write access</a>.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!--#include file="footer.html" -->
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<!-- Footer -->
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<hr />
|
||||
|
||||
<p>
|
||||
<font face="arial, helvetica, sans-serif" size="-1">
|
||||
<a HREF="/copyright.txt">Copyright © 1999-2003 Erik Andersen</a>
|
||||
<br>
|
||||
Mail all comments, insults, suggestions and bribes to
|
||||
<br>
|
||||
Erik Andersen <A HREF="mailto:andersen@codepoet.org">andersen@codepoet.org</A><BR>
|
||||
</font>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loaded 100 of 307 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user