OSDN Git Service
Elliott Hughes [Wed, 3 Dec 2014 02:42:51 +0000 (18:42 -0800)]
Merge remote-tracking branch 'toybox/master' into HEAD
Rob Landley [Tue, 2 Dec 2014 19:00:08 +0000 (13:00 -0600)]
Note posix mailing list posting correcting a bug in the web version of the standard.
Rob Landley [Tue, 2 Dec 2014 09:17:34 +0000 (03:17 -0600)]
Don't mount a filesystem over an existing one with the same /dev and /dir.
The OS mostly catches this for block devices, but calling "mount -a" twice
shouldn't overmount tmpfs entries with new tmpfs instances. (This needs a test
suite entry, and the test suite needs a root context to run in...)
Rob Landley [Tue, 2 Dec 2014 09:12:58 +0000 (03:12 -0600)]
Switching on fortify was not kind to the pending directory. Fix the actual build break (open(O_CREAT) without permissions).
Rob Landley [Tue, 2 Dec 2014 09:05:01 +0000 (03:05 -0600)]
Start of deflate compress-side code, mostly refactoring and stubs so far.
Rob Landley [Mon, 1 Dec 2014 18:52:55 +0000 (12:52 -0600)]
Ashwini Sharma pointed out that "mkdir sub; ln -s . sub/up; du -L sub" shouldn't loop endlessly.
Rob Landley [Mon, 1 Dec 2014 09:15:25 +0000 (03:15 -0600)]
Refactor expr and add another test entry that works with TEST_HOST=1 but not with the one in pending.
Rob Landley [Sun, 30 Nov 2014 20:10:36 +0000 (14:10 -0600)]
Tests for operator priority groupings.
Rob Landley [Sun, 30 Nov 2014 17:05:39 +0000 (11:05 -0600)]
Remove the strncpy from mountpoint, and make a lot of other changes while I'm here (to be described on the mailing list).
Rob Landley [Sun, 30 Nov 2014 03:11:34 +0000 (21:11 -0600)]
The "re-exec to regain root permissions" logic broke the error message when calling root-only commands through the multiplexer.
It would say "no such command" when it should say "not root".
Rob Landley [Sun, 30 Nov 2014 01:07:08 +0000 (19:07 -0600)]
Minor whitespace cleanups.
Ashwini Sharma [Sun, 30 Nov 2014 00:38:05 +0000 (18:38 -0600)]
expr.c: Added '==' sign into list of operations. Also added support for regex pattern match.
Rob Landley [Fri, 28 Nov 2014 23:30:46 +0000 (17:30 -0600)]
Improve error reporting in parallel build. (On error, wait for all children to finish before exiting.)
Rob Landley [Fri, 28 Nov 2014 22:57:45 +0000 (16:57 -0600)]
Make sendfile use libbuf.
Rob Landley [Fri, 28 Nov 2014 22:56:53 +0000 (16:56 -0600)]
Tiny in-passing cleanups to more.c.
Rob Landley [Fri, 28 Nov 2014 22:53:59 +0000 (16:53 -0600)]
Check in most recent release notes.
Rob Landley [Fri, 28 Nov 2014 22:52:06 +0000 (16:52 -0600)]
When running a test, the diff is always an ascii diff, not binary.
Rob Landley [Fri, 28 Nov 2014 22:51:32 +0000 (16:51 -0600)]
Add "change" subdirectory to make clean.
Rob Landley [Fri, 28 Nov 2014 22:49:46 +0000 (16:49 -0600)]
Add "make change" target to build the big toybox binary as a bunch of little ones (in the "change" subdirectory), and tweak scripts/make.sh to avoid redundant work when rebuilding.
Rob Landley [Fri, 28 Nov 2014 02:38:21 +0000 (20:38 -0600)]
sed: c needs to trigger range logic like d, D works like d when there isn't anything left in the line, and more tests.
Rob Landley [Thu, 27 Nov 2014 06:28:13 +0000 (00:28 -0600)]
New ifconfig tests from Cynt Rynt.
(I added the "only run if root" stanza at the beginning.)
Elliott Hughes [Wed, 26 Nov 2014 23:21:03 +0000 (15:21 -0800)]
Switch to toybox readlink.
Change-Id: I9f777703bbd6444901dac58b330249e1f044e1cf
Elliott Hughes [Wed, 26 Nov 2014 19:38:43 +0000 (11:38 -0800)]
Switch to toybox dmesg.
Change-Id: I016c2f57545bcd82962e4c181a46121d69dadae0
Elliott Hughes [Wed, 26 Nov 2014 19:28:46 +0000 (11:28 -0800)]
Regenerate generated files after upstream sync.
Change-Id: I506f53563f132a54f400b3a0dcdb4945ff880b89
Elliott Hughes [Wed, 26 Nov 2014 19:28:00 +0000 (11:28 -0800)]
Merge remote-tracking branch 'toybox/master' into clean
Rob Landley [Wed, 26 Nov 2014 03:45:18 +0000 (21:45 -0600)]
Update dmesg, loosely based on a patch from Elliott Hughes.
Probe the default buffer size, replace the constants with FLAG_x macros, add -r,
replace the byte at a time output with a single xwrite(), more comments.
Elliott Hughes [Wed, 26 Nov 2014 01:00:40 +0000 (17:00 -0800)]
Switch to toybox nohup.
Change-Id: I11d837ba0d306d18e52823612bd5d136633cda64
Rob Landley [Wed, 26 Nov 2014 00:49:34 +0000 (18:49 -0600)]
Variant of a patch from Ashwini Sharma, making df /dev/node work and tweaking the spacing.
I didn't apply the POSIXLY_CORRECT gnuism because it's a can of worms (as would
be LSB_CORRECT), and you can presumably alias df="df -P" if you want that.
Possibly in future I should factor out the "readahead and align columns based
on measuring the largest value in each" code from ls and apply it here.
Elliott Hughes [Tue, 25 Nov 2014 00:12:40 +0000 (16:12 -0800)]
Switch to toybox mkswap, swapoff, swapon.
Change-Id: I2d539d29aae4767a2126a3bdd3a2ce2977d8e607
Elliott Hughes [Mon, 24 Nov 2014 23:36:51 +0000 (15:36 -0800)]
Switch printenv to toybox.
Change-Id: I53362a14b3c3ed290844c840e9d5523e8c042d22
enh [Mon, 24 Nov 2014 23:26:09 +0000 (17:26 -0600)]
Android-related roadmap.html updates.
most notably:
* Android switched to mksh several releases ago.
* system/core/reboot is Android's reboot(1) (and sdcard is how
emulated sdcards work in production, not a testing thing).
* I removed all the "apparently unused" tools from the tree, since
they were all actually unused with the exception of lsusb which people
would build as/when they needed it. (which may need resurrecting when
they come back and find there's no "lsusb -v" in toolbox.)
Rob Landley [Mon, 24 Nov 2014 23:23:23 +0000 (17:23 -0600)]
Tweak the "ignoring return value" fortify workaround for readlinkat.
We zero the buffer and if the link read fails that's left alone, so
it's ok for the symlink not to be there. Unfortunately, typecasting the
return value to (void) doesn't shut up gcc, and having an if(); with the
semicolon on the same line doesn't shut up llvm. (The semicolon on a new
line would, but C does not have significant whitespace and I'm not going
to humor llvm if it plans to start.)
So far, empty curly brackets consistently get the warning to shut up.
Elliott Hughes [Mon, 24 Nov 2014 23:23:04 +0000 (15:23 -0800)]
Switch to toybox sleep.
Change-Id: I1477527b1b8e09d9955e266a8194da790a9952b3
Elliott Hughes [Mon, 24 Nov 2014 22:53:36 +0000 (14:53 -0800)]
Switch sync to toybox.
Change-Id: Ib614187f2fcc8f769280d5ac26a8002ffb14e1d8
Elliott Hughes [Mon, 24 Nov 2014 22:34:48 +0000 (14:34 -0800)]
Remove halt/poweroff/reboot.
These commands call the reboot(2) system call. On Android rebooting is done
by asking init to reboot.
Change-Id: If859d61282a32e7aa20b58f42db9f91084235b7d
Ying Wang [Mon, 24 Nov 2014 20:42:09 +0000 (12:42 -0800)]
Use LOCAL_POST_LINK_CMD to install toybox symlinks
It's simpler; Also whenever toybox is updated the symlinks get
recreated.
Remove the dependency on Android.mk. (The build system has already
automatically added the dependency on Android.mk.)
Change-Id: I6f9b933bce699f2a7af181697cef08844fc77837
Elliott Hughes [Mon, 24 Nov 2014 19:41:35 +0000 (11:41 -0800)]
Switch insmod/lsmod/rmmod to toybox.
Change-Id: I01d751b4b4773bf6436a2078da3de2a28afc27a4
Elliott Hughes [Sun, 23 Nov 2014 06:56:47 +0000 (22:56 -0800)]
Move clear, false, and true over to toybox.
These are all identical to their toolbox counterparts.
Change-Id: I3fab6ed80ac6a90f6837983ed585eb8fb0262d04
Elliott Hughes [Sun, 23 Nov 2014 06:41:27 +0000 (06:41 +0000)]
Merge "As long as Android's going to require fortify, fixup the warnings it generates."
Elliott Hughes [Sun, 23 Nov 2014 06:39:34 +0000 (06:39 +0000)]
Merge "Whitespace/code style."
Elliott Hughes [Sun, 23 Nov 2014 06:39:19 +0000 (06:39 +0000)]
Merge "A patch against your current ToT that builds in AOSP "
Rob Landley [Sat, 22 Nov 2014 06:36:45 +0000 (00:36 -0600)]
As long as Android's going to require fortify, fixup the warnings it generates.
Rob Landley [Sat, 22 Nov 2014 06:31:03 +0000 (00:31 -0600)]
Whitespace/code style.
Elliott Hughes [Sat, 22 Nov 2014 03:49:05 +0000 (21:49 -0600)]
A patch against your current ToT that builds in AOSP
Elliott Hughes [Fri, 21 Nov 2014 22:58:40 +0000 (22:58 +0000)]
Merge "Add usleep and note that inotifyd could replace notify."
Elliott Hughes [Fri, 21 Nov 2014 22:55:48 +0000 (22:55 +0000)]
Merge "Don't include asm/* files directly."
Elliott Hughes [Fri, 21 Nov 2014 22:55:34 +0000 (22:55 +0000)]
Merge "Patch from Elliott Hughes for Android/bionic build."
Elliott Hughes [Fri, 21 Nov 2014 22:53:43 +0000 (14:53 -0800)]
Add usleep and note that inotifyd could replace notify.
Change-Id: I73758b0c5b95f9e040640fa92ead804ad0fcca80
Rob Landley [Fri, 21 Nov 2014 16:06:45 +0000 (10:06 -0600)]
Don't include asm/* files directly.
Rob Landley [Fri, 21 Nov 2014 12:42:37 +0000 (06:42 -0600)]
Patch from Elliott Hughes for Android/bionic build.
Elliott Hughes [Thu, 20 Nov 2014 18:39:27 +0000 (10:39 -0800)]
Build toybox.
Change-Id: I2ae49ed68086fd9407f4e50636300d011c85d557
Rob Landley [Thu, 20 Nov 2014 03:38:00 +0000 (21:38 -0600)]
Make md5sum and sha1sum work on big endian systems.
Rob Landley [Wed, 19 Nov 2014 22:55:12 +0000 (16:55 -0600)]
Fixups for the android/bionic build probes patch.
The CFG_* symbols are always defined so if() can use them as compile-time
constants, so don't if defined() them.
Doing USE_BLAH() around variable definitions opens up the same potential for
config-dependent build breaks as #ifdefs do, just make the whole command
depend on the symbol for now, factor out the utmpx infrastructure later.
The PTY probe was always failing because it used NULL without #including
the header that defines it. Substitute 0 instead.
Isaac Dunham [Wed, 19 Nov 2014 22:38:46 +0000 (16:38 -0600)]
probe for getspnam(), forkpty(), utmpx, replace sethostname()
Android is missing all of these; we need to probe for some so we have
a config symbol to depend on.
sethostname() is easily replaced.
We got termios.h via pty.h; now it's not included in configure-step tools,
so we need termios.h to generate globals.
Rob Landley [Wed, 19 Nov 2014 20:29:53 +0000 (14:29 -0600)]
Fix "tail -c 10" segfault spotted by Lukasz Szpakowski.
Once we've read through the initial TT.bytes backlog we discard the extra data,
meaning we adjust the remaining amount each time so the overflow is zero bytes.
We were doing the adjustment right, but not zeroing out the overflow counter
after we did so.
Rob Landley [Tue, 18 Nov 2014 10:25:27 +0000 (04:25 -0600)]
More sed bugfixes.
Rob Landley [Tue, 18 Nov 2014 03:21:04 +0000 (21:21 -0600)]
sed: fix 'q', and { }, and } after s/// with no semicolon.
Rob Landley [Mon, 17 Nov 2014 09:14:05 +0000 (03:14 -0600)]
More sed corner cases. (Empty regex repeats previous regex, implement -i, etc.)
Rob Landley [Mon, 17 Nov 2014 00:58:22 +0000 (18:58 -0600)]
Fix more sed bugs.
Rob Landley [Sun, 16 Nov 2014 20:21:42 +0000 (14:21 -0600)]
Fix sed 'b' with no label and 'N' in general.
Rob Landley [Sat, 15 Nov 2014 23:19:23 +0000 (17:19 -0600)]
More sed bugfixes. (Did you know s/[/]// is a valid sed expression?)
Rob Landley [Sat, 15 Nov 2014 22:16:29 +0000 (16:16 -0600)]
Debugging pass on sed: make the existing test suite pass.
Rob Landley [Fri, 14 Nov 2014 22:44:21 +0000 (16:44 -0600)]
Add a few more sed tests.
Rob Landley [Fri, 14 Nov 2014 22:44:00 +0000 (16:44 -0600)]
Add color support for scripts/test.sh and new SKIP_HOST for tests expected to fail on non-toybox implementations.
Rob Landley [Fri, 14 Nov 2014 21:53:17 +0000 (15:53 -0600)]
sed: implement s & and \1 backrefs.
Rob Landley [Wed, 12 Nov 2014 20:47:57 +0000 (14:47 -0600)]
Implement more sed plumbing, including s/// (without \1 or & yet).
Rob Landley [Tue, 11 Nov 2014 21:08:25 +0000 (15:08 -0600)]
Remove unnecessary assignment spotted by Cynt Rynt.
Rob Landley [Mon, 10 Nov 2014 23:17:17 +0000 (17:17 -0600)]
Implement another largeish chunk of sed. Untested, unfinished, do not use yet.
Rob Landley [Mon, 10 Nov 2014 23:14:11 +0000 (17:14 -0600)]
First cleanup pass on hwclock.
Ashwini Sharma [Mon, 10 Nov 2014 21:26:08 +0000 (15:26 -0600)]
hwclock: get and set the hwclock
Ashwini Sharma [Mon, 10 Nov 2014 21:25:35 +0000 (15:25 -0600)]
ipcrm : remove msg que, sem or shared memory
Rob Landley [Sun, 9 Nov 2014 20:16:33 +0000 (14:16 -0600)]
Yet more sed tests.
Rob Landley [Sat, 8 Nov 2014 07:51:59 +0000 (01:51 -0600)]
Implement a few sed commands. Not done, and not tested yet.
Rob Landley [Thu, 6 Nov 2014 22:26:59 +0000 (16:26 -0600)]
More sed tests.
Rob Landley [Wed, 5 Nov 2014 00:07:46 +0000 (18:07 -0600)]
Next round of sed infrastructure, parses most commands now, doesn't implement them yet.
Ashwini Sharma [Thu, 30 Oct 2014 23:36:09 +0000 (18:36 -0500)]
Attached are new toys TR and CRONTAB.
*tr.c*: It translate, squezze and delete characters.
Supported classes are alpha, alnum, digit, lower, upper
space, blank, puct, cntrl and xdigit.
*crontab.c*: Companion of crond. It maintains crontab files.
Rob Landley [Thu, 30 Oct 2014 21:47:29 +0000 (16:47 -0500)]
Test for ls -d from Isaac Dunham, and he pointed out -F also disables symlink following.
Rob Landley [Thu, 30 Oct 2014 10:32:54 +0000 (05:32 -0500)]
Bug report from Isaac Dunham: ls -d shouldn't follow command line symlinks without -H or -L (just like ls -l).
Rob Landley [Wed, 29 Oct 2014 23:44:33 +0000 (18:44 -0500)]
First batch of sed tests.
Only good for TEST_HOST=1 at the moment because the test infrastructure itself
depends on sed, so if an unfinished sed is in the $PATH it goes boing. But
hey, corner cases!
I have... more.
Rob Landley [Wed, 29 Oct 2014 19:49:47 +0000 (14:49 -0500)]
Next drop of sed infrastructure, mostly argument parsing, doesn't do anything interesting yet.
Rob Landley [Wed, 29 Oct 2014 04:43:58 +0000 (23:43 -0500)]
Fill out rest of help text for sed.
Rob Landley [Tue, 28 Oct 2014 00:20:31 +0000 (19:20 -0500)]
Fix use after free error spotted by ?ukasz Szpakowski.
Rob Landley [Mon, 27 Oct 2014 23:08:59 +0000 (18:08 -0500)]
O_CLOEXEC was confusing the O_RDONLY test in loopfiles(), resulting in attempts to read from stdout instead of stdin for "-" or no arguments.
Rob Landley [Sun, 26 Oct 2014 18:34:33 +0000 (13:34 -0500)]
xexec() recursion limiter has to go after rebound or toy_init() zeroes it.
Rob Landley [Sun, 26 Oct 2014 17:56:41 +0000 (12:56 -0500)]
Cosmetic tweak: no trailing spaces when ./toybox lists command names.
Rob Landley [Fri, 24 Oct 2014 23:16:32 +0000 (18:16 -0500)]
Basic sed range support, enough for "sed -n 9,11p README" to work.
Rob Landley [Wed, 22 Oct 2014 22:11:06 +0000 (17:11 -0500)]
Teach ln -f to leave original target alone if link creation fails.
Suggested by Ashwini Sharma, I wound up implementing it by creating the new
link at a temporary name and renaming it over the old one instead of renaming
the old file out of the way and putting it back if it failed.
(Because "mkdir -p one/one/blah && ln -sf /bin/one one" would otherwise
rename one/one out of the way and only notice it can't delete it way at the
end when recovery's darn awkward, vs create new thing and if rename fails
(including EISDIR) that's the main error path. And yes the temporary name
is in the same directory as the destination so we never rename between mounts.)
link over the old one instead of renaming the old file and renaming it back.
Rob Landley [Tue, 21 Oct 2014 02:07:16 +0000 (21:07 -0500)]
Random in-progress snapshot of sed, not finished yet.
Rob Landley [Tue, 21 Oct 2014 00:56:05 +0000 (19:56 -0500)]
More static analysis fixes from Ashwini Sharma.
Rob Landley [Tue, 21 Oct 2014 00:52:29 +0000 (19:52 -0500)]
Add TOYBOX_NORECURSE so xexec() won't make internal function calls.
Andy Lutomirski [Sun, 19 Oct 2014 17:08:25 +0000 (12:08 -0500)]
nsenter: A tool to use setns(2)
This implements all of the namespace parts of nsenter, but UID and GID
switching are missing, as are -r and -w (both because they're not strictly
necessary and because the nsenter manpage has an insufficient
description of how they work).
Andy Lutomirski [Sat, 18 Oct 2014 01:40:03 +0000 (18:40 -0700)]
unshare: Fix help and option parsing
The help text was inconsistent, and option parsing was completely broken
(the options mostly did the wrong thing).
Rob Landley [Sat, 18 Oct 2014 22:14:12 +0000 (17:14 -0500)]
Factor out printf-style escape parsing logic from echo.c.
Rob Landley [Thu, 16 Oct 2014 10:58:35 +0000 (05:58 -0500)]
Even bigger ip.c, from Ashwini Sharma.
Rob Landley [Tue, 14 Oct 2014 19:16:34 +0000 (14:16 -0500)]
Use O_CLOEXEC instead of O_RDONLY to signal loopfiles_rw() to close filehandles.
Rob Landley [Tue, 14 Oct 2014 16:40:03 +0000 (11:40 -0500)]
Fix last night's mv commit (use dest, not source).
Rob Landley [Tue, 14 Oct 2014 05:01:22 +0000 (00:01 -0500)]
Implement mv -f and -i.
Rob Landley [Mon, 13 Oct 2014 15:49:24 +0000 (10:49 -0500)]
Started over on sed (by reading the posix spec).
Isaac Dunham [Fri, 10 Oct 2014 14:47:35 +0000 (09:47 -0500)]
acpi: implement -ctV, fix recursion, plug a small leak
* acpi_callback had blindly assumed that a path of 26 chars or more was
the right depth; rely on depth from dirtree root
* acpi -c shows cooling device state
some backlights are set up so that they will report dimmer as higher,
but that's a hardware issue that can't be sanely worked around.
* acpi -t shows temperatures
this implementation will pick up fan, battery temperatures, etc.
(but currently not hwmon-type temperatures, or hdd temps;
acpi 1.7 does not measure these either)
we handle milli-C (typical) and deci-C (I've seen this on Qualcomm
batteries, and not yet anywhere else)
we do *not* handle deci-K yet
* acpi -V shows all sensors
* without saving the result of dirtree_path() to free later, we had
a slow leak.
all callbacks call this once, so save it in GLOBALS()
acpi -t happens to need this anyhow, though using openat()/readall()
instead of readfile() would work.
Rob Landley [Thu, 9 Oct 2014 18:43:32 +0000 (13:43 -0500)]
Various bugfixes (mostly resource leaks) from Ashwini Sharma's static analysis, plus occasional tweak by me while reviewing them.