OSDN Git Service
Elliott Hughes [Sat, 10 Feb 2018 04:00:27 +0000 (04:00 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD
am:
b5517d09b2
Change-Id: I6578e6446b411e93af01e8883dfb7fd02892493e
Elliott Hughes [Sat, 10 Feb 2018 01:36:01 +0000 (17:36 -0800)]
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: Id5e655e6beec5bd291a8f2b53987d646b1f54f5f
Elliott Hughes [Fri, 9 Feb 2018 06:41:52 +0000 (22:41 -0800)]
Fix the pidof comm and cmdline tests.
If we have a 15-byte name, we don't know whether comm actually matches
or is a truncated form of a longer name that has a common prefix.
For example, with "this-is-a-very-long-name-that-is-too-long", we shouldn't
match "this-is-a-very-" (but the old code would).
The cmdline code was also broken on Android because it used basename(3)
rather than getbasename. This doesn't affect glibc because there's a
workaround in portability.h to ensure that we get the non-POSIX basename(3)
with glibc but then a non-glibc section that ensures everyone else gets
POSIX basename(3). That should probably be removed (and maybe `basename`
poisoned) to prevent similar mistakes in future.
Bug: http://b/
73123244
Elliott Hughes [Fri, 9 Feb 2018 18:49:08 +0000 (18:49 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD
am:
4b13881492
Change-Id: I1e2d98073fcbb2b84ab3ccb3eef01f0fdd8c9a99
Elliott Hughes [Fri, 9 Feb 2018 16:49:48 +0000 (08:49 -0800)]
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: Ib8bc739a3c5c68f426ff4aef793050db4a10f4a4
Rob Landley [Fri, 9 Feb 2018 15:03:34 +0000 (09:03 -0600)]
Andreas Gampe suggested a different fix.
(Bionic _does_ do the malloc(0)!=0 thing, the problem is pedantic access
checking, not null dereference. So test count instead.)
Elliott Hughes [Thu, 8 Feb 2018 19:36:59 +0000 (19:36 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD
am:
b02120dad8
Change-Id: I1295c7bd2156f093e702fd2196dc222bf43b2a48
Elliott Hughes [Thu, 8 Feb 2018 16:18:50 +0000 (08:18 -0800)]
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: I7ee7afbf48e3b5878c0ce0434d75d37a3214bd11
Rob Landley [Thu, 8 Feb 2018 14:57:10 +0000 (08:57 -0600)]
Thinko pointed out by Andreas Gampe (causing segfaults in top, oops).
Rob Landley [Mon, 5 Feb 2018 02:07:12 +0000 (20:07 -0600)]
People keep running ./configure, so have it do a defconfig for them.
Rob Landley [Sun, 4 Feb 2018 23:35:29 +0000 (17:35 -0600)]
Add crc32.
In cksum, make -H pad with leading zeroes to 8 chars, don't output len with -N,
and don't output filename with zero arguments.
Rob Landley [Thu, 1 Feb 2018 01:55:13 +0000 (19:55 -0600)]
Ahem, I _said_ basic ping support.
Rob Landley [Wed, 31 Jan 2018 00:44:58 +0000 (18:44 -0600)]
Basic ping support.
Requires echo 0 $((1<<30)) > /proc/sys/net/ipv4/ping_group_range (as root)
Elliott Hughes [Thu, 25 Jan 2018 15:50:37 +0000 (15:50 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD
am:
e77711bf80
Change-Id: Ia7b278c6f96e2a75cbbadd21366f6732e802c2cf
Elliott Hughes [Thu, 25 Jan 2018 05:09:42 +0000 (21:09 -0800)]
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: I2e776e6091f09fed27fa83715d8f46460c75b73f
Rob Landley [Wed, 24 Jan 2018 21:10:44 +0000 (15:10 -0600)]
Revert the ps -T thing until I understand what Elliott wants.
Elliott Hughes [Mon, 22 Jan 2018 22:04:24 +0000 (14:04 -0800)]
Fix hang in losetup test.
Switch the printf over to %s because the input is actually hex (so %d
is wrong), but without the leading "0x" that %x would require.
For some reason the NODE assignment wasn't providing any input to awk
(hence the hang), and awk wasn't looking for the correct field anyway.
The tests still fail for me:
losetup: /dev/block/loop0: No such device or address
losetup: /dev/block/loop0: No such device or address
losetup: file: No such file or directory
losetup: needs 1 arg (see "losetup --help")
But at least now they allow the other tests to continue!
Elliott Hughes [Mon, 22 Jan 2018 21:34:08 +0000 (21:34 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD
am:
af478b798e
Change-Id: I945d01ec1091497310ab945024a2b7c56f90fede
Elliott Hughes [Mon, 22 Jan 2018 20:56:47 +0000 (12:56 -0800)]
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: Ie08bda874aabd559c72d721c3fcae5415c482242
Reverend Homer [Sun, 21 Jan 2018 20:45:02 +0000 (23:45 +0300)]
Fix variables in help.txt
Rob Landley [Sun, 21 Jan 2018 16:55:07 +0000 (10:55 -0600)]
gzip cleanup: fix test_gzip, unify do_gzip/do_gunzip, inline gzerror_msg().
Rob Landley [Sun, 21 Jan 2018 04:29:25 +0000 (22:29 -0600)]
Fix gunzip to past test_gunzip.
Rob Landley [Tue, 16 Jan 2018 03:46:45 +0000 (21:46 -0600)]
Fix "ps -T 1234" to show thread belonging to that PID.
Rob Landley [Mon, 15 Jan 2018 19:37:25 +0000 (13:37 -0600)]
Merge shared_main() back into ps_main() and top_main(), add comments.
Rob Landley [Mon, 15 Jan 2018 17:51:42 +0000 (11:51 -0600)]
Add more comments to ps.
Rob Landley [Mon, 15 Jan 2018 05:15:01 +0000 (23:15 -0600)]
Switch xgettty() -> tty_fd() (returning -1 instead of erroring out if none).
Tom Cherry [Thu, 11 Jan 2018 16:37:19 +0000 (16:37 +0000)]
Reland: Stop building getprop
am:
69a95fdec1
Change-Id: I64aba811de33f1916a2388e37384e25f453632aa
Tom Cherry [Thu, 4 Jan 2018 18:13:59 +0000 (10:13 -0800)]
Reland: Stop building getprop
We've replaced this with our own C++ version to support the new
property info parsing.
Bug:
36001741
Test: Compared getprop results with toybox getprop
Change-Id: I022e1ee63635547e2705d43c818579a68f01b872
Rob Landley [Wed, 10 Jan 2018 16:54:11 +0000 (10:54 -0600)]
Move make help text out of Makefile.
Elliott Hughes [Mon, 24 Apr 2017 20:29:30 +0000 (13:29 -0700)]
Add the gzip/gunzip/zcat tests I wrote for toolbox gzip/gunzip/zcat.
Bringing the zlib-based gzip/gunzip/zcat over to toybox is a problem for
another day, but at least the tests are easy...
(These tests pass with TEST_HOST and on the toolbox versions, but the
toybox toys are in pending and very broken.)
Tom Cherry [Tue, 9 Jan 2018 15:09:54 +0000 (15:09 +0000)]
Revert "Stop building getprop"
am:
9810b2abf3
Change-Id: Iece1fef3ae04ff459a313cbc1799bc2ac3a4ab15
Tom Cherry [Tue, 9 Jan 2018 00:27:45 +0000 (00:27 +0000)]
Revert "Stop building getprop"
This reverts commit
2a7219cdf2fa1b9bd080f9377ed5f2cf993600a3.
Change-Id: I24118e45c9f7c99699959b58c2ccbd4a0fd9414e
Tom Cherry [Mon, 8 Jan 2018 22:36:58 +0000 (22:36 +0000)]
Stop building getprop
am:
2a7219cdf2
Change-Id: I55446a9ec8890afafe5426845896a73cae07e121
Rob Landley [Sat, 6 Jan 2018 21:43:17 +0000 (15:43 -0600)]
Move millitime() into lib.c.
Tom Cherry [Thu, 4 Jan 2018 18:13:59 +0000 (10:13 -0800)]
Stop building getprop
We've replaced this with our own C++ version to support the new
property info parsing.
Bug:
36001741
Test: Compared getprop results with toybox getprop
Change-Id: Iba71544e0d8eb2c0d683fdd244fa7ccb87294de4
Rob Landley [Wed, 3 Jan 2018 18:53:46 +0000 (12:53 -0600)]
Cleanup pass on gzip.c.
Rob Landley [Mon, 1 Jan 2018 22:32:13 +0000 (16:32 -0600)]
Promote logger, and fluff up help text a bit.
Rob Landley [Mon, 1 Jan 2018 22:25:18 +0000 (16:25 -0600)]
Cleanup logger.c, and move the facilitynames/prioritynames SYSLOG_NAMES
stuff syslog.h does into lib.c and portability.h
Rob Landley [Mon, 1 Jan 2018 17:24:48 +0000 (11:24 -0600)]
xphung on github said: "config2help currently doesn't work on OS X, it
terminates parsing of Config.in at first blank line. This is because
getdelim() in portability.c returns -1 whenever the line comprises only
a single linefeed character. Fixing this was a trivial change to two lines
(see below), and config2help now works on OS X but I haven't regression
tested this on any other commands which rely on getdelim()"
Rob Landley [Fri, 29 Dec 2017 23:19:02 +0000 (17:19 -0600)]
Promote iconv.
Rob Landley [Fri, 29 Dec 2017 22:43:38 +0000 (16:43 -0600)]
Cleanup iconv.
Implement -c, fix endless loop when illegal char happens with
!outleft (don't need to check errno, just in == toybuf), refill
buffer each time (less efficient handling of illegal chars but never
have to worry about how long constitutes a valid sequence in unknown
encoding).
Fix input longer than 2k (memmove() has src/dest switched, second time through
loop in starts at offset inleft...) Made it start at beginning every time.
Switch iconv_open() error msg to show to/from and errno (rather than
hardwired english text).
Rob Landley [Wed, 27 Dec 2017 17:23:43 +0000 (11:23 -0600)]
Promote setfattr
Rob Landley [Wed, 27 Dec 2017 17:21:21 +0000 (11:21 -0600)]
Minor cleanup on setfattr.c
Elliott Hughes [Sun, 24 Dec 2017 08:42:38 +0000 (00:42 -0800)]
Add xxd -i (and xxd -ri).
The original xxd doesn't support -r with -i. The original also outputs
"unsigned char name[] = { ... };" for input other than stdin, but that
actually makes it less useful --- many languages support array
initializers, but far fewer support that exact declaration syntax.
Also fix the -c range checking and defaulting: ><= in the argument string
only works for floating point arguments.
Bug: http://b/
64711851
Elliott Hughes [Tue, 26 Dec 2017 05:24:57 +0000 (21:24 -0800)]
Fix xargs -0 with -n.
Also make -0 and -E mutually exclusive (rather than just ignore -E
with -0).
Bug: https://github.com/landley/toybox/issues/78
Elliott Hughes [Sun, 24 Dec 2017 07:44:04 +0000 (23:44 -0800)]
Add fmt.
A very simple implementation of fmt, good enough for my daily use of !!fmt
in vi to reflow checkin comments like this.
Rob Landley [Fri, 22 Dec 2017 20:56:37 +0000 (14:56 -0600)]
Redo namestopid to handle more cases.
Elliott Hughes [Fri, 22 Dec 2017 02:01:39 +0000 (02:01 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD
am:
5c2683335f
Change-Id: Id1c5fa6a2253e8ff1c8d00c5eb553e813af89aff
Elliott Hughes [Fri, 22 Dec 2017 01:51:17 +0000 (17:51 -0800)]
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: Icb80c8fe862fb4db4f6bcfacb9c5e1d9d26108d5
Rob Landley [Tue, 19 Dec 2017 22:16:31 +0000 (16:16 -0600)]
Fix make bloatcheck dependencies (pointed out by Patrick Oppenlander).
Elliott Hughes [Wed, 13 Dec 2017 19:47:08 +0000 (11:47 -0800)]
killall should kill scripts too.
Found running LTP file system tests on Android.
Bug: http://b/
70627145
Rob Landley [Mon, 11 Dec 2017 13:19:37 +0000 (07:19 -0600)]
An incomplete list of deviations from posix (it's a start).
Rob Landley [Sun, 10 Dec 2017 20:12:19 +0000 (14:12 -0600)]
Cleanup pass on stty: collate do_stty() calls for future inlining,
collapse flag arrays to fewer lines, factor out xtcgetattr(),
strip curly brackets around single lines, don't have a separate error
message for tcsetattr() return code if more thorough check is on next line,
take advantage of O_RDONLY being zero, document -F.
Elliott Hughes [Wed, 6 Dec 2017 03:41:38 +0000 (03:41 +0000)]
Merge changes I768f0948,I3d79bb35
am:
2474ba9744
Change-Id: I04aec22a4eefac8439e101a6f28817e4f90b7bc9
Treehugger Robot [Wed, 6 Dec 2017 02:50:40 +0000 (02:50 +0000)]
Merge changes I768f0948,I3d79bb35
* changes:
Merge remote-tracking branch 'toybox/master' into HEAD
Use NULL rather than 0 in vargs.
Elliott Hughes [Tue, 5 Dec 2017 22:55:03 +0000 (14:55 -0800)]
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: I768f0948024a388113ded1b689994c274565acce
Elliott Hughes [Mon, 4 Dec 2017 20:31:53 +0000 (12:31 -0800)]
Use NULL rather than 0 in vargs.
Top bits count too!
Elliott Hughes [Mon, 4 Dec 2017 20:48:15 +0000 (20:48 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD
am:
b4d75fdc5e
Change-Id: Ie14854bfa3c1a616f16382dd7a7c0578ab04fa08
Elliott Hughes [Mon, 4 Dec 2017 18:10:29 +0000 (10:10 -0800)]
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: I8385fe7ba26eb183696d77d160c1c6662f2d775b
Rob Landley [Sun, 3 Dec 2017 07:30:39 +0000 (01:30 -0600)]
Commands in pending should default n.
Elliott Hughes [Sat, 2 Dec 2017 06:43:38 +0000 (22:43 -0800)]
Add stty(1).
Full POSIX stty with Linux extensions. Output and behavior match coreutils
8.26 as far as I can tell. For some reason busybox 1.22 stty always
shows all the special characters, even when they match "sane". I've
matched coreutils, since "shows differences from sane" is easy to describe
and obviously useful.
Flags in the various arrays are not in the order they're introduced in
POSIX or in the Linux header file: they're in the order that they're
output by coreutils' stty.
The -g output matches coreutils and busybox.
I implemented iuclc, xcase, and olcuc even though they've been removed
from POSIX because the others implement them, and "man stty" defines "raw"
and "sane" in terms of them (where POSIX doesn't define "sane" in any
useful sense).
This builds fine against glibc 2.24, and as far as I can tell all the
constants used were in Linux 2.6 so I'm assuming that there shouldn't
be any #ifdef nonsense needed for any reasonable vintage of C library.
Elliott Hughes [Fri, 17 Nov 2017 00:16:12 +0000 (16:16 -0800)]
Don't capitalize in the middle of a sentence.
Before:
toy: Unknown option p (See "toy --help")
After:
toy: Unknown option p (see "toy --help")
Elliott Hughes [Fri, 17 Nov 2017 00:35:10 +0000 (16:35 -0800)]
Add uptime -p.
We (Android) give up trying to teach folks what "up 142 days, 1:45"
means...
Bug: http://b/
65205261
Rob Landley [Sun, 3 Dec 2017 07:20:42 +0000 (01:20 -0600)]
Gaël PORTAY wants mdev to work when Linux has the block layer configured out.
Rob Landley [Sun, 3 Dec 2017 03:18:52 +0000 (21:18 -0600)]
Android has its loop devices under "block" as Elliott says "by reason of
historical accident", so fall back to check there.
Also remove an obsolete comment TODO block, check !parent for dirtree
top of tree instead of '/' in the filename, and typecast some printf
arguments for 32-bit systems.
Elliott Hughes [Tue, 28 Nov 2017 01:33:53 +0000 (01:33 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD
am:
73fd808900
Change-Id: I32af02ae6ff58b9aa9160f7a58dad6b30c2e5c44
Elliott Hughes [Tue, 28 Nov 2017 01:21:21 +0000 (17:21 -0800)]
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: I22ec2b8b3f1a978442fd5f7031a35eba8cb9ce25
Rob Landley [Mon, 27 Nov 2017 05:40:20 +0000 (23:40 -0600)]
Recognize sh/frv fdpic, and add types for bpf and new microblaze.
Rob Landley [Sun, 26 Nov 2017 11:33:35 +0000 (05:33 -0600)]
Use endianness info to read executable type.
Elliott Hughes [Fri, 17 Nov 2017 20:10:36 +0000 (12:10 -0800)]
Add "time -v".
This shows the other fields in getrusage. I've chosen to only show the
ones actually maintained by Linux.
Elliott Hughes [Thu, 16 Nov 2017 21:59:37 +0000 (13:59 -0800)]
Make find -exec + obey ARG_MAX just like xargs.
This isn't ideal, but it matches xargs and none of us is likely to have
time to do the best possible thing any time soon.
Bug: http://b/
65818597
Test: ./toybox find /usr/local/google/ndkports/ -exec echo {} +
Rob Landley [Fri, 17 Nov 2017 03:04:31 +0000 (21:04 -0600)]
Minor tweaks.
Elliott Hughes [Wed, 15 Nov 2017 21:06:17 +0000 (13:06 -0800)]
Add "df -i".
Also switch to u64 for calculations. Some FUSE file systems have inode
counts large enough to overflow s64.
Xin Li [Mon, 13 Nov 2017 22:35:30 +0000 (14:35 -0800)]
Merge commit '
ebbab5196ab1c9dfeb610f6847650da181268e59' into HEAD
Change-Id: I4589911438030283a85737073c0c4eeb2fd875a9
Elliott Hughes [Sat, 4 Nov 2017 07:30:58 +0000 (07:30 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD
am:
62f36d9160
Change-Id: If03981a937fed75efa974b00c8cf5ed0fcc5fbce
Elliott Hughes [Sat, 4 Nov 2017 05:46:47 +0000 (22:46 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: I29c0c12ba499702296fa4c6f01d5c6dfde25ae11
Elliott Hughes [Wed, 1 Nov 2017 18:09:42 +0000 (11:09 -0700)]
file(1): add ogg, TrueType font, LLVM bitcode, PEM certs, and PE executables.
More of the files encountered on the Android system image (plus PE
executables, which we build but which shouldn't actually make it to the
system image!).
Elliott Hughes [Wed, 1 Nov 2017 21:44:25 +0000 (21:44 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD
am:
60f116b00b
Change-Id: Ie744d7d4736301f157c34f797c31fdea6c7ced58
Elliott Hughes [Wed, 1 Nov 2017 15:51:16 +0000 (08:51 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: I0f484781d22922c8d0764051f05924fab1d8b072
Rob Landley [Wed, 1 Nov 2017 00:44:32 +0000 (19:44 -0500)]
Add top -m, fix width truncating for narrow screens (off by one), and add iotop -H
Rob Landley [Tue, 31 Oct 2017 20:51:02 +0000 (15:51 -0500)]
Rename test_*.c to demo_*.c (because "make test_$CMD" means something already),
fluff out README, and add a comment to hostid explaining its deprecation.
Rob Landley [Tue, 31 Oct 2017 20:43:38 +0000 (15:43 -0500)]
Only show LABEL= when there is one.
Rob Landley [Tue, 31 Oct 2017 20:30:04 +0000 (15:30 -0500)]
Fix cut -s and -f when delimiter not found (posix says print whole line).
Elliott Hughes [Sat, 28 Oct 2017 20:15:24 +0000 (20:15 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD
am:
e64d3fbcfc
Change-Id: I1ea8da7d493f1f870fcf2fbbc111b844ebc1abab
Elliott Hughes [Sat, 28 Oct 2017 18:25:01 +0000 (11:25 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: Ie8296ab28983a463cabe2c6b3bf1a0bfee6127d4
Rob Landley [Sat, 28 Oct 2017 08:26:33 +0000 (03:26 -0500)]
Web page updates.
Rob Landley [Thu, 26 Oct 2017 01:27:33 +0000 (20:27 -0500)]
Make -c work with unicode chars, and first stab at -C measuring columns.
Elliott Hughes [Mon, 23 Oct 2017 15:59:21 +0000 (15:59 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD
am:
cb633d4175
Change-Id: Iabf046987aeeef1d866415ae35bff412c52bf29d
Elliott Hughes [Mon, 23 Oct 2017 05:56:36 +0000 (22:56 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: Ic864a300496f900884e5e07e834ac309c76d569e
Rob Landley [Sun, 22 Oct 2017 18:36:02 +0000 (13:36 -0500)]
Insmod dummy for ifconfig tests, and "pointopoint" only has two t's.
Rob Landley [Sun, 22 Oct 2017 16:52:32 +0000 (11:52 -0500)]
Add stat to index.
Rob Landley [Sun, 22 Oct 2017 16:42:59 +0000 (11:42 -0500)]
I ended up writing a new find from scratch, so remove old unfinished cleanup log.
Rob Landley [Sun, 22 Oct 2017 16:41:27 +0000 (11:41 -0500)]
Typo.
Rob Landley [Sat, 21 Oct 2017 14:53:14 +0000 (09:53 -0500)]
Use char for exitval and wasroot (first capped at 8 bits and second's a flag).
Rob Landley [Sat, 21 Oct 2017 14:48:24 +0000 (09:48 -0500)]
Use setlocale(LC_CTYPE, "C.UTF-8") for more targeted locale enable:
(only enable character parsing, force utf8, "C" semantics otherwise.)
Jiyong Park [Fri, 20 Oct 2017 01:10:58 +0000 (01:10 +0000)]
Remove libselinux_vendor
am:
61be2f867f
Change-Id: I6e8d751fd816f789727465a15941ea35f966db65
Rob Landley [Thu, 19 Oct 2017 21:49:52 +0000 (16:49 -0500)]
Elliott wants to add TOYBOX_VENDOR.
Jiyong Park [Fri, 13 Oct 2017 00:18:10 +0000 (09:18 +0900)]
Remove libselinux_vendor
libselinux is now a vendor_available: true library.
Bug:
66914194
Test: lunch aosp_arm64_ab-userdebug; m libselinux.vendor toybox_vendor
Change-Id: I3ff0a73c29e089881e74566c52693792b9f1ecd3
Elliott Hughes [Wed, 18 Oct 2017 23:29:02 +0000 (23:29 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD am:
fa58895b44 am:
e77b0564e2
am:
579a5da1af
Change-Id: I36aa5ec1bc25a6aed0fad2a071e538afe5a71512
Elliott Hughes [Wed, 18 Oct 2017 23:24:10 +0000 (23:24 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD am:
fa58895b44
am:
e77b0564e2
Change-Id: I73052043f9c026fb47ae5c110f43e5075a30d2f3