Compare commits
287
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83785f0ebc | ||
|
|
aa4e5092f5 | ||
|
|
f5234398ef | ||
|
|
d2266d43bf | ||
|
|
c9665631d3 | ||
|
|
df9196d824 | ||
|
|
6dca172610 | ||
|
|
56443cdbdd | ||
|
|
8cab66730a | ||
|
|
b110e1fecb | ||
|
|
d778e6c6f8 | ||
|
|
6500d123d0 | ||
|
|
53772869bc | ||
|
|
75e1e7b3d5 | ||
|
|
176bc34475 | ||
|
|
86a03bee1d | ||
|
|
ee0d4cd8cb | ||
|
|
0b2b0f31a3 | ||
|
|
caf5768154 | ||
|
|
14850308e9 | ||
|
|
7a4269329f | ||
|
|
1d9e99b399 | ||
|
|
3e3a8d50b3 | ||
|
|
1c12b67705 | ||
|
|
25dbb0743e | ||
|
|
b1b70969e0 | ||
|
|
0d6bbb0497 | ||
|
|
ba88826c66 | ||
|
|
cc1bb603e8 | ||
|
|
78a3b6739c | ||
|
|
5e896481eb | ||
|
|
7fe1e3f161 | ||
|
|
65457625a7 | ||
|
|
c528917195 | ||
|
|
79bec06168 | ||
|
|
07fcaab595 | ||
|
|
d98dc92d6a | ||
|
|
4e3beb2e1d | ||
|
|
0687a5b496 | ||
|
|
39c2cb2e93 | ||
|
|
bf6343796e | ||
|
|
69d81a1c1b | ||
|
|
d4acaf70c5 | ||
|
|
8be49c3a80 | ||
|
|
bb8d7db597 | ||
|
|
d29c946f93 | ||
|
|
b5d6ae9a33 | ||
|
|
faac1d3e6e | ||
|
|
02c3c38420 | ||
|
|
8a6a2f9c9c | ||
|
|
774bce8e8b | ||
|
|
59655077c5 | ||
|
|
17eedcad94 | ||
|
|
11e61d5c71 | ||
|
|
fa737cebe7 | ||
|
|
547ee7926e | ||
|
|
b3439d4727 | ||
|
|
bb9254a3b2 | ||
|
|
81b6bf1852 | ||
|
|
132b044f4b | ||
|
|
e8cfc3f693 | ||
|
|
97e5281641 | ||
|
|
e8ce285395 | ||
|
|
b124c3491b | ||
|
|
74584b8665 | ||
|
|
03a99e3d5c | ||
|
|
3ac066c256 | ||
|
|
62c006d508 | ||
|
|
cd09e81520 | ||
|
|
0b170e6a09 | ||
|
|
694738f4eb | ||
|
|
fc4ebd0d0b | ||
|
|
16c52a5d7b | ||
|
|
6111f967f5 | ||
|
|
af36ba206f | ||
|
|
cfcb1dac83 | ||
|
|
8cce1b3ad8 | ||
|
|
b2d668872c | ||
|
|
5a5db93b0f | ||
|
|
817c230a0c | ||
|
|
d0222503ff | ||
|
|
594db1e62a | ||
|
|
9106107a50 | ||
|
|
638dbc34b3 | ||
|
|
bbf1e3c144 | ||
|
|
6e9d047c15 | ||
|
|
ef43beac63 | ||
|
|
9ec3cd400a | ||
|
|
35def51c97 | ||
|
|
428bd2d433 | ||
|
|
c0657e0d0a | ||
|
|
800a9a056a | ||
|
|
7eaa03709b | ||
|
|
da2b2da6a7 | ||
|
|
1c7724bf2a | ||
|
|
e8758eaf4f | ||
|
|
c158601d50 | ||
|
|
ce4f39ac7c | ||
|
|
fdd0b3b398 | ||
|
|
6e8861b5f1 | ||
|
|
7ce209b9d4 | ||
|
|
d29ae7e071 | ||
|
|
7550201e9a | ||
|
|
499597d6ef | ||
|
|
982fdaf4b2 | ||
|
|
d45efd3a9f | ||
|
|
3e0c428c45 | ||
|
|
a76dd50ce1 | ||
|
|
acdb0041b3 | ||
|
|
2e55404bcf | ||
|
|
6b64a26976 | ||
|
|
ba65872950 | ||
|
|
6a93212b54 | ||
|
|
83f103b30e | ||
|
|
3365e9f3cc | ||
|
|
03419aa037 | ||
|
|
93b4a60526 | ||
|
|
f282c6b657 | ||
|
|
f85bd1a7a7 | ||
|
|
ee0f444f11 | ||
|
|
7b57ff4436 | ||
|
|
be2a557918 | ||
|
|
b05cd6b7a7 | ||
|
|
cda6ea905d | ||
|
|
2bef526331 | ||
|
|
d6f5000c13 | ||
|
|
454fe29a80 | ||
|
|
1b41b33be3 | ||
|
|
fdf514f343 | ||
|
|
3ef3cc5949 | ||
|
|
7280d2017d | ||
|
|
53782d9221 | ||
|
|
2f8ccc14f7 | ||
|
|
c3375f0389 | ||
|
|
b8ff9357d5 | ||
|
|
5560e1af0a | ||
|
|
ef7aa46bc4 | ||
|
|
beb860ac75 | ||
|
|
0fa3e5f6f9 | ||
|
|
7291755439 | ||
|
|
901365fcff | ||
|
|
1fd7129bc6 | ||
|
|
65a1ee956f | ||
|
|
d2277e262f | ||
|
|
fcb9e07eca | ||
|
|
5f118ff885 | ||
|
|
fc186711fe | ||
|
|
3bc4fc5857 | ||
|
|
578b817151 | ||
|
|
41fea01066 | ||
|
|
a0bef7cc27 | ||
|
|
860491c525 | ||
|
|
1dc80bae0b | ||
|
|
f59a50ee30 | ||
|
|
a092a89d8f | ||
|
|
2951add2bf | ||
|
|
39b233182c | ||
|
|
a86e02492d | ||
|
|
fae473c81b | ||
|
|
b9f4cd85f0 | ||
|
|
743edac6c8 | ||
|
|
7e21f0491c | ||
|
|
2b6a6b90cc | ||
|
|
68c5b28156 | ||
|
|
9ba75048c0 | ||
|
|
50089fc61c | ||
|
|
0fd4347ced | ||
|
|
3b46fcb95d | ||
|
|
d38ca03946 | ||
|
|
2017d48c0d | ||
|
|
c0cae52662 | ||
|
|
9ce09bc9cb | ||
|
|
45cdf166dc | ||
|
|
f3efd3c2a0 | ||
|
|
f808e777db | ||
|
|
b5ebe5fdb3 | ||
|
|
f85554c265 | ||
|
|
3b1603410a | ||
|
|
f8a5b792ba | ||
|
|
156840c249 | ||
|
|
bcdae63875 | ||
|
|
c0e37b4340 | ||
|
|
c531b9a3e4 | ||
|
|
b076193f74 | ||
|
|
e504c245f7 | ||
|
|
83e34ac4b5 | ||
|
|
8de2e42201 | ||
|
|
e6094d95b5 | ||
|
|
73d249e704 | ||
|
|
328f27fe44 | ||
|
|
ec447c7f01 | ||
|
|
e9dc354df8 | ||
|
|
ee320c6d9c | ||
|
|
e206a4de4c | ||
|
|
a241069004 | ||
|
|
94354154c4 | ||
|
|
7449e18190 | ||
|
|
ef5a2d757a | ||
|
|
5dd1f472a4 | ||
|
|
17fb598dc2 | ||
|
|
2af2acf9b5 | ||
|
|
fbca0c68a7 | ||
|
|
cd4d78f525 | ||
|
|
1dff672335 | ||
|
|
42816c204d | ||
|
|
7981d79ef0 | ||
|
|
f461385521 | ||
|
|
1f56e51ca1 | ||
|
|
2ea73b513d | ||
|
|
4ea37d62c2 | ||
|
|
efd08bfa0a | ||
|
|
f74f280a14 | ||
|
|
9c28fb8d28 | ||
|
|
dd82443b92 | ||
|
|
ce8c4cf37f | ||
|
|
5f92043c3f | ||
|
|
6464f15ddb | ||
|
|
6c9c0a1dc9 | ||
|
|
cd06e06eee | ||
|
|
e4fa7b7965 | ||
|
|
4c77ad75b1 | ||
|
|
ecccbac37b | ||
|
|
39ec6a2ad5 | ||
|
|
cc87588a61 | ||
|
|
faf7c62f1d | ||
|
|
85b1f292c9 | ||
|
|
b64bd16459 | ||
|
|
8d9ac30572 | ||
|
|
d184a728cf | ||
|
|
45f0a1156d | ||
|
|
3eccd7ecbe | ||
|
|
16714245f9 | ||
|
|
5c6ba6c56f | ||
|
|
34c469ae04 | ||
|
|
0851d125c3 | ||
|
|
6d2d652cd3 | ||
|
|
514cbfc593 | ||
|
|
c74a79f288 | ||
|
|
d18ef6c9f6 | ||
|
|
585541e8e3 | ||
|
|
dd1eb413f2 | ||
|
|
378ab68199 | ||
|
|
a221bc5f99 | ||
|
|
f9e07e70bb | ||
|
|
74b871febb | ||
|
|
13e709c53f | ||
|
|
dd1061b6a7 | ||
|
|
5126cf9a15 | ||
|
|
46aa5e0859 | ||
|
|
223b9417b3 | ||
|
|
d2fe2ba08d | ||
|
|
7b46d11582 | ||
|
|
d48fdde370 | ||
|
|
522041ee7b | ||
|
|
202a1b9284 | ||
|
|
c2a06db69d | ||
|
|
880eec8f33 | ||
|
|
f23f7856cb | ||
|
|
e0894f567a | ||
|
|
831756bac4 | ||
|
|
12e154f0cf | ||
|
|
289c47b049 | ||
|
|
0d0260fd1e | ||
|
|
9289935cfd | ||
|
|
f65c5f5c54 | ||
|
|
e8f36330d9 | ||
|
|
8c84f7545c | ||
|
|
e45af7ad17 | ||
|
|
bede215cf1 | ||
|
|
4840ae8a06 | ||
|
|
7b46220d92 | ||
|
|
2390109dcb | ||
|
|
abc33ac8b2 | ||
|
|
24915117a2 | ||
|
|
1285437217 | ||
|
|
a04e4c2266 | ||
|
|
c5f7847659 | ||
|
|
251fc70e97 | ||
|
|
b1611d9a46 | ||
|
|
4619802a5f | ||
|
|
816cd16a4c | ||
|
|
9176f6c52c | ||
|
|
a7d6bb3b5d | ||
|
|
4f54168ea2 | ||
|
|
c21c310e46 | ||
|
|
c97578de6b | ||
|
|
8b141ebd45 |
No files matched your search
@@ -83,20 +83,21 @@ config FEATURE_BUFFERS_GO_IN_BSS
|
||||
endchoice
|
||||
|
||||
config SHOW_USAGE
|
||||
bool "Show terse applet usage messages"
|
||||
bool "Show applet usage messages"
|
||||
default y
|
||||
help
|
||||
All BusyBox applets will show help messages when invoked with
|
||||
wrong arguments. You can turn off printing these terse usage
|
||||
messages if you say no here.
|
||||
This will save you up to 7k.
|
||||
Enabling this option, BusyBox applets will show terse help messages
|
||||
when invoked with wrong arguments.
|
||||
If you do not want to show any (helpful) usage message when
|
||||
issuing wrong command syntax, you can say 'N' here,
|
||||
saving approximately 7k.
|
||||
|
||||
config FEATURE_VERBOSE_USAGE
|
||||
bool "Show verbose applet usage messages"
|
||||
default y
|
||||
depends on SHOW_USAGE
|
||||
help
|
||||
All BusyBox applets will show more verbose help messages when
|
||||
All BusyBox applets will show verbose help messages when
|
||||
busybox is invoked with --help. This will add a lot of text to the
|
||||
busybox binary. In the default configuration, this will add about
|
||||
13k, but it can add much more depending on your configuration.
|
||||
@@ -106,8 +107,8 @@ config FEATURE_COMPRESS_USAGE
|
||||
default y
|
||||
depends on SHOW_USAGE
|
||||
help
|
||||
Store usage messages in compressed form, uncompress them on-the-fly
|
||||
when <applet> --help is called.
|
||||
Store usage messages in .bz compressed form, uncompress them
|
||||
on-the-fly when <applet> --help is called.
|
||||
|
||||
If you have a really tiny busybox with few applets enabled (and
|
||||
bunzip2 isn't one of them), the overhead of the decompressor might
|
||||
@@ -599,12 +600,39 @@ config CROSS_COMPILER_PREFIX
|
||||
|
||||
Native builds leave this empty.
|
||||
|
||||
config SYSROOT
|
||||
string "Path to sysroot"
|
||||
default ""
|
||||
help
|
||||
If you want to build BusyBox with a cross compiler, then you
|
||||
might also need to specify where /usr/include and /usr/lib
|
||||
will be found.
|
||||
|
||||
For example, BusyBox can be built against an installed
|
||||
Android NDK, platform version 9, for ARM ABI with
|
||||
|
||||
CONFIG_SYSROOT=/opt/android-ndk/platforms/android-9/arch-arm
|
||||
|
||||
Native builds leave this empty.
|
||||
|
||||
config EXTRA_CFLAGS
|
||||
string "Additional CFLAGS"
|
||||
default ""
|
||||
help
|
||||
Additional CFLAGS to pass to the compiler verbatim.
|
||||
|
||||
config EXTRA_LDFLAGS
|
||||
string "Additional LDFLAGS"
|
||||
default ""
|
||||
help
|
||||
Additional LDFLAGS to pass to the linker verbatim.
|
||||
|
||||
config EXTRA_LDLIBS
|
||||
string "Additional LDLIBS"
|
||||
default ""
|
||||
help
|
||||
Additional LDLIBS to pass to the linker with -l.
|
||||
|
||||
endmenu
|
||||
|
||||
menu 'Debugging Options'
|
||||
|
||||
@@ -47,8 +47,11 @@ the only commands busybox can find are the built-in ones.
|
||||
|
||||
Note that the standalone shell requires CONFIG_BUSYBOX_EXEC_PATH
|
||||
to be set appropriately, depending on whether or not /proc/self/exe is
|
||||
available or not. If you do not have /proc, then point that config option
|
||||
available. If you do not have /proc, then point that config option
|
||||
to the location of your busybox binary, usually /bin/busybox.
|
||||
Another solution is to patch the kernel (see
|
||||
examples/linux-*_proc_self_exe.patch) to make exec("/proc/self/exe")
|
||||
always work.
|
||||
|
||||
Configuring Busybox:
|
||||
====================
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
VERSION = 1
|
||||
PATCHLEVEL = 19
|
||||
SUBLEVEL = 4
|
||||
PATCHLEVEL = 20
|
||||
SUBLEVEL = 2
|
||||
EXTRAVERSION =
|
||||
NAME = Unnamed
|
||||
|
||||
|
||||
+34
-1
@@ -97,10 +97,33 @@ CFLAGS += $(strip $(subst ",,$(CONFIG_EXTRA_CFLAGS)))
|
||||
#"))
|
||||
endif
|
||||
|
||||
# Note: both "" (string consisting of two quote chars) and empty string
|
||||
# are possible, and should be skipped below.
|
||||
ifneq ($(subst "",,$(CONFIG_SYSROOT)),)
|
||||
CFLAGS += --sysroot=$(CONFIG_SYSROOT)
|
||||
export SYSROOT=$(CONFIG_SYSROOT)
|
||||
endif
|
||||
|
||||
# Android has no separate crypt library
|
||||
# gcc-4.2.1 fails if we try to feed C source on stdin:
|
||||
# echo 'int main(void){return 0;}' | $(CC) $(CFLAGS) -lcrypt -o /dev/null -xc -
|
||||
# fall back to using a temp file:
|
||||
CRYPT_AVAILABLE := $(shell echo 'int main(void){return 0;}' >crypttest.c; $(CC) $(CFLAGS) -lcrypt -o /dev/null crypttest.c >/dev/null 2>&1 && echo "y"; rm crypttest.c)
|
||||
ifeq ($(CRYPT_AVAILABLE),y)
|
||||
LDLIBS += m crypt
|
||||
else
|
||||
LDLIBS += m
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PAM),y)
|
||||
LDLIBS += pam pam_misc
|
||||
# libpam uses libpthread, so for static builds busybox must be linked to
|
||||
# libpthread. On some platforms that requires an explicit -lpthread, so
|
||||
# it should be in LDLIBS. For non-static builds, scripts/trylink will
|
||||
# take care of removing -lpthread if possible. (Not bothering to check
|
||||
# CONFIG_STATIC because even in a non-static build it could be that the
|
||||
# only libpam available is libpam.a, so -lpthread could still be
|
||||
# needed.)
|
||||
LDLIBS += pam pam_misc pthread
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SELINUX),y)
|
||||
@@ -125,6 +148,16 @@ ifneq (,$(findstring $(W_ELF2FLT),$(LDFLAGS) $(CFLAGS_busybox)))
|
||||
SKIP_STRIP = y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_EXTRA_LDFLAGS),)
|
||||
EXTRA_LDFLAGS += $(strip $(subst ",,$(CONFIG_EXTRA_LDFLAGS)))
|
||||
#"))
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_EXTRA_LDLIBS),)
|
||||
LDLIBS += $(strip $(subst ",,$(CONFIG_EXTRA_LDLIBS)))
|
||||
#"))
|
||||
endif
|
||||
|
||||
# Busybox is a stack-fatty so make sure we increase default size
|
||||
# TODO: use "make stksizes" to find & fix big stack users
|
||||
# (we stole scripts/checkstack.pl from the kernel... thanks guys!)
|
||||
|
||||
@@ -2,6 +2,8 @@ Busybox TODO
|
||||
|
||||
Harvest patches from
|
||||
http://git.openembedded.org/cgit.cgi/openembedded/tree/recipes/busybox/
|
||||
https://dev.openwrt.org/browser/trunk/package/busybox/patches/
|
||||
|
||||
|
||||
Stuff that needs to be done. This is organized by who plans to get around to
|
||||
doing it eventually, but that doesn't mean they "own" the item. If you want to
|
||||
|
||||
@@ -80,15 +80,8 @@ int main(int argc, char **argv)
|
||||
|
||||
printf("#define NUM_APPLETS %u\n", NUM_APPLETS);
|
||||
if (NUM_APPLETS == 1) {
|
||||
char *dash_to_underscore, *p;
|
||||
printf("#define SINGLE_APPLET_STR \"%s\"\n", applets[0].name);
|
||||
/* Example: "ether-wake" -> "ether_wake" */
|
||||
p = dash_to_underscore = strdup(applets[0].name);
|
||||
p--;
|
||||
while (*++p)
|
||||
if (*p == '-')
|
||||
*p = '_';
|
||||
printf("#define SINGLE_APPLET_MAIN %s_main\n", dash_to_underscore);
|
||||
printf("#define SINGLE_APPLET_MAIN %s_main\n", applets[0].main);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
This directory contains examples of applets implemented as shell scripts.
|
||||
|
||||
So far these scripts are not hooked to the build system and are not
|
||||
installed by "make install". If you want to use them,
|
||||
you need to install them by hand.
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
# TODO: use getopt to avoid parsing options as filenames,
|
||||
# and to support -- and --help
|
||||
[ $# -ne 0 ] && DASH_I=-i
|
||||
sed $DASH_I -e 's/\r$//' "$@"
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
cat /etc/nologin.txt 2>/dev/null || echo "This account is not available"
|
||||
sleep 5
|
||||
exit 1
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
# TODO: use getopt to avoid parsing options as filenames,
|
||||
# and to support -- and --help
|
||||
for i in "$@"
|
||||
do
|
||||
sed -e '1!G;h;$!d' "$i"
|
||||
done
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
# TODO: use getopt to avoid parsing options as filenames,
|
||||
# and to support -- and --help
|
||||
[ $# -ne 0 ] && DASH_I=-i
|
||||
sed $DASH_I -e 's/$/\r/' "$@"
|
||||
+16
-7
@@ -32,10 +32,10 @@ config FEATURE_SEAMLESS_GZ
|
||||
Make tar, rpm, modprobe etc understand .gz data.
|
||||
|
||||
config FEATURE_SEAMLESS_Z
|
||||
bool "Make tar and gunzip understand .Z data"
|
||||
bool "tar, rpm, modprobe etc understand .Z data"
|
||||
default n
|
||||
help
|
||||
Make tar and gunzip understand .Z data.
|
||||
Make tar, rpm, modprobe etc understand .Z data.
|
||||
|
||||
config AR
|
||||
bool "ar"
|
||||
@@ -187,6 +187,18 @@ config FEATURE_GZIP_LONG_OPTIONS
|
||||
help
|
||||
Enable use of long options, increases size by about 106 Bytes
|
||||
|
||||
config GZIP_FAST
|
||||
int "Trade memory for gzip speed (0:small,slow - 2:fast,big)"
|
||||
default 0
|
||||
range 0 2
|
||||
depends on GZIP
|
||||
help
|
||||
Enable big memory options for gzip.
|
||||
0: small buffers, small hash-tables
|
||||
1: larger buffers, larger hash-tables
|
||||
2: larger buffers, largest hash-tables
|
||||
Larger models may give slightly better compression
|
||||
|
||||
config LZOP
|
||||
bool "lzop"
|
||||
default y
|
||||
@@ -330,15 +342,12 @@ config UNLZMA
|
||||
is generally considerably better than that achieved by the bzip2
|
||||
compressors.
|
||||
|
||||
The BusyBox unlzma applet is limited to de-compression only.
|
||||
The BusyBox unlzma applet is limited to decompression only.
|
||||
On an x86 system, this applet adds about 4K.
|
||||
|
||||
Unless you have a specific application which requires unlzma, you
|
||||
should probably say N here.
|
||||
|
||||
config FEATURE_LZMA_FAST
|
||||
bool "Optimize unlzma for speed"
|
||||
default y
|
||||
default n
|
||||
depends on UNLZMA
|
||||
help
|
||||
This option reduces decompression time by about 25% at the cost of
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
//usage: "\n -v Verbose"
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
#include "ar.h"
|
||||
|
||||
#if ENABLE_FEATURE_AR_CREATE
|
||||
|
||||
+24
-57
@@ -5,7 +5,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
enum {
|
||||
OPT_STDOUT = 1 << 0,
|
||||
@@ -33,7 +33,7 @@ char* FAST_FUNC append_ext(char *filename, const char *expected_ext)
|
||||
}
|
||||
|
||||
int FAST_FUNC bbunpack(char **argv,
|
||||
IF_DESKTOP(long long) int FAST_FUNC (*unpacker)(unpack_info_t *info),
|
||||
IF_DESKTOP(long long) int FAST_FUNC (*unpacker)(transformer_aux_data_t *aux),
|
||||
char* FAST_FUNC (*make_new_name)(char *filename, const char *expected_ext),
|
||||
const char *expected_ext
|
||||
)
|
||||
@@ -42,7 +42,7 @@ int FAST_FUNC bbunpack(char **argv,
|
||||
IF_DESKTOP(long long) int status;
|
||||
char *filename, *new_name;
|
||||
smallint exitcode = 0;
|
||||
unpack_info_t info;
|
||||
transformer_aux_data_t aux;
|
||||
|
||||
do {
|
||||
/* NB: new_name is *maybe* malloc'ed! */
|
||||
@@ -98,21 +98,23 @@ int FAST_FUNC bbunpack(char **argv,
|
||||
"use -f to force it");
|
||||
}
|
||||
|
||||
/* memset(&info, 0, sizeof(info)); */
|
||||
info.mtime = 0; /* so far it has one member only */
|
||||
status = unpacker(&info);
|
||||
init_transformer_aux_data(&aux);
|
||||
aux.check_signature = 1;
|
||||
status = unpacker(&aux);
|
||||
if (status < 0)
|
||||
exitcode = 1;
|
||||
xclose(STDOUT_FILENO); /* with error check! */
|
||||
|
||||
if (!(option_mask32 & OPT_STDOUT))
|
||||
xclose(STDOUT_FILENO); /* with error check! */
|
||||
|
||||
if (filename) {
|
||||
char *del = new_name;
|
||||
if (status >= 0) {
|
||||
/* TODO: restore other things? */
|
||||
if (info.mtime) {
|
||||
if (aux.mtime != 0) {
|
||||
struct timeval times[2];
|
||||
|
||||
times[1].tv_sec = times[0].tv_sec = info.mtime;
|
||||
times[1].tv_sec = times[0].tv_sec = aux.mtime;
|
||||
times[1].tv_usec = times[0].tv_usec = 0;
|
||||
/* Note: we closed it first.
|
||||
* On some systems calling utimes
|
||||
@@ -143,6 +145,9 @@ int FAST_FUNC bbunpack(char **argv,
|
||||
}
|
||||
} while (*argv && *++argv);
|
||||
|
||||
if (option_mask32 & OPT_STDOUT)
|
||||
xclose(STDOUT_FILENO); /* with error check! */
|
||||
|
||||
return exitcode;
|
||||
}
|
||||
|
||||
@@ -177,16 +182,9 @@ char* FAST_FUNC make_new_name_generic(char *filename, const char *expected_ext)
|
||||
|
||||
#if ENABLE_UNCOMPRESS
|
||||
static
|
||||
IF_DESKTOP(long long) int FAST_FUNC unpack_uncompress(unpack_info_t *info UNUSED_PARAM)
|
||||
IF_DESKTOP(long long) int FAST_FUNC unpack_uncompress(transformer_aux_data_t *aux)
|
||||
{
|
||||
IF_DESKTOP(long long) int status = -1;
|
||||
|
||||
if ((xread_char(STDIN_FILENO) != 0x1f) || (xread_char(STDIN_FILENO) != 0x9d)) {
|
||||
bb_error_msg("invalid magic");
|
||||
} else {
|
||||
status = unpack_Z_stream(STDIN_FILENO, STDOUT_FILENO);
|
||||
}
|
||||
return status;
|
||||
return unpack_Z_stream(aux, STDIN_FILENO, STDOUT_FILENO);
|
||||
}
|
||||
int uncompress_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int uncompress_main(int argc UNUSED_PARAM, char **argv)
|
||||
@@ -274,31 +272,9 @@ char* FAST_FUNC make_new_name_gunzip(char *filename, const char *expected_ext UN
|
||||
return filename;
|
||||
}
|
||||
static
|
||||
IF_DESKTOP(long long) int FAST_FUNC unpack_gunzip(unpack_info_t *info)
|
||||
IF_DESKTOP(long long) int FAST_FUNC unpack_gunzip(transformer_aux_data_t *aux)
|
||||
{
|
||||
IF_DESKTOP(long long) int status = -1;
|
||||
|
||||
/* do the decompression, and cleanup */
|
||||
if (xread_char(STDIN_FILENO) == 0x1f) {
|
||||
unsigned char magic2;
|
||||
|
||||
magic2 = xread_char(STDIN_FILENO);
|
||||
if (ENABLE_FEATURE_SEAMLESS_Z && magic2 == 0x9d) {
|
||||
status = unpack_Z_stream(STDIN_FILENO, STDOUT_FILENO);
|
||||
} else if (magic2 == 0x8b) {
|
||||
status = unpack_gz_stream_with_info(STDIN_FILENO, STDOUT_FILENO, info);
|
||||
} else {
|
||||
goto bad_magic;
|
||||
}
|
||||
if (status < 0) {
|
||||
bb_error_msg("error inflating");
|
||||
}
|
||||
} else {
|
||||
bad_magic:
|
||||
bb_error_msg("invalid magic");
|
||||
/* status is still == -1 */
|
||||
}
|
||||
return status;
|
||||
return unpack_gz_stream(aux, STDIN_FILENO, STDOUT_FILENO);
|
||||
}
|
||||
/*
|
||||
* Linux kernel build uses gzip -d -n. We accept and ignore it.
|
||||
@@ -347,9 +323,9 @@ int gunzip_main(int argc UNUSED_PARAM, char **argv)
|
||||
//applet:IF_BUNZIP2(APPLET_ODDNAME(bzcat, bunzip2, BB_DIR_USR_BIN, BB_SUID_DROP, bzcat))
|
||||
#if ENABLE_BUNZIP2
|
||||
static
|
||||
IF_DESKTOP(long long) int FAST_FUNC unpack_bunzip2(unpack_info_t *info UNUSED_PARAM)
|
||||
IF_DESKTOP(long long) int FAST_FUNC unpack_bunzip2(transformer_aux_data_t *aux)
|
||||
{
|
||||
return unpack_bz2_stream_prime(STDIN_FILENO, STDOUT_FILENO);
|
||||
return unpack_bz2_stream(aux, STDIN_FILENO, STDOUT_FILENO);
|
||||
}
|
||||
int bunzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int bunzip2_main(int argc UNUSED_PARAM, char **argv)
|
||||
@@ -415,9 +391,9 @@ int bunzip2_main(int argc UNUSED_PARAM, char **argv)
|
||||
|
||||
#if ENABLE_UNLZMA
|
||||
static
|
||||
IF_DESKTOP(long long) int FAST_FUNC unpack_unlzma(unpack_info_t *info UNUSED_PARAM)
|
||||
IF_DESKTOP(long long) int FAST_FUNC unpack_unlzma(transformer_aux_data_t *aux)
|
||||
{
|
||||
return unpack_lzma_stream(STDIN_FILENO, STDOUT_FILENO);
|
||||
return unpack_lzma_stream(aux, STDIN_FILENO, STDOUT_FILENO);
|
||||
}
|
||||
int unlzma_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int unlzma_main(int argc UNUSED_PARAM, char **argv)
|
||||
@@ -440,18 +416,9 @@ int unlzma_main(int argc UNUSED_PARAM, char **argv)
|
||||
|
||||
#if ENABLE_UNXZ
|
||||
static
|
||||
IF_DESKTOP(long long) int FAST_FUNC unpack_unxz(unpack_info_t *info UNUSED_PARAM)
|
||||
IF_DESKTOP(long long) int FAST_FUNC unpack_unxz(transformer_aux_data_t *aux)
|
||||
{
|
||||
struct {
|
||||
uint32_t v1;
|
||||
uint16_t v2;
|
||||
} magic;
|
||||
xread(STDIN_FILENO, &magic, 6);
|
||||
if (magic.v1 != XZ_MAGIC1a || magic.v2 != XZ_MAGIC2a) {
|
||||
bb_error_msg("invalid magic");
|
||||
return -1;
|
||||
}
|
||||
return unpack_xz_stream(STDIN_FILENO, STDOUT_FILENO);
|
||||
return unpack_xz_stream(aux, STDIN_FILENO, STDOUT_FILENO);
|
||||
}
|
||||
int unxz_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int unxz_main(int argc UNUSED_PARAM, char **argv)
|
||||
|
||||
+4
-4
@@ -17,9 +17,9 @@
|
||||
//usage: "\n -f Force"
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
#define CONFIG_BZIP2_FEATURE_SPEED 1
|
||||
#define CONFIG_BZIP2_FAST 1
|
||||
|
||||
/* Speed test:
|
||||
* Compiled with gcc 4.2.1, run on Athlon 64 1800 MHz (512K L2 cache).
|
||||
@@ -27,7 +27,7 @@
|
||||
* (time to compress gcc-4.2.1.tar is 126.4% compared to bbox).
|
||||
* At SPEED 5 difference is 32.7%.
|
||||
*
|
||||
* Test run of all CONFIG_BZIP2_FEATURE_SPEED values on a 11Mb text file:
|
||||
* Test run of all CONFIG_BZIP2_FAST values on a 11Mb text file:
|
||||
* Size Time (3 runs)
|
||||
* 0: 10828 4.145 4.146 4.148
|
||||
* 1: 11097 3.845 3.860 3.861
|
||||
@@ -111,7 +111,7 @@ IF_DESKTOP(long long) int bz_write(bz_stream *strm, void* rbuf, ssize_t rlen, vo
|
||||
}
|
||||
|
||||
static
|
||||
IF_DESKTOP(long long) int FAST_FUNC compressStream(unpack_info_t *info UNUSED_PARAM)
|
||||
IF_DESKTOP(long long) int FAST_FUNC compressStream(transformer_aux_data_t *aux UNUSED_PARAM)
|
||||
{
|
||||
IF_DESKTOP(long long) int total;
|
||||
ssize_t count;
|
||||
|
||||
+2
-1
@@ -12,7 +12,7 @@
|
||||
*
|
||||
*/
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
//usage:#define cpio_trivial_usage
|
||||
//usage: "[-dmvu] [-F FILE]" IF_FEATURE_CPIO_O(" [-H newc]")
|
||||
@@ -384,6 +384,7 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
|
||||
goto dump;
|
||||
}
|
||||
/* parent */
|
||||
USE_FOR_NOMMU(argv[-optind][0] &= 0x7f); /* undo fork_or_rexec() damage */
|
||||
xchdir(*argv++);
|
||||
close(pp.wr);
|
||||
xmove_fd(pp.rd, STDIN_FILENO);
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
#include <fnmatch.h>
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
/* note: if you vary hash_prime sizes be aware,
|
||||
* 1) tweaking these will have a big effect on how much memory this program uses.
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
//usage: "$ dpkg-deb -X ./busybox_0.48-1_i386.deb /tmp\n"
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
#define DPKG_DEB_OPT_CONTENTS 1
|
||||
#define DPKG_DEB_OPT_CONTROL 2
|
||||
|
||||
+11
-3
@@ -55,7 +55,7 @@ aa: 85.1% -- replaced with aa.gz
|
||||
//usage: "-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n"
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
|
||||
/* ===========================================================================
|
||||
@@ -81,7 +81,15 @@ aa: 85.1% -- replaced with aa.gz
|
||||
|
||||
/* ===========================================================================
|
||||
*/
|
||||
#define SMALL_MEM
|
||||
#if CONFIG_GZIP_FAST == 0
|
||||
# define SMALL_MEM
|
||||
#elif CONFIG_GZIP_FAST == 1
|
||||
# define MEDIUM_MEM
|
||||
#elif CONFIG_GZIP_FAST == 2
|
||||
# define BIG_MEM
|
||||
#else
|
||||
# error "Invalid CONFIG_GZIP_FAST value"
|
||||
#endif
|
||||
|
||||
#ifndef INBUFSIZ
|
||||
# ifdef SMALL_MEM
|
||||
@@ -2007,7 +2015,7 @@ static void zip(ulg time_stamp)
|
||||
|
||||
/* ======================================================================== */
|
||||
static
|
||||
IF_DESKTOP(long long) int FAST_FUNC pack_gzip(unpack_info_t *info UNUSED_PARAM)
|
||||
IF_DESKTOP(long long) int FAST_FUNC pack_gzip(transformer_aux_data_t *aux UNUSED_PARAM)
|
||||
{
|
||||
struct stat s;
|
||||
|
||||
|
||||
@@ -28,10 +28,13 @@ COMMON_FILES:= \
|
||||
init_handle.o
|
||||
|
||||
DPKG_FILES:= \
|
||||
get_header_ar.o \
|
||||
unpack_ar_archive.o \
|
||||
filter_accept_list_reassign.o \
|
||||
get_header_ar.o \
|
||||
get_header_tar.o \
|
||||
filter_accept_list_reassign.o
|
||||
get_header_tar_gz.o \
|
||||
get_header_tar_bz2.o \
|
||||
get_header_tar_lzma.o \
|
||||
|
||||
INSERT
|
||||
|
||||
@@ -42,20 +45,22 @@ lib-$(CONFIG_UNXZ) += decompress_unxz.o
|
||||
lib-$(CONFIG_CPIO) += get_header_cpio.o
|
||||
lib-$(CONFIG_DPKG) += $(DPKG_FILES)
|
||||
lib-$(CONFIG_DPKG_DEB) += $(DPKG_FILES)
|
||||
lib-$(CONFIG_GUNZIP) += decompress_unzip.o
|
||||
lib-$(CONFIG_RPM2CPIO) += decompress_unzip.o get_header_cpio.o
|
||||
lib-$(CONFIG_RPM) += open_transformer.o decompress_unzip.o get_header_cpio.o
|
||||
lib-$(CONFIG_GUNZIP) += open_transformer.o decompress_gunzip.o
|
||||
lib-$(CONFIG_RPM2CPIO) += decompress_gunzip.o get_header_cpio.o
|
||||
lib-$(CONFIG_RPM) += open_transformer.o decompress_gunzip.o get_header_cpio.o
|
||||
lib-$(CONFIG_TAR) += get_header_tar.o
|
||||
lib-$(CONFIG_UNCOMPRESS) += decompress_uncompress.o
|
||||
lib-$(CONFIG_UNZIP) += decompress_unzip.o
|
||||
lib-$(CONFIG_UNZIP) += decompress_gunzip.o
|
||||
lib-$(CONFIG_LZOP) += lzo1x_1.o lzo1x_1o.o lzo1x_d.o
|
||||
lib-$(CONFIG_LZOP_COMPR_HIGH) += lzo1x_9x.o
|
||||
lib-$(CONFIG_MODINFO) += open_transformer.o
|
||||
lib-$(CONFIG_INSMOD) += open_transformer.o
|
||||
lib-$(CONFIG_FEATURE_SEAMLESS_Z) += open_transformer.o decompress_uncompress.o
|
||||
lib-$(CONFIG_FEATURE_SEAMLESS_GZ) += open_transformer.o decompress_unzip.o get_header_tar_gz.o
|
||||
lib-$(CONFIG_FEATURE_SEAMLESS_BZ2) += open_transformer.o decompress_bunzip2.o get_header_tar_bz2.o
|
||||
lib-$(CONFIG_FEATURE_SEAMLESS_LZMA) += open_transformer.o decompress_unlzma.o get_header_tar_lzma.o
|
||||
lib-$(CONFIG_FEATURE_SEAMLESS_GZ) += open_transformer.o decompress_gunzip.o
|
||||
lib-$(CONFIG_FEATURE_SEAMLESS_BZ2) += open_transformer.o decompress_bunzip2.o
|
||||
lib-$(CONFIG_FEATURE_SEAMLESS_LZMA) += open_transformer.o decompress_unlzma.o
|
||||
lib-$(CONFIG_FEATURE_SEAMLESS_XZ) += open_transformer.o decompress_unxz.o
|
||||
lib-$(CONFIG_FEATURE_COMPRESS_USAGE) += decompress_bunzip2.o
|
||||
lib-$(CONFIG_FEATURE_COMPRESS_USAGE) += open_transformer.o decompress_bunzip2.o
|
||||
lib-$(CONFIG_FEATURE_COMPRESS_BBCONFIG) += decompress_bunzip2.o
|
||||
lib-$(CONFIG_FEATURE_TAR_TO_COMMAND) += data_extract_to_command.o
|
||||
|
||||
|
||||
@@ -385,7 +385,7 @@ int mainGtU(
|
||||
* but speeds up compression 10% overall
|
||||
*/
|
||||
|
||||
#if CONFIG_BZIP2_FEATURE_SPEED >= 1
|
||||
#if CONFIG_BZIP2_FAST >= 1
|
||||
|
||||
#define TIMES_8(code) \
|
||||
code; code; code; code; \
|
||||
@@ -496,7 +496,7 @@ void mainSimpleSort(uint32_t* ptr,
|
||||
i++;
|
||||
|
||||
/* 1.5% overall speedup, +290 bytes */
|
||||
#if CONFIG_BZIP2_FEATURE_SPEED >= 3
|
||||
#if CONFIG_BZIP2_FAST >= 3
|
||||
/*-- copy 2 --*/
|
||||
if (i > hi) break;
|
||||
v = ptr[i];
|
||||
@@ -750,7 +750,7 @@ void mainSort(EState* state,
|
||||
j = block[0] << 8;
|
||||
i = nblock - 1;
|
||||
/* 3%, +300 bytes */
|
||||
#if CONFIG_BZIP2_FEATURE_SPEED >= 2
|
||||
#if CONFIG_BZIP2_FAST >= 2
|
||||
for (; i >= 3; i -= 4) {
|
||||
quadrant[i] = 0;
|
||||
j = (j >> 8) | (((uint16_t)block[i]) << 8);
|
||||
@@ -787,7 +787,7 @@ void mainSort(EState* state,
|
||||
|
||||
s = block[0] << 8;
|
||||
i = nblock - 1;
|
||||
#if CONFIG_BZIP2_FEATURE_SPEED >= 2
|
||||
#if CONFIG_BZIP2_FAST >= 2
|
||||
for (; i >= 3; i -= 4) {
|
||||
s = (s >> 8) | (block[i] << 8);
|
||||
j = ftab[s] - 1;
|
||||
|
||||
@@ -183,7 +183,7 @@ typedef struct EState {
|
||||
/* stack-saving measures: these can be local, but they are too big */
|
||||
int32_t sendMTFValues__code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
|
||||
int32_t sendMTFValues__rfreq[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
|
||||
#if CONFIG_BZIP2_FEATURE_SPEED >= 5
|
||||
#if CONFIG_BZIP2_FAST >= 5
|
||||
/* second dimension: only 3 needed; 4 makes index calculations faster */
|
||||
uint32_t sendMTFValues__len_pack[BZ_MAX_ALPHA_SIZE][4];
|
||||
#endif
|
||||
|
||||
@@ -61,7 +61,7 @@ void bsFinishWrite(EState* s)
|
||||
/*---------------------------------------------------*/
|
||||
static
|
||||
/* Helps only on level 5, on other levels hurts. ? */
|
||||
#if CONFIG_BZIP2_FEATURE_SPEED >= 5
|
||||
#if CONFIG_BZIP2_FAST >= 5
|
||||
ALWAYS_INLINE
|
||||
#endif
|
||||
void bsW(EState* s, int32_t n, uint32_t v)
|
||||
@@ -331,7 +331,7 @@ void sendMTFValues(EState* s)
|
||||
for (v = 0; v < alphaSize; v++)
|
||||
s->rfreq[t][v] = 0;
|
||||
|
||||
#if CONFIG_BZIP2_FEATURE_SPEED >= 5
|
||||
#if CONFIG_BZIP2_FAST >= 5
|
||||
/*
|
||||
* Set up an auxiliary length table which is used to fast-track
|
||||
* the common case (nGroups == 6).
|
||||
@@ -361,7 +361,7 @@ void sendMTFValues(EState* s)
|
||||
*/
|
||||
for (t = 0; t < nGroups; t++)
|
||||
cost[t] = 0;
|
||||
#if CONFIG_BZIP2_FEATURE_SPEED >= 5
|
||||
#if CONFIG_BZIP2_FAST >= 5
|
||||
if (nGroups == 6 && 50 == ge-gs+1) {
|
||||
/*--- fast track the common case ---*/
|
||||
register uint32_t cost01, cost23, cost45;
|
||||
@@ -420,7 +420,7 @@ void sendMTFValues(EState* s)
|
||||
* Increment the symbol frequencies for the selected table.
|
||||
*/
|
||||
/* 1% faster compress. +800 bytes */
|
||||
#if CONFIG_BZIP2_FEATURE_SPEED >= 4
|
||||
#if CONFIG_BZIP2_FAST >= 4
|
||||
if (nGroups == 6 && 50 == ge-gs+1) {
|
||||
/*--- fast track the common case ---*/
|
||||
#define BZ_ITUR(nn) s->rfreq[bt][mtfv[gs + (nn)]]++
|
||||
|
||||
@@ -48,7 +48,7 @@ in the file LICENSE.
|
||||
|
||||
|
||||
/* 90 bytes, 0.3% of overall compress speed */
|
||||
#if CONFIG_BZIP2_FEATURE_SPEED >= 1
|
||||
#if CONFIG_BZIP2_FAST >= 1
|
||||
|
||||
/* macro works better than inline (gcc 4.2.1) */
|
||||
#define DOWNHEAP1(heap, weight, Heap) \
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
void FAST_FUNC data_align(archive_handle_t *archive_handle, unsigned boundary)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
|
||||
{
|
||||
@@ -13,13 +13,13 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
|
||||
int res;
|
||||
|
||||
#if ENABLE_FEATURE_TAR_SELINUX
|
||||
char *sctx = archive_handle->tar__next_file_sctx;
|
||||
char *sctx = archive_handle->tar__sctx[PAX_NEXT_FILE];
|
||||
if (!sctx)
|
||||
sctx = archive_handle->tar__global_sctx;
|
||||
sctx = archive_handle->tar__sctx[PAX_GLOBAL];
|
||||
if (sctx) { /* setfscreatecon is 4 syscalls, avoid if possible */
|
||||
setfscreatecon(sctx);
|
||||
free(archive_handle->tar__next_file_sctx);
|
||||
archive_handle->tar__next_file_sctx = NULL;
|
||||
free(archive_handle->tar__sctx[PAX_NEXT_FILE]);
|
||||
archive_handle->tar__sctx[PAX_NEXT_FILE] = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
enum {
|
||||
//TAR_FILETYPE,
|
||||
@@ -64,13 +64,13 @@ void FAST_FUNC data_extract_to_command(archive_handle_t *archive_handle)
|
||||
file_header_t *file_header = archive_handle->file_header;
|
||||
|
||||
#if 0 /* do we need this? ENABLE_FEATURE_TAR_SELINUX */
|
||||
char *sctx = archive_handle->tar__next_file_sctx;
|
||||
char *sctx = archive_handle->tar__sctx[PAX_NEXT_FILE];
|
||||
if (!sctx)
|
||||
sctx = archive_handle->tar__global_sctx;
|
||||
sctx = archive_handle->tar__sctx[PAX_GLOBAL];
|
||||
if (sctx) { /* setfscreatecon is 4 syscalls, avoid if possible */
|
||||
setfscreatecon(sctx);
|
||||
free(archive_handle->tar__next_file_sctx);
|
||||
archive_handle->tar__next_file_sctx = NULL;
|
||||
free(archive_handle->tar__sctx[PAX_NEXT_FILE]);
|
||||
archive_handle->tar__sctx[PAX_NEXT_FILE] = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
void FAST_FUNC data_extract_to_stdout(archive_handle_t *archive_handle)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
void FAST_FUNC data_skip(archive_handle_t *archive_handle)
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
/* Constants for Huffman coding */
|
||||
#define MAX_GROUPS 6
|
||||
@@ -721,7 +721,7 @@ void FAST_FUNC dealloc_bunzip(bunzip_data *bd)
|
||||
|
||||
/* Decompress src_fd to dst_fd. Stops at end of bzip data, not end of file. */
|
||||
IF_DESKTOP(long long) int FAST_FUNC
|
||||
unpack_bz2_stream(int src_fd, int dst_fd)
|
||||
unpack_bz2_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd)
|
||||
{
|
||||
IF_DESKTOP(long long total_written = 0;)
|
||||
bunzip_data *bd;
|
||||
@@ -729,6 +729,9 @@ unpack_bz2_stream(int src_fd, int dst_fd)
|
||||
int i;
|
||||
unsigned len;
|
||||
|
||||
if (check_signature16(aux, src_fd, BZIP2_MAGIC))
|
||||
return -1;
|
||||
|
||||
outbuf = xmalloc(IOBUF_SIZE);
|
||||
len = 0;
|
||||
while (1) { /* "Process one BZ... stream" loop */
|
||||
@@ -752,7 +755,14 @@ unpack_bz2_stream(int src_fd, int dst_fd)
|
||||
}
|
||||
}
|
||||
|
||||
if (i != RETVAL_LAST_BLOCK) {
|
||||
if (i != RETVAL_LAST_BLOCK
|
||||
/* Observed case when i == RETVAL_OK:
|
||||
* "bzcat z.bz2", where "z.bz2" is a bzipped zero-length file
|
||||
* (to be exact, z.bz2 is exactly these 14 bytes:
|
||||
* 42 5a 68 39 17 72 45 38 50 90 00 00 00 00).
|
||||
*/
|
||||
&& i != RETVAL_OK
|
||||
) {
|
||||
bb_error_msg("bunzip error %d", i);
|
||||
break;
|
||||
}
|
||||
@@ -787,17 +797,6 @@ unpack_bz2_stream(int src_fd, int dst_fd)
|
||||
return i ? i : IF_DESKTOP(total_written) + 0;
|
||||
}
|
||||
|
||||
IF_DESKTOP(long long) int FAST_FUNC
|
||||
unpack_bz2_stream_prime(int src_fd, int dst_fd)
|
||||
{
|
||||
uint16_t magic2;
|
||||
xread(src_fd, &magic2, 2);
|
||||
if (magic2 != BZIP2_MAGIC) {
|
||||
bb_error_msg_and_die("invalid magic");
|
||||
}
|
||||
return unpack_bz2_stream(src_fd, dst_fd);
|
||||
}
|
||||
|
||||
#ifdef TESTING
|
||||
|
||||
static char *const bunzip_errors[] = {
|
||||
@@ -812,7 +811,7 @@ int main(int argc, char **argv)
|
||||
int i;
|
||||
char c;
|
||||
|
||||
int i = unpack_bz2_stream_prime(0, 1);
|
||||
int i = unpack_bz2_stream(0, 1);
|
||||
if (i < 0)
|
||||
fprintf(stderr, "%s\n", bunzip_errors[-i]);
|
||||
else if (read(STDIN_FILENO, &c, 1))
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
#include <setjmp.h>
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
typedef struct huft_t {
|
||||
unsigned char e; /* number of extra bits or operation */
|
||||
@@ -1034,22 +1034,22 @@ inflate_unzip_internal(STATE_PARAM int in, int out)
|
||||
/* For unzip */
|
||||
|
||||
IF_DESKTOP(long long) int FAST_FUNC
|
||||
inflate_unzip(inflate_unzip_result *res, off_t compr_size, int in, int out)
|
||||
inflate_unzip(transformer_aux_data_t *aux, int in, int out)
|
||||
{
|
||||
IF_DESKTOP(long long) int n;
|
||||
DECLARE_STATE;
|
||||
|
||||
ALLOC_STATE;
|
||||
|
||||
to_read = compr_size;
|
||||
to_read = aux->bytes_in;
|
||||
// bytebuffer_max = 0x8000;
|
||||
bytebuffer_offset = 4;
|
||||
bytebuffer = xmalloc(bytebuffer_max);
|
||||
n = inflate_unzip_internal(PASS_STATE in, out);
|
||||
free(bytebuffer);
|
||||
|
||||
res->crc = gunzip_crc;
|
||||
res->bytes_out = gunzip_bytes_out;
|
||||
aux->crc32 = gunzip_crc;
|
||||
aux->bytes_out = gunzip_bytes_out;
|
||||
DEALLOC_STATE;
|
||||
return n;
|
||||
}
|
||||
@@ -1107,7 +1107,7 @@ static uint32_t buffer_read_le_u32(STATE_PARAM_ONLY)
|
||||
return res;
|
||||
}
|
||||
|
||||
static int check_header_gzip(STATE_PARAM unpack_info_t *info)
|
||||
static int check_header_gzip(STATE_PARAM transformer_aux_data_t *aux)
|
||||
{
|
||||
union {
|
||||
unsigned char raw[8];
|
||||
@@ -1169,8 +1169,8 @@ static int check_header_gzip(STATE_PARAM unpack_info_t *info)
|
||||
}
|
||||
}
|
||||
|
||||
if (info)
|
||||
info->mtime = SWAP_LE32(header.formatted.mtime);
|
||||
if (aux)
|
||||
aux->mtime = SWAP_LE32(header.formatted.mtime);
|
||||
|
||||
/* Read the header checksum */
|
||||
if (header.formatted.flags & 0x02) {
|
||||
@@ -1182,33 +1182,58 @@ static int check_header_gzip(STATE_PARAM unpack_info_t *info)
|
||||
}
|
||||
|
||||
IF_DESKTOP(long long) int FAST_FUNC
|
||||
unpack_gz_stream_with_info(int in, int out, unpack_info_t *info)
|
||||
unpack_gz_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd)
|
||||
{
|
||||
uint32_t v32;
|
||||
IF_DESKTOP(long long) int n;
|
||||
IF_DESKTOP(long long) int total, n;
|
||||
DECLARE_STATE;
|
||||
|
||||
n = 0;
|
||||
#if !ENABLE_FEATURE_SEAMLESS_Z
|
||||
if (check_signature16(aux, src_fd, GZIP_MAGIC))
|
||||
return -1;
|
||||
#else
|
||||
if (aux && aux->check_signature) {
|
||||
uint16_t magic2;
|
||||
|
||||
if (full_read(src_fd, &magic2, 2) != 2) {
|
||||
bad_magic:
|
||||
bb_error_msg("invalid magic");
|
||||
return -1;
|
||||
}
|
||||
if (magic2 == COMPRESS_MAGIC) {
|
||||
aux->check_signature = 0;
|
||||
return unpack_Z_stream(aux, src_fd, dst_fd);
|
||||
}
|
||||
if (magic2 != GZIP_MAGIC)
|
||||
goto bad_magic;
|
||||
}
|
||||
#endif
|
||||
|
||||
total = 0;
|
||||
|
||||
ALLOC_STATE;
|
||||
to_read = -1;
|
||||
// bytebuffer_max = 0x8000;
|
||||
bytebuffer = xmalloc(bytebuffer_max);
|
||||
gunzip_src_fd = in;
|
||||
gunzip_src_fd = src_fd;
|
||||
|
||||
again:
|
||||
if (!check_header_gzip(PASS_STATE info)) {
|
||||
if (!check_header_gzip(PASS_STATE aux)) {
|
||||
bb_error_msg("corrupted data");
|
||||
n = -1;
|
||||
total = -1;
|
||||
goto ret;
|
||||
}
|
||||
n += inflate_unzip_internal(PASS_STATE in, out);
|
||||
if (n < 0)
|
||||
|
||||
n = inflate_unzip_internal(PASS_STATE src_fd, dst_fd);
|
||||
if (n < 0) {
|
||||
total = -1;
|
||||
goto ret;
|
||||
}
|
||||
total += n;
|
||||
|
||||
if (!top_up(PASS_STATE 8)) {
|
||||
bb_error_msg("corrupted data");
|
||||
n = -1;
|
||||
total = -1;
|
||||
goto ret;
|
||||
}
|
||||
|
||||
@@ -1216,7 +1241,7 @@ unpack_gz_stream_with_info(int in, int out, unpack_info_t *info)
|
||||
v32 = buffer_read_le_u32(PASS_STATE_ONLY);
|
||||
if ((~gunzip_crc) != v32) {
|
||||
bb_error_msg("crc error");
|
||||
n = -1;
|
||||
total = -1;
|
||||
goto ret;
|
||||
}
|
||||
|
||||
@@ -1224,7 +1249,7 @@ unpack_gz_stream_with_info(int in, int out, unpack_info_t *info)
|
||||
v32 = buffer_read_le_u32(PASS_STATE_ONLY);
|
||||
if ((uint32_t)gunzip_bytes_out != v32) {
|
||||
bb_error_msg("incorrect length");
|
||||
n = -1;
|
||||
total = -1;
|
||||
}
|
||||
|
||||
if (!top_up(PASS_STATE 2))
|
||||
@@ -1242,11 +1267,5 @@ unpack_gz_stream_with_info(int in, int out, unpack_info_t *info)
|
||||
ret:
|
||||
free(bytebuffer);
|
||||
DEALLOC_STATE;
|
||||
return n;
|
||||
}
|
||||
|
||||
IF_DESKTOP(long long) int FAST_FUNC
|
||||
unpack_gz_stream(int in, int out)
|
||||
{
|
||||
return unpack_gz_stream_with_info(in, out, NULL);
|
||||
return total;
|
||||
}
|
||||
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
|
||||
/* Default input buffer size */
|
||||
@@ -73,7 +73,7 @@
|
||||
*/
|
||||
|
||||
IF_DESKTOP(long long) int FAST_FUNC
|
||||
unpack_Z_stream(int fd_in, int fd_out)
|
||||
unpack_Z_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd)
|
||||
{
|
||||
IF_DESKTOP(long long total_written = 0;)
|
||||
IF_DESKTOP(long long) int retval = -1;
|
||||
@@ -103,16 +103,19 @@ unpack_Z_stream(int fd_in, int fd_out)
|
||||
/* block compress mode -C compatible with 2.0 */
|
||||
int block_mode; /* = BLOCK_MODE; */
|
||||
|
||||
if (check_signature16(aux, src_fd, COMPRESS_MAGIC))
|
||||
return -1;
|
||||
|
||||
inbuf = xzalloc(IBUFSIZ + 64);
|
||||
outbuf = xzalloc(OBUFSIZ + 2048);
|
||||
htab = xzalloc(HSIZE); /* wsn't zeroed out before, maybe can xmalloc? */
|
||||
htab = xzalloc(HSIZE); /* wasn't zeroed out before, maybe can xmalloc? */
|
||||
codetab = xzalloc(HSIZE * sizeof(codetab[0]));
|
||||
|
||||
insize = 0;
|
||||
|
||||
/* xread isn't good here, we have to return - caller may want
|
||||
* to do some cleanup (e.g. delete incomplete unpacked file etc) */
|
||||
if (full_read(fd_in, inbuf, 1) != 1) {
|
||||
if (full_read(src_fd, inbuf, 1) != 1) {
|
||||
bb_error_msg("short read");
|
||||
goto err;
|
||||
}
|
||||
@@ -162,7 +165,7 @@ unpack_Z_stream(int fd_in, int fd_out)
|
||||
}
|
||||
|
||||
if (insize < (int) (IBUFSIZ + 64) - IBUFSIZ) {
|
||||
rsize = safe_read(fd_in, inbuf + insize, IBUFSIZ);
|
||||
rsize = safe_read(src_fd, inbuf + insize, IBUFSIZ);
|
||||
if (rsize < 0)
|
||||
bb_error_msg_and_die(bb_msg_read_error);
|
||||
insize += rsize;
|
||||
@@ -268,7 +271,7 @@ unpack_Z_stream(int fd_in, int fd_out)
|
||||
}
|
||||
|
||||
if (outpos >= OBUFSIZ) {
|
||||
xwrite(fd_out, outbuf, outpos);
|
||||
xwrite(dst_fd, outbuf, outpos);
|
||||
IF_DESKTOP(total_written += outpos;)
|
||||
outpos = 0;
|
||||
}
|
||||
@@ -296,7 +299,7 @@ unpack_Z_stream(int fd_in, int fd_out)
|
||||
} while (rsize > 0);
|
||||
|
||||
if (outpos > 0) {
|
||||
xwrite(fd_out, outbuf, outpos);
|
||||
xwrite(dst_fd, outbuf, outpos);
|
||||
IF_DESKTOP(total_written += outpos;)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
#if ENABLE_FEATURE_LZMA_FAST
|
||||
# define speed_inline ALWAYS_INLINE
|
||||
@@ -213,7 +213,7 @@ enum {
|
||||
|
||||
|
||||
IF_DESKTOP(long long) int FAST_FUNC
|
||||
unpack_lzma_stream(int src_fd, int dst_fd)
|
||||
unpack_lzma_stream(transformer_aux_data_t *aux UNUSED_PARAM, int src_fd, int dst_fd)
|
||||
{
|
||||
IF_DESKTOP(long long total_written = 0;)
|
||||
lzma_header_t header;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* Licensed under GPLv2, see file LICENSE in this source tree.
|
||||
*/
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
#define XZ_FUNC FAST_FUNC
|
||||
#define XZ_EXTERN static
|
||||
@@ -38,7 +38,7 @@ static uint32_t xz_crc32(const uint8_t *buf, size_t size, uint32_t crc)
|
||||
#include "unxz/xz_dec_stream.c"
|
||||
|
||||
IF_DESKTOP(long long) int FAST_FUNC
|
||||
unpack_xz_stream(int src_fd, int dst_fd)
|
||||
unpack_xz_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd)
|
||||
{
|
||||
struct xz_buf iobuf;
|
||||
struct xz_dec *state;
|
||||
@@ -49,13 +49,17 @@ unpack_xz_stream(int src_fd, int dst_fd)
|
||||
global_crc32_table = crc32_filltable(NULL, /*endian:*/ 0);
|
||||
|
||||
memset(&iobuf, 0, sizeof(iobuf));
|
||||
/* Preload XZ file signature */
|
||||
membuf = (void*) strcpy(xmalloc(2 * BUFSIZ), HEADER_MAGIC);
|
||||
membuf = xmalloc(2 * BUFSIZ);
|
||||
iobuf.in = membuf;
|
||||
iobuf.in_size = HEADER_MAGIC_SIZE;
|
||||
iobuf.out = membuf + BUFSIZ;
|
||||
iobuf.out_size = BUFSIZ;
|
||||
|
||||
if (!aux || aux->check_signature == 0) {
|
||||
/* Preload XZ file signature */
|
||||
strcpy((char*)membuf, HEADER_MAGIC);
|
||||
iobuf.in_size = HEADER_MAGIC_SIZE;
|
||||
} /* else: let xz code read & check it */
|
||||
|
||||
/* Limit memory usage to about 64 MiB. */
|
||||
state = xz_dec_init(XZ_DYNALLOC, 64*1024*1024);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
/* Accept any non-null name, its not really a filter at all */
|
||||
char FAST_FUNC filter_accept_all(archive_handle_t *archive_handle)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
/*
|
||||
* Accept names that are in the accept list, ignoring reject list.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
/* Built and used only if ENABLE_DPKG || ENABLE_DPKG_DEB */
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
/*
|
||||
* Accept names that are in the accept list and not in the reject list
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <fnmatch.h>
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
/* Find a string in a shell pattern list */
|
||||
const llist_t* FAST_FUNC find_list_entry(const llist_t *list, const char *filename)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
#include "ar.h"
|
||||
|
||||
static unsigned read_num(const char *str, int base)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
typedef struct hardlinks_t {
|
||||
struct hardlinks_t *next;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
typedef uint32_t aliased_uint32_t FIX_ALIASING;
|
||||
typedef off_t aliased_off_t FIX_ALIASING;
|
||||
@@ -79,34 +79,31 @@ static unsigned long long getOctal(char *str, int len)
|
||||
*
|
||||
* NB: tarballs with NEGATIVE unix times encoded that way were seen!
|
||||
*/
|
||||
v = first;
|
||||
/* Sign-extend using 6th bit: */
|
||||
v <<= sizeof(unsigned long long)*8 - 7;
|
||||
v = (long long)v >> (sizeof(unsigned long long)*8 - 7);
|
||||
/* Sign-extend 7bit 'first' to 64bit 'v' (that is, using 6th bit as sign): */
|
||||
first <<= 1;
|
||||
first >>= 1; /* now 7th bit = 6th bit */
|
||||
v = first; /* sign-extend 8 bits to 64 */
|
||||
while (--len != 0)
|
||||
v = (v << 8) + (unsigned char) *str++;
|
||||
v = (v << 8) + (uint8_t) *++str;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
#define GET_OCTAL(a) getOctal((a), sizeof(a))
|
||||
|
||||
#if ENABLE_FEATURE_TAR_SELINUX
|
||||
/* Scan a PAX header for SELinux contexts, via "RHT.security.selinux" keyword.
|
||||
* This is what Red Hat's patched version of tar uses.
|
||||
*/
|
||||
# define SELINUX_CONTEXT_KEYWORD "RHT.security.selinux"
|
||||
static char *get_selinux_sctx_from_pax_hdr(archive_handle_t *archive_handle, unsigned sz)
|
||||
/* "global" is 0 or 1 */
|
||||
static void process_pax_hdr(archive_handle_t *archive_handle, unsigned sz, int global)
|
||||
{
|
||||
char *buf, *p;
|
||||
char *result;
|
||||
unsigned blk_sz;
|
||||
|
||||
blk_sz = (sz + 511) & (~511);
|
||||
p = buf = xmalloc(blk_sz + 1);
|
||||
xread(archive_handle->src_fd, buf, blk_sz);
|
||||
archive_handle->offset += blk_sz;
|
||||
|
||||
p = buf = xmalloc(sz + 1);
|
||||
/* prevent bb_strtou from running off the buffer */
|
||||
buf[sz] = '\0';
|
||||
xread(archive_handle->src_fd, buf, sz);
|
||||
archive_handle->offset += sz;
|
||||
|
||||
result = NULL;
|
||||
while (sz != 0) {
|
||||
char *end, *value;
|
||||
unsigned len;
|
||||
@@ -133,19 +130,33 @@ static char *get_selinux_sctx_from_pax_hdr(archive_handle_t *archive_handle, uns
|
||||
* (we do not bother to check that it *was* a newline)
|
||||
*/
|
||||
p[-1] = '\0';
|
||||
/* Is it selinux security context? */
|
||||
value = end + 1;
|
||||
|
||||
#if ENABLE_FEATURE_TAR_GNU_EXTENSIONS
|
||||
if (!global && strncmp(value, "path=", sizeof("path=") - 1) == 0) {
|
||||
value += sizeof("path=") - 1;
|
||||
free(archive_handle->tar__longname);
|
||||
archive_handle->tar__longname = xstrdup(value);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLE_FEATURE_TAR_SELINUX
|
||||
/* Scan for SELinux contexts, via "RHT.security.selinux" keyword.
|
||||
* This is what Red Hat's patched version of tar uses.
|
||||
*/
|
||||
# define SELINUX_CONTEXT_KEYWORD "RHT.security.selinux"
|
||||
if (strncmp(value, SELINUX_CONTEXT_KEYWORD"=", sizeof(SELINUX_CONTEXT_KEYWORD"=") - 1) == 0) {
|
||||
value += sizeof(SELINUX_CONTEXT_KEYWORD"=") - 1;
|
||||
result = xstrdup(value);
|
||||
break;
|
||||
free(archive_handle->tar__sctx[global]);
|
||||
archive_handle->tar__sctx[global] = xstrdup(value);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
free(buf);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
|
||||
{
|
||||
@@ -224,43 +235,18 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
|
||||
|| memcmp(tar.magic, "\0\0\0\0", 5) != 0)
|
||||
) {
|
||||
#if ENABLE_FEATURE_TAR_AUTODETECT
|
||||
char FAST_FUNC (*get_header_ptr)(archive_handle_t *);
|
||||
uint16_t magic2;
|
||||
|
||||
autodetect:
|
||||
magic2 = *(bb__aliased_uint16_t*)tar.name;
|
||||
/* tar gz/bz autodetect: check for gz/bz2 magic.
|
||||
* If we see the magic, and it is the very first block,
|
||||
* we can switch to get_header_tar_gz/bz2/lzma().
|
||||
* Needs seekable fd. I wish recv(MSG_PEEK) works
|
||||
* on any fd... */
|
||||
# if ENABLE_FEATURE_SEAMLESS_GZ
|
||||
if (magic2 == GZIP_MAGIC) {
|
||||
get_header_ptr = get_header_tar_gz;
|
||||
} else
|
||||
# endif
|
||||
# if ENABLE_FEATURE_SEAMLESS_BZ2
|
||||
if (magic2 == BZIP2_MAGIC
|
||||
&& tar.name[2] == 'h' && isdigit(tar.name[3])
|
||||
) { /* bzip2 */
|
||||
get_header_ptr = get_header_tar_bz2;
|
||||
} else
|
||||
# endif
|
||||
# if ENABLE_FEATURE_SEAMLESS_XZ
|
||||
//TODO: if (magic2 == XZ_MAGIC1)...
|
||||
//else
|
||||
# endif
|
||||
goto err;
|
||||
/* Two different causes for lseek() != 0:
|
||||
* unseekable fd (would like to support that too, but...),
|
||||
* or not first block (false positive, it's not .gz/.bz2!) */
|
||||
if (lseek(archive_handle->src_fd, -i, SEEK_CUR) != 0)
|
||||
goto err;
|
||||
while (get_header_ptr(archive_handle) == EXIT_SUCCESS)
|
||||
continue;
|
||||
return EXIT_FAILURE;
|
||||
if (setup_unzip_on_fd(archive_handle->src_fd, /*fail_if_not_detected:*/ 0) != 0)
|
||||
err:
|
||||
#endif /* FEATURE_TAR_AUTODETECT */
|
||||
bb_error_msg_and_die("invalid tar magic");
|
||||
archive_handle->offset = 0;
|
||||
goto again_after_align;
|
||||
#endif
|
||||
bb_error_msg_and_die("invalid tar magic");
|
||||
}
|
||||
|
||||
@@ -418,12 +404,14 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
|
||||
case 'S': /* Sparse file */
|
||||
case 'V': /* Volume header */
|
||||
#endif
|
||||
#if !ENABLE_FEATURE_TAR_SELINUX
|
||||
case 'g': /* pax global header */
|
||||
case 'x': /* pax extended header */
|
||||
#else
|
||||
case 'x': { /* pax extended header */
|
||||
if ((uoff_t)file_header->size > 0xfffff) /* paranoia */
|
||||
goto skip_ext_hdr;
|
||||
process_pax_hdr(archive_handle, file_header->size, (tar.typeflag == 'g'));
|
||||
goto again_after_align;
|
||||
}
|
||||
skip_ext_hdr:
|
||||
#endif
|
||||
{
|
||||
off_t sz;
|
||||
bb_error_msg("warning: skipping header '%c'", tar.typeflag);
|
||||
@@ -435,18 +423,6 @@ char FAST_FUNC get_header_tar(archive_handle_t *archive_handle)
|
||||
/* return get_header_tar(archive_handle); */
|
||||
goto again_after_align;
|
||||
}
|
||||
#if ENABLE_FEATURE_TAR_SELINUX
|
||||
case 'g': /* pax global header */
|
||||
case 'x': { /* pax extended header */
|
||||
char **pp;
|
||||
if ((uoff_t)file_header->size > 0xfffff) /* paranoia */
|
||||
goto skip_ext_hdr;
|
||||
pp = (tar.typeflag == 'g') ? &archive_handle->tar__global_sctx : &archive_handle->tar__next_file_sctx;
|
||||
free(*pp);
|
||||
*pp = get_selinux_sctx_from_pax_hdr(archive_handle, file_header->size);
|
||||
goto again;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
bb_error_msg_and_die("unknown typeflag: 0x%x", tar.typeflag);
|
||||
}
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
char FAST_FUNC get_header_tar_bz2(archive_handle_t *archive_handle)
|
||||
{
|
||||
/* Can't lseek over pipes */
|
||||
archive_handle->seek = seek_by_read;
|
||||
|
||||
open_transformer(archive_handle->src_fd, unpack_bz2_stream_prime, "bunzip2");
|
||||
open_transformer_with_sig(archive_handle->src_fd, unpack_bz2_stream, "bunzip2");
|
||||
archive_handle->offset = 0;
|
||||
while (get_header_tar(archive_handle) == EXIT_SUCCESS)
|
||||
continue;
|
||||
|
||||
@@ -4,29 +4,14 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
char FAST_FUNC get_header_tar_gz(archive_handle_t *archive_handle)
|
||||
{
|
||||
#if BB_MMU
|
||||
uint16_t magic;
|
||||
#endif
|
||||
|
||||
/* Can't lseek over pipes */
|
||||
archive_handle->seek = seek_by_read;
|
||||
|
||||
/* Check gzip magic only if open_transformer will invoke unpack_gz_stream (MMU case).
|
||||
* Otherwise, it will invoke an external helper "gunzip -cf" (NOMMU case) which will
|
||||
* need the header. */
|
||||
#if BB_MMU
|
||||
xread(archive_handle->src_fd, &magic, 2);
|
||||
/* Can skip this check, but error message will be less clear */
|
||||
if (magic != GZIP_MAGIC) {
|
||||
bb_error_msg_and_die("invalid gzip magic");
|
||||
}
|
||||
#endif
|
||||
|
||||
open_transformer(archive_handle->src_fd, unpack_gz_stream, "gunzip");
|
||||
open_transformer_with_sig(archive_handle->src_fd, unpack_gz_stream, "gunzip");
|
||||
archive_handle->offset = 0;
|
||||
while (get_header_tar(archive_handle) == EXIT_SUCCESS)
|
||||
continue;
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
char FAST_FUNC get_header_tar_lzma(archive_handle_t *archive_handle)
|
||||
{
|
||||
/* Can't lseek over pipes */
|
||||
archive_handle->seek = seek_by_read;
|
||||
|
||||
open_transformer(archive_handle->src_fd, unpack_lzma_stream, "unlzma");
|
||||
open_transformer_with_sig(archive_handle->src_fd, unpack_lzma_stream, "unlzma");
|
||||
archive_handle->offset = 0;
|
||||
while (get_header_tar(archive_handle) == EXIT_SUCCESS)
|
||||
continue;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
void FAST_FUNC header_list(const file_header_t *file_header)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
void FAST_FUNC header_skip(const file_header_t *file_header UNUSED_PARAM)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
void FAST_FUNC header_verbose_list(const file_header_t *file_header)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
archive_handle_t* FAST_FUNC init_handle(void)
|
||||
{
|
||||
|
||||
@@ -4,16 +4,64 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
void FAST_FUNC init_transformer_aux_data(transformer_aux_data_t *aux)
|
||||
{
|
||||
memset(aux, 0, sizeof(*aux));
|
||||
}
|
||||
|
||||
int FAST_FUNC check_signature16(transformer_aux_data_t *aux, int src_fd, unsigned magic16)
|
||||
{
|
||||
if (aux && aux->check_signature) {
|
||||
uint16_t magic2;
|
||||
if (full_read(src_fd, &magic2, 2) != 2 || magic2 != magic16) {
|
||||
bb_error_msg("invalid magic");
|
||||
#if 0 /* possible future extension */
|
||||
if (aux->check_signature > 1)
|
||||
xfunc_die();
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void check_errors_in_children(int signo)
|
||||
{
|
||||
int status;
|
||||
|
||||
if (!signo) {
|
||||
/* block waiting for any child */
|
||||
if (wait(&status) < 0)
|
||||
return; /* probably there are no children */
|
||||
goto check_status;
|
||||
}
|
||||
|
||||
/* Wait for any child without blocking */
|
||||
for (;;) {
|
||||
if (wait_any_nohang(&status) < 0)
|
||||
/* wait failed?! I'm confused... */
|
||||
return;
|
||||
check_status:
|
||||
if (WIFEXITED(status) && WEXITSTATUS(status) == 0)
|
||||
/* this child exited with 0 */
|
||||
continue;
|
||||
/* Cannot happen?
|
||||
if (!WIFSIGNALED(status) && !WIFEXITED(status)) ???; */
|
||||
bb_got_signal = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* transformer(), more than meets the eye */
|
||||
/*
|
||||
* On MMU machine, the transform_prog is removed by macro magic
|
||||
* in include/archive.h. On NOMMU, transformer is removed.
|
||||
*/
|
||||
#if BB_MMU
|
||||
void FAST_FUNC open_transformer(int fd,
|
||||
IF_DESKTOP(long long) int FAST_FUNC (*transformer)(int src_fd, int dst_fd),
|
||||
const char *transform_prog)
|
||||
int check_signature,
|
||||
IF_DESKTOP(long long) int FAST_FUNC (*transformer)(transformer_aux_data_t *aux, int src_fd, int dst_fd)
|
||||
)
|
||||
#else
|
||||
void FAST_FUNC open_transformer(int fd, const char *transform_prog)
|
||||
#endif
|
||||
{
|
||||
struct fd_pair fd_pipe;
|
||||
int pid;
|
||||
@@ -25,13 +73,18 @@ void FAST_FUNC open_transformer(int fd,
|
||||
close(fd_pipe.rd); /* we don't want to read from the parent */
|
||||
// FIXME: error check?
|
||||
#if BB_MMU
|
||||
transformer(fd, fd_pipe.wr);
|
||||
if (ENABLE_FEATURE_CLEAN_UP) {
|
||||
close(fd_pipe.wr); /* send EOF */
|
||||
close(fd);
|
||||
{
|
||||
transformer_aux_data_t aux;
|
||||
init_transformer_aux_data(&aux);
|
||||
aux.check_signature = check_signature;
|
||||
transformer(&aux, fd, fd_pipe.wr);
|
||||
if (ENABLE_FEATURE_CLEAN_UP) {
|
||||
close(fd_pipe.wr); /* send EOF */
|
||||
close(fd);
|
||||
}
|
||||
/* must be _exit! bug was actually seen here */
|
||||
_exit(EXIT_SUCCESS);
|
||||
}
|
||||
/* must be _exit! bug was actually seen here */
|
||||
_exit(EXIT_SUCCESS);
|
||||
#else
|
||||
{
|
||||
char *argv[4];
|
||||
@@ -52,3 +105,117 @@ void FAST_FUNC open_transformer(int fd,
|
||||
close(fd_pipe.wr); /* don't want to write to the child */
|
||||
xmove_fd(fd_pipe.rd, fd);
|
||||
}
|
||||
|
||||
|
||||
#if SEAMLESS_COMPRESSION
|
||||
|
||||
/* Used by e.g. rpm which gives us a fd without filename,
|
||||
* thus we can't guess the format from filename's extension.
|
||||
*/
|
||||
int FAST_FUNC setup_unzip_on_fd(int fd, int fail_if_not_detected)
|
||||
{
|
||||
union {
|
||||
uint8_t b[4];
|
||||
uint16_t b16[2];
|
||||
uint32_t b32[1];
|
||||
} magic;
|
||||
int offset = -2;
|
||||
USE_FOR_MMU(IF_DESKTOP(long long) int FAST_FUNC (*xformer)(transformer_aux_data_t *aux, int src_fd, int dst_fd);)
|
||||
USE_FOR_NOMMU(const char *xformer_prog;)
|
||||
|
||||
/* .gz and .bz2 both have 2-byte signature, and their
|
||||
* unpack_XXX_stream wants this header skipped. */
|
||||
xread(fd, magic.b16, sizeof(magic.b16[0]));
|
||||
if (ENABLE_FEATURE_SEAMLESS_GZ
|
||||
&& magic.b16[0] == GZIP_MAGIC
|
||||
) {
|
||||
USE_FOR_MMU(xformer = unpack_gz_stream;)
|
||||
USE_FOR_NOMMU(xformer_prog = "gunzip";)
|
||||
goto found_magic;
|
||||
}
|
||||
if (ENABLE_FEATURE_SEAMLESS_BZ2
|
||||
&& magic.b16[0] == BZIP2_MAGIC
|
||||
) {
|
||||
USE_FOR_MMU(xformer = unpack_bz2_stream;)
|
||||
USE_FOR_NOMMU(xformer_prog = "bunzip2";)
|
||||
goto found_magic;
|
||||
}
|
||||
if (ENABLE_FEATURE_SEAMLESS_XZ
|
||||
&& magic.b16[0] == XZ_MAGIC1
|
||||
) {
|
||||
offset = -6;
|
||||
xread(fd, magic.b32, sizeof(magic.b32[0]));
|
||||
if (magic.b32[0] == XZ_MAGIC2) {
|
||||
USE_FOR_MMU(xformer = unpack_xz_stream;)
|
||||
USE_FOR_NOMMU(xformer_prog = "unxz";)
|
||||
goto found_magic;
|
||||
}
|
||||
}
|
||||
|
||||
/* No known magic seen */
|
||||
if (fail_if_not_detected)
|
||||
bb_error_msg_and_die("no gzip"
|
||||
IF_FEATURE_SEAMLESS_BZ2("/bzip2")
|
||||
IF_FEATURE_SEAMLESS_XZ("/xz")
|
||||
" magic");
|
||||
xlseek(fd, offset, SEEK_CUR);
|
||||
return 1;
|
||||
|
||||
found_magic:
|
||||
# if BB_MMU
|
||||
open_transformer_with_no_sig(fd, xformer);
|
||||
# else
|
||||
/* NOMMU version of open_transformer execs
|
||||
* an external unzipper that wants
|
||||
* file position at the start of the file */
|
||||
xlseek(fd, offset, SEEK_CUR);
|
||||
open_transformer_with_sig(fd, xformer, xformer_prog);
|
||||
# endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
int FAST_FUNC open_zipped(const char *fname)
|
||||
{
|
||||
char *sfx;
|
||||
int fd;
|
||||
|
||||
fd = open(fname, O_RDONLY);
|
||||
if (fd < 0)
|
||||
return fd;
|
||||
|
||||
sfx = strrchr(fname, '.');
|
||||
if (sfx) {
|
||||
sfx++;
|
||||
if (ENABLE_FEATURE_SEAMLESS_LZMA && strcmp(sfx, "lzma") == 0)
|
||||
/* .lzma has no header/signature, just trust it */
|
||||
open_transformer_with_sig(fd, unpack_lzma_stream, "unlzma");
|
||||
else
|
||||
if ((ENABLE_FEATURE_SEAMLESS_GZ && strcmp(sfx, "gz") == 0)
|
||||
|| (ENABLE_FEATURE_SEAMLESS_BZ2 && strcmp(sfx, "bz2") == 0)
|
||||
|| (ENABLE_FEATURE_SEAMLESS_XZ && strcmp(sfx, "xz") == 0)
|
||||
) {
|
||||
setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 1);
|
||||
}
|
||||
}
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
#endif /* SEAMLESS_COMPRESSION */
|
||||
|
||||
void* FAST_FUNC xmalloc_open_zipped_read_close(const char *fname, size_t *maxsz_p)
|
||||
{
|
||||
int fd;
|
||||
char *image;
|
||||
|
||||
fd = open_zipped(fname);
|
||||
if (fd < 0)
|
||||
return NULL;
|
||||
|
||||
image = xmalloc_read(fd, maxsz_p);
|
||||
if (!image)
|
||||
bb_perror_msg("read error from '%s'", fname);
|
||||
close(fd);
|
||||
|
||||
return image;
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
void FAST_FUNC seek_by_jump(int fd, off_t amount)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
/* If we are reading through a pipe, or from stdin then we can't lseek,
|
||||
* we must read and discard the data to skip over it.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
#include "ar.h"
|
||||
|
||||
void FAST_FUNC unpack_ar_archive(archive_handle_t *ar_archive)
|
||||
|
||||
+8
-7
@@ -51,7 +51,7 @@
|
||||
//usage: "\n -F Don't store or verify checksum"
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
#include "liblzo_interface.h"
|
||||
|
||||
/* lzo-2.03/src/lzo_ptr.h */
|
||||
@@ -201,7 +201,7 @@ static NOINLINE int lzo1x_optimize(uint8_t *in, unsigned in_len,
|
||||
/* remove short run */
|
||||
*litp &= ~3;
|
||||
/* copy over the 2 literals that replace the match */
|
||||
copy2(ip-3+1,m_pos,pd(op,m_pos));
|
||||
copy2(ip-3+1, m_pos, pd(op, m_pos));
|
||||
/* move literals 1 byte ahead */
|
||||
litp += 2;
|
||||
if (lit > 0)
|
||||
@@ -211,7 +211,8 @@ static NOINLINE int lzo1x_optimize(uint8_t *in, unsigned in_len,
|
||||
*litp = (unsigned char)(lit - 3);
|
||||
|
||||
o_m1_b++;
|
||||
*op++ = *m_pos++; *op++ = *m_pos++;
|
||||
*op++ = *m_pos++;
|
||||
*op++ = *m_pos++;
|
||||
goto copy_literal_run;
|
||||
}
|
||||
copy_m1:
|
||||
@@ -240,7 +241,7 @@ static NOINLINE int lzo1x_optimize(uint8_t *in, unsigned in_len,
|
||||
) {
|
||||
t = *ip++;
|
||||
/* copy over the 3 literals that replace the match */
|
||||
copy3(ip-1-2,m_pos,pd(op,m_pos));
|
||||
copy3(ip-1-2, m_pos, pd(op, m_pos));
|
||||
/* set new length of previous literal run */
|
||||
lit += 3 + t + 3;
|
||||
*litp = (unsigned char)(lit - 3);
|
||||
@@ -289,7 +290,7 @@ static NOINLINE int lzo1x_optimize(uint8_t *in, unsigned in_len,
|
||||
lit += 3;
|
||||
*litp = (unsigned char)((*litp & ~3) | lit);
|
||||
/* copy over the 3 literals that replace the match */
|
||||
copy3(ip-3,m_pos,pd(op,m_pos));
|
||||
copy3(ip-3, m_pos, pd(op, m_pos));
|
||||
o_m3_a++;
|
||||
}
|
||||
/* test if a literal run follows */
|
||||
@@ -300,7 +301,7 @@ static NOINLINE int lzo1x_optimize(uint8_t *in, unsigned in_len,
|
||||
/* remove short run */
|
||||
*litp &= ~3;
|
||||
/* copy over the 3 literals that replace the match */
|
||||
copy3(ip-4+1,m_pos,pd(op,m_pos));
|
||||
copy3(ip-4+1, m_pos, pd(op, m_pos));
|
||||
/* move literals 1 byte ahead */
|
||||
litp += 2;
|
||||
if (lit > 0)
|
||||
@@ -1076,7 +1077,7 @@ static char* FAST_FUNC make_new_name_lzop(char *filename, const char *expected_e
|
||||
return xasprintf("%s.lzo", filename);
|
||||
}
|
||||
|
||||
static IF_DESKTOP(long long) int FAST_FUNC pack_lzop(unpack_info_t *info UNUSED_PARAM)
|
||||
static IF_DESKTOP(long long) int FAST_FUNC pack_lzop(transformer_aux_data_t *aux UNUSED_PARAM)
|
||||
{
|
||||
if (option_mask32 & OPT_DECOMPRESS)
|
||||
return do_lzo_decompress();
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@
|
||||
//usage: "\n -c List config files"
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
#include "rpm.h"
|
||||
|
||||
#define RPM_CHAR_TYPE 1
|
||||
@@ -236,7 +236,7 @@ static void extract_cpio(int fd, const char *source_rpm)
|
||||
archive_handle->src_fd = fd;
|
||||
/*archive_handle->offset = 0; - init_handle() did it */
|
||||
|
||||
setup_unzip_on_fd(archive_handle->src_fd /*, fail_if_not_detected: 1*/);
|
||||
setup_unzip_on_fd(archive_handle->src_fd, /*fail_if_not_detected:*/ 1);
|
||||
while (get_header_cpio(archive_handle) == EXIT_SUCCESS)
|
||||
continue;
|
||||
}
|
||||
|
||||
+11
-43
@@ -13,7 +13,7 @@
|
||||
//usage: "Output a cpio archive of the rpm file"
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
#include "rpm.h"
|
||||
|
||||
enum { rpm_fd = STDIN_FILENO };
|
||||
@@ -66,54 +66,22 @@ int rpm2cpio_main(int argc UNUSED_PARAM, char **argv)
|
||||
/* Skip the main header */
|
||||
skip_header();
|
||||
|
||||
#if 0
|
||||
//if (SEAMLESS_COMPRESSION)
|
||||
// /* We need to know whether child (gzip/bzip/etc) exits abnormally */
|
||||
// signal(SIGCHLD, check_errors_in_children);
|
||||
|
||||
/* This works, but doesn't report uncompress errors (they happen in child) */
|
||||
setup_unzip_on_fd(rpm_fd /*fail_if_not_detected: 1*/);
|
||||
setup_unzip_on_fd(rpm_fd, /*fail_if_not_detected:*/ 1);
|
||||
if (bb_copyfd_eof(rpm_fd, STDOUT_FILENO) < 0)
|
||||
bb_error_msg_and_die("error unpacking");
|
||||
#else
|
||||
/* BLOAT */
|
||||
{
|
||||
union {
|
||||
uint8_t b[4];
|
||||
uint16_t b16[2];
|
||||
uint32_t b32[1];
|
||||
} magic;
|
||||
IF_DESKTOP(long long) int FAST_FUNC (*unpack)(int src_fd, int dst_fd);
|
||||
|
||||
xread(rpm_fd, magic.b16, sizeof(magic.b16[0]));
|
||||
if (magic.b16[0] == GZIP_MAGIC) {
|
||||
unpack = unpack_gz_stream;
|
||||
} else
|
||||
if (ENABLE_FEATURE_SEAMLESS_BZ2
|
||||
&& magic.b16[0] == BZIP2_MAGIC
|
||||
) {
|
||||
unpack = unpack_bz2_stream;
|
||||
} else
|
||||
if (ENABLE_FEATURE_SEAMLESS_XZ
|
||||
&& magic.b16[0] == XZ_MAGIC1
|
||||
) {
|
||||
xread(rpm_fd, magic.b32, sizeof(magic.b32[0]));
|
||||
if (magic.b32[0] != XZ_MAGIC2)
|
||||
goto no_magic;
|
||||
/* unpack_xz_stream wants fd at position 6, no need to seek */
|
||||
//xlseek(rpm_fd, -6, SEEK_CUR);
|
||||
unpack = unpack_xz_stream;
|
||||
} else {
|
||||
no_magic:
|
||||
bb_error_msg_and_die("no gzip"
|
||||
IF_FEATURE_SEAMLESS_BZ2("/bzip2")
|
||||
IF_FEATURE_SEAMLESS_XZ("/xz")
|
||||
" magic");
|
||||
}
|
||||
if (unpack(rpm_fd, STDOUT_FILENO) < 0)
|
||||
bb_error_msg_and_die("error unpacking");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ENABLE_FEATURE_CLEAN_UP) {
|
||||
close(rpm_fd);
|
||||
}
|
||||
|
||||
return 0;
|
||||
if (SEAMLESS_COMPRESSION) {
|
||||
check_errors_in_children(0);
|
||||
return bb_got_signal;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
+35
-68
@@ -44,7 +44,7 @@
|
||||
|
||||
#include <fnmatch.h>
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
/* FIXME: Stop using this non-standard feature */
|
||||
#ifndef FNM_LEADING_DIR
|
||||
# define FNM_LEADING_DIR 0
|
||||
@@ -690,54 +690,6 @@ static llist_t *append_file_list_to_list(llist_t *list)
|
||||
# define append_file_list_to_list(x) 0
|
||||
#endif
|
||||
|
||||
#if ENABLE_FEATURE_SEAMLESS_Z
|
||||
static char FAST_FUNC get_header_tar_Z(archive_handle_t *archive_handle)
|
||||
{
|
||||
/* Can't lseek over pipes */
|
||||
archive_handle->seek = seek_by_read;
|
||||
|
||||
/* do the decompression, and cleanup */
|
||||
if (xread_char(archive_handle->src_fd) != 0x1f
|
||||
|| xread_char(archive_handle->src_fd) != 0x9d
|
||||
) {
|
||||
bb_error_msg_and_die("invalid magic");
|
||||
}
|
||||
|
||||
open_transformer(archive_handle->src_fd, unpack_Z_stream, "uncompress");
|
||||
archive_handle->offset = 0;
|
||||
while (get_header_tar(archive_handle) == EXIT_SUCCESS)
|
||||
continue;
|
||||
|
||||
/* Can only do one file at a time */
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
#else
|
||||
# define get_header_tar_Z NULL
|
||||
#endif
|
||||
|
||||
#ifdef CHECK_FOR_CHILD_EXITCODE
|
||||
/* Looks like it isn't needed - tar detects malformed (truncated)
|
||||
* archive if e.g. bunzip2 fails */
|
||||
static int child_error;
|
||||
|
||||
static void handle_SIGCHLD(int status)
|
||||
{
|
||||
/* Actually, 'status' is a signo. We reuse it for other needs */
|
||||
|
||||
/* Wait for any child without blocking */
|
||||
if (wait_any_nohang(&status) < 0)
|
||||
/* wait failed?! I'm confused... */
|
||||
return;
|
||||
|
||||
if (WIFEXITED(status) && WEXITSTATUS(status) == 0)
|
||||
/* child exited with 0 */
|
||||
return;
|
||||
/* Cannot happen?
|
||||
if (!WIFSIGNALED(status) && !WIFEXITED(status)) return; */
|
||||
child_error = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
//usage:#define tar_trivial_usage
|
||||
//usage: "-[" IF_FEATURE_TAR_CREATE("c") "xt"
|
||||
//usage: IF_FEATURE_SEAMLESS_Z("Z")
|
||||
@@ -843,6 +795,8 @@ enum {
|
||||
OPT_NUMERIC_OWNER = IF_FEATURE_TAR_LONG_OPTIONS((1 << OPTBIT_NUMERIC_OWNER )) + 0, // numeric-owner
|
||||
OPT_NOPRESERVE_PERM = IF_FEATURE_TAR_LONG_OPTIONS((1 << OPTBIT_NOPRESERVE_PERM)) + 0, // no-same-permissions
|
||||
OPT_OVERWRITE = IF_FEATURE_TAR_LONG_OPTIONS((1 << OPTBIT_OVERWRITE )) + 0, // overwrite
|
||||
|
||||
OPT_ANY_COMPRESS = (OPT_BZIP2 | OPT_LZMA | OPT_GZIP | OPT_COMPRESS),
|
||||
};
|
||||
#if ENABLE_FEATURE_TAR_LONG_OPTIONS
|
||||
static const char tar_longopts[] ALIGN1 =
|
||||
@@ -901,7 +855,6 @@ static const char tar_longopts[] ALIGN1 =
|
||||
int tar_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int tar_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
char FAST_FUNC (*get_header_ptr)(archive_handle_t *) = get_header_tar;
|
||||
archive_handle_t *tar_handle;
|
||||
char *base_dir = NULL;
|
||||
const char *tar_filename = "-";
|
||||
@@ -1017,18 +970,6 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
|
||||
tar_handle->ah_flags |= ARCHIVE_O_TRUNC;
|
||||
}
|
||||
|
||||
if (opt & OPT_GZIP)
|
||||
get_header_ptr = get_header_tar_gz;
|
||||
|
||||
if (opt & OPT_BZIP2)
|
||||
get_header_ptr = get_header_tar_bz2;
|
||||
|
||||
if (opt & OPT_LZMA)
|
||||
get_header_ptr = get_header_tar_lzma;
|
||||
|
||||
if (opt & OPT_COMPRESS)
|
||||
get_header_ptr = get_header_tar_Z;
|
||||
|
||||
if (opt & OPT_NOPRESERVE_TIME)
|
||||
tar_handle->ah_flags &= ~ARCHIVE_RESTORE_DATE;
|
||||
|
||||
@@ -1081,7 +1022,7 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
|
||||
} else {
|
||||
if (ENABLE_FEATURE_TAR_AUTODETECT
|
||||
&& flags == O_RDONLY
|
||||
&& get_header_ptr == get_header_tar
|
||||
&& !(opt & OPT_ANY_COMPRESS)
|
||||
) {
|
||||
tar_handle->src_fd = open_zipped(tar_filename);
|
||||
if (tar_handle->src_fd < 0)
|
||||
@@ -1095,10 +1036,9 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
|
||||
if (base_dir)
|
||||
xchdir(base_dir);
|
||||
|
||||
#ifdef CHECK_FOR_CHILD_EXITCODE
|
||||
/* We need to know whether child (gzip/bzip/etc) exits abnormally */
|
||||
signal(SIGCHLD, handle_SIGCHLD);
|
||||
#endif
|
||||
//if (SEAMLESS_COMPRESSION || OPT_COMPRESS)
|
||||
// /* We need to know whether child (gzip/bzip/etc) exits abnormally */
|
||||
// signal(SIGCHLD, check_errors_in_children);
|
||||
|
||||
/* Create an archive */
|
||||
if (opt & OPT_CREATE) {
|
||||
@@ -1115,7 +1055,30 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
|
||||
tar_handle->reject, zipMode);
|
||||
}
|
||||
|
||||
while (get_header_ptr(tar_handle) == EXIT_SUCCESS)
|
||||
if (opt & OPT_ANY_COMPRESS) {
|
||||
USE_FOR_MMU(IF_DESKTOP(long long) int FAST_FUNC (*xformer)(transformer_aux_data_t *aux, int src_fd, int dst_fd);)
|
||||
USE_FOR_NOMMU(const char *xformer_prog;)
|
||||
|
||||
if (opt & OPT_COMPRESS)
|
||||
USE_FOR_MMU(xformer = unpack_Z_stream;)
|
||||
USE_FOR_NOMMU(xformer_prog = "uncompress";)
|
||||
if (opt & OPT_GZIP)
|
||||
USE_FOR_MMU(xformer = unpack_gz_stream;)
|
||||
USE_FOR_NOMMU(xformer_prog = "gunzip";)
|
||||
if (opt & OPT_BZIP2)
|
||||
USE_FOR_MMU(xformer = unpack_bz2_stream;)
|
||||
USE_FOR_NOMMU(xformer_prog = "bunzip2";)
|
||||
if (opt & OPT_LZMA)
|
||||
USE_FOR_MMU(xformer = unpack_lzma_stream;)
|
||||
USE_FOR_NOMMU(xformer_prog = "unlzma";)
|
||||
|
||||
open_transformer_with_sig(tar_handle->src_fd, xformer, xformer_prog);
|
||||
/* Can't lseek over pipes */
|
||||
tar_handle->seek = seek_by_read;
|
||||
/*tar_handle->offset = 0; - already is */
|
||||
}
|
||||
|
||||
while (get_header_tar(tar_handle) == EXIT_SUCCESS)
|
||||
continue;
|
||||
|
||||
/* Check that every file that should have been extracted was */
|
||||
@@ -1131,5 +1094,9 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
|
||||
if (ENABLE_FEATURE_CLEAN_UP /* && tar_handle->src_fd != STDIN_FILENO */)
|
||||
close(tar_handle->src_fd);
|
||||
|
||||
if (SEAMLESS_COMPRESSION || OPT_COMPRESS) {
|
||||
check_errors_in_children(0);
|
||||
return bb_got_signal;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
+10
-7
@@ -32,7 +32,7 @@
|
||||
//usage: "\n -d DIR Extract files into DIR"
|
||||
|
||||
#include "libbb.h"
|
||||
#include "archive.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
enum {
|
||||
#if BB_BIG_ENDIAN
|
||||
@@ -235,7 +235,7 @@ static void unzip_create_leading_dirs(const char *fn)
|
||||
/* Create all leading directories */
|
||||
char *name = xstrdup(fn);
|
||||
if (bb_make_directory(dirname(name), 0777, FILEUTILS_RECUR)) {
|
||||
bb_error_msg_and_die("exiting"); /* bb_make_directory is noisy */
|
||||
xfunc_die(); /* bb_make_directory is noisy */
|
||||
}
|
||||
free(name);
|
||||
}
|
||||
@@ -249,15 +249,17 @@ static void unzip_extract(zip_header_t *zip_header, int dst_fd)
|
||||
bb_copyfd_exact_size(zip_fd, dst_fd, size);
|
||||
} else {
|
||||
/* Method 8 - inflate */
|
||||
inflate_unzip_result res;
|
||||
if (inflate_unzip(&res, zip_header->formatted.cmpsize, zip_fd, dst_fd) < 0)
|
||||
transformer_aux_data_t aux;
|
||||
init_transformer_aux_data(&aux);
|
||||
aux.bytes_in = zip_header->formatted.cmpsize;
|
||||
if (inflate_unzip(&aux, zip_fd, dst_fd) < 0)
|
||||
bb_error_msg_and_die("inflate error");
|
||||
/* Validate decompression - crc */
|
||||
if (zip_header->formatted.crc32 != (res.crc ^ 0xffffffffL)) {
|
||||
if (zip_header->formatted.crc32 != (aux.crc32 ^ 0xffffffffL)) {
|
||||
bb_error_msg_and_die("crc error");
|
||||
}
|
||||
/* Validate decompression - size */
|
||||
if (zip_header->formatted.ucmpsize != res.bytes_out) {
|
||||
if (zip_header->formatted.ucmpsize != aux.bytes_out) {
|
||||
/* Don't die. Who knows, maybe len calculation
|
||||
* was botched somewhere. After all, crc matched! */
|
||||
bb_error_msg("bad length");
|
||||
@@ -595,7 +597,7 @@ int unzip_main(int argc, char **argv)
|
||||
}
|
||||
unzip_create_leading_dirs(dst_fn);
|
||||
if (bb_make_directory(dst_fn, dir_mode, 0)) {
|
||||
bb_error_msg_and_die("exiting");
|
||||
xfunc_die();
|
||||
}
|
||||
} else {
|
||||
if (!S_ISDIR(stat_buf.st_mode)) {
|
||||
@@ -619,6 +621,7 @@ int unzip_main(int argc, char **argv)
|
||||
i = 'y';
|
||||
} else {
|
||||
printf("replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: ", dst_fn);
|
||||
fflush_all();
|
||||
if (!fgets(key_buf, sizeof(key_buf), stdin)) {
|
||||
bb_perror_msg_and_die("can't read input");
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ CONFIG_PREFIX="./_install"
|
||||
# Busybox Library Tuning
|
||||
#
|
||||
CONFIG_PASSWORD_MINLEN=6
|
||||
CONFIG_MD5_SIZE_VS_SPEED=2
|
||||
CONFIG_MD5_SMALL=1
|
||||
CONFIG_FEATURE_FAST_TOP=y
|
||||
CONFIG_FEATURE_ETC_NETWORKS=y
|
||||
CONFIG_FEATURE_EDITING=y
|
||||
|
||||
@@ -89,7 +89,7 @@ CONFIG_PREFIX="./_install"
|
||||
# Busybox Library Tuning
|
||||
#
|
||||
CONFIG_PASSWORD_MINLEN=6
|
||||
CONFIG_MD5_SIZE_VS_SPEED=2
|
||||
CONFIG_MD5_SMALL=1
|
||||
CONFIG_FEATURE_FAST_TOP=y
|
||||
# CONFIG_FEATURE_ETC_NETWORKS is not set
|
||||
CONFIG_FEATURE_EDITING=y
|
||||
|
||||
@@ -88,7 +88,7 @@ CONFIG_PREFIX="./_install"
|
||||
# Busybox Library Tuning
|
||||
#
|
||||
CONFIG_PASSWORD_MINLEN=6
|
||||
CONFIG_MD5_SIZE_VS_SPEED=2
|
||||
CONFIG_MD5_SMALL=1
|
||||
CONFIG_FEATURE_FAST_TOP=y
|
||||
# CONFIG_FEATURE_ETC_NETWORKS is not set
|
||||
CONFIG_FEATURE_EDITING=y
|
||||
|
||||
@@ -0,0 +1,997 @@
|
||||
# Run "make android2_defconfig", then "make".
|
||||
#
|
||||
# Tested with the standalone toolchain from ndk r6:
|
||||
# android-ndk-r6/build/tools/make-standalone-toolchain.sh --platform=android-8
|
||||
#
|
||||
CONFIG_HAVE_DOT_CONFIG=y
|
||||
|
||||
#
|
||||
# Busybox Settings
|
||||
#
|
||||
|
||||
#
|
||||
# General Configuration
|
||||
#
|
||||
# CONFIG_DESKTOP is not set
|
||||
# CONFIG_EXTRA_COMPAT is not set
|
||||
# CONFIG_INCLUDE_SUSv2 is not set
|
||||
# CONFIG_USE_PORTABLE_CODE is not set
|
||||
CONFIG_PLATFORM_LINUX=y
|
||||
CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
|
||||
# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
|
||||
# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
|
||||
# CONFIG_SHOW_USAGE is not set
|
||||
# CONFIG_FEATURE_VERBOSE_USAGE is not set
|
||||
# CONFIG_FEATURE_COMPRESS_USAGE is not set
|
||||
# CONFIG_FEATURE_INSTALLER is not set
|
||||
# CONFIG_INSTALL_NO_USR is not set
|
||||
# CONFIG_LOCALE_SUPPORT is not set
|
||||
# CONFIG_UNICODE_SUPPORT is not set
|
||||
# CONFIG_UNICODE_USING_LOCALE is not set
|
||||
# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
|
||||
CONFIG_SUBST_WCHAR=0
|
||||
CONFIG_LAST_SUPPORTED_WCHAR=0
|
||||
# CONFIG_UNICODE_COMBINING_WCHARS is not set
|
||||
# CONFIG_UNICODE_WIDE_WCHARS is not set
|
||||
# CONFIG_UNICODE_BIDI_SUPPORT is not set
|
||||
# CONFIG_UNICODE_NEUTRAL_TABLE is not set
|
||||
# CONFIG_UNICODE_PRESERVE_BROKEN is not set
|
||||
# CONFIG_LONG_OPTS is not set
|
||||
# CONFIG_FEATURE_DEVPTS is not set
|
||||
# CONFIG_FEATURE_CLEAN_UP is not set
|
||||
# CONFIG_FEATURE_UTMP is not set
|
||||
# CONFIG_FEATURE_WTMP is not set
|
||||
# CONFIG_FEATURE_PIDFILE is not set
|
||||
# CONFIG_FEATURE_SUID is not set
|
||||
# CONFIG_FEATURE_SUID_CONFIG is not set
|
||||
# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set
|
||||
# CONFIG_SELINUX is not set
|
||||
# CONFIG_FEATURE_PREFER_APPLETS is not set
|
||||
CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
|
||||
CONFIG_FEATURE_SYSLOG=y
|
||||
# CONFIG_FEATURE_HAVE_RPC is not set
|
||||
|
||||
#
|
||||
# Build Options
|
||||
#
|
||||
# CONFIG_STATIC is not set
|
||||
# CONFIG_PIE is not set
|
||||
# CONFIG_NOMMU is not set
|
||||
# CONFIG_BUILD_LIBBUSYBOX is not set
|
||||
# CONFIG_FEATURE_INDIVIDUAL is not set
|
||||
# CONFIG_FEATURE_SHARED_BUSYBOX is not set
|
||||
# CONFIG_LFS is not set
|
||||
CONFIG_CROSS_COMPILER_PREFIX="arm-linux-androideabi-"
|
||||
CONFIG_EXTRA_CFLAGS=""
|
||||
|
||||
#
|
||||
# Debugging Options
|
||||
#
|
||||
# CONFIG_DEBUG is not set
|
||||
# CONFIG_DEBUG_PESSIMIZE is not set
|
||||
# CONFIG_WERROR is not set
|
||||
CONFIG_NO_DEBUG_LIB=y
|
||||
# CONFIG_DMALLOC is not set
|
||||
# CONFIG_EFENCE is not set
|
||||
|
||||
#
|
||||
# Installation Options ("make install" behavior)
|
||||
#
|
||||
CONFIG_INSTALL_APPLET_SYMLINKS=y
|
||||
# CONFIG_INSTALL_APPLET_HARDLINKS is not set
|
||||
# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set
|
||||
# CONFIG_INSTALL_APPLET_DONT is not set
|
||||
# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set
|
||||
# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set
|
||||
# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set
|
||||
CONFIG_PREFIX="./_install"
|
||||
|
||||
#
|
||||
# Busybox Library Tuning
|
||||
#
|
||||
# CONFIG_FEATURE_SYSTEMD is not set
|
||||
# CONFIG_FEATURE_RTMINMAX is not set
|
||||
CONFIG_PASSWORD_MINLEN=6
|
||||
CONFIG_MD5_SMALL=1
|
||||
# CONFIG_FEATURE_FAST_TOP is not set
|
||||
# CONFIG_FEATURE_ETC_NETWORKS is not set
|
||||
CONFIG_FEATURE_USE_TERMIOS=y
|
||||
# CONFIG_FEATURE_EDITING is not set
|
||||
CONFIG_FEATURE_EDITING_MAX_LEN=0
|
||||
# CONFIG_FEATURE_EDITING_VI is not set
|
||||
CONFIG_FEATURE_EDITING_HISTORY=0
|
||||
# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set
|
||||
# CONFIG_FEATURE_TAB_COMPLETION is not set
|
||||
# CONFIG_FEATURE_USERNAME_COMPLETION is not set
|
||||
# CONFIG_FEATURE_EDITING_FANCY_PROMPT is not set
|
||||
# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set
|
||||
# CONFIG_FEATURE_NON_POSIX_CP is not set
|
||||
# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set
|
||||
CONFIG_FEATURE_COPYBUF_KB=4
|
||||
# CONFIG_FEATURE_SKIP_ROOTFS is not set
|
||||
# CONFIG_MONOTONIC_SYSCALL is not set
|
||||
# CONFIG_IOCTL_HEX2STR_ERROR is not set
|
||||
# CONFIG_FEATURE_HWIB is not set
|
||||
|
||||
#
|
||||
# Applets
|
||||
#
|
||||
|
||||
#
|
||||
# Archival Utilities
|
||||
#
|
||||
CONFIG_FEATURE_SEAMLESS_XZ=y
|
||||
CONFIG_FEATURE_SEAMLESS_LZMA=y
|
||||
CONFIG_FEATURE_SEAMLESS_BZ2=y
|
||||
CONFIG_FEATURE_SEAMLESS_GZ=y
|
||||
CONFIG_FEATURE_SEAMLESS_Z=y
|
||||
CONFIG_AR=y
|
||||
CONFIG_FEATURE_AR_LONG_FILENAMES=y
|
||||
CONFIG_FEATURE_AR_CREATE=y
|
||||
CONFIG_BUNZIP2=y
|
||||
CONFIG_BZIP2=y
|
||||
CONFIG_CPIO=y
|
||||
CONFIG_FEATURE_CPIO_O=y
|
||||
CONFIG_FEATURE_CPIO_P=y
|
||||
CONFIG_DPKG=y
|
||||
CONFIG_DPKG_DEB=y
|
||||
# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set
|
||||
CONFIG_GUNZIP=y
|
||||
CONFIG_GZIP=y
|
||||
# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set
|
||||
CONFIG_LZOP=y
|
||||
CONFIG_LZOP_COMPR_HIGH=y
|
||||
CONFIG_RPM2CPIO=y
|
||||
CONFIG_RPM=y
|
||||
CONFIG_TAR=y
|
||||
CONFIG_FEATURE_TAR_CREATE=y
|
||||
CONFIG_FEATURE_TAR_AUTODETECT=y
|
||||
CONFIG_FEATURE_TAR_FROM=y
|
||||
CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y
|
||||
CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY=y
|
||||
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
|
||||
# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
|
||||
# CONFIG_FEATURE_TAR_TO_COMMAND is not set
|
||||
CONFIG_FEATURE_TAR_UNAME_GNAME=y
|
||||
CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y
|
||||
# CONFIG_FEATURE_TAR_SELINUX is not set
|
||||
CONFIG_UNCOMPRESS=y
|
||||
CONFIG_UNLZMA=y
|
||||
CONFIG_FEATURE_LZMA_FAST=y
|
||||
CONFIG_LZMA=y
|
||||
CONFIG_UNXZ=y
|
||||
CONFIG_XZ=y
|
||||
CONFIG_UNZIP=y
|
||||
|
||||
#
|
||||
# Coreutils
|
||||
#
|
||||
CONFIG_BASENAME=y
|
||||
CONFIG_CAT=y
|
||||
# CONFIG_DATE is not set
|
||||
# CONFIG_FEATURE_DATE_ISOFMT is not set
|
||||
# CONFIG_FEATURE_DATE_NANO is not set
|
||||
# CONFIG_FEATURE_DATE_COMPAT is not set
|
||||
# CONFIG_ID is not set
|
||||
# CONFIG_GROUPS is not set
|
||||
CONFIG_TEST=y
|
||||
CONFIG_FEATURE_TEST_64=y
|
||||
CONFIG_TOUCH=y
|
||||
CONFIG_TR=y
|
||||
CONFIG_FEATURE_TR_CLASSES=y
|
||||
CONFIG_FEATURE_TR_EQUIV=y
|
||||
CONFIG_BASE64=y
|
||||
CONFIG_CAL=y
|
||||
CONFIG_CATV=y
|
||||
CONFIG_CHGRP=y
|
||||
CONFIG_CHMOD=y
|
||||
CONFIG_CHOWN=y
|
||||
# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set
|
||||
CONFIG_CHROOT=y
|
||||
CONFIG_CKSUM=y
|
||||
CONFIG_COMM=y
|
||||
CONFIG_CP=y
|
||||
# CONFIG_FEATURE_CP_LONG_OPTIONS is not set
|
||||
CONFIG_CUT=y
|
||||
CONFIG_DD=y
|
||||
CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
|
||||
CONFIG_FEATURE_DD_THIRD_STATUS_LINE=y
|
||||
CONFIG_FEATURE_DD_IBS_OBS=y
|
||||
# CONFIG_DF is not set
|
||||
# CONFIG_FEATURE_DF_FANCY is not set
|
||||
CONFIG_DIRNAME=y
|
||||
CONFIG_DOS2UNIX=y
|
||||
CONFIG_UNIX2DOS=y
|
||||
CONFIG_DU=y
|
||||
CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y
|
||||
CONFIG_ECHO=y
|
||||
CONFIG_FEATURE_FANCY_ECHO=y
|
||||
# CONFIG_ENV is not set
|
||||
# CONFIG_FEATURE_ENV_LONG_OPTIONS is not set
|
||||
CONFIG_EXPAND=y
|
||||
# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set
|
||||
# CONFIG_EXPR is not set
|
||||
# CONFIG_EXPR_MATH_SUPPORT_64 is not set
|
||||
CONFIG_FALSE=y
|
||||
CONFIG_FOLD=y
|
||||
# CONFIG_FSYNC is not set
|
||||
CONFIG_HEAD=y
|
||||
CONFIG_FEATURE_FANCY_HEAD=y
|
||||
# CONFIG_HOSTID is not set
|
||||
CONFIG_INSTALL=y
|
||||
# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set
|
||||
CONFIG_LN=y
|
||||
# CONFIG_LOGNAME is not set
|
||||
CONFIG_LS=y
|
||||
CONFIG_FEATURE_LS_FILETYPES=y
|
||||
CONFIG_FEATURE_LS_FOLLOWLINKS=y
|
||||
CONFIG_FEATURE_LS_RECURSIVE=y
|
||||
CONFIG_FEATURE_LS_SORTFILES=y
|
||||
CONFIG_FEATURE_LS_TIMESTAMPS=y
|
||||
CONFIG_FEATURE_LS_USERNAME=y
|
||||
# CONFIG_FEATURE_LS_COLOR is not set
|
||||
# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set
|
||||
CONFIG_MD5SUM=y
|
||||
CONFIG_MKDIR=y
|
||||
# CONFIG_FEATURE_MKDIR_LONG_OPTIONS is not set
|
||||
CONFIG_MKFIFO=y
|
||||
CONFIG_MKNOD=y
|
||||
CONFIG_MV=y
|
||||
# CONFIG_FEATURE_MV_LONG_OPTIONS is not set
|
||||
CONFIG_NICE=y
|
||||
CONFIG_NOHUP=y
|
||||
CONFIG_OD=y
|
||||
CONFIG_PRINTENV=y
|
||||
CONFIG_PRINTF=y
|
||||
CONFIG_PWD=y
|
||||
CONFIG_READLINK=y
|
||||
CONFIG_FEATURE_READLINK_FOLLOW=y
|
||||
CONFIG_REALPATH=y
|
||||
CONFIG_RM=y
|
||||
CONFIG_RMDIR=y
|
||||
# CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set
|
||||
CONFIG_SEQ=y
|
||||
CONFIG_SHA1SUM=y
|
||||
CONFIG_SHA256SUM=y
|
||||
CONFIG_SHA512SUM=y
|
||||
CONFIG_SLEEP=y
|
||||
CONFIG_FEATURE_FANCY_SLEEP=y
|
||||
CONFIG_FEATURE_FLOAT_SLEEP=y
|
||||
CONFIG_SORT=y
|
||||
CONFIG_FEATURE_SORT_BIG=y
|
||||
CONFIG_SPLIT=y
|
||||
CONFIG_FEATURE_SPLIT_FANCY=y
|
||||
# CONFIG_STAT is not set
|
||||
# CONFIG_FEATURE_STAT_FORMAT is not set
|
||||
CONFIG_STTY=y
|
||||
CONFIG_SUM=y
|
||||
CONFIG_SYNC=y
|
||||
CONFIG_TAC=y
|
||||
CONFIG_TAIL=y
|
||||
CONFIG_FEATURE_FANCY_TAIL=y
|
||||
CONFIG_TEE=y
|
||||
CONFIG_FEATURE_TEE_USE_BLOCK_IO=y
|
||||
CONFIG_TRUE=y
|
||||
# CONFIG_TTY is not set
|
||||
CONFIG_UNAME=y
|
||||
CONFIG_UNEXPAND=y
|
||||
# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set
|
||||
CONFIG_UNIQ=y
|
||||
# CONFIG_USLEEP is not set
|
||||
CONFIG_UUDECODE=y
|
||||
CONFIG_UUENCODE=y
|
||||
CONFIG_WC=y
|
||||
CONFIG_FEATURE_WC_LARGE=y
|
||||
# CONFIG_WHO is not set
|
||||
CONFIG_WHOAMI=y
|
||||
CONFIG_YES=y
|
||||
|
||||
#
|
||||
# Common options for cp and mv
|
||||
#
|
||||
CONFIG_FEATURE_PRESERVE_HARDLINKS=y
|
||||
|
||||
#
|
||||
# Common options for ls, more and telnet
|
||||
#
|
||||
CONFIG_FEATURE_AUTOWIDTH=y
|
||||
|
||||
#
|
||||
# Common options for df, du, ls
|
||||
#
|
||||
CONFIG_FEATURE_HUMAN_READABLE=y
|
||||
|
||||
#
|
||||
# Common options for md5sum, sha1sum, sha256sum, sha512sum
|
||||
#
|
||||
CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
|
||||
|
||||
#
|
||||
# Console Utilities
|
||||
#
|
||||
CONFIG_CHVT=y
|
||||
CONFIG_FGCONSOLE=y
|
||||
CONFIG_CLEAR=y
|
||||
CONFIG_DEALLOCVT=y
|
||||
CONFIG_DUMPKMAP=y
|
||||
# CONFIG_KBD_MODE is not set
|
||||
# CONFIG_LOADFONT is not set
|
||||
CONFIG_LOADKMAP=y
|
||||
CONFIG_OPENVT=y
|
||||
CONFIG_RESET=y
|
||||
CONFIG_RESIZE=y
|
||||
CONFIG_FEATURE_RESIZE_PRINT=y
|
||||
CONFIG_SETCONSOLE=y
|
||||
# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set
|
||||
# CONFIG_SETFONT is not set
|
||||
# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set
|
||||
CONFIG_DEFAULT_SETFONT_DIR=""
|
||||
CONFIG_SETKEYCODES=y
|
||||
CONFIG_SETLOGCONS=y
|
||||
CONFIG_SHOWKEY=y
|
||||
# CONFIG_FEATURE_LOADFONT_PSF2 is not set
|
||||
# CONFIG_FEATURE_LOADFONT_RAW is not set
|
||||
|
||||
#
|
||||
# Debian Utilities
|
||||
#
|
||||
CONFIG_MKTEMP=y
|
||||
CONFIG_PIPE_PROGRESS=y
|
||||
CONFIG_RUN_PARTS=y
|
||||
# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set
|
||||
CONFIG_FEATURE_RUN_PARTS_FANCY=y
|
||||
CONFIG_START_STOP_DAEMON=y
|
||||
CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y
|
||||
# CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set
|
||||
CONFIG_WHICH=y
|
||||
|
||||
#
|
||||
# Editors
|
||||
#
|
||||
CONFIG_PATCH=y
|
||||
# CONFIG_VI is not set
|
||||
CONFIG_FEATURE_VI_MAX_LEN=0
|
||||
# CONFIG_FEATURE_VI_8BIT is not set
|
||||
# CONFIG_FEATURE_VI_COLON is not set
|
||||
# CONFIG_FEATURE_VI_YANKMARK is not set
|
||||
# CONFIG_FEATURE_VI_SEARCH is not set
|
||||
# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
|
||||
# CONFIG_FEATURE_VI_USE_SIGNALS is not set
|
||||
# CONFIG_FEATURE_VI_DOT_CMD is not set
|
||||
# CONFIG_FEATURE_VI_READONLY is not set
|
||||
# CONFIG_FEATURE_VI_SETOPTS is not set
|
||||
# CONFIG_FEATURE_VI_SET is not set
|
||||
# CONFIG_FEATURE_VI_WIN_RESIZE is not set
|
||||
# CONFIG_FEATURE_VI_ASK_TERMINAL is not set
|
||||
# CONFIG_FEATURE_VI_OPTIMIZE_CURSOR is not set
|
||||
# CONFIG_AWK is not set
|
||||
# CONFIG_FEATURE_AWK_LIBM is not set
|
||||
CONFIG_CMP=y
|
||||
CONFIG_DIFF=y
|
||||
# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set
|
||||
CONFIG_FEATURE_DIFF_DIR=y
|
||||
# CONFIG_ED is not set
|
||||
# CONFIG_SED is not set
|
||||
# CONFIG_FEATURE_ALLOW_EXEC is not set
|
||||
|
||||
#
|
||||
# Finding Utilities
|
||||
#
|
||||
# CONFIG_FIND is not set
|
||||
# CONFIG_FEATURE_FIND_PRINT0 is not set
|
||||
# CONFIG_FEATURE_FIND_MTIME is not set
|
||||
# CONFIG_FEATURE_FIND_MMIN 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_MAXDEPTH is not set
|
||||
# CONFIG_FEATURE_FIND_NEWER is not set
|
||||
# CONFIG_FEATURE_FIND_INUM is not set
|
||||
# CONFIG_FEATURE_FIND_EXEC is not set
|
||||
# CONFIG_FEATURE_FIND_USER is not set
|
||||
# CONFIG_FEATURE_FIND_GROUP is not set
|
||||
# CONFIG_FEATURE_FIND_NOT is not set
|
||||
# CONFIG_FEATURE_FIND_DEPTH is not set
|
||||
# CONFIG_FEATURE_FIND_PAREN is not set
|
||||
# CONFIG_FEATURE_FIND_SIZE is not set
|
||||
# CONFIG_FEATURE_FIND_PRUNE is not set
|
||||
# CONFIG_FEATURE_FIND_DELETE is not set
|
||||
# CONFIG_FEATURE_FIND_PATH is not set
|
||||
# CONFIG_FEATURE_FIND_REGEX is not set
|
||||
# CONFIG_FEATURE_FIND_CONTEXT is not set
|
||||
# CONFIG_FEATURE_FIND_LINKS is not set
|
||||
# CONFIG_GREP is not set
|
||||
# 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=y
|
||||
CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y
|
||||
CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y
|
||||
CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y
|
||||
CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y
|
||||
|
||||
#
|
||||
# Init Utilities
|
||||
#
|
||||
# CONFIG_BOOTCHARTD is not set
|
||||
# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set
|
||||
# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set
|
||||
CONFIG_HALT=y
|
||||
# CONFIG_FEATURE_CALL_TELINIT is not set
|
||||
CONFIG_TELINIT_PATH=""
|
||||
CONFIG_INIT=y
|
||||
CONFIG_FEATURE_USE_INITTAB=y
|
||||
# CONFIG_FEATURE_KILL_REMOVED is not set
|
||||
CONFIG_FEATURE_KILL_DELAY=0
|
||||
CONFIG_FEATURE_INIT_SCTTY=y
|
||||
CONFIG_FEATURE_INIT_SYSLOG=y
|
||||
CONFIG_FEATURE_EXTRA_QUIET=y
|
||||
CONFIG_FEATURE_INIT_COREDUMPS=y
|
||||
CONFIG_FEATURE_INITRD=y
|
||||
CONFIG_INIT_TERMINAL_TYPE="linux"
|
||||
CONFIG_MESG=y
|
||||
CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y
|
||||
|
||||
#
|
||||
# Login/Password Management Utilities
|
||||
#
|
||||
# CONFIG_ADD_SHELL is not set
|
||||
# CONFIG_REMOVE_SHELL is not set
|
||||
# CONFIG_FEATURE_SHADOWPASSWDS is not set
|
||||
# CONFIG_USE_BB_PWD_GRP is not set
|
||||
# CONFIG_USE_BB_SHADOW is not set
|
||||
# CONFIG_USE_BB_CRYPT is not set
|
||||
# CONFIG_USE_BB_CRYPT_SHA is not set
|
||||
# CONFIG_ADDUSER is not set
|
||||
# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set
|
||||
# CONFIG_FEATURE_CHECK_NAMES is not set
|
||||
CONFIG_FIRST_SYSTEM_ID=0
|
||||
CONFIG_LAST_SYSTEM_ID=0
|
||||
# CONFIG_ADDGROUP is not set
|
||||
# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set
|
||||
# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set
|
||||
# CONFIG_DELUSER is not set
|
||||
# CONFIG_DELGROUP is not set
|
||||
# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set
|
||||
# CONFIG_GETTY is not set
|
||||
# CONFIG_LOGIN is not set
|
||||
# CONFIG_PAM is not set
|
||||
# CONFIG_LOGIN_SCRIPTS is not set
|
||||
# CONFIG_FEATURE_NOLOGIN is not set
|
||||
# CONFIG_FEATURE_SECURETTY is not set
|
||||
# CONFIG_PASSWD is not set
|
||||
# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set
|
||||
# CONFIG_CRYPTPW is not set
|
||||
# CONFIG_CHPASSWD is not set
|
||||
# CONFIG_SU is not set
|
||||
# CONFIG_FEATURE_SU_SYSLOG is not set
|
||||
# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set
|
||||
# CONFIG_SULOGIN is not set
|
||||
# CONFIG_VLOCK is not set
|
||||
|
||||
#
|
||||
# Linux Ext2 FS Progs
|
||||
#
|
||||
CONFIG_CHATTR=y
|
||||
# CONFIG_FSCK is not set
|
||||
CONFIG_LSATTR=y
|
||||
CONFIG_TUNE2FS=y
|
||||
|
||||
#
|
||||
# Linux Module Utilities
|
||||
#
|
||||
CONFIG_MODINFO=y
|
||||
CONFIG_MODPROBE_SMALL=y
|
||||
CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE=y
|
||||
CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED=y
|
||||
# CONFIG_INSMOD is not set
|
||||
# CONFIG_RMMOD is not set
|
||||
# CONFIG_LSMOD is not set
|
||||
# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
|
||||
# CONFIG_MODPROBE is not set
|
||||
# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
|
||||
# CONFIG_DEPMOD is not set
|
||||
|
||||
#
|
||||
# Options common to multiple modutils
|
||||
#
|
||||
# CONFIG_FEATURE_2_4_MODULES is not set
|
||||
# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set
|
||||
# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
|
||||
# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
|
||||
# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
|
||||
# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
|
||||
# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
|
||||
# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set
|
||||
# CONFIG_FEATURE_MODUTILS_ALIAS is not set
|
||||
# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set
|
||||
CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
|
||||
CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
|
||||
|
||||
#
|
||||
# Linux System Utilities
|
||||
#
|
||||
CONFIG_BLOCKDEV=y
|
||||
CONFIG_REV=y
|
||||
# CONFIG_ACPID is not set
|
||||
# CONFIG_FEATURE_ACPID_COMPAT is not set
|
||||
CONFIG_BLKID=y
|
||||
# CONFIG_FEATURE_BLKID_TYPE is not set
|
||||
CONFIG_DMESG=y
|
||||
CONFIG_FEATURE_DMESG_PRETTY=y
|
||||
CONFIG_FBSET=y
|
||||
CONFIG_FEATURE_FBSET_FANCY=y
|
||||
CONFIG_FEATURE_FBSET_READMODE=y
|
||||
CONFIG_FDFLUSH=y
|
||||
CONFIG_FDFORMAT=y
|
||||
CONFIG_FDISK=y
|
||||
CONFIG_FDISK_SUPPORT_LARGE_DISKS=y
|
||||
CONFIG_FEATURE_FDISK_WRITABLE=y
|
||||
# CONFIG_FEATURE_AIX_LABEL is not set
|
||||
# CONFIG_FEATURE_SGI_LABEL is not set
|
||||
# CONFIG_FEATURE_SUN_LABEL is not set
|
||||
# CONFIG_FEATURE_OSF_LABEL is not set
|
||||
# CONFIG_FEATURE_GPT_LABEL is not set
|
||||
CONFIG_FEATURE_FDISK_ADVANCED=y
|
||||
CONFIG_FINDFS=y
|
||||
CONFIG_FLOCK=y
|
||||
CONFIG_FREERAMDISK=y
|
||||
# CONFIG_FSCK_MINIX is not set
|
||||
# CONFIG_MKFS_EXT2 is not set
|
||||
# CONFIG_MKFS_MINIX is not set
|
||||
# CONFIG_FEATURE_MINIX2 is not set
|
||||
# CONFIG_MKFS_REISER is not set
|
||||
# CONFIG_MKFS_VFAT is not set
|
||||
CONFIG_GETOPT=y
|
||||
CONFIG_FEATURE_GETOPT_LONG=y
|
||||
CONFIG_HEXDUMP=y
|
||||
CONFIG_FEATURE_HEXDUMP_REVERSE=y
|
||||
CONFIG_HD=y
|
||||
# CONFIG_HWCLOCK is not set
|
||||
# CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS is not set
|
||||
# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set
|
||||
# CONFIG_IPCRM is not set
|
||||
# CONFIG_IPCS is not set
|
||||
CONFIG_LOSETUP=y
|
||||
CONFIG_LSPCI=y
|
||||
CONFIG_LSUSB=y
|
||||
# CONFIG_MDEV is not set
|
||||
# CONFIG_FEATURE_MDEV_CONF is not set
|
||||
# CONFIG_FEATURE_MDEV_RENAME is not set
|
||||
# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set
|
||||
# CONFIG_FEATURE_MDEV_EXEC is not set
|
||||
# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set
|
||||
CONFIG_MKSWAP=y
|
||||
CONFIG_FEATURE_MKSWAP_UUID=y
|
||||
CONFIG_MORE=y
|
||||
# CONFIG_MOUNT is not set
|
||||
# CONFIG_FEATURE_MOUNT_FAKE is not set
|
||||
# CONFIG_FEATURE_MOUNT_VERBOSE is not set
|
||||
# CONFIG_FEATURE_MOUNT_HELPERS is not set
|
||||
# CONFIG_FEATURE_MOUNT_LABEL is not set
|
||||
# CONFIG_FEATURE_MOUNT_NFS is not set
|
||||
# CONFIG_FEATURE_MOUNT_CIFS is not set
|
||||
# CONFIG_FEATURE_MOUNT_FLAGS is not set
|
||||
# CONFIG_FEATURE_MOUNT_FSTAB is not set
|
||||
# CONFIG_PIVOT_ROOT is not set
|
||||
# CONFIG_RDATE is not set
|
||||
CONFIG_RDEV=y
|
||||
CONFIG_READPROFILE=y
|
||||
CONFIG_RTCWAKE=y
|
||||
CONFIG_SCRIPT=y
|
||||
CONFIG_SCRIPTREPLAY=y
|
||||
# CONFIG_SETARCH is not set
|
||||
# CONFIG_SWAPONOFF is not set
|
||||
# CONFIG_FEATURE_SWAPON_PRI is not set
|
||||
# CONFIG_SWITCH_ROOT is not set
|
||||
# CONFIG_UMOUNT is not set
|
||||
# CONFIG_FEATURE_UMOUNT_ALL is not set
|
||||
# CONFIG_FEATURE_MOUNT_LOOP is not set
|
||||
# CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set
|
||||
# CONFIG_FEATURE_MTAB_SUPPORT is not set
|
||||
CONFIG_VOLUMEID=y
|
||||
|
||||
#
|
||||
# Filesystem/Volume identification
|
||||
#
|
||||
CONFIG_FEATURE_VOLUMEID_EXT=y
|
||||
CONFIG_FEATURE_VOLUMEID_BTRFS=y
|
||||
CONFIG_FEATURE_VOLUMEID_REISERFS=y
|
||||
CONFIG_FEATURE_VOLUMEID_FAT=y
|
||||
CONFIG_FEATURE_VOLUMEID_HFS=y
|
||||
CONFIG_FEATURE_VOLUMEID_JFS=y
|
||||
CONFIG_FEATURE_VOLUMEID_XFS=y
|
||||
CONFIG_FEATURE_VOLUMEID_NTFS=y
|
||||
CONFIG_FEATURE_VOLUMEID_ISO9660=y
|
||||
CONFIG_FEATURE_VOLUMEID_UDF=y
|
||||
CONFIG_FEATURE_VOLUMEID_LUKS=y
|
||||
CONFIG_FEATURE_VOLUMEID_LINUXSWAP=y
|
||||
CONFIG_FEATURE_VOLUMEID_CRAMFS=y
|
||||
CONFIG_FEATURE_VOLUMEID_ROMFS=y
|
||||
CONFIG_FEATURE_VOLUMEID_SYSV=y
|
||||
CONFIG_FEATURE_VOLUMEID_OCFS2=y
|
||||
CONFIG_FEATURE_VOLUMEID_LINUXRAID=y
|
||||
|
||||
#
|
||||
# Miscellaneous Utilities
|
||||
#
|
||||
# CONFIG_CONSPY is not set
|
||||
# CONFIG_NANDWRITE is not set
|
||||
CONFIG_NANDDUMP=y
|
||||
CONFIG_SETSERIAL=y
|
||||
# CONFIG_UBIATTACH is not set
|
||||
# CONFIG_UBIDETACH is not set
|
||||
# CONFIG_UBIMKVOL is not set
|
||||
# CONFIG_UBIRMVOL is not set
|
||||
# CONFIG_UBIRSVOL is not set
|
||||
# CONFIG_UBIUPDATEVOL is not set
|
||||
# CONFIG_ADJTIMEX is not set
|
||||
# CONFIG_BBCONFIG is not set
|
||||
# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set
|
||||
CONFIG_BEEP=y
|
||||
CONFIG_FEATURE_BEEP_FREQ=4000
|
||||
CONFIG_FEATURE_BEEP_LENGTH_MS=30
|
||||
CONFIG_CHAT=y
|
||||
CONFIG_FEATURE_CHAT_NOFAIL=y
|
||||
# CONFIG_FEATURE_CHAT_TTY_HIFI is not set
|
||||
CONFIG_FEATURE_CHAT_IMPLICIT_CR=y
|
||||
CONFIG_FEATURE_CHAT_SWALLOW_OPTS=y
|
||||
CONFIG_FEATURE_CHAT_SEND_ESCAPES=y
|
||||
CONFIG_FEATURE_CHAT_VAR_ABORT_LEN=y
|
||||
CONFIG_FEATURE_CHAT_CLR_ABORT=y
|
||||
CONFIG_CHRT=y
|
||||
# CONFIG_CROND is not set
|
||||
# CONFIG_FEATURE_CROND_D is not set
|
||||
# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
|
||||
CONFIG_FEATURE_CROND_DIR=""
|
||||
# CONFIG_CRONTAB is not set
|
||||
CONFIG_DC=y
|
||||
CONFIG_FEATURE_DC_LIBM=y
|
||||
# CONFIG_DEVFSD is not set
|
||||
# CONFIG_DEVFSD_MODLOAD is not set
|
||||
# CONFIG_DEVFSD_FG_NP is not set
|
||||
# CONFIG_DEVFSD_VERBOSE is not set
|
||||
# CONFIG_FEATURE_DEVFS is not set
|
||||
CONFIG_DEVMEM=y
|
||||
# CONFIG_EJECT is not set
|
||||
# CONFIG_FEATURE_EJECT_SCSI is not set
|
||||
CONFIG_FBSPLASH=y
|
||||
CONFIG_FLASHCP=y
|
||||
CONFIG_FLASH_LOCK=y
|
||||
CONFIG_FLASH_UNLOCK=y
|
||||
# CONFIG_FLASH_ERASEALL is not set
|
||||
# CONFIG_IONICE is not set
|
||||
CONFIG_INOTIFYD=y
|
||||
# CONFIG_LAST is not set
|
||||
# CONFIG_FEATURE_LAST_SMALL is not set
|
||||
# CONFIG_FEATURE_LAST_FANCY is not set
|
||||
# CONFIG_LESS is not set
|
||||
CONFIG_FEATURE_LESS_MAXLINES=0
|
||||
# CONFIG_FEATURE_LESS_BRACKETS is not set
|
||||
# CONFIG_FEATURE_LESS_FLAGS is not set
|
||||
# CONFIG_FEATURE_LESS_MARKS is not set
|
||||
# CONFIG_FEATURE_LESS_REGEXP is not set
|
||||
# CONFIG_FEATURE_LESS_WINCH is not set
|
||||
# CONFIG_FEATURE_LESS_DASHCMD is not set
|
||||
# CONFIG_FEATURE_LESS_LINENUMS is not set
|
||||
CONFIG_HDPARM=y
|
||||
CONFIG_FEATURE_HDPARM_GET_IDENTITY=y
|
||||
CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF=y
|
||||
CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF=y
|
||||
CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET=y
|
||||
CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF=y
|
||||
CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA=y
|
||||
CONFIG_MAKEDEVS=y
|
||||
# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
|
||||
CONFIG_FEATURE_MAKEDEVS_TABLE=y
|
||||
CONFIG_MAN=y
|
||||
# CONFIG_MICROCOM is not set
|
||||
# CONFIG_MOUNTPOINT is not set
|
||||
# CONFIG_MT is not set
|
||||
CONFIG_RAIDAUTORUN=y
|
||||
# CONFIG_READAHEAD is not set
|
||||
# CONFIG_RFKILL is not set
|
||||
# CONFIG_RUNLEVEL is not set
|
||||
CONFIG_RX=y
|
||||
CONFIG_SETSID=y
|
||||
CONFIG_STRINGS=y
|
||||
# CONFIG_TASKSET is not set
|
||||
# CONFIG_FEATURE_TASKSET_FANCY is not set
|
||||
CONFIG_TIME=y
|
||||
CONFIG_TIMEOUT=y
|
||||
CONFIG_TTYSIZE=y
|
||||
CONFIG_VOLNAME=y
|
||||
# CONFIG_WALL is not set
|
||||
# CONFIG_WATCHDOG is not set
|
||||
|
||||
#
|
||||
# Networking Utilities
|
||||
#
|
||||
# CONFIG_NAMEIF is not set
|
||||
# CONFIG_FEATURE_NAMEIF_EXTENDED is not set
|
||||
CONFIG_NBDCLIENT=y
|
||||
CONFIG_NC=y
|
||||
CONFIG_NC_SERVER=y
|
||||
CONFIG_NC_EXTRA=y
|
||||
# CONFIG_NC_110_COMPAT is not set
|
||||
# CONFIG_PING is not set
|
||||
# CONFIG_PING6 is not set
|
||||
# CONFIG_FEATURE_FANCY_PING is not set
|
||||
CONFIG_WHOIS=y
|
||||
# CONFIG_FEATURE_IPV6 is not set
|
||||
# CONFIG_FEATURE_UNIX_LOCAL is not set
|
||||
# CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set
|
||||
# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
|
||||
CONFIG_ARP=y
|
||||
# CONFIG_ARPING is not set
|
||||
# CONFIG_BRCTL is not set
|
||||
# CONFIG_FEATURE_BRCTL_FANCY is not set
|
||||
# CONFIG_FEATURE_BRCTL_SHOW is not set
|
||||
CONFIG_DNSD=y
|
||||
# CONFIG_ETHER_WAKE is not set
|
||||
CONFIG_FAKEIDENTD=y
|
||||
CONFIG_FTPD=y
|
||||
CONFIG_FEATURE_FTP_WRITE=y
|
||||
CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST=y
|
||||
CONFIG_FTPGET=y
|
||||
CONFIG_FTPPUT=y
|
||||
# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
|
||||
# CONFIG_HOSTNAME is not set
|
||||
CONFIG_HTTPD=y
|
||||
CONFIG_FEATURE_HTTPD_RANGES=y
|
||||
CONFIG_FEATURE_HTTPD_USE_SENDFILE=y
|
||||
CONFIG_FEATURE_HTTPD_SETUID=y
|
||||
CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
|
||||
# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
|
||||
CONFIG_FEATURE_HTTPD_CGI=y
|
||||
CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR=y
|
||||
CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV=y
|
||||
CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y
|
||||
CONFIG_FEATURE_HTTPD_ERROR_PAGES=y
|
||||
CONFIG_FEATURE_HTTPD_PROXY=y
|
||||
CONFIG_FEATURE_HTTPD_GZIP=y
|
||||
CONFIG_IFCONFIG=y
|
||||
CONFIG_FEATURE_IFCONFIG_STATUS=y
|
||||
# CONFIG_FEATURE_IFCONFIG_SLIP is not set
|
||||
CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ=y
|
||||
CONFIG_FEATURE_IFCONFIG_HW=y
|
||||
CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y
|
||||
# CONFIG_IFENSLAVE is not set
|
||||
# CONFIG_IFPLUGD is not set
|
||||
CONFIG_IFUPDOWN=y
|
||||
CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate"
|
||||
CONFIG_FEATURE_IFUPDOWN_IP=y
|
||||
CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN=y
|
||||
# CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set
|
||||
CONFIG_FEATURE_IFUPDOWN_IPV4=y
|
||||
# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set
|
||||
CONFIG_FEATURE_IFUPDOWN_MAPPING=y
|
||||
# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set
|
||||
# CONFIG_INETD is not set
|
||||
# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set
|
||||
# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set
|
||||
# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set
|
||||
# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set
|
||||
# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set
|
||||
# CONFIG_FEATURE_INETD_RPC 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=y
|
||||
CONFIG_FEATURE_IP_RULE=y
|
||||
CONFIG_FEATURE_IP_SHORT_FORMS=y
|
||||
# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set
|
||||
CONFIG_IPADDR=y
|
||||
CONFIG_IPLINK=y
|
||||
CONFIG_IPROUTE=y
|
||||
CONFIG_IPTUNNEL=y
|
||||
CONFIG_IPRULE=y
|
||||
CONFIG_IPCALC=y
|
||||
CONFIG_FEATURE_IPCALC_FANCY=y
|
||||
# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set
|
||||
CONFIG_NETSTAT=y
|
||||
CONFIG_FEATURE_NETSTAT_WIDE=y
|
||||
CONFIG_FEATURE_NETSTAT_PRG=y
|
||||
# CONFIG_NSLOOKUP is not set
|
||||
# CONFIG_NTPD is not set
|
||||
# CONFIG_FEATURE_NTPD_SERVER is not set
|
||||
CONFIG_PSCAN=y
|
||||
CONFIG_ROUTE=y
|
||||
# CONFIG_SLATTACH is not set
|
||||
CONFIG_TCPSVD=y
|
||||
# CONFIG_TELNET is not set
|
||||
# CONFIG_FEATURE_TELNET_TTYPE is not set
|
||||
# CONFIG_FEATURE_TELNET_AUTOLOGIN is not set
|
||||
# CONFIG_TELNETD is not set
|
||||
# CONFIG_FEATURE_TELNETD_STANDALONE is not set
|
||||
# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set
|
||||
# CONFIG_TFTP is not set
|
||||
# CONFIG_TFTPD is not set
|
||||
# CONFIG_FEATURE_TFTP_GET is not set
|
||||
# CONFIG_FEATURE_TFTP_PUT is not set
|
||||
# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
|
||||
# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
|
||||
# CONFIG_TFTP_DEBUG is not set
|
||||
# CONFIG_TRACEROUTE is not set
|
||||
# CONFIG_TRACEROUTE6 is not set
|
||||
# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set
|
||||
# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set
|
||||
# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set
|
||||
CONFIG_TUNCTL=y
|
||||
CONFIG_FEATURE_TUNCTL_UG=y
|
||||
# CONFIG_UDHCPD is not set
|
||||
# CONFIG_DHCPRELAY is not set
|
||||
# CONFIG_DUMPLEASES is not set
|
||||
# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set
|
||||
# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set
|
||||
CONFIG_DHCPD_LEASES_FILE=""
|
||||
CONFIG_UDHCPC=y
|
||||
CONFIG_FEATURE_UDHCPC_ARPING=y
|
||||
# CONFIG_FEATURE_UDHCP_PORT is not set
|
||||
CONFIG_UDHCP_DEBUG=9
|
||||
CONFIG_FEATURE_UDHCP_RFC3397=y
|
||||
CONFIG_FEATURE_UDHCP_8021Q=y
|
||||
CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
|
||||
CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
|
||||
CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n"
|
||||
# CONFIG_UDPSVD is not set
|
||||
# CONFIG_VCONFIG is not set
|
||||
CONFIG_WGET=y
|
||||
CONFIG_FEATURE_WGET_STATUSBAR=y
|
||||
CONFIG_FEATURE_WGET_AUTHENTICATION=y
|
||||
# CONFIG_FEATURE_WGET_LONG_OPTIONS is not set
|
||||
CONFIG_FEATURE_WGET_TIMEOUT=y
|
||||
# CONFIG_ZCIP is not set
|
||||
|
||||
#
|
||||
# Print Utilities
|
||||
#
|
||||
CONFIG_LPD=y
|
||||
CONFIG_LPR=y
|
||||
CONFIG_LPQ=y
|
||||
|
||||
#
|
||||
# Mail Utilities
|
||||
#
|
||||
CONFIG_MAKEMIME=y
|
||||
CONFIG_FEATURE_MIME_CHARSET="us-ascii"
|
||||
CONFIG_POPMAILDIR=y
|
||||
CONFIG_FEATURE_POPMAILDIR_DELIVERY=y
|
||||
CONFIG_REFORMIME=y
|
||||
CONFIG_FEATURE_REFORMIME_COMPAT=y
|
||||
CONFIG_SENDMAIL=y
|
||||
|
||||
#
|
||||
# Process Utilities
|
||||
#
|
||||
CONFIG_IOSTAT=y
|
||||
CONFIG_MPSTAT=y
|
||||
CONFIG_NMETER=y
|
||||
CONFIG_PMAP=y
|
||||
CONFIG_POWERTOP=y
|
||||
CONFIG_PSTREE=y
|
||||
CONFIG_PWDX=y
|
||||
CONFIG_SMEMCAP=y
|
||||
# CONFIG_FREE is not set
|
||||
CONFIG_FUSER=y
|
||||
# CONFIG_KILL is not set
|
||||
# CONFIG_KILLALL is not set
|
||||
# CONFIG_KILLALL5 is not set
|
||||
# CONFIG_PGREP is not set
|
||||
CONFIG_PIDOF=y
|
||||
CONFIG_FEATURE_PIDOF_SINGLE=y
|
||||
CONFIG_FEATURE_PIDOF_OMIT=y
|
||||
# CONFIG_PKILL is not set
|
||||
# CONFIG_PS is not set
|
||||
# CONFIG_FEATURE_PS_WIDE is not set
|
||||
# CONFIG_FEATURE_PS_TIME is not set
|
||||
# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set
|
||||
# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set
|
||||
CONFIG_RENICE=y
|
||||
CONFIG_BB_SYSCTL=y
|
||||
CONFIG_TOP=y
|
||||
CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
|
||||
CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y
|
||||
CONFIG_FEATURE_TOP_SMP_CPU=y
|
||||
CONFIG_FEATURE_TOP_DECIMALS=y
|
||||
CONFIG_FEATURE_TOP_SMP_PROCESS=y
|
||||
CONFIG_FEATURE_TOPMEM=y
|
||||
CONFIG_FEATURE_SHOW_THREADS=y
|
||||
# CONFIG_UPTIME is not set
|
||||
CONFIG_WATCH=y
|
||||
|
||||
#
|
||||
# Runit Utilities
|
||||
#
|
||||
CONFIG_RUNSV=y
|
||||
CONFIG_RUNSVDIR=y
|
||||
# CONFIG_FEATURE_RUNSVDIR_LOG is not set
|
||||
CONFIG_SV=y
|
||||
CONFIG_SV_DEFAULT_SERVICE_DIR="/var/service"
|
||||
CONFIG_SVLOGD=y
|
||||
CONFIG_CHPST=y
|
||||
CONFIG_SETUIDGID=y
|
||||
CONFIG_ENVUIDGID=y
|
||||
CONFIG_ENVDIR=y
|
||||
CONFIG_SOFTLIMIT=y
|
||||
# CONFIG_CHCON is not set
|
||||
# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set
|
||||
# CONFIG_GETENFORCE is not set
|
||||
# CONFIG_GETSEBOOL is not set
|
||||
# CONFIG_LOAD_POLICY is not set
|
||||
# CONFIG_MATCHPATHCON is not set
|
||||
# CONFIG_RESTORECON is not set
|
||||
# CONFIG_RUNCON is not set
|
||||
# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set
|
||||
# CONFIG_SELINUXENABLED is not set
|
||||
# CONFIG_SETENFORCE is not set
|
||||
# CONFIG_SETFILES is not set
|
||||
# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set
|
||||
# CONFIG_SETSEBOOL is not set
|
||||
# CONFIG_SESTATUS is not set
|
||||
|
||||
#
|
||||
# Shells
|
||||
#
|
||||
# CONFIG_ASH is not set
|
||||
# CONFIG_ASH_BASH_COMPAT is not set
|
||||
# CONFIG_ASH_IDLE_TIMEOUT is not set
|
||||
# CONFIG_ASH_JOB_CONTROL is not set
|
||||
# CONFIG_ASH_ALIAS is not set
|
||||
# CONFIG_ASH_GETOPTS is not set
|
||||
# CONFIG_ASH_BUILTIN_ECHO is not set
|
||||
# CONFIG_ASH_BUILTIN_PRINTF is not set
|
||||
# CONFIG_ASH_BUILTIN_TEST is not set
|
||||
# CONFIG_ASH_CMDCMD is not set
|
||||
# CONFIG_ASH_MAIL is not set
|
||||
# CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set
|
||||
# CONFIG_ASH_RANDOM_SUPPORT is not set
|
||||
# CONFIG_ASH_EXPAND_PRMT is not set
|
||||
CONFIG_CTTYHACK=y
|
||||
# CONFIG_HUSH is not set
|
||||
# CONFIG_HUSH_BASH_COMPAT is not set
|
||||
# CONFIG_HUSH_BRACE_EXPANSION is not set
|
||||
# CONFIG_HUSH_HELP is not set
|
||||
# CONFIG_HUSH_INTERACTIVE is not set
|
||||
# CONFIG_HUSH_SAVEHISTORY is not set
|
||||
# CONFIG_HUSH_JOB is not set
|
||||
# CONFIG_HUSH_TICK is not set
|
||||
# CONFIG_HUSH_IF is not set
|
||||
# CONFIG_HUSH_LOOPS is not set
|
||||
# CONFIG_HUSH_CASE is not set
|
||||
# CONFIG_HUSH_FUNCTIONS is not set
|
||||
# CONFIG_HUSH_LOCAL is not set
|
||||
# CONFIG_HUSH_RANDOM_SUPPORT is not set
|
||||
# CONFIG_HUSH_EXPORT_N is not set
|
||||
# CONFIG_HUSH_MODE_X is not set
|
||||
# CONFIG_MSH is not set
|
||||
# CONFIG_FEATURE_SH_IS_ASH is not set
|
||||
# CONFIG_FEATURE_SH_IS_HUSH is not set
|
||||
CONFIG_FEATURE_SH_IS_NONE=y
|
||||
# CONFIG_FEATURE_BASH_IS_ASH is not set
|
||||
# CONFIG_FEATURE_BASH_IS_HUSH is not set
|
||||
CONFIG_FEATURE_BASH_IS_NONE=y
|
||||
# CONFIG_SH_MATH_SUPPORT is not set
|
||||
# CONFIG_SH_MATH_SUPPORT_64 is not set
|
||||
# CONFIG_FEATURE_SH_EXTRA_QUIET is not set
|
||||
# CONFIG_FEATURE_SH_STANDALONE is not set
|
||||
# CONFIG_FEATURE_SH_NOFORK is not set
|
||||
# CONFIG_FEATURE_SH_HISTFILESIZE is not set
|
||||
|
||||
#
|
||||
# System Logging Utilities
|
||||
#
|
||||
# CONFIG_SYSLOGD is not set
|
||||
# CONFIG_FEATURE_ROTATE_LOGFILE is not set
|
||||
# CONFIG_FEATURE_REMOTE_LOG is not set
|
||||
# CONFIG_FEATURE_SYSLOGD_DUP is not set
|
||||
# CONFIG_FEATURE_SYSLOGD_CFG is not set
|
||||
CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0
|
||||
# CONFIG_FEATURE_IPC_SYSLOG is not set
|
||||
CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0
|
||||
# CONFIG_LOGREAD is not set
|
||||
# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set
|
||||
CONFIG_KLOGD=y
|
||||
CONFIG_FEATURE_KLOGD_KLOGCTL=y
|
||||
# CONFIG_LOGGER is not set
|
||||
+124
-109
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Busybox version: 1.19.0.git
|
||||
# Wed Jun 29 12:01:57 2011
|
||||
# Busybox version: 1.20.0.git
|
||||
# Sun Nov 6 07:51:38 2011
|
||||
#
|
||||
CONFIG_HAVE_DOT_CONFIG=y
|
||||
|
||||
@@ -12,7 +12,7 @@ CONFIG_HAVE_DOT_CONFIG=y
|
||||
#
|
||||
# General Configuration
|
||||
#
|
||||
# CONFIG_DESKTOP is not set
|
||||
CONFIG_DESKTOP=y
|
||||
# CONFIG_EXTRA_COMPAT is not set
|
||||
# CONFIG_INCLUDE_SUSv2 is not set
|
||||
# CONFIG_USE_PORTABLE_CODE is not set
|
||||
@@ -70,6 +70,8 @@ CONFIG_CROSS_COMPILER_PREFIX="arm-eabi-"
|
||||
# -Werror=sequence-point -Wstrict-aliasing=2 -Wno-undef -Wno-shadow
|
||||
# bbox already adds these:
|
||||
# -ffunction-sections -fomit-frame-pointer
|
||||
# enabled implicitly by -Os:
|
||||
# -frerun-cse-after-loop
|
||||
# should be not needed, or even increases code size:
|
||||
# -finline-functions -fno-inline-functions-called-once -finline-limit=64
|
||||
# -fstack-protector -fno-strict-aliasing -fno-exceptions -funwind-tables
|
||||
@@ -77,9 +79,8 @@ CONFIG_CROSS_COMPILER_PREFIX="arm-eabi-"
|
||||
# todo: do we need these? -
|
||||
# -fno-short-enums
|
||||
# -fgcse-after-reload
|
||||
# -frerun-cse-after-loop
|
||||
# -frename-registers
|
||||
CONFIG_EXTRA_CFLAGS="-I$A/system/core/include -I$A/bionic/libc/arch-arm/include -I$A/bionic/libc/include -I$A/bionic/libc/kernel/common -I$A/bionic/libc/kernel/arch-arm -I$A/bionic/libm/include -I$A/bionic/libm/include/arch/arm -include $A/system/core/include/arch/linux-arm/AndroidConfig.h -I$A/system/core/include/arch/linux-arm/ -DANDROID -DSK_RELEASE -nostdlib -march=armv7-a -msoft-float -mfloat-abi=softfp -mfpu=neon -mthumb -mthumb-interwork -fpic -fno-short-enums -fgcse-after-reload -frerun-cse-after-loop -frename-registers"
|
||||
CONFIG_EXTRA_CFLAGS="-I$A/system/core/include -I$A/bionic/libc/arch-arm/include -I$A/bionic/libc/include -I$A/bionic/libc/kernel/common -I$A/bionic/libc/kernel/arch-arm -I$A/bionic/libm/include -I$A/bionic/libm/include/arch/arm -include $A/system/core/include/arch/linux-arm/AndroidConfig.h -I$A/system/core/include/arch/linux-arm/ -D__ANDROID__ -DSK_RELEASE -nostdlib -march=armv7-a -msoft-float -mfloat-abi=softfp -mfpu=neon -mthumb -mthumb-interwork -fpic -fno-short-enums -fgcse-after-reload -frename-registers"
|
||||
|
||||
#
|
||||
# Debugging Options
|
||||
@@ -109,7 +110,7 @@ CONFIG_PREFIX="./_install"
|
||||
# CONFIG_FEATURE_SYSTEMD is not set
|
||||
# CONFIG_FEATURE_RTMINMAX is not set
|
||||
CONFIG_PASSWORD_MINLEN=6
|
||||
CONFIG_MD5_SIZE_VS_SPEED=2
|
||||
CONFIG_MD5_SMALL=1
|
||||
# CONFIG_FEATURE_FAST_TOP is not set
|
||||
# CONFIG_FEATURE_ETC_NETWORKS is not set
|
||||
CONFIG_FEATURE_USE_TERMIOS=y
|
||||
@@ -118,6 +119,8 @@ CONFIG_FEATURE_EDITING_MAX_LEN=0
|
||||
# CONFIG_FEATURE_EDITING_VI is not set
|
||||
CONFIG_FEATURE_EDITING_HISTORY=0
|
||||
# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set
|
||||
# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set
|
||||
# CONFIG_FEATURE_REVERSE_SEARCH is not set
|
||||
# CONFIG_FEATURE_TAB_COMPLETION is not set
|
||||
# CONFIG_FEATURE_USERNAME_COMPLETION is not set
|
||||
# CONFIG_FEATURE_EDITING_FANCY_PROMPT is not set
|
||||
@@ -156,6 +159,7 @@ CONFIG_DPKG_DEB=y
|
||||
CONFIG_GUNZIP=y
|
||||
CONFIG_GZIP=y
|
||||
# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set
|
||||
CONFIG_GZIP_FAST=0
|
||||
CONFIG_LZOP=y
|
||||
CONFIG_LZOP_COMPR_HIGH=y
|
||||
CONFIG_RPM2CPIO=y
|
||||
@@ -189,15 +193,19 @@ CONFIG_CAT=y
|
||||
# CONFIG_FEATURE_DATE_ISOFMT is not set
|
||||
# CONFIG_FEATURE_DATE_NANO is not set
|
||||
# CONFIG_FEATURE_DATE_COMPAT is not set
|
||||
# CONFIG_HOSTID is not set
|
||||
# CONFIG_ID is not set
|
||||
# CONFIG_GROUPS is not set
|
||||
CONFIG_TEST=y
|
||||
CONFIG_FEATURE_TEST_64=y
|
||||
CONFIG_TOUCH=y
|
||||
CONFIG_FEATURE_TOUCH_SUSV3=y
|
||||
CONFIG_TR=y
|
||||
CONFIG_FEATURE_TR_CLASSES=y
|
||||
CONFIG_FEATURE_TR_EQUIV=y
|
||||
CONFIG_BASE64=y
|
||||
# CONFIG_WHO is not set
|
||||
# CONFIG_USERS is not set
|
||||
CONFIG_CAL=y
|
||||
CONFIG_CATV=y
|
||||
CONFIG_CHGRP=y
|
||||
@@ -223,18 +231,17 @@ CONFIG_DU=y
|
||||
CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y
|
||||
CONFIG_ECHO=y
|
||||
CONFIG_FEATURE_FANCY_ECHO=y
|
||||
# CONFIG_ENV is not set
|
||||
CONFIG_ENV=y
|
||||
# CONFIG_FEATURE_ENV_LONG_OPTIONS is not set
|
||||
CONFIG_EXPAND=y
|
||||
# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set
|
||||
# CONFIG_EXPR is not set
|
||||
# CONFIG_EXPR_MATH_SUPPORT_64 is not set
|
||||
CONFIG_EXPR=y
|
||||
CONFIG_EXPR_MATH_SUPPORT_64=y
|
||||
CONFIG_FALSE=y
|
||||
CONFIG_FOLD=y
|
||||
# CONFIG_FSYNC is not set
|
||||
CONFIG_FSYNC=y
|
||||
CONFIG_HEAD=y
|
||||
CONFIG_FEATURE_FANCY_HEAD=y
|
||||
# CONFIG_HOSTID is not set
|
||||
CONFIG_INSTALL=y
|
||||
# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set
|
||||
CONFIG_LN=y
|
||||
@@ -294,12 +301,11 @@ CONFIG_UNAME=y
|
||||
CONFIG_UNEXPAND=y
|
||||
# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set
|
||||
CONFIG_UNIQ=y
|
||||
# CONFIG_USLEEP is not set
|
||||
CONFIG_USLEEP=y
|
||||
CONFIG_UUDECODE=y
|
||||
CONFIG_UUENCODE=y
|
||||
CONFIG_WC=y
|
||||
CONFIG_FEATURE_WC_LARGE=y
|
||||
# CONFIG_WHO is not set
|
||||
CONFIG_WHOAMI=y
|
||||
CONFIG_YES=y
|
||||
|
||||
@@ -366,61 +372,61 @@ CONFIG_WHICH=y
|
||||
# Editors
|
||||
#
|
||||
CONFIG_PATCH=y
|
||||
# CONFIG_VI is not set
|
||||
CONFIG_FEATURE_VI_MAX_LEN=0
|
||||
# CONFIG_FEATURE_VI_8BIT is not set
|
||||
# CONFIG_FEATURE_VI_COLON is not set
|
||||
# CONFIG_FEATURE_VI_YANKMARK is not set
|
||||
# CONFIG_FEATURE_VI_SEARCH is not set
|
||||
CONFIG_VI=y
|
||||
CONFIG_FEATURE_VI_MAX_LEN=4096
|
||||
CONFIG_FEATURE_VI_8BIT=y
|
||||
CONFIG_FEATURE_VI_COLON=y
|
||||
CONFIG_FEATURE_VI_YANKMARK=y
|
||||
CONFIG_FEATURE_VI_SEARCH=y
|
||||
# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
|
||||
# CONFIG_FEATURE_VI_USE_SIGNALS is not set
|
||||
# CONFIG_FEATURE_VI_DOT_CMD is not set
|
||||
# CONFIG_FEATURE_VI_READONLY is not set
|
||||
# CONFIG_FEATURE_VI_SETOPTS is not set
|
||||
# CONFIG_FEATURE_VI_SET is not set
|
||||
# CONFIG_FEATURE_VI_WIN_RESIZE is not set
|
||||
# CONFIG_FEATURE_VI_ASK_TERMINAL is not set
|
||||
# CONFIG_FEATURE_VI_OPTIMIZE_CURSOR is not set
|
||||
# CONFIG_AWK is not set
|
||||
# CONFIG_FEATURE_AWK_LIBM is not set
|
||||
CONFIG_FEATURE_VI_USE_SIGNALS=y
|
||||
CONFIG_FEATURE_VI_DOT_CMD=y
|
||||
CONFIG_FEATURE_VI_READONLY=y
|
||||
CONFIG_FEATURE_VI_SETOPTS=y
|
||||
CONFIG_FEATURE_VI_SET=y
|
||||
CONFIG_FEATURE_VI_WIN_RESIZE=y
|
||||
CONFIG_FEATURE_VI_ASK_TERMINAL=y
|
||||
CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y
|
||||
CONFIG_AWK=y
|
||||
CONFIG_FEATURE_AWK_LIBM=y
|
||||
CONFIG_CMP=y
|
||||
CONFIG_DIFF=y
|
||||
# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set
|
||||
CONFIG_FEATURE_DIFF_DIR=y
|
||||
# CONFIG_ED is not set
|
||||
# CONFIG_SED is not set
|
||||
# CONFIG_FEATURE_ALLOW_EXEC is not set
|
||||
CONFIG_ED=y
|
||||
CONFIG_SED=y
|
||||
CONFIG_FEATURE_ALLOW_EXEC=y
|
||||
|
||||
#
|
||||
# Finding Utilities
|
||||
#
|
||||
# CONFIG_FIND is not set
|
||||
# CONFIG_FEATURE_FIND_PRINT0 is not set
|
||||
# CONFIG_FEATURE_FIND_MTIME is not set
|
||||
# CONFIG_FEATURE_FIND_MMIN 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_MAXDEPTH is not set
|
||||
# CONFIG_FEATURE_FIND_NEWER is not set
|
||||
# CONFIG_FEATURE_FIND_INUM is not set
|
||||
# CONFIG_FEATURE_FIND_EXEC is not set
|
||||
# CONFIG_FEATURE_FIND_USER is not set
|
||||
# CONFIG_FEATURE_FIND_GROUP is not set
|
||||
# CONFIG_FEATURE_FIND_NOT is not set
|
||||
# CONFIG_FEATURE_FIND_DEPTH is not set
|
||||
# CONFIG_FEATURE_FIND_PAREN is not set
|
||||
# CONFIG_FEATURE_FIND_SIZE is not set
|
||||
# CONFIG_FEATURE_FIND_PRUNE is not set
|
||||
# CONFIG_FEATURE_FIND_DELETE is not set
|
||||
# CONFIG_FEATURE_FIND_PATH is not set
|
||||
# CONFIG_FEATURE_FIND_REGEX is not set
|
||||
CONFIG_FIND=y
|
||||
CONFIG_FEATURE_FIND_PRINT0=y
|
||||
CONFIG_FEATURE_FIND_MTIME=y
|
||||
CONFIG_FEATURE_FIND_MMIN=y
|
||||
CONFIG_FEATURE_FIND_PERM=y
|
||||
CONFIG_FEATURE_FIND_TYPE=y
|
||||
CONFIG_FEATURE_FIND_XDEV=y
|
||||
CONFIG_FEATURE_FIND_MAXDEPTH=y
|
||||
CONFIG_FEATURE_FIND_NEWER=y
|
||||
CONFIG_FEATURE_FIND_INUM=y
|
||||
CONFIG_FEATURE_FIND_EXEC=y
|
||||
CONFIG_FEATURE_FIND_USER=y
|
||||
CONFIG_FEATURE_FIND_GROUP=y
|
||||
CONFIG_FEATURE_FIND_NOT=y
|
||||
CONFIG_FEATURE_FIND_DEPTH=y
|
||||
CONFIG_FEATURE_FIND_PAREN=y
|
||||
CONFIG_FEATURE_FIND_SIZE=y
|
||||
CONFIG_FEATURE_FIND_PRUNE=y
|
||||
CONFIG_FEATURE_FIND_DELETE=y
|
||||
CONFIG_FEATURE_FIND_PATH=y
|
||||
CONFIG_FEATURE_FIND_REGEX=y
|
||||
# CONFIG_FEATURE_FIND_CONTEXT is not set
|
||||
# CONFIG_FEATURE_FIND_LINKS is not set
|
||||
# CONFIG_GREP is not set
|
||||
# CONFIG_FEATURE_GREP_EGREP_ALIAS is not set
|
||||
# CONFIG_FEATURE_GREP_FGREP_ALIAS is not set
|
||||
# CONFIG_FEATURE_GREP_CONTEXT is not set
|
||||
CONFIG_FEATURE_FIND_LINKS=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=y
|
||||
CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y
|
||||
@@ -430,9 +436,9 @@ CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y
|
||||
#
|
||||
# Init Utilities
|
||||
#
|
||||
# CONFIG_BOOTCHARTD is not set
|
||||
# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set
|
||||
# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set
|
||||
CONFIG_BOOTCHARTD=y
|
||||
CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER=y
|
||||
CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE=y
|
||||
CONFIG_HALT=y
|
||||
# CONFIG_FEATURE_CALL_TELINIT is not set
|
||||
CONFIG_TELINIT_PATH=""
|
||||
@@ -472,6 +478,7 @@ CONFIG_LAST_SYSTEM_ID=0
|
||||
# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set
|
||||
# CONFIG_GETTY is not set
|
||||
# CONFIG_LOGIN is not set
|
||||
# CONFIG_LOGIN_SESSION_AS_CHILD is not set
|
||||
# CONFIG_PAM is not set
|
||||
# CONFIG_LOGIN_SCRIPTS is not set
|
||||
# CONFIG_FEATURE_NOLOGIN is not set
|
||||
@@ -529,11 +536,17 @@ CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
|
||||
# Linux System Utilities
|
||||
#
|
||||
CONFIG_BLOCKDEV=y
|
||||
CONFIG_MDEV=y
|
||||
CONFIG_FEATURE_MDEV_CONF=y
|
||||
CONFIG_FEATURE_MDEV_RENAME=y
|
||||
CONFIG_FEATURE_MDEV_RENAME_REGEXP=y
|
||||
CONFIG_FEATURE_MDEV_EXEC=y
|
||||
CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y
|
||||
CONFIG_REV=y
|
||||
# CONFIG_ACPID is not set
|
||||
# CONFIG_FEATURE_ACPID_COMPAT is not set
|
||||
CONFIG_BLKID=y
|
||||
# CONFIG_FEATURE_BLKID_TYPE is not set
|
||||
CONFIG_FEATURE_BLKID_TYPE=y
|
||||
CONFIG_DMESG=y
|
||||
CONFIG_FEATURE_DMESG_PRETTY=y
|
||||
CONFIG_FBSET=y
|
||||
@@ -564,7 +577,7 @@ CONFIG_FEATURE_GETOPT_LONG=y
|
||||
CONFIG_HEXDUMP=y
|
||||
CONFIG_FEATURE_HEXDUMP_REVERSE=y
|
||||
CONFIG_HD=y
|
||||
# CONFIG_HWCLOCK is not set
|
||||
CONFIG_HWCLOCK=y
|
||||
# CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS is not set
|
||||
# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set
|
||||
# CONFIG_IPCRM is not set
|
||||
@@ -572,12 +585,6 @@ CONFIG_HD=y
|
||||
CONFIG_LOSETUP=y
|
||||
CONFIG_LSPCI=y
|
||||
CONFIG_LSUSB=y
|
||||
# CONFIG_MDEV is not set
|
||||
# CONFIG_FEATURE_MDEV_CONF is not set
|
||||
# CONFIG_FEATURE_MDEV_RENAME is not set
|
||||
# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set
|
||||
# CONFIG_FEATURE_MDEV_EXEC is not set
|
||||
# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set
|
||||
CONFIG_MKSWAP=y
|
||||
CONFIG_FEATURE_MKSWAP_UUID=y
|
||||
CONFIG_MORE=y
|
||||
@@ -600,7 +607,7 @@ CONFIG_SCRIPTREPLAY=y
|
||||
# CONFIG_SETARCH is not set
|
||||
# CONFIG_SWAPONOFF is not set
|
||||
# CONFIG_FEATURE_SWAPON_PRI is not set
|
||||
# CONFIG_SWITCH_ROOT is not set
|
||||
CONFIG_SWITCH_ROOT=y
|
||||
# CONFIG_UMOUNT is not set
|
||||
# CONFIG_FEATURE_UMOUNT_ALL is not set
|
||||
# CONFIG_FEATURE_MOUNT_LOOP is not set
|
||||
@@ -633,6 +640,16 @@ CONFIG_FEATURE_VOLUMEID_LINUXRAID=y
|
||||
# Miscellaneous Utilities
|
||||
#
|
||||
# CONFIG_CONSPY is not set
|
||||
CONFIG_LESS=y
|
||||
CONFIG_FEATURE_LESS_MAXLINES=9999999
|
||||
CONFIG_FEATURE_LESS_BRACKETS=y
|
||||
CONFIG_FEATURE_LESS_FLAGS=y
|
||||
CONFIG_FEATURE_LESS_MARKS=y
|
||||
CONFIG_FEATURE_LESS_REGEXP=y
|
||||
CONFIG_FEATURE_LESS_WINCH=y
|
||||
CONFIG_FEATURE_LESS_ASK_TERMINAL=y
|
||||
CONFIG_FEATURE_LESS_DASHCMD=y
|
||||
CONFIG_FEATURE_LESS_LINENUMS=y
|
||||
# CONFIG_NANDWRITE is not set
|
||||
CONFIG_NANDDUMP=y
|
||||
CONFIG_SETSERIAL=y
|
||||
@@ -657,11 +674,11 @@ CONFIG_FEATURE_CHAT_SEND_ESCAPES=y
|
||||
CONFIG_FEATURE_CHAT_VAR_ABORT_LEN=y
|
||||
CONFIG_FEATURE_CHAT_CLR_ABORT=y
|
||||
CONFIG_CHRT=y
|
||||
# CONFIG_CROND is not set
|
||||
# CONFIG_FEATURE_CROND_D is not set
|
||||
# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
|
||||
CONFIG_FEATURE_CROND_DIR=""
|
||||
# CONFIG_CRONTAB is not set
|
||||
CONFIG_CROND=y
|
||||
CONFIG_FEATURE_CROND_D=y
|
||||
CONFIG_FEATURE_CROND_CALL_SENDMAIL=y
|
||||
CONFIG_FEATURE_CROND_DIR="/var/spool/cron"
|
||||
CONFIG_CRONTAB=y
|
||||
CONFIG_DC=y
|
||||
CONFIG_FEATURE_DC_LIBM=y
|
||||
# CONFIG_DEVFSD is not set
|
||||
@@ -682,15 +699,6 @@ CONFIG_INOTIFYD=y
|
||||
# CONFIG_LAST is not set
|
||||
# CONFIG_FEATURE_LAST_SMALL is not set
|
||||
# CONFIG_FEATURE_LAST_FANCY is not set
|
||||
# CONFIG_LESS is not set
|
||||
CONFIG_FEATURE_LESS_MAXLINES=0
|
||||
# CONFIG_FEATURE_LESS_BRACKETS is not set
|
||||
# CONFIG_FEATURE_LESS_FLAGS is not set
|
||||
# CONFIG_FEATURE_LESS_MARKS is not set
|
||||
# CONFIG_FEATURE_LESS_REGEXP is not set
|
||||
# CONFIG_FEATURE_LESS_WINCH is not set
|
||||
# CONFIG_FEATURE_LESS_DASHCMD is not set
|
||||
# CONFIG_FEATURE_LESS_LINENUMS is not set
|
||||
CONFIG_HDPARM=y
|
||||
CONFIG_FEATURE_HDPARM_GET_IDENTITY=y
|
||||
CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF=y
|
||||
@@ -731,9 +739,9 @@ CONFIG_NC=y
|
||||
CONFIG_NC_SERVER=y
|
||||
CONFIG_NC_EXTRA=y
|
||||
# CONFIG_NC_110_COMPAT is not set
|
||||
# CONFIG_PING is not set
|
||||
CONFIG_PING=y
|
||||
# CONFIG_PING6 is not set
|
||||
# CONFIG_FEATURE_FANCY_PING is not set
|
||||
CONFIG_FEATURE_FANCY_PING=y
|
||||
CONFIG_WHOIS=y
|
||||
# CONFIG_FEATURE_IPV6 is not set
|
||||
# CONFIG_FEATURE_UNIX_LOCAL is not set
|
||||
@@ -783,7 +791,7 @@ CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN=y
|
||||
CONFIG_FEATURE_IFUPDOWN_IPV4=y
|
||||
# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set
|
||||
CONFIG_FEATURE_IFUPDOWN_MAPPING=y
|
||||
# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set
|
||||
CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP=y
|
||||
# CONFIG_INETD is not set
|
||||
# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set
|
||||
# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set
|
||||
@@ -817,26 +825,31 @@ CONFIG_PSCAN=y
|
||||
CONFIG_ROUTE=y
|
||||
# CONFIG_SLATTACH is not set
|
||||
CONFIG_TCPSVD=y
|
||||
# CONFIG_TELNET is not set
|
||||
# CONFIG_FEATURE_TELNET_TTYPE is not set
|
||||
# CONFIG_FEATURE_TELNET_AUTOLOGIN is not set
|
||||
# CONFIG_TELNETD is not set
|
||||
# CONFIG_FEATURE_TELNETD_STANDALONE is not set
|
||||
# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set
|
||||
# CONFIG_TFTP is not set
|
||||
# CONFIG_TFTPD is not set
|
||||
# CONFIG_FEATURE_TFTP_GET is not set
|
||||
# CONFIG_FEATURE_TFTP_PUT is not set
|
||||
# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
|
||||
# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
|
||||
CONFIG_TELNET=y
|
||||
CONFIG_FEATURE_TELNET_TTYPE=y
|
||||
CONFIG_FEATURE_TELNET_AUTOLOGIN=y
|
||||
CONFIG_TELNETD=y
|
||||
CONFIG_FEATURE_TELNETD_STANDALONE=y
|
||||
CONFIG_FEATURE_TELNETD_INETD_WAIT=y
|
||||
CONFIG_TFTP=y
|
||||
CONFIG_TFTPD=y
|
||||
|
||||
#
|
||||
# Common options for tftp/tftpd
|
||||
#
|
||||
CONFIG_FEATURE_TFTP_GET=y
|
||||
CONFIG_FEATURE_TFTP_PUT=y
|
||||
CONFIG_FEATURE_TFTP_BLOCKSIZE=y
|
||||
CONFIG_FEATURE_TFTP_PROGRESS_BAR=y
|
||||
# CONFIG_TFTP_DEBUG is not set
|
||||
# CONFIG_TRACEROUTE is not set
|
||||
CONFIG_TRACEROUTE=y
|
||||
# CONFIG_TRACEROUTE6 is not set
|
||||
# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set
|
||||
CONFIG_FEATURE_TRACEROUTE_VERBOSE=y
|
||||
# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set
|
||||
# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set
|
||||
CONFIG_TUNCTL=y
|
||||
CONFIG_FEATURE_TUNCTL_UG=y
|
||||
# CONFIG_UDHCPC6 is not set
|
||||
# CONFIG_UDHCPD is not set
|
||||
# CONFIG_DHCPRELAY is not set
|
||||
# CONFIG_DUMPLEASES is not set
|
||||
@@ -845,15 +858,15 @@ CONFIG_FEATURE_TUNCTL_UG=y
|
||||
CONFIG_DHCPD_LEASES_FILE=""
|
||||
CONFIG_UDHCPC=y
|
||||
CONFIG_FEATURE_UDHCPC_ARPING=y
|
||||
# CONFIG_FEATURE_UDHCP_PORT is not set
|
||||
CONFIG_FEATURE_UDHCP_PORT=y
|
||||
CONFIG_UDHCP_DEBUG=9
|
||||
CONFIG_FEATURE_UDHCP_RFC3397=y
|
||||
CONFIG_FEATURE_UDHCP_8021Q=y
|
||||
CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
|
||||
CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
|
||||
CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n"
|
||||
# CONFIG_UDPSVD is not set
|
||||
# CONFIG_VCONFIG is not set
|
||||
CONFIG_UDPSVD=y
|
||||
CONFIG_VCONFIG=y
|
||||
CONFIG_WGET=y
|
||||
CONFIG_FEATURE_WGET_STATUSBAR=y
|
||||
CONFIG_FEATURE_WGET_AUTHENTICATION=y
|
||||
@@ -890,7 +903,9 @@ CONFIG_POWERTOP=y
|
||||
CONFIG_PSTREE=y
|
||||
CONFIG_PWDX=y
|
||||
CONFIG_SMEMCAP=y
|
||||
# CONFIG_FREE is not set
|
||||
CONFIG_UPTIME=y
|
||||
# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set
|
||||
CONFIG_FREE=y
|
||||
CONFIG_FUSER=y
|
||||
# CONFIG_KILL is not set
|
||||
# CONFIG_KILLALL is not set
|
||||
@@ -900,10 +915,11 @@ CONFIG_PIDOF=y
|
||||
CONFIG_FEATURE_PIDOF_SINGLE=y
|
||||
CONFIG_FEATURE_PIDOF_OMIT=y
|
||||
# CONFIG_PKILL is not set
|
||||
# CONFIG_PS is not set
|
||||
CONFIG_PS=y
|
||||
# CONFIG_FEATURE_PS_WIDE is not set
|
||||
# CONFIG_FEATURE_PS_TIME is not set
|
||||
# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set
|
||||
# CONFIG_FEATURE_PS_LONG is not set
|
||||
CONFIG_FEATURE_PS_TIME=y
|
||||
CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS=y
|
||||
# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set
|
||||
CONFIG_RENICE=y
|
||||
CONFIG_BB_SYSCTL=y
|
||||
@@ -915,7 +931,6 @@ CONFIG_FEATURE_TOP_DECIMALS=y
|
||||
CONFIG_FEATURE_TOP_SMP_PROCESS=y
|
||||
CONFIG_FEATURE_TOPMEM=y
|
||||
CONFIG_FEATURE_SHOW_THREADS=y
|
||||
# CONFIG_UPTIME is not set
|
||||
CONFIG_WATCH=y
|
||||
|
||||
#
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -92,7 +92,7 @@ CONFIG_PREFIX="./_install"
|
||||
# CONFIG_FEATURE_SYSTEMD is not set
|
||||
CONFIG_FEATURE_RTMINMAX=y
|
||||
CONFIG_PASSWORD_MINLEN=6
|
||||
CONFIG_MD5_SIZE_VS_SPEED=2
|
||||
CONFIG_MD5_SMALL=1
|
||||
CONFIG_FEATURE_FAST_TOP=y
|
||||
# CONFIG_FEATURE_ETC_NETWORKS is not set
|
||||
CONFIG_FEATURE_USE_TERMIOS=y
|
||||
|
||||
@@ -90,7 +90,7 @@ CONFIG_PREFIX="./_install"
|
||||
# Busybox Library Tuning
|
||||
#
|
||||
CONFIG_PASSWORD_MINLEN=6
|
||||
CONFIG_MD5_SIZE_VS_SPEED=2
|
||||
CONFIG_MD5_SMALL=1
|
||||
CONFIG_FEATURE_FAST_TOP=y
|
||||
# CONFIG_FEATURE_ETC_NETWORKS is not set
|
||||
CONFIG_FEATURE_USE_TERMIOS=y
|
||||
|
||||
@@ -269,13 +269,6 @@ config FEATURE_FANCY_HEAD
|
||||
help
|
||||
This enables the head options (-c, -q, and -v).
|
||||
|
||||
config HOSTID
|
||||
bool "hostid"
|
||||
default y
|
||||
help
|
||||
hostid prints the numeric identifier (in hexadecimal) for
|
||||
the current host.
|
||||
|
||||
config INSTALL
|
||||
bool "install"
|
||||
default y
|
||||
|
||||
@@ -36,7 +36,6 @@ lib-$(CONFIG_FALSE) += false.o
|
||||
lib-$(CONFIG_FOLD) += fold.o
|
||||
lib-$(CONFIG_FSYNC) += fsync.o
|
||||
lib-$(CONFIG_HEAD) += head.o
|
||||
lib-$(CONFIG_HOSTID) += hostid.o
|
||||
lib-$(CONFIG_INSTALL) += install.o
|
||||
#lib-$(CONFIG_LENGTH) += length.o
|
||||
lib-$(CONFIG_LN) += ln.o
|
||||
|
||||
@@ -31,7 +31,6 @@ int chroot_main(int argc UNUSED_PARAM, char **argv)
|
||||
if (!*argv)
|
||||
bb_show_usage();
|
||||
xchroot(*argv);
|
||||
xchdir("/");
|
||||
|
||||
++argv;
|
||||
if (!*argv) { /* no 2nd param (PROG), use shell */
|
||||
|
||||
+2
-2
@@ -16,9 +16,9 @@
|
||||
*/
|
||||
|
||||
//usage:#define cp_trivial_usage
|
||||
//usage: "[OPTIONS] SOURCE DEST"
|
||||
//usage: "[OPTIONS] SOURCE... DEST"
|
||||
//usage:#define cp_full_usage "\n\n"
|
||||
//usage: "Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY\n"
|
||||
//usage: "Copy SOURCE(s) to DEST\n"
|
||||
//usage: "\n -a Same as -dpR"
|
||||
//usage: IF_SELINUX(
|
||||
//usage: "\n -c Preserve security context"
|
||||
|
||||
@@ -129,6 +129,9 @@
|
||||
//usage: "\n [YYYY.]MM.DD-hh:mm[:ss]"
|
||||
//usage: "\n YYYY-MM-DD hh:mm[:ss]"
|
||||
//usage: "\n [[[[[YY]YY]MM]DD]hh]mm[.ss]"
|
||||
//usage: IF_FEATURE_DATE_COMPAT(
|
||||
//usage: "\n 'date TIME' form accepts MMDDhhmm[[YY]YY][.ss] instead"
|
||||
//usage: )
|
||||
//usage:
|
||||
//usage:#define date_example_usage
|
||||
//usage: "$ date\n"
|
||||
|
||||
+14
-13
@@ -26,11 +26,7 @@
|
||||
//usage:#define du_trivial_usage
|
||||
//usage: "[-aHLdclsx" IF_FEATURE_HUMAN_READABLE("hm") "k] [FILE]..."
|
||||
//usage:#define du_full_usage "\n\n"
|
||||
//usage: "Summarize disk space used for each FILE and/or directory.\n"
|
||||
//usage: "Disk space is printed in units of "
|
||||
//usage: IF_FEATURE_DU_DEFAULT_BLOCKSIZE_1K("1024")
|
||||
//usage: IF_NOT_FEATURE_DU_DEFAULT_BLOCKSIZE_1K("512")
|
||||
//usage: " bytes.\n"
|
||||
//usage: "Summarize disk space used for each FILE and/or directory\n"
|
||||
//usage: "\n -a Show file sizes too"
|
||||
//usage: "\n -L Follow all symlinks"
|
||||
//usage: "\n -H Follow symlinks on command line"
|
||||
@@ -40,11 +36,13 @@
|
||||
//usage: "\n -s Display only a total for each argument"
|
||||
//usage: "\n -x Skip directories on different filesystems"
|
||||
//usage: IF_FEATURE_HUMAN_READABLE(
|
||||
//usage: "\n -h Sizes in human readable format (e.g., 1K 243M 2G )"
|
||||
//usage: "\n -h Sizes in human readable format (e.g., 1K 243M 2G)"
|
||||
//usage: "\n -m Sizes in megabytes"
|
||||
//usage: )
|
||||
//usage: "\n -k Sizes in kilobytes"
|
||||
//usage: IF_FEATURE_DU_DEFAULT_BLOCKSIZE_1K(" (default)")
|
||||
//usage: "\n -k Sizes in kilobytes" IF_FEATURE_DU_DEFAULT_BLOCKSIZE_1K(" (default)")
|
||||
//usage: IF_NOT_FEATURE_DU_DEFAULT_BLOCKSIZE_1K(
|
||||
//usage: "\n Default unit is 512 bytes"
|
||||
//usage: )
|
||||
//usage:
|
||||
//usage:#define du_example_usage
|
||||
//usage: "$ du\n"
|
||||
@@ -88,9 +86,10 @@ struct globals {
|
||||
dev_t dir_dev;
|
||||
} FIX_ALIASING;
|
||||
#define G (*(struct globals*)&bb_common_bufsiz1)
|
||||
#define INIT_G() do { } while (0)
|
||||
|
||||
|
||||
static void print(unsigned long size, const char *filename)
|
||||
static void print(unsigned long long size, const char *filename)
|
||||
{
|
||||
/* TODO - May not want to defer error checking here. */
|
||||
#if ENABLE_FEATURE_HUMAN_READABLE
|
||||
@@ -104,15 +103,15 @@ static void print(unsigned long size, const char *filename)
|
||||
size++;
|
||||
size >>= 1;
|
||||
}
|
||||
printf("%lu\t%s\n", size, filename);
|
||||
printf("%llu\t%s\n", size, filename);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* tiny recursive du */
|
||||
static unsigned long du(const char *filename)
|
||||
static unsigned long long du(const char *filename)
|
||||
{
|
||||
struct stat statbuf;
|
||||
unsigned long sum;
|
||||
unsigned long long sum;
|
||||
|
||||
if (lstat(filename, &statbuf) != 0) {
|
||||
bb_simple_perror_msg(filename);
|
||||
@@ -189,10 +188,12 @@ static unsigned long du(const char *filename)
|
||||
int du_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int du_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
unsigned long total;
|
||||
unsigned long long total;
|
||||
int slink_depth_save;
|
||||
unsigned opt;
|
||||
|
||||
INIT_G();
|
||||
|
||||
#if ENABLE_FEATURE_HUMAN_READABLE
|
||||
IF_FEATURE_DU_DEFAULT_BLOCKSIZE_1K(G.disp_hr = 1024;)
|
||||
IF_NOT_FEATURE_DU_DEFAULT_BLOCKSIZE_1K(G.disp_hr = 512;)
|
||||
|
||||
@@ -100,6 +100,7 @@ struct globals {
|
||||
char **args;
|
||||
} FIX_ALIASING;
|
||||
#define G (*(struct globals*)&bb_common_bufsiz1)
|
||||
#define INIT_G() do { } while (0)
|
||||
|
||||
/* forward declarations */
|
||||
static VALUE *eval(void);
|
||||
@@ -519,6 +520,8 @@ int expr_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
VALUE *v;
|
||||
|
||||
INIT_G();
|
||||
|
||||
xfunc_error_retval = 2; /* coreutils compat */
|
||||
G.args = argv + 1;
|
||||
if (*G.args == NULL) {
|
||||
|
||||
+12
-1
@@ -9,6 +9,17 @@
|
||||
|
||||
/* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */
|
||||
|
||||
//config:config HOSTID
|
||||
//config: bool "hostid"
|
||||
//config: default y
|
||||
//config: help
|
||||
//config: hostid prints the numeric identifier (in hexadecimal) for
|
||||
//config: the current host.
|
||||
|
||||
//applet:IF_HOSTID(APPLET_NOFORK(hostid, hostid, BB_DIR_USR_BIN, BB_SUID_DROP, hostid))
|
||||
|
||||
//kbuild:lib-$(CONFIG_HOSTID) += hostid.o
|
||||
|
||||
//usage:#define hostid_trivial_usage
|
||||
//usage: ""
|
||||
//usage:#define hostid_full_usage "\n\n"
|
||||
@@ -25,7 +36,7 @@ int hostid_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
printf("%lx\n", gethostid());
|
||||
printf("%08lx\n", gethostid());
|
||||
|
||||
return fflush_all();
|
||||
}
|
||||
+2
-2
@@ -69,8 +69,8 @@ int ln_main(int argc, char **argv)
|
||||
src = last;
|
||||
|
||||
if (is_directory(src,
|
||||
(opts & LN_NODEREFERENCE) ^ LN_NODEREFERENCE,
|
||||
NULL)
|
||||
(opts & LN_NODEREFERENCE) ^ LN_NODEREFERENCE
|
||||
)
|
||||
) {
|
||||
src_name = xstrdup(*argv);
|
||||
src = concat_path_file(src, bb_get_last_path_component_strip(src_name));
|
||||
|
||||
+4
-3
@@ -54,7 +54,7 @@ static const char mkdir_longopts[] ALIGN1 =
|
||||
int mkdir_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int mkdir_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
mode_t mode = (mode_t)(-1);
|
||||
long mode = -1;
|
||||
int status = EXIT_SUCCESS;
|
||||
int flags = 0;
|
||||
unsigned opt;
|
||||
@@ -68,10 +68,11 @@ int mkdir_main(int argc UNUSED_PARAM, char **argv)
|
||||
#endif
|
||||
opt = getopt32(argv, "m:p" IF_SELINUX("Z:"), &smode IF_SELINUX(,&scontext));
|
||||
if (opt & 1) {
|
||||
mode = 0777;
|
||||
if (!bb_parse_mode(smode, &mode)) {
|
||||
mode_t mmode = 0777;
|
||||
if (!bb_parse_mode(smode, &mmode)) {
|
||||
bb_error_msg_and_die("invalid mode '%s'", smode);
|
||||
}
|
||||
mode = mmode;
|
||||
}
|
||||
if (opt & 2)
|
||||
flags |= FILEUTILS_RECUR;
|
||||
|
||||
+20
-6
@@ -36,13 +36,12 @@
|
||||
David MacKenzie <djm@gnu.ai.mit.edu>
|
||||
*/
|
||||
|
||||
// 19990508 Busy Boxed! Dave Cinege
|
||||
/* 19990508 Busy Boxed! Dave Cinege */
|
||||
|
||||
//usage:#define printf_trivial_usage
|
||||
//usage: "FORMAT [ARGUMENT]..."
|
||||
//usage: "FORMAT [ARG]..."
|
||||
//usage:#define printf_full_usage "\n\n"
|
||||
//usage: "Format and print ARGUMENT(s) according to FORMAT,\n"
|
||||
//usage: "where FORMAT controls the output exactly as in C printf"
|
||||
//usage: "Format and print ARG(s) according to FORMAT (a-la C printf)"
|
||||
//usage:
|
||||
//usage:#define printf_example_usage
|
||||
//usage: "$ printf \"Val=%d\\n\" 5\n"
|
||||
@@ -132,13 +131,28 @@ static double my_xstrtod(const char *arg)
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Handles %b */
|
||||
static void print_esc_string(const char *str)
|
||||
{
|
||||
char c;
|
||||
while ((c = *str) != '\0') {
|
||||
str++;
|
||||
if (c == '\\')
|
||||
c = bb_process_escape_sequence(&str);
|
||||
if (c == '\\') {
|
||||
/* %b also accepts 4-digit octals of the form \0### */
|
||||
if (*str == '0') {
|
||||
if ((unsigned char)(str[1] - '0') < 8) {
|
||||
/* 2nd char is 0..7: skip leading '0' */
|
||||
str++;
|
||||
}
|
||||
}
|
||||
{
|
||||
/* optimization: don't force arg to be on-stack,
|
||||
* use another variable for that. */
|
||||
const char *z = str;
|
||||
c = bb_process_escape_sequence(&z);
|
||||
str = z;
|
||||
}
|
||||
}
|
||||
putchar(c);
|
||||
}
|
||||
}
|
||||
|
||||
+51
-1
@@ -20,13 +20,63 @@
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
|
||||
static int logical_getcwd(void)
|
||||
{
|
||||
struct stat st1;
|
||||
struct stat st2;
|
||||
char *wd;
|
||||
char *p;
|
||||
|
||||
wd = getenv("PWD");
|
||||
if (!wd || wd[0] != '/')
|
||||
return 0;
|
||||
|
||||
p = wd;
|
||||
while (*p) {
|
||||
/* doing strstr(p, "/.") by hand is smaller and faster... */
|
||||
if (*p++ != '/')
|
||||
continue;
|
||||
if (*p != '.')
|
||||
continue;
|
||||
/* we found "/.", skip to next char */
|
||||
p++;
|
||||
if (*p == '.')
|
||||
p++; /* we found "/.." */
|
||||
if (*p == '\0' || *p == '/')
|
||||
return 0; /* "/./" or "/../" component: bad */
|
||||
}
|
||||
|
||||
if (stat(wd, &st1) != 0)
|
||||
return 0;
|
||||
if (stat(".", &st2) != 0)
|
||||
return 0;
|
||||
if (st1.st_ino != st2.st_ino)
|
||||
return 0;
|
||||
if (st1.st_dev != st2.st_dev)
|
||||
return 0;
|
||||
|
||||
puts(wd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int pwd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int pwd_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
|
||||
{
|
||||
char *buf;
|
||||
|
||||
if (ENABLE_DESKTOP) {
|
||||
/* TODO: assume -L if $POSIXLY_CORRECT? (coreutils does that)
|
||||
* Rationale:
|
||||
* POSIX requires a default of -L, but most scripts expect -P
|
||||
*/
|
||||
unsigned opt = getopt32(argv, "LP");
|
||||
if ((opt & 1) && logical_getcwd())
|
||||
return fflush_all();
|
||||
}
|
||||
|
||||
buf = xrealloc_getcwd_or_warn(NULL);
|
||||
if (buf != NULL) {
|
||||
|
||||
if (buf) {
|
||||
puts(buf);
|
||||
free(buf);
|
||||
return fflush_all();
|
||||
|
||||
+8
-6
@@ -1404,13 +1404,15 @@ int stty_main(int argc UNUSED_PARAM, char **argv)
|
||||
|
||||
/* Specifying both -a and -g is an error */
|
||||
if ((stty_state & (STTY_verbose_output | STTY_recoverable_output)) ==
|
||||
(STTY_verbose_output | STTY_recoverable_output))
|
||||
bb_error_msg_and_die("verbose and stty-readable output styles are mutually exclusive");
|
||||
/* Specifying -a or -g with non-options is an error */
|
||||
if (!(stty_state & STTY_noargs)
|
||||
&& (stty_state & (STTY_verbose_output | STTY_recoverable_output))
|
||||
(STTY_verbose_output | STTY_recoverable_output)
|
||||
) {
|
||||
bb_error_msg_and_die("modes may not be set when specifying an output style");
|
||||
bb_error_msg_and_die("-a and -g are mutually exclusive");
|
||||
}
|
||||
/* Specifying -a or -g with non-options is an error */
|
||||
if ((stty_state & (STTY_verbose_output | STTY_recoverable_output))
|
||||
&& !(stty_state & STTY_noargs)
|
||||
) {
|
||||
bb_error_msg_and_die("modes may not be set when -a or -g is used");
|
||||
}
|
||||
|
||||
/* Now it is safe to start doing things */
|
||||
|
||||
@@ -62,6 +62,7 @@ struct globals {
|
||||
bool exitcode;
|
||||
} FIX_ALIASING;
|
||||
#define G (*(struct globals*)&bb_common_bufsiz1)
|
||||
#define INIT_G() do { } while (0)
|
||||
|
||||
static void tail_xprint_header(const char *fmt, const char *filename)
|
||||
{
|
||||
@@ -120,6 +121,8 @@ int tail_main(int argc, char **argv)
|
||||
int *fds;
|
||||
const char *fmt;
|
||||
|
||||
INIT_G();
|
||||
|
||||
#if ENABLE_INCLUDE_SUSv2 || ENABLE_FEATURE_FANCY_TAIL
|
||||
/* Allow legacy syntax of an initial numeric option without -n. */
|
||||
if (argv[1] && (argv[1][0] == '+' || argv[1][0] == '-')
|
||||
|
||||
+8
-7
@@ -710,7 +710,8 @@ static number_t nexpr(enum token n)
|
||||
if (n == EOI) {
|
||||
/* special case: [ ! ], [ a -a ! ] are valid */
|
||||
/* IOW, "! ARG" may miss ARG */
|
||||
unnest_msg("<nexpr:1 (!EOI)\n");
|
||||
args--;
|
||||
unnest_msg("<nexpr:1 (!EOI), args:%s(%p)\n", args[0], &args[0]);
|
||||
return 1;
|
||||
}
|
||||
res = !nexpr(n);
|
||||
@@ -729,15 +730,15 @@ static number_t aexpr(enum token n)
|
||||
|
||||
nest_msg(">aexpr(%s)\n", TOKSTR[n]);
|
||||
res = nexpr(n);
|
||||
dbg_msg("aexpr: nexpr:%lld, next args:%s\n", res, args[1]);
|
||||
dbg_msg("aexpr: nexpr:%lld, next args:%s(%p)\n", res, args[1], &args[1]);
|
||||
if (check_operator(*++args) == BAND) {
|
||||
dbg_msg("aexpr: arg is AND, next args:%s\n", args[1]);
|
||||
dbg_msg("aexpr: arg is AND, next args:%s(%p)\n", args[1], &args[1]);
|
||||
res = aexpr(check_operator(*++args)) && res;
|
||||
unnest_msg("<aexpr:%lld\n", res);
|
||||
return res;
|
||||
}
|
||||
args--;
|
||||
unnest_msg("<aexpr:%lld, args:%s\n", res, args[0]);
|
||||
unnest_msg("<aexpr:%lld, args:%s(%p)\n", res, args[0], &args[0]);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -748,15 +749,15 @@ static number_t oexpr(enum token n)
|
||||
|
||||
nest_msg(">oexpr(%s)\n", TOKSTR[n]);
|
||||
res = aexpr(n);
|
||||
dbg_msg("oexpr: aexpr:%lld, next args:%s\n", res, args[1]);
|
||||
dbg_msg("oexpr: aexpr:%lld, next args:%s(%p)\n", res, args[1], &args[1]);
|
||||
if (check_operator(*++args) == BOR) {
|
||||
dbg_msg("oexpr: next arg is OR, next args:%s\n", args[1]);
|
||||
dbg_msg("oexpr: next arg is OR, next args:%s(%p)\n", args[1], &args[1]);
|
||||
res = oexpr(check_operator(*++args)) || res;
|
||||
unnest_msg("<oexpr:%lld\n", res);
|
||||
return res;
|
||||
}
|
||||
args--;
|
||||
unnest_msg("<oexpr:%lld, args:%s\n", res, args[0]);
|
||||
unnest_msg("<oexpr:%lld, args:%s(%p)\n", res, args[0], &args[0]);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
+17
-9
@@ -7,7 +7,7 @@
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
|
||||
/* BB_AUDIT SUSv3 _NOT_ compliant -- options -a, -m, -r, -t not supported. */
|
||||
/* BB_AUDIT SUSv3 _NOT_ compliant -- options -a, -m not supported. */
|
||||
/* http://www.opengroup.org/onlinepubs/007904975/utilities/touch.html */
|
||||
|
||||
/* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org)
|
||||
@@ -25,18 +25,26 @@
|
||||
//config: help
|
||||
//config: touch is used to create or change the access and/or
|
||||
//config: modification timestamp of specified files.
|
||||
//config:
|
||||
//config:config FEATURE_TOUCH_SUSV3
|
||||
//config: bool "Add support for SUSV3 features (-d -t -r)"
|
||||
//config: default y
|
||||
//config: depends on TOUCH
|
||||
//config: help
|
||||
//config: Enable touch to use a reference file or a given date/time argument.
|
||||
|
||||
//applet:IF_TOUCH(APPLET_NOFORK(touch, touch, BB_DIR_BIN, BB_SUID_DROP, touch))
|
||||
|
||||
//kbuild:lib-$(CONFIG_TOUCH) += touch.o
|
||||
|
||||
//usage:#define touch_trivial_usage
|
||||
//usage: "[-c]" IF_DESKTOP(" [-d DATE] [-r FILE]") " FILE [FILE]..."
|
||||
//usage: "[-c]" IF_FEATURE_TOUCH_SUSV3(" [-d DATE] [-t DATE] [-r FILE]") " FILE..."
|
||||
//usage:#define touch_full_usage "\n\n"
|
||||
//usage: "Update the last-modified date on the given FILE[s]\n"
|
||||
//usage: "\n -c Don't create files"
|
||||
//usage: IF_DESKTOP(
|
||||
//usage: IF_FEATURE_TOUCH_SUSV3(
|
||||
//usage: "\n -d DT Date/time to use"
|
||||
//usage: "\n -t DT Date/time to use"
|
||||
//usage: "\n -r FILE Use FILE's date/time"
|
||||
//usage: )
|
||||
//usage:
|
||||
@@ -71,7 +79,7 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
|
||||
int fd;
|
||||
int status = EXIT_SUCCESS;
|
||||
int opts;
|
||||
#if ENABLE_DESKTOP
|
||||
#if ENABLE_FEATURE_TOUCH_SUSV3
|
||||
# if ENABLE_LONG_OPTS
|
||||
static const char touch_longopts[] ALIGN1 =
|
||||
/* name, has_arg, val */
|
||||
@@ -90,17 +98,17 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
|
||||
# define timebuf ((struct timeval*)NULL)
|
||||
#endif
|
||||
|
||||
#if ENABLE_DESKTOP && ENABLE_LONG_OPTS
|
||||
#if ENABLE_FEATURE_TOUCH_SUSV3 && ENABLE_LONG_OPTS
|
||||
applet_long_options = touch_longopts;
|
||||
#endif
|
||||
/* -d and -t both set time. In coreutils,
|
||||
* accepted data format differs a bit between -d and -t.
|
||||
* We accept the same formats for both */
|
||||
opts = getopt32(argv, "c" IF_DESKTOP("r:d:t:")
|
||||
opts = getopt32(argv, "c" IF_FEATURE_TOUCH_SUSV3("r:d:t:")
|
||||
/*ignored:*/ "fma"
|
||||
IF_DESKTOP(, &reference_file)
|
||||
IF_DESKTOP(, &date_str)
|
||||
IF_DESKTOP(, &date_str)
|
||||
IF_FEATURE_TOUCH_SUSV3(, &reference_file)
|
||||
IF_FEATURE_TOUCH_SUSV3(, &date_str)
|
||||
IF_FEATURE_TOUCH_SUSV3(, &date_str)
|
||||
);
|
||||
|
||||
opts &= 1; /* only -c bit is left */
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
//usage: "[-o OUTFILE] [INFILE]"
|
||||
//usage:#define uudecode_full_usage "\n\n"
|
||||
//usage: "Uudecode a file\n"
|
||||
//usage: "Finds outfile name in uuencoded source unless -o is given"
|
||||
//usage: "Finds OUTFILE in uuencoded source unless -o is given"
|
||||
//usage:
|
||||
//usage:#define uudecode_example_usage
|
||||
//usage: "$ uudecode -o busybox busybox.uu\n"
|
||||
@@ -125,10 +125,11 @@ int uudecode_main(int argc UNUSED_PARAM, char **argv)
|
||||
mode = bb_strtou(line_ptr, NULL, 8);
|
||||
if (outname == NULL) {
|
||||
outname = strchr(line_ptr, ' ');
|
||||
if ((outname == NULL) || (*outname == '\0')) {
|
||||
if (!outname)
|
||||
break;
|
||||
}
|
||||
outname++;
|
||||
if (!outname[0])
|
||||
break;
|
||||
}
|
||||
dst_stream = stdout;
|
||||
if (NOT_LONE_DASH(outname)) {
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
*/
|
||||
|
||||
//usage:#define uuencode_trivial_usage
|
||||
//usage: "[-m] [INFILE] STORED_FILENAME"
|
||||
//usage: "[-m] [FILE] STORED_FILENAME"
|
||||
//usage:#define uuencode_full_usage "\n\n"
|
||||
//usage: "Uuencode a file to stdout\n"
|
||||
//usage: "Uuencode FILE (or stdin) to stdout\n"
|
||||
//usage: "\n -m Use base64 encoding per RFC1521"
|
||||
//usage:
|
||||
//usage:#define uuencode_example_usage
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
//usage:#define who_full_usage "\n\n"
|
||||
//usage: "Show who is logged on\n"
|
||||
//usage: "\n -a Show all"
|
||||
//usage: "\n -H Print column headers"
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
|
||||
+20
-3
@@ -41,6 +41,7 @@
|
||||
////usage: "\n -q Fail silently on errors" - we ignore this opt
|
||||
//usage: "\n -t Prepend base directory name to TEMPLATE"
|
||||
//usage: "\n -p DIR Use DIR as a base directory (implies -t)"
|
||||
//usage: "\n -u Do not create anything; print a name"
|
||||
//usage: "\n"
|
||||
//usage: "\nBase directory is: -p DIR, else $TMPDIR, else /tmp"
|
||||
//usage:
|
||||
@@ -63,6 +64,7 @@ int mktemp_main(int argc UNUSED_PARAM, char **argv)
|
||||
OPT_q = 1 << 1,
|
||||
OPT_t = 1 << 2,
|
||||
OPT_p = 1 << 3,
|
||||
OPT_u = 1 << 4,
|
||||
};
|
||||
|
||||
path = getenv("TMPDIR");
|
||||
@@ -71,7 +73,7 @@ int mktemp_main(int argc UNUSED_PARAM, char **argv)
|
||||
|
||||
/* -q is ignored */
|
||||
opt_complementary = "?1"; /* 1 argument max */
|
||||
opts = getopt32(argv, "dqtp:", &path);
|
||||
opts = getopt32(argv, "dqtp:u", &path);
|
||||
|
||||
chp = argv[optind];
|
||||
if (!chp) {
|
||||
@@ -81,6 +83,22 @@ int mktemp_main(int argc UNUSED_PARAM, char **argv)
|
||||
chp = xstrdup("tmp.XXXXXX");
|
||||
opts |= OPT_t;
|
||||
}
|
||||
|
||||
if (opts & OPT_u) {
|
||||
/* Remove (up to) 6 X's */
|
||||
unsigned len = strlen(chp);
|
||||
int cnt = len > 6 ? 6 : len;
|
||||
while (--cnt >= 0 && chp[--len] == 'X')
|
||||
chp[len] = '\0';
|
||||
|
||||
chp = tempnam(opts & (OPT_t|OPT_p) ? path : "./", chp);
|
||||
if (!chp)
|
||||
return EXIT_FAILURE;
|
||||
if (!(opts & (OPT_t|OPT_p)))
|
||||
chp += 2;
|
||||
goto ret;
|
||||
}
|
||||
|
||||
if (opts & (OPT_t|OPT_p))
|
||||
chp = concat_path_file(path, chp);
|
||||
|
||||
@@ -91,8 +109,7 @@ int mktemp_main(int argc UNUSED_PARAM, char **argv)
|
||||
if (mkstemp(chp) < 0)
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
ret:
|
||||
puts(chp);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -66,6 +66,7 @@ struct globals {
|
||||
#define names (G.names)
|
||||
#define cur (G.cur )
|
||||
#define cmd (G.cmd )
|
||||
#define INIT_G() do { } while (0)
|
||||
|
||||
enum { NUM_CMD = (COMMON_BUFSIZE - sizeof(G)) / sizeof(cmd[0]) - 1 };
|
||||
|
||||
@@ -143,6 +144,8 @@ int run_parts_main(int argc UNUSED_PARAM, char **argv)
|
||||
unsigned n;
|
||||
int ret;
|
||||
|
||||
INIT_G();
|
||||
|
||||
#if ENABLE_FEATURE_RUN_PARTS_LONG_OPTIONS
|
||||
applet_long_options = runparts_longopts;
|
||||
#endif
|
||||
|
||||
@@ -31,7 +31,8 @@ Options controlling process matching
|
||||
[TODO: can PROCESS_NAME be a full pathname? Should we require full match then
|
||||
with /proc/$PID/exe or argv[0] (comm can't be matched, it never contains path)]
|
||||
-x,--exec EXECUTABLE Look for processes that were started with this
|
||||
command in /proc/$PID/cmdline.
|
||||
command in /proc/$PID/exe and /proc/$PID/cmdline
|
||||
(/proc/$PID/cmdline is a bbox extension)
|
||||
Unlike -n, we match against the full path:
|
||||
"ntpd" != "./ntpd" != "/path/to/ntpd"
|
||||
-p,--pidfile PID_FILE Look for processes with PID from this file
|
||||
@@ -68,7 +69,7 @@ Misc options:
|
||||
//usage: "\n -n,--name NAME Match processes with NAME"
|
||||
//usage: "\n in comm field in /proc/PID/stat"
|
||||
//usage: "\n -x,--exec EXECUTABLE Match processes with this command"
|
||||
//usage: "\n in /proc/PID/cmdline"
|
||||
//usage: "\n in /proc/PID/{exe,cmdline}"
|
||||
//usage: "\n -p,--pidfile FILE Match a process with PID from the file"
|
||||
//usage: "\n All specified conditions must match"
|
||||
//usage: "\n-S only:"
|
||||
@@ -198,8 +199,18 @@ static int pid_is_exec(pid_t pid)
|
||||
{
|
||||
ssize_t bytes;
|
||||
char buf[sizeof("/proc/%u/cmdline") + sizeof(int)*3];
|
||||
char *procname, *exelink;
|
||||
int match;
|
||||
|
||||
sprintf(buf, "/proc/%u/cmdline", (unsigned)pid);
|
||||
procname = buf + sprintf(buf, "/proc/%u/exe", (unsigned)pid) - 3;
|
||||
|
||||
exelink = xmalloc_readlink(buf);
|
||||
match = (exelink && strcmp(execname, exelink) == 0);
|
||||
free(exelink);
|
||||
if (match)
|
||||
return match;
|
||||
|
||||
strcpy(procname, "cmdline");
|
||||
bytes = open_read_close(buf, G.execname_cmpbuf, G.execname_sizeof);
|
||||
if (bytes > 0) {
|
||||
G.execname_cmpbuf[bytes] = '\0';
|
||||
@@ -474,7 +485,7 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv)
|
||||
*--argv = startas;
|
||||
if (opt & OPT_BACKGROUND) {
|
||||
#if BB_MMU
|
||||
bb_daemonize(DAEMON_DEVNULL_STDIO + DAEMON_CLOSE_EXTRA_FDS);
|
||||
bb_daemonize(DAEMON_DEVNULL_STDIO + DAEMON_CLOSE_EXTRA_FDS + DAEMON_DOUBLE_FORK);
|
||||
/* DAEMON_DEVNULL_STDIO is superfluous -
|
||||
* it's always done by bb_daemonize() */
|
||||
#else
|
||||
@@ -502,8 +513,16 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv)
|
||||
if (opt & OPT_c) {
|
||||
struct bb_uidgid_t ugid = { -1, -1 };
|
||||
parse_chown_usergroup_or_die(&ugid, chuid);
|
||||
if (ugid.gid != (gid_t) -1) xsetgid(ugid.gid);
|
||||
if (ugid.uid != (uid_t) -1) xsetuid(ugid.uid);
|
||||
if (ugid.uid != (uid_t) -1) {
|
||||
struct passwd *pw = xgetpwuid(ugid.uid);
|
||||
if (ugid.gid != (gid_t) -1)
|
||||
pw->pw_gid = ugid.gid;
|
||||
/* initgroups, setgid, setuid: */
|
||||
change_identity(pw);
|
||||
} else if (ugid.gid != (gid_t) -1) {
|
||||
xsetgid(ugid.gid);
|
||||
setgroups(1, &ugid.gid);
|
||||
}
|
||||
}
|
||||
#if ENABLE_FEATURE_START_STOP_DAEMON_FANCY
|
||||
if (opt & OPT_NICELEVEL) {
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
<p>Before looking at the Linux implementation, first a general Unix
|
||||
description of threads, processes, process groups and sessions.
|
||||
</p><p>
|
||||
(See also <a href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap11.html">General Terminal Interface</a>)
|
||||
</p><p>A session contains a number of process groups, and a process group
|
||||
contains a number of processes, and a process contains a number
|
||||
of threads.
|
||||
@@ -277,6 +279,7 @@ and inspect it by
|
||||
Again, if TOSTOP is set but the background process ignores or blocks
|
||||
the SIGTTOU signal, or if its process group is orphaned (see below),
|
||||
then the write() returns an EIO error, and no signal is sent.
|
||||
[vda: correction. SUS says that if SIGTTOU is blocked/ignored, write succeeds. ]
|
||||
<p>
|
||||
</p><h3>Orphaned process groups</h3>
|
||||
|
||||
|
||||
+9
-3
@@ -51,19 +51,25 @@ device nodes if your system needs something more than the default root/root
|
||||
660 permissions.
|
||||
|
||||
The file has the format:
|
||||
<device regex> <uid>:<gid> <permissions>
|
||||
or @<maj[,min1[-min2]]> <uid>:<gid> <permissions>
|
||||
[-]<device regex> <uid>:<gid> <permissions>
|
||||
or
|
||||
@<maj[,min1[-min2]]> <uid>:<gid> <permissions>
|
||||
or
|
||||
$envvar=<regex> <uid>:<gid> <permissions>
|
||||
|
||||
For example:
|
||||
hd[a-z][0-9]* 0:3 660
|
||||
hd[a-z][0-9]* 0:3 660
|
||||
|
||||
The config file parsing stops at the first matching line. If no line is
|
||||
matched, then the default of 0:0 660 is used. To set your own default, simply
|
||||
create your own total match like so:
|
||||
|
||||
.* 1:1 777
|
||||
|
||||
You can rename/move device nodes by using the next optional field.
|
||||
|
||||
<device regex> <uid>:<gid> <permissions> [=path]
|
||||
|
||||
So if you want to place the device node into a subdirectory, make sure the path
|
||||
has a trailing /. If you want to rename the device node, just place the name.
|
||||
hda 0:3 660 =drives/
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
/* Constants and structures */
|
||||
#include "e2fs_defs.h"
|
||||
#include "bb_e2fs_defs.h"
|
||||
|
||||
PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
|
||||
|
||||
|
||||
@@ -575,8 +575,12 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
|
||||
printf("need to revalidate %s (time since last check %lu)\n",
|
||||
dev->bid_name, diff));
|
||||
|
||||
if (((fd = open(dev->bid_name, O_RDONLY)) < 0) ||
|
||||
(fstat(fd, &st) < 0)) {
|
||||
fd = open(dev->bid_name, O_RDONLY);
|
||||
if (fd < 0
|
||||
|| fstat(fd, &st) < 0
|
||||
) {
|
||||
if (fd >= 0)
|
||||
close(fd);
|
||||
if (errno == ENXIO || errno == ENODEV || errno == ENOENT) {
|
||||
blkid_free_dev(dev);
|
||||
return NULL;
|
||||
@@ -653,6 +657,7 @@ try_again:
|
||||
|
||||
if (!dev->bid_type) {
|
||||
blkid_free_dev(dev);
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -11577,7 +11577,7 @@ static void check_resize_inode(e2fsck_t ctx)
|
||||
* s_reserved_gdt_blocks must be zero.
|
||||
*/
|
||||
if (!(fs->super->s_feature_compat &
|
||||
EXT2_FEATURE_COMPAT_RESIZE_INODE)) {
|
||||
EXT2_FEATURE_COMPAT_RESIZE_INO)) {
|
||||
if (fs->super->s_reserved_gdt_blocks) {
|
||||
pctx.num = fs->super->s_reserved_gdt_blocks;
|
||||
if (fix_problem(ctx, PR_0_NONZERO_RESERVED_GDT_BLOCKS,
|
||||
@@ -11593,7 +11593,7 @@ static void check_resize_inode(e2fsck_t ctx)
|
||||
retval = ext2fs_read_inode(fs, EXT2_RESIZE_INO, &inode);
|
||||
if (retval) {
|
||||
if (fs->super->s_feature_compat &
|
||||
EXT2_FEATURE_COMPAT_RESIZE_INODE)
|
||||
EXT2_FEATURE_COMPAT_RESIZE_INO)
|
||||
ctx->flags |= E2F_FLAG_RESIZE_INODE;
|
||||
return;
|
||||
}
|
||||
@@ -11603,7 +11603,7 @@ static void check_resize_inode(e2fsck_t ctx)
|
||||
* the resize inode is cleared; then we're done.
|
||||
*/
|
||||
if (!(fs->super->s_feature_compat &
|
||||
EXT2_FEATURE_COMPAT_RESIZE_INODE)) {
|
||||
EXT2_FEATURE_COMPAT_RESIZE_INO)) {
|
||||
for (i=0; i < EXT2_N_BLOCKS; i++) {
|
||||
if (inode.i_block[i])
|
||||
break;
|
||||
|
||||
@@ -34,7 +34,7 @@ static const struct feature feature_list[] = {
|
||||
"ext_attr" },
|
||||
{ E2P_FEATURE_COMPAT, EXT2_FEATURE_COMPAT_DIR_INDEX,
|
||||
"dir_index" },
|
||||
{ E2P_FEATURE_COMPAT, EXT2_FEATURE_COMPAT_RESIZE_INODE,
|
||||
{ E2P_FEATURE_COMPAT, EXT2_FEATURE_COMPAT_RESIZE_INO,
|
||||
"resize_inode" },
|
||||
{ E2P_FEATURE_RO_INCOMPAT, EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER,
|
||||
"sparse_super" },
|
||||
|
||||
@@ -475,7 +475,7 @@ struct ext2_super_block {
|
||||
#define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002
|
||||
#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004
|
||||
#define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008
|
||||
#define EXT2_FEATURE_COMPAT_RESIZE_INODE 0x0010
|
||||
#define EXT2_FEATURE_COMPAT_RESIZE_INO 0x0010
|
||||
#define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020
|
||||
|
||||
#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
|
||||
|
||||
@@ -383,7 +383,7 @@ typedef struct ext2_icount *ext2_icount_t;
|
||||
#define EXT2_LIB_FEATURE_COMPAT_SUPP (EXT2_FEATURE_COMPAT_DIR_PREALLOC|\
|
||||
EXT2_FEATURE_COMPAT_IMAGIC_INODES|\
|
||||
EXT3_FEATURE_COMPAT_HAS_JOURNAL|\
|
||||
EXT2_FEATURE_COMPAT_RESIZE_INODE|\
|
||||
EXT2_FEATURE_COMPAT_RESIZE_INO|\
|
||||
EXT2_FEATURE_COMPAT_DIR_INDEX|\
|
||||
EXT2_FEATURE_COMPAT_EXT_ATTR)
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ retry:
|
||||
/*
|
||||
* check the number of reserved group descriptor table blocks
|
||||
*/
|
||||
if (super->s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INODE)
|
||||
if (super->s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INO)
|
||||
rsv_gdt = calc_reserved_gdt_blocks(fs);
|
||||
else
|
||||
rsv_gdt = 0;
|
||||
|
||||
@@ -757,7 +757,7 @@ static void parse_extended_opts(struct ext2_super_block *sb_param,
|
||||
|
||||
if (rsv_gdb > 0) {
|
||||
sb_param->s_feature_compat |=
|
||||
EXT2_FEATURE_COMPAT_RESIZE_INODE;
|
||||
EXT2_FEATURE_COMPAT_RESIZE_INO;
|
||||
|
||||
sb_param->s_reserved_gdt_blocks = rsv_gdb;
|
||||
}
|
||||
@@ -778,7 +778,7 @@ static void parse_extended_opts(struct ext2_super_block *sb_param,
|
||||
|
||||
static __u32 ok_features[3] = {
|
||||
EXT3_FEATURE_COMPAT_HAS_JOURNAL |
|
||||
EXT2_FEATURE_COMPAT_RESIZE_INODE |
|
||||
EXT2_FEATURE_COMPAT_RESIZE_INO |
|
||||
EXT2_FEATURE_COMPAT_DIR_INDEX, /* Compat */
|
||||
EXT2_FEATURE_INCOMPAT_FILETYPE| /* Incompat */
|
||||
EXT3_FEATURE_INCOMPAT_JOURNAL_DEV|
|
||||
@@ -1123,7 +1123,7 @@ static int PRS(int argc, char **argv)
|
||||
/* Since sparse_super is the default, we would only have a problem
|
||||
* here if it was explicitly disabled.
|
||||
*/
|
||||
if ((param.s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INODE) &&
|
||||
if ((param.s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INO) &&
|
||||
!(param.s_feature_ro_compat&EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)) {
|
||||
bb_error_msg_and_die("reserved online resize blocks not supported "
|
||||
"on non-sparse filesystem");
|
||||
@@ -1312,7 +1312,7 @@ int mke2fs_main (int argc, char **argv)
|
||||
reserve_inodes(fs);
|
||||
create_bad_block_inode(fs, bb_list);
|
||||
if (fs->super->s_feature_compat &
|
||||
EXT2_FEATURE_COMPAT_RESIZE_INODE) {
|
||||
EXT2_FEATURE_COMPAT_RESIZE_INO) {
|
||||
retval = ext2fs_create_resize_inode(fs);
|
||||
mke2fs_error_msg_and_die(retval, "reserve blocks for online resize");
|
||||
}
|
||||
|
||||
+12
-5
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
#include "libbb.h"
|
||||
#include <linux/fs.h>
|
||||
#include <linux/ext2_fs.h>
|
||||
#include "bb_e2fs_defs.h"
|
||||
|
||||
// storage helpers
|
||||
char BUG_wrong_field_size(void);
|
||||
@@ -28,12 +28,13 @@ do { \
|
||||
(sizeof(field) == 4 ? SWAP_LE32(field) : BUG_wrong_field_size())
|
||||
|
||||
//usage:#define tune2fs_trivial_usage
|
||||
//usage: "[-c MOUNT_CNT] "
|
||||
//usage: "[-c MAX_MOUNT_COUNT] "
|
||||
////usage: "[-e errors-behavior] [-g group] "
|
||||
//usage: "[-i DAYS] "
|
||||
////usage: "[-j] [-J journal-options] [-l] [-s sparse-flag] "
|
||||
////usage: "[-m reserved-blocks-percent] [-o [^]mount-options[,...]] "
|
||||
////usage: "[-r reserved-blocks-count] [-u user] [-C mount-count] "
|
||||
////usage: "[-r reserved-blocks-count] [-u user] "
|
||||
//usage: "[-C MOUNT_COUNT] "
|
||||
//usage: "[-L LABEL] "
|
||||
////usage: "[-M last-mounted-dir] [-O [^]feature[,...]] "
|
||||
////usage: "[-T last-check-time] [-U UUID] "
|
||||
@@ -46,18 +47,19 @@ enum {
|
||||
OPT_L = 1 << 0, // label
|
||||
OPT_c = 1 << 1, // max mount count
|
||||
OPT_i = 1 << 2, // check interval
|
||||
OPT_C = 1 << 3, // current mount count
|
||||
};
|
||||
|
||||
int tune2fs_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int tune2fs_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
unsigned opts;
|
||||
const char *label, *str_c, *str_i;
|
||||
const char *label, *str_c, *str_i, *str_C;
|
||||
struct ext2_super_block *sb;
|
||||
int fd;
|
||||
|
||||
opt_complementary = "=1";
|
||||
opts = getopt32(argv, "L:c:i:", &label, &str_c, &str_i);
|
||||
opts = getopt32(argv, "L:c:i:C:", &label, &str_c, &str_i, &str_C);
|
||||
if (!opts)
|
||||
bb_show_usage();
|
||||
argv += optind; // argv[0] -- device
|
||||
@@ -71,6 +73,11 @@ int tune2fs_main(int argc UNUSED_PARAM, char **argv)
|
||||
// mangle superblock
|
||||
//STORE_LE(sb->s_wtime, time(NULL)); - why bother?
|
||||
|
||||
if (opts & OPT_C) {
|
||||
int n = xatoi_range(str_C, 1, 0xfffe);
|
||||
STORE_LE(sb->s_mnt_count, (unsigned)n);
|
||||
}
|
||||
|
||||
// set the label
|
||||
if (opts & OPT_L)
|
||||
safe_strncpy((char *)sb->s_volume_name, label, sizeof(sb->s_volume_name));
|
||||
|
||||
+76
-18
@@ -25,6 +25,7 @@
|
||||
* to perform debug printfs to stderr: */
|
||||
#define debug_printf_walker(...) do {} while (0)
|
||||
#define debug_printf_eval(...) do {} while (0)
|
||||
#define debug_printf_parse(...) do {} while (0)
|
||||
|
||||
#ifndef debug_printf_walker
|
||||
# define debug_printf_walker(...) (fprintf(stderr, __VA_ARGS__))
|
||||
@@ -32,6 +33,9 @@
|
||||
#ifndef debug_printf_eval
|
||||
# define debug_printf_eval(...) (fprintf(stderr, __VA_ARGS__))
|
||||
#endif
|
||||
#ifndef debug_printf_parse
|
||||
# define debug_printf_parse(...) (fprintf(stderr, __VA_ARGS__))
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -238,6 +242,9 @@ typedef struct tsplitter_s {
|
||||
* For builtins it has different meaning: n n s3 s2 s1 v3 v2 v1,
|
||||
* n - min. number of args, vN - resolve Nth arg to var, sN - resolve to string
|
||||
*/
|
||||
#undef P
|
||||
#undef PRIMASK
|
||||
#undef PRIMASK2
|
||||
#define P(x) (x << 24)
|
||||
#define PRIMASK 0x7F000000
|
||||
#define PRIMASK2 0x7E000000
|
||||
@@ -432,13 +439,13 @@ struct globals {
|
||||
smallint nextrec;
|
||||
smallint nextfile;
|
||||
smallint is_f0_split;
|
||||
smallint t_rollback;
|
||||
};
|
||||
struct globals2 {
|
||||
uint32_t t_info; /* often used */
|
||||
uint32_t t_tclass;
|
||||
char *t_string;
|
||||
int t_lineno;
|
||||
int t_rollback;
|
||||
|
||||
var *intvar[NUM_INTERNAL_VARS]; /* often used */
|
||||
|
||||
@@ -496,11 +503,11 @@ struct globals2 {
|
||||
#define nextrec (G1.nextrec )
|
||||
#define nextfile (G1.nextfile )
|
||||
#define is_f0_split (G1.is_f0_split )
|
||||
#define t_rollback (G1.t_rollback )
|
||||
#define t_info (G.t_info )
|
||||
#define t_tclass (G.t_tclass )
|
||||
#define t_string (G.t_string )
|
||||
#define t_lineno (G.t_lineno )
|
||||
#define t_rollback (G.t_rollback )
|
||||
#define intvar (G.intvar )
|
||||
#define fsplitter (G.fsplitter )
|
||||
#define rsplitter (G.rsplitter )
|
||||
@@ -1008,6 +1015,7 @@ static uint32_t next_token(uint32_t expected)
|
||||
|
||||
if (*p == '\0') {
|
||||
tc = TC_EOF;
|
||||
debug_printf_parse("%s: token found: TC_EOF\n", __func__);
|
||||
|
||||
} else if (*p == '\"') {
|
||||
/* it's a string */
|
||||
@@ -1023,6 +1031,7 @@ static uint32_t next_token(uint32_t expected)
|
||||
p++;
|
||||
*s = '\0';
|
||||
tc = TC_STRING;
|
||||
debug_printf_parse("%s: token found:'%s' TC_STRING\n", __func__, t_string);
|
||||
|
||||
} else if ((expected & TC_REGEXP) && *p == '/') {
|
||||
/* it's regexp */
|
||||
@@ -1045,6 +1054,7 @@ static uint32_t next_token(uint32_t expected)
|
||||
p++;
|
||||
*s = '\0';
|
||||
tc = TC_REGEXP;
|
||||
debug_printf_parse("%s: token found:'%s' TC_REGEXP\n", __func__, t_string);
|
||||
|
||||
} else if (*p == '.' || isdigit(*p)) {
|
||||
/* it's a number */
|
||||
@@ -1054,6 +1064,7 @@ static uint32_t next_token(uint32_t expected)
|
||||
if (*p == '.')
|
||||
syntax_error(EMSG_UNEXP_TOKEN);
|
||||
tc = TC_NUMBER;
|
||||
debug_printf_parse("%s: token found:%f TC_NUMBER\n", __func__, t_double);
|
||||
|
||||
} else {
|
||||
/* search for something known */
|
||||
@@ -1076,6 +1087,7 @@ static uint32_t next_token(uint32_t expected)
|
||||
) {
|
||||
/* then this is what we are looking for */
|
||||
t_info = *ti;
|
||||
debug_printf_parse("%s: token found:'%.*s' t_info:%x\n", __func__, l, p, t_info);
|
||||
p += l;
|
||||
goto token_found;
|
||||
}
|
||||
@@ -1099,14 +1111,17 @@ static uint32_t next_token(uint32_t expected)
|
||||
p = skip_spaces(p);
|
||||
if (*p == '(') {
|
||||
tc = TC_FUNCTION;
|
||||
debug_printf_parse("%s: token found:'%s' TC_FUNCTION\n", __func__, t_string);
|
||||
} else {
|
||||
if (*p == '[') {
|
||||
p++;
|
||||
tc = TC_ARRAY;
|
||||
}
|
||||
debug_printf_parse("%s: token found:'%s' TC_ARRAY\n", __func__, t_string);
|
||||
} else
|
||||
debug_printf_parse("%s: token found:'%s' TC_VARIABLE\n", __func__, t_string);
|
||||
}
|
||||
token_found: ;
|
||||
}
|
||||
token_found:
|
||||
g_pos = p;
|
||||
|
||||
/* skipping newlines in some cases */
|
||||
@@ -1178,6 +1193,8 @@ static node *parse_expr(uint32_t iexp)
|
||||
uint32_t tc, xtc;
|
||||
var *v;
|
||||
|
||||
debug_printf_parse("%s(%x)\n", __func__, iexp);
|
||||
|
||||
sn.info = PRIMASK;
|
||||
sn.r.n = glptr = NULL;
|
||||
xtc = TC_OPERAND | TC_UOPPRE | TC_REGEXP | iexp;
|
||||
@@ -1186,12 +1203,14 @@ static node *parse_expr(uint32_t iexp)
|
||||
|
||||
if (glptr && (t_info == (OC_COMPARE | VV | P(39) | 2))) {
|
||||
/* input redirection (<) attached to glptr node */
|
||||
debug_printf_parse("%s: input redir\n", __func__);
|
||||
cn = glptr->l.n = new_node(OC_CONCAT | SS | P(37));
|
||||
cn->a.n = glptr;
|
||||
xtc = TC_OPERAND | TC_UOPPRE;
|
||||
glptr = NULL;
|
||||
|
||||
} else if (tc & (TC_BINOP | TC_UOPPOST)) {
|
||||
debug_printf_parse("%s: TC_BINOP | TC_UOPPOST\n", __func__);
|
||||
/* for binary and postfix-unary operators, jump back over
|
||||
* previous operators with higher priority */
|
||||
vn = cn;
|
||||
@@ -1221,6 +1240,7 @@ static node *parse_expr(uint32_t iexp)
|
||||
vn->a.n = cn;
|
||||
|
||||
} else {
|
||||
debug_printf_parse("%s: other\n", __func__);
|
||||
/* for operands and prefix-unary operators, attach them
|
||||
* to last node */
|
||||
vn = cn;
|
||||
@@ -1228,12 +1248,14 @@ static node *parse_expr(uint32_t iexp)
|
||||
cn->a.n = vn;
|
||||
xtc = TC_OPERAND | TC_UOPPRE | TC_REGEXP;
|
||||
if (tc & (TC_OPERAND | TC_REGEXP)) {
|
||||
debug_printf_parse("%s: TC_OPERAND | TC_REGEXP\n", __func__);
|
||||
xtc = TC_UOPPRE | TC_UOPPOST | TC_BINOP | TC_OPERAND | iexp;
|
||||
/* one should be very careful with switch on tclass -
|
||||
* only simple tclasses should be used! */
|
||||
switch (tc) {
|
||||
case TC_VARIABLE:
|
||||
case TC_ARRAY:
|
||||
debug_printf_parse("%s: TC_VARIABLE | TC_ARRAY\n", __func__);
|
||||
cn->info = OC_VAR;
|
||||
v = hash_search(ahash, t_string);
|
||||
if (v != NULL) {
|
||||
@@ -1250,6 +1272,7 @@ static node *parse_expr(uint32_t iexp)
|
||||
|
||||
case TC_NUMBER:
|
||||
case TC_STRING:
|
||||
debug_printf_parse("%s: TC_NUMBER | TC_STRING\n", __func__);
|
||||
cn->info = OC_VAR;
|
||||
v = cn->l.v = xzalloc(sizeof(var));
|
||||
if (tc & TC_NUMBER)
|
||||
@@ -1259,32 +1282,41 @@ static node *parse_expr(uint32_t iexp)
|
||||
break;
|
||||
|
||||
case TC_REGEXP:
|
||||
debug_printf_parse("%s: TC_REGEXP\n", __func__);
|
||||
mk_re_node(t_string, cn, xzalloc(sizeof(regex_t)*2));
|
||||
break;
|
||||
|
||||
case TC_FUNCTION:
|
||||
debug_printf_parse("%s: TC_FUNCTION\n", __func__);
|
||||
cn->info = OC_FUNC;
|
||||
cn->r.f = newfunc(t_string);
|
||||
cn->l.n = condition();
|
||||
break;
|
||||
|
||||
case TC_SEQSTART:
|
||||
debug_printf_parse("%s: TC_SEQSTART\n", __func__);
|
||||
cn = vn->r.n = parse_expr(TC_SEQTERM);
|
||||
if (!cn)
|
||||
syntax_error("Empty sequence");
|
||||
cn->a.n = vn;
|
||||
break;
|
||||
|
||||
case TC_GETLINE:
|
||||
debug_printf_parse("%s: TC_GETLINE\n", __func__);
|
||||
glptr = cn;
|
||||
xtc = TC_OPERAND | TC_UOPPRE | TC_BINOP | iexp;
|
||||
break;
|
||||
|
||||
case TC_BUILTIN:
|
||||
debug_printf_parse("%s: TC_BUILTIN\n", __func__);
|
||||
cn->l.n = condition();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
debug_printf_parse("%s() returns %p\n", __func__, sn.r.n);
|
||||
return sn.r.n;
|
||||
}
|
||||
|
||||
@@ -1353,18 +1385,25 @@ static void chain_group(void)
|
||||
} while (c & TC_NEWLINE);
|
||||
|
||||
if (c & TC_GRPSTART) {
|
||||
debug_printf_parse("%s: TC_GRPSTART\n", __func__);
|
||||
while (next_token(TC_GRPSEQ | TC_GRPTERM) != TC_GRPTERM) {
|
||||
debug_printf_parse("%s: !TC_GRPTERM\n", __func__);
|
||||
if (t_tclass & TC_NEWLINE)
|
||||
continue;
|
||||
rollback_token();
|
||||
chain_group();
|
||||
}
|
||||
debug_printf_parse("%s: TC_GRPTERM\n", __func__);
|
||||
} else if (c & (TC_OPSEQ | TC_OPTERM)) {
|
||||
debug_printf_parse("%s: TC_OPSEQ | TC_OPTERM\n", __func__);
|
||||
rollback_token();
|
||||
chain_expr(OC_EXEC | Vx);
|
||||
} else { /* TC_STATEMNT */
|
||||
} else {
|
||||
/* TC_STATEMNT */
|
||||
debug_printf_parse("%s: TC_STATEMNT(?)\n", __func__);
|
||||
switch (t_info & OPCLSMASK) {
|
||||
case ST_IF:
|
||||
debug_printf_parse("%s: ST_IF\n", __func__);
|
||||
n = chain_node(OC_BR | Vx);
|
||||
n->l.n = condition();
|
||||
chain_group();
|
||||
@@ -1379,12 +1418,14 @@ static void chain_group(void)
|
||||
break;
|
||||
|
||||
case ST_WHILE:
|
||||
debug_printf_parse("%s: ST_WHILE\n", __func__);
|
||||
n2 = condition();
|
||||
n = chain_loop(NULL);
|
||||
n->l.n = n2;
|
||||
break;
|
||||
|
||||
case ST_DO:
|
||||
debug_printf_parse("%s: ST_DO\n", __func__);
|
||||
n2 = chain_node(OC_EXEC);
|
||||
n = chain_loop(NULL);
|
||||
n2->a.n = n->a.n;
|
||||
@@ -1393,6 +1434,7 @@ static void chain_group(void)
|
||||
break;
|
||||
|
||||
case ST_FOR:
|
||||
debug_printf_parse("%s: ST_FOR\n", __func__);
|
||||
next_token(TC_SEQSTART);
|
||||
n2 = parse_expr(TC_SEMICOL | TC_SEQTERM);
|
||||
if (t_tclass & TC_SEQTERM) { /* for-in */
|
||||
@@ -1418,6 +1460,7 @@ static void chain_group(void)
|
||||
|
||||
case OC_PRINT:
|
||||
case OC_PRINTF:
|
||||
debug_printf_parse("%s: OC_PRINT[F]\n", __func__);
|
||||
n = chain_node(t_info);
|
||||
n->l.n = parse_expr(TC_OPTERM | TC_OUTRDR | TC_GRPTERM);
|
||||
if (t_tclass & TC_OUTRDR) {
|
||||
@@ -1429,17 +1472,20 @@ static void chain_group(void)
|
||||
break;
|
||||
|
||||
case OC_BREAK:
|
||||
debug_printf_parse("%s: OC_BREAK\n", __func__);
|
||||
n = chain_node(OC_EXEC);
|
||||
n->a.n = break_ptr;
|
||||
break;
|
||||
|
||||
case OC_CONTINUE:
|
||||
debug_printf_parse("%s: OC_CONTINUE\n", __func__);
|
||||
n = chain_node(OC_EXEC);
|
||||
n->a.n = continue_ptr;
|
||||
break;
|
||||
|
||||
/* delete, next, nextfile, return, exit */
|
||||
default:
|
||||
debug_printf_parse("%s: default\n", __func__);
|
||||
chain_expr(t_info);
|
||||
}
|
||||
}
|
||||
@@ -1457,19 +1503,24 @@ static void parse_program(char *p)
|
||||
while ((tclass = next_token(TC_EOF | TC_OPSEQ | TC_GRPSTART |
|
||||
TC_OPTERM | TC_BEGIN | TC_END | TC_FUNCDECL)) != TC_EOF) {
|
||||
|
||||
if (tclass & TC_OPTERM)
|
||||
if (tclass & TC_OPTERM) {
|
||||
debug_printf_parse("%s: TC_OPTERM\n", __func__);
|
||||
continue;
|
||||
}
|
||||
|
||||
seq = &mainseq;
|
||||
if (tclass & TC_BEGIN) {
|
||||
debug_printf_parse("%s: TC_BEGIN\n", __func__);
|
||||
seq = &beginseq;
|
||||
chain_group();
|
||||
|
||||
} else if (tclass & TC_END) {
|
||||
debug_printf_parse("%s: TC_END\n", __func__);
|
||||
seq = &endseq;
|
||||
chain_group();
|
||||
|
||||
} else if (tclass & TC_FUNCDECL) {
|
||||
debug_printf_parse("%s: TC_FUNCDECL\n", __func__);
|
||||
next_token(TC_FUNCTION);
|
||||
g_pos++;
|
||||
f = newfunc(t_string);
|
||||
@@ -1487,22 +1538,27 @@ static void parse_program(char *p)
|
||||
clear_array(ahash);
|
||||
|
||||
} else if (tclass & TC_OPSEQ) {
|
||||
debug_printf_parse("%s: TC_OPSEQ\n", __func__);
|
||||
rollback_token();
|
||||
cn = chain_node(OC_TEST);
|
||||
cn->l.n = parse_expr(TC_OPTERM | TC_EOF | TC_GRPSTART);
|
||||
if (t_tclass & TC_GRPSTART) {
|
||||
debug_printf_parse("%s: TC_GRPSTART\n", __func__);
|
||||
rollback_token();
|
||||
chain_group();
|
||||
} else {
|
||||
debug_printf_parse("%s: !TC_GRPSTART\n", __func__);
|
||||
chain_node(OC_PRINT);
|
||||
}
|
||||
cn->r.n = mainseq.last;
|
||||
|
||||
} else /* if (tclass & TC_GRPSTART) */ {
|
||||
debug_printf_parse("%s: TC_GRPSTART(?)\n", __func__);
|
||||
rollback_token();
|
||||
chain_group();
|
||||
}
|
||||
}
|
||||
debug_printf_parse("%s: TC_EOF\n", __func__);
|
||||
}
|
||||
|
||||
|
||||
@@ -2627,7 +2683,7 @@ static var *evaluate(node *op, var *res)
|
||||
rsm = iF;
|
||||
}
|
||||
|
||||
if (!rsm->F) {
|
||||
if (!rsm || !rsm->F) {
|
||||
setvar_i(intvar[ERRNO], errno);
|
||||
setvar_i(res, -1);
|
||||
break;
|
||||
@@ -2961,7 +3017,7 @@ static rstream *next_input_file(void)
|
||||
#define rsm (G.next_input_file__rsm)
|
||||
#define files_happen (G.next_input_file__files_happen)
|
||||
|
||||
FILE *F = NULL;
|
||||
FILE *F;
|
||||
const char *fname, *ind;
|
||||
|
||||
if (rsm.F)
|
||||
@@ -2969,19 +3025,21 @@ static rstream *next_input_file(void)
|
||||
rsm.F = NULL;
|
||||
rsm.pos = rsm.adv = 0;
|
||||
|
||||
do {
|
||||
for (;;) {
|
||||
if (getvar_i(intvar[ARGIND])+1 >= getvar_i(intvar[ARGC])) {
|
||||
if (files_happen)
|
||||
return NULL;
|
||||
fname = "-";
|
||||
F = stdin;
|
||||
} else {
|
||||
ind = getvar_s(incvar(intvar[ARGIND]));
|
||||
fname = getvar_s(findvar(iamarray(intvar[ARGV]), ind));
|
||||
if (fname && *fname && !is_assignment(fname))
|
||||
F = xfopen_stdin(fname);
|
||||
break;
|
||||
}
|
||||
} while (!F);
|
||||
ind = getvar_s(incvar(intvar[ARGIND]));
|
||||
fname = getvar_s(findvar(iamarray(intvar[ARGV]), ind));
|
||||
if (fname && *fname && !is_assignment(fname)) {
|
||||
F = xfopen_stdin(fname);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
files_happen = TRUE;
|
||||
setvar_s(intvar[FILENAME], fname);
|
||||
@@ -2995,7 +3053,7 @@ int awk_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int awk_main(int argc, char **argv)
|
||||
{
|
||||
unsigned opt;
|
||||
char *opt_F, *opt_W;
|
||||
char *opt_F;
|
||||
llist_t *list_v = NULL;
|
||||
llist_t *list_f = NULL;
|
||||
int i, j;
|
||||
@@ -3057,7 +3115,7 @@ int awk_main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
opt_complementary = "v::f::"; /* -v and -f can occur multiple times */
|
||||
opt = getopt32(argv, "F:v:f:W:", &opt_F, &list_v, &list_f, &opt_W);
|
||||
opt = getopt32(argv, "F:v:f:W:", &opt_F, &list_v, &list_f, NULL);
|
||||
argv += optind;
|
||||
argc -= optind;
|
||||
if (opt & 0x1)
|
||||
@@ -3091,7 +3149,7 @@ int awk_main(int argc, char **argv)
|
||||
parse_program(*argv++);
|
||||
}
|
||||
if (opt & 0x8) // -W
|
||||
bb_error_msg("warning: unrecognized option '-W %s' ignored", opt_W);
|
||||
bb_error_msg("warning: option -W is ignored");
|
||||
|
||||
/* fill in ARGV array */
|
||||
setvar_i(intvar[ARGC], argc);
|
||||
|
||||
Loaded 100 of 240 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user