OSDN Git Service
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 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 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 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, 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 00:27:45 +0000 (00:27 +0000)]
Revert "Stop building getprop"
This reverts commit
2a7219cdf2fa1b9bd080f9377ed5f2cf993600a3.
Change-Id: I24118e45c9f7c99699959b58c2ccbd4a0fd9414e
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 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
Elliott Hughes [Wed, 18 Oct 2017 23:22:07 +0000 (23:22 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD
am:
fa58895b44
Change-Id: I2d9a87c927142612d498e38a47f61cb3401842d9
Elliott Hughes [Wed, 18 Oct 2017 21:25:38 +0000 (14:25 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: Icf243ef1fcceed4281f8491bc90f668fd65f3979
Elliott Hughes [Fri, 29 Sep 2017 22:20:26 +0000 (15:20 -0700)]
Fix groups(1) and id -G.
Both should only output the groups.
Elliott Hughes [Tue, 17 Oct 2017 20:23:19 +0000 (20:23 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD am:
bac04b4984 am:
3917661b78
am:
80060a8309
Change-Id: I1c95d91113a23a50ed5f2ae6c84b3f5948765d7e
Elliott Hughes [Tue, 17 Oct 2017 20:10:59 +0000 (20:10 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD am:
bac04b4984
am:
3917661b78
Change-Id: I069acb5748db4d150cf9cd5fc51b3e209f4cd5d6
Elliott Hughes [Tue, 17 Oct 2017 20:08:29 +0000 (20:08 +0000)]
Merge remote-tracking branch 'toybox/master' into HEAD
am:
bac04b4984
Change-Id: I2034eee62a46862ae2c1a204787af537c17ee438
Elliott Hughes [Tue, 17 Oct 2017 18:14:09 +0000 (11:14 -0700)]
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: I017f86ef407b801d0cd9c04bd4b50905b87eb143
Tom Cherry [Thu, 12 Oct 2017 16:43:32 +0000 (09:43 -0700)]
Allow ro. properties to have arbitrary lengths
Android now allows ro. properties to have arbitrary lengths. Two
changes need to happen to support this:
1) The length check in setprop.c before attempting to set a property
needs to be removed for ro. properties
2) __system_property_read_callback() must be used in place of
__system_property_get() in getprop.c as only the former is capable
of reading properties with size > 92 characters.
Bug:
23102347
Bug:
34954705
Change-Id: Ib8565a3e6d987dd5e6a5fe790e804ecf8ad1e020
Elliott Hughes [Tue, 17 Oct 2017 05:17:33 +0000 (05:17 +0000)]
Android doesn't support setuid-root toybox. am:
ce26024f83 am:
d8a348ac79
am:
2f42b9cd22
Change-Id: I00496dd0240654a921ef4954baca6ce4c61c0950
Elliott Hughes [Mon, 16 Oct 2017 22:41:21 +0000 (22:41 +0000)]
Android doesn't support setuid-root toybox. am:
ce26024f83
am:
d8a348ac79
Change-Id: If75406c47e3fe218e19852ad23b32143656178ca
Elliott Hughes [Mon, 16 Oct 2017 22:29:25 +0000 (22:29 +0000)]
Android doesn't support setuid-root toybox.
am:
ce26024f83
Change-Id: I162cd9cebc22917f1208362359afc678e4afbe4b