OSDN Git Service
Rob Landley [Sat, 20 Sep 2014 19:11:59 +0000 (14:11 -0500)]
Fluff out the documentation some more.
Rob Landley [Sat, 20 Sep 2014 18:22:24 +0000 (13:22 -0500)]
Remove debug echo checked in by mistake.
Rob Landley [Sat, 20 Sep 2014 18:22:13 +0000 (13:22 -0500)]
Forgot to check in the updated makefile when I moved the testsuite.
(Did you know you can test individual commands with scripts/test.sh command?
Now you do...)
Rob Landley [Sat, 20 Sep 2014 18:20:17 +0000 (13:20 -0500)]
Typo from the dawn of time: toybox is not capitalized the way BusyBox was.
It's just a word. Capitalize at the start of the sentence, otherwise don't.
Yeah, it could be always capitalized as a proper name but since the command
"toybox" is all lower case, that would be weird.
Rob Landley [Sat, 20 Sep 2014 18:18:44 +0000 (13:18 -0500)]
The ancient GPL (copied from the 2.6.12 kernel) build infrastructure is actually in the "kconfig" directory, not under scripts. Remind me to write a new one from scratch...
(Someone actually submitted a basic kconfig rewrite in awk once, but until I
bite the bullet and write my own awk.c, I just don't know awk well enough to
maintain a large script written in it. Back when I maintained kernel.org/doc
I wrote http://landley.net/hg/kdocs/file/tip/make/menuconfig2html.py but
I am NOT reintroducing python as a build dependency. And neither actually
implemented actual menuing part. So... todo list.)
Rob Landley [Sat, 20 Sep 2014 18:09:14 +0000 (13:09 -0500)]
Move testsuite out of scripts/test into its own top level tests directory, and make ctrl-c kill "make test" more reliably.
Rob Landley [Sat, 20 Sep 2014 18:07:53 +0000 (13:07 -0500)]
Give library probe a progress indicator, and use 150% of detected CPUs to try to keep large SMP machines busy (each compiler invocation is short so they exit almost as fast as we launch them).
Rob Landley [Thu, 18 Sep 2014 23:07:58 +0000 (18:07 -0500)]
Reorder functions to get rid of unnecessary prototypes, and move a global into GLOBALS.
Isaac Dunham [Thu, 18 Sep 2014 18:05:21 +0000 (13:05 -0500)]
rm -rf needs to chmod directories to u+rwx, because directories need +x to search.
(Fixes messages about not being able to delete directories when running make test).
Ashwini Sharma [Thu, 18 Sep 2014 16:47:42 +0000 (11:47 -0500)]
A few fixes for issues reported in static analysis.
Rob Landley [Thu, 18 Sep 2014 01:21:44 +0000 (20:21 -0500)]
Cleanup pass on README.
Other versions are adding Cached from /proc/meminfo to free buffers/cache
(and subtracting it from used), but sysinfo() doesn't provide it. (But it
provide "high memory", which hasn't been relevant for almost a decade...)
But that's a design change, not a cleanup issue.
Rob Landley [Wed, 17 Sep 2014 23:25:05 +0000 (18:25 -0500)]
Update README for pending directory, include list of code outside of pending (grandfathered) awaiting cleanup.
Rob Landley [Wed, 17 Sep 2014 23:24:10 +0000 (18:24 -0500)]
Minor cleanup pass on touch.
Rob Landley [Wed, 17 Sep 2014 13:26:07 +0000 (08:26 -0500)]
Cleanup pass on cut, more to do.
Cut predates the "pending" directory, so was checked in as-is. Ashwini
Sharma's recent static analysis fixes touched this file, but there's a lot
more to do than the static analyzer found.
Rob Landley [Tue, 16 Sep 2014 12:21:56 +0000 (07:21 -0500)]
Cleanup pass on useradd.
Rob Landley [Mon, 15 Sep 2014 02:24:50 +0000 (21:24 -0500)]
Add cpio -p
Rob Landley [Mon, 15 Sep 2014 01:37:23 +0000 (20:37 -0500)]
find -xdev should return mount points, just not contents.
Rob Landley [Mon, 15 Sep 2014 00:54:19 +0000 (19:54 -0500)]
Second attempt at one way xpopen().
Rob Landley [Sun, 14 Sep 2014 17:29:44 +0000 (12:29 -0500)]
Split xpopen() into xpopen_both(), xpopen(), and xrun() depending on whether we want to redirect both, one, or neither of stdin/stdout.
Rob Landley [Sat, 13 Sep 2014 19:48:37 +0000 (14:48 -0500)]
Bug report from luckboy: rm -f on a broken symlink didn't work because our "does it exist" test (to avoid errors on rm -f of nonexistent files) said it didn't.
The fix: replace the access() with unlink(), which produces the same "does not
exist" errno and has the added bonus of acting as a fastpath for rm -f on
non-directories. (And since it produces a different error on directories,
falls through to the old behavior there.)
Most of this commit is comment updates explaining being subtle. :)
Rob Landley [Fri, 12 Sep 2014 01:50:10 +0000 (20:50 -0500)]
Create a generated/build.sh with a single compiler command line to rebuild the toybox_unstripped binary using the existing generated/*.h files.
This way we can snapshot the generated/*.{h,sh} from a defconfig build into
a "shipped" directory or something, and then people can maybe build on crazy
crippled environments like pcbsd that haven't got gmake and put bash under
/usr/local so none of the #!/scripts can find it. This solves at least
part of the "toybox can build with itself but you need to build toybox first
to have the tools to run the build scripts" problem.
Next up: work out the minimal config to provide the build tools needed
to run an actual build. (This should, eventually, include a "make" command
if freebsd's kernel is going to refuse to build with netbsd's "make" and
we don't just write off the whole thing as crazy. But it probably shouldn't
include commands that #include <linux/*.h> if we are trying to make that work.)
Rob Landley [Thu, 11 Sep 2014 05:04:37 +0000 (00:04 -0500)]
Oops, unbreak make.sh.
Clearing out old .o files needs -r now that generated/obj has its own subdirectory. (Works if you make clean between, but shouldn't need it.)
Rob Landley [Wed, 10 Sep 2014 04:44:48 +0000 (23:44 -0500)]
Ignore -m option to cpio, it's what we do anyway so it's not an error.
Rob Landley [Wed, 10 Sep 2014 04:42:25 +0000 (23:42 -0500)]
Two problems: 1) Sometimes toy_exec() needs to re-exec to gain dropped root permissions, 2) shouldn't recurse forever without exec, stack depth increases and we may leak other resources. Limit it to ~5 levels.
Rob Landley [Wed, 10 Sep 2014 01:13:03 +0000 (20:13 -0500)]
Make tweaks: collate generated/*.o files into their own subdirectory, add PIPEFAIL for better error reporting, and simpler regex to select toys/*/*.c list based on NEWTOY/OLDTOY macros.
Rob Landley [Mon, 8 Sep 2014 13:51:45 +0000 (08:51 -0500)]
Fix more memory leaks reported by Ashwini Sharma.
Rob Landley [Mon, 8 Sep 2014 13:40:06 +0000 (08:40 -0500)]
Don't close device handle until after calling flush ioctls, reported by Ashwini Sharma.
Rob Landley [Mon, 8 Sep 2014 13:26:02 +0000 (08:26 -0500)]
Add error test and fix memory leak, reported by Ashwini Sharma.
Rob Landley [Mon, 8 Sep 2014 00:33:18 +0000 (19:33 -0500)]
Promote mount. It's not perfect, but it basically works now.
Rob Landley [Mon, 8 Sep 2014 00:30:05 +0000 (19:30 -0500)]
Fix mount --move bug.
Rob Landley [Sun, 7 Sep 2014 19:42:51 +0000 (14:42 -0500)]
Debugging pass on mount. Not quite done yet, but the basics seem to work now.
Rob Landley [Sat, 6 Sep 2014 18:24:58 +0000 (13:24 -0500)]
Work around uClibc brain-damage.
Rob Landley [Thu, 4 Sep 2014 05:23:51 +0000 (00:23 -0500)]
Don't hang for $CPUS=1.
echo prints a newline if it has nothing to print, so wc -l always returns at least 1. Fix: echo -n
Divya Kothari [Wed, 3 Sep 2014 18:38:18 +0000 (13:38 -0500)]
Testsuites for toybox command - "tar", "bzcat", "xzcat", "zcat" and "hostname".
Divya Kothari [Wed, 3 Sep 2014 18:32:32 +0000 (13:32 -0500)]
chmod testsuite and link testsuite.
Chmod ?
In this testsuite after change file mode bits, we are comparing file mode with expected ones.
One additional "." is coming with modes (actual result). That?s why test cases are getting failed.
This patch will remove additional "." from actual result.
Link ?
Added more test cases.
Rob Landley [Mon, 1 Sep 2014 17:47:32 +0000 (12:47 -0500)]
Add cp -F to force delete of existing destination files, and make install command use that.
-F is equivalent to the gnu/dammit flag --we-think-long-options-without-short-options-are-a-good-idea
Rob Landley [Mon, 1 Sep 2014 03:07:43 +0000 (22:07 -0500)]
More parallel build tweaks.
echo "$PENDING" needs the quotes to avoid gluing the lines together, which
prevents wc -l or head -n +2 from working right.
Rob Landley [Sun, 31 Aug 2014 19:06:37 +0000 (14:06 -0500)]
Next mount checkpoint.
Testing level: It compiled. If any portion of this works, I'll be amazed.
Still a bunch of todo items (see giant TODO block after globals)
Rob Landley [Sun, 31 Aug 2014 16:58:39 +0000 (11:58 -0500)]
Give a hint when setuid logic fails.
Toybox expects to be setuid root; setuid some other user confuses the attempt to drop privileges, and we err on the side of avoiding shenanigans.
Rob Landley [Sat, 30 Aug 2014 22:44:07 +0000 (17:44 -0500)]
Old compilers complain about linker options passed with -c, so split out $LDOPTIMIZE.
Rob Landley [Sat, 30 Aug 2014 21:34:46 +0000 (16:34 -0500)]
Another fix from Johan Bergstr?m, using the gnu/dammit version of sort on the host can be screwed up by more than one environment variable.
Rob Landley [Sat, 30 Aug 2014 18:03:40 +0000 (13:03 -0500)]
Add VERBOSE=fail to "make tests", based on suggestion from Johan Bergstr?m.
Ashwini Sharma [Tue, 26 Aug 2014 03:01:11 +0000 (22:01 -0500)]
ipcs : display all the IPC fascilities information
crond : CRON scheduler
Rob Landley [Mon, 25 Aug 2014 04:46:23 +0000 (23:46 -0500)]
Work in progress snapshot of mount, with fallout to umount. (Not done yet.)
Rob Landley [Mon, 25 Aug 2014 03:42:47 +0000 (22:42 -0500)]
Fix parallel make not always catching errors before link time.
jobs -p removes finished jobs from the list after reporting them once,
so we need to record the output and remove duplicates ourselves.
Rob Landley [Sun, 24 Aug 2014 04:08:59 +0000 (23:08 -0500)]
Promote blockdev to other.
Rob Landley [Sun, 24 Aug 2014 04:08:04 +0000 (23:08 -0500)]
Cleanup blockdev.
Isaac Dunham [Sat, 23 Aug 2014 04:34:52 +0000 (23:34 -0500)]
getty needs fd 0 to stay open.
The O_CLOEXEC reversal resulted in login failing.
Rob Landley [Thu, 21 Aug 2014 03:23:39 +0000 (22:23 -0500)]
Promote inotifyd to other.
Rob Landley [Thu, 21 Aug 2014 03:22:46 +0000 (22:22 -0500)]
Minor help text tweak for inotifyd.
Rob Landley [Thu, 21 Aug 2014 03:21:36 +0000 (22:21 -0500)]
Cleanup inotifyd.
Rob Landley [Tue, 19 Aug 2014 00:10:45 +0000 (19:10 -0500)]
Cleanups on useradd/groupadd/groupdel, and put TOYBOX_UID_SYS and TOYBOX_UID_USR in the top level Config.
Rob Landley [Sat, 16 Aug 2014 14:46:42 +0000 (09:46 -0500)]
Add install to cp/mv.
Rob Landley [Fri, 15 Aug 2014 23:53:01 +0000 (18:53 -0500)]
Fix bug reported by Ashwini Sharma: [-abc] syntax to switch off a command forget
s _all_ saved command line arguments in GLOBALS(), not just for the command bein
g dropped.
Rob Landley [Fri, 15 Aug 2014 15:50:39 +0000 (10:50 -0500)]
If string_to_mode() is called on a base mode with S_ISDIR() and such set, pass those extra bits through.
Rob Landley [Tue, 12 Aug 2014 23:05:55 +0000 (18:05 -0500)]
Enable a command's sub-options in single builds.
Ashwini Sharma [Tue, 12 Aug 2014 12:14:58 +0000 (07:14 -0500)]
A toy _BLOCKDEV_ to get/set block device properties.
Ashwini Sharma [Tue, 12 Aug 2014 12:09:01 +0000 (07:09 -0500)]
Patches to commands for issues reported from static analysis tool.
portability.h.patch - it is for O_CLOEXEC, as compiler complained of it.
Makefile.patch - for cleaning generated/*.o files and libopts.dat file
[Fixup to uniq.c from Rob.]
Rob Landley [Tue, 12 Aug 2014 01:15:19 +0000 (20:15 -0500)]
Promote lspci.
Rob Landley [Tue, 12 Aug 2014 01:11:58 +0000 (20:11 -0500)]
Cleanup pass on lspci.
Rob Landley [Sun, 10 Aug 2014 17:01:49 +0000 (12:01 -0500)]
Update clean to clean up after new parallel build.
Rob Landley [Sun, 10 Aug 2014 04:49:48 +0000 (23:49 -0500)]
Disable xopen's default O_CLOEXEC for oneit.
Rob Landley [Sat, 9 Aug 2014 19:33:34 +0000 (14:33 -0500)]
Parallelize the build. (set CPUS=1 to force single processor build, or another number to override processor count autodetect.)
Rob Landley [Fri, 8 Aug 2014 04:19:18 +0000 (23:19 -0500)]
Fix -mindepth and -maxdepth to not drill down into excluded directories.
The fact other implementations don't implement "! -mindepth" doesn't mean we can't. Also, find uses +N, N, -N for everything else but this extension doesn't. Also, -depth already had a definition and this has nothing to do with that. It's a poorly thought-out extension, is what I'm saying.
Rob Landley [Wed, 6 Aug 2014 04:21:18 +0000 (23:21 -0500)]
More find bugfixes.
Rob Landley [Wed, 6 Aug 2014 00:44:59 +0000 (19:44 -0500)]
Rereading posix find.c page: "Specifying more than one of the mutually-exclusive options -H and -L shall not be considered an error. The last option specified shall determine the behavior of the utility."
Rob Landley [Wed, 6 Aug 2014 00:41:36 +0000 (19:41 -0500)]
find.c: Posix wants loop detection.
Rob Landley [Wed, 6 Aug 2014 00:32:44 +0000 (19:32 -0500)]
Building busybox from source needs find -not (a synonym for posix's "!").
Rob Landley [Wed, 6 Aug 2014 00:27:02 +0000 (19:27 -0500)]
Fix a couple patch bugs concerning error output.
Rob Landley [Tue, 5 Aug 2014 00:28:41 +0000 (19:28 -0500)]
find.c: add -mindepth, -maxdepth, and document -newer and -depth.
Rob Landley [Sun, 3 Aug 2014 20:50:10 +0000 (15:50 -0500)]
Implement exec -user, -group, and -newer. Enable find in defconfig.
Rob Landley [Sun, 3 Aug 2014 02:07:43 +0000 (21:07 -0500)]
Squash mix of tabs and spaces to just spaces.
Rob Landley [Sun, 3 Aug 2014 00:54:38 +0000 (19:54 -0500)]
Missed checking in dirtree_recurse() change (now needs specific DIRTREE_SYMFOLLOW value, not just true/false).
Rob Landley [Sun, 3 Aug 2014 00:52:44 +0000 (19:52 -0500)]
Cosmetic tweak, slightly more conventional for loop.
Rob Landley [Sun, 3 Aug 2014 00:50:03 +0000 (19:50 -0500)]
Yank xrealpath prototype since the function's gone.
Rob Landley [Sun, 3 Aug 2014 00:49:10 +0000 (19:49 -0500)]
Add --help support to single.sh builds.
Rob Landley [Sun, 3 Aug 2014 00:40:35 +0000 (19:40 -0500)]
Unbreak find -exec.
Ashwini Sharma [Sat, 2 Aug 2014 17:00:20 +0000 (12:00 -0500)]
New toys unified DIFF and USERDEL.
Bradley Conroy [Sat, 2 Aug 2014 16:49:30 +0000 (11:49 -0500)]
mix.c - A very basic mixer.
Rob Landley [Fri, 1 Aug 2014 23:50:46 +0000 (18:50 -0500)]
factor: catch integer overflow.
Now factor
9223372036854775783 (largest positive 64 bit signed prime) takes a
couple minutes but gives the right answer.
Rob Landley [Fri, 1 Aug 2014 14:08:00 +0000 (09:08 -0500)]
Add factor.
I was reading http://www.muppetlabs.com/~breadbox/txt/rsa.html and it mentioned
"factor" and I noticed it was in coreutils. I'm not sure why it's in coreutils,
but it's pretty trivial, so...
Rob Landley [Thu, 31 Jul 2014 01:21:13 +0000 (20:21 -0500)]
find.c: fix -iname.
Rob Landley [Thu, 31 Jul 2014 00:22:55 +0000 (19:22 -0500)]
As long as I had to write xabspath(), no point in wrapping realpath().
Rob Landley [Wed, 30 Jul 2014 01:04:38 +0000 (20:04 -0500)]
find.c: first pass at case case insensitivity and exec. (Needs more debugging.)
Rob Landley [Wed, 30 Jul 2014 01:02:31 +0000 (20:02 -0500)]
Actually set the again flag when calling the dirtree comeagain callback.
Rob Landley [Sun, 27 Jul 2014 20:19:49 +0000 (15:19 -0500)]
Patch from Isaac Dunham to work around the deficiencies in musl's regex engine (which break building under alpine linux).
Musl's regex engine doesn't support \| which changes the behavior of busybox
sed, breaks toybox grep... I need to come up with a musl patch, in the meantime
here's a workaround.
Rob Landley [Sat, 26 Jul 2014 18:30:40 +0000 (13:30 -0500)]
Move DIRTREE_COMEAGAIN second callback up to when the filehandle is still open, and add dir->again variable to distinguish second call instead of checking for -1 filehandle.
Rob Landley [Sat, 26 Jul 2014 18:27:07 +0000 (13:27 -0500)]
Default xcreate/xopen to O_CLOEXEC. (Pass O_CLOEXEC in the flags to switch it back off.)
This way we're not leaking filehandles to children from things like find -exec.
Rob Landley [Sat, 26 Jul 2014 18:22:59 +0000 (13:22 -0500)]
Document more cleanup.
Rob Landley [Tue, 22 Jul 2014 01:03:06 +0000 (20:03 -0500)]
Have single.sh enable I18N and FLOAT.
Rob Landley [Tue, 22 Jul 2014 00:57:36 +0000 (19:57 -0500)]
Improve gid/uid error messages.
Rob Landley [Tue, 22 Jul 2014 00:56:53 +0000 (19:56 -0500)]
Little endian and big endian versions of peek (for host.c).
Rob Landley [Tue, 22 Jul 2014 00:55:06 +0000 (19:55 -0500)]
Fix memory leak in error path.
Rob Landley [Mon, 21 Jul 2014 03:08:46 +0000 (22:08 -0500)]
Don't go into an endless loop if we hit a bad utf8 sequence without -q.
Rob Landley [Mon, 21 Jul 2014 02:34:49 +0000 (21:34 -0500)]
Isaac Dunham spotted that dhcp was also reimplementing daemon().
Rob Landley [Sun, 20 Jul 2014 21:34:36 +0000 (16:34 -0500)]
Add utf8 support to ls -C.
Use wcwidth() instead of strlen(), and extend the -q substitution to also
whiteout nonprintable characters that are nonparseable utf8 snippets.
Rob Landley [Sun, 20 Jul 2014 01:54:29 +0000 (20:54 -0500)]
find needs "c" suffix to -size.
Rob Landley [Fri, 18 Jul 2014 23:31:41 +0000 (18:31 -0500)]
Find bugfixes.
The check for -print vs -print0 was tested before I optimized out the "-" in the strcmps, and I didn't adjust the offset or retest it. (Ooops.)
Also, I wasn't clearing the ! value when descending into parentheticals, so "find . -name blah -o \! \( -stuff -o -thing \)" acted like it had a spurious second ! before -stuff inside the parentheses.
Rob Landley [Fri, 18 Jul 2014 03:52:58 +0000 (22:52 -0500)]
Apparently I deleted this locally but forgot to commit the removal. Oops.
Rob Landley [Fri, 18 Jul 2014 03:50:49 +0000 (22:50 -0500)]
Use libc daemon() instead of pending daemonize.