platform/upstream/toybox.git
9 years agoDon't include asm/* files directly.
Rob Landley [Fri, 21 Nov 2014 16:06:45 +0000 (10:06 -0600)]
Don't include asm/* files directly.

9 years agoPatch from Elliott Hughes for Android/bionic build.
Rob Landley [Fri, 21 Nov 2014 12:42:37 +0000 (06:42 -0600)]
Patch from Elliott Hughes for Android/bionic build.

9 years agoMake md5sum and sha1sum work on big endian systems.
Rob Landley [Thu, 20 Nov 2014 03:38:00 +0000 (21:38 -0600)]
Make md5sum and sha1sum work on big endian systems.

9 years agoFixups for the android/bionic build probes patch.
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.

9 years agoprobe for getspnam(), forkpty(), utmpx, replace sethostname()
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.

9 years agoFix "tail -c 10" segfault spotted by Lukasz Szpakowski.
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.

9 years agoMore sed bugfixes.
Rob Landley [Tue, 18 Nov 2014 10:25:27 +0000 (04:25 -0600)]
More sed bugfixes.

9 years agosed: fix 'q', and { }, and } after s/// with no semicolon.
Rob Landley [Tue, 18 Nov 2014 03:21:04 +0000 (21:21 -0600)]
sed: fix 'q', and { }, and } after s/// with no semicolon.

9 years agoMore sed corner cases. (Empty regex repeats previous regex, implement -i, etc.)
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.)

9 years agoFix more sed bugs.
Rob Landley [Mon, 17 Nov 2014 00:58:22 +0000 (18:58 -0600)]
Fix more sed bugs.

9 years agoFix sed 'b' with no label and 'N' in general.
Rob Landley [Sun, 16 Nov 2014 20:21:42 +0000 (14:21 -0600)]
Fix sed 'b' with no label and 'N' in general.

9 years agoMore sed bugfixes. (Did you know s/[/]// is a valid sed expression?)
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?)

9 years agoDebugging pass on sed: make the existing test suite pass.
Rob Landley [Sat, 15 Nov 2014 22:16:29 +0000 (16:16 -0600)]
Debugging pass on sed: make the existing test suite pass.

9 years agoAdd a few more sed tests.
Rob Landley [Fri, 14 Nov 2014 22:44:21 +0000 (16:44 -0600)]
Add a few more sed tests.

9 years agoAdd color support for scripts/test.sh and new SKIP_HOST for tests expected to fail...
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.

9 years agosed: implement s & and \1 backrefs.
Rob Landley [Fri, 14 Nov 2014 21:53:17 +0000 (15:53 -0600)]
sed: implement s & and \1 backrefs.

9 years agoImplement more sed plumbing, including s/// (without \1 or & yet).
Rob Landley [Wed, 12 Nov 2014 20:47:57 +0000 (14:47 -0600)]
Implement more sed plumbing, including s/// (without \1 or & yet).

9 years agoRemove unnecessary assignment spotted by Cynt Rynt.
Rob Landley [Tue, 11 Nov 2014 21:08:25 +0000 (15:08 -0600)]
Remove unnecessary assignment spotted by Cynt Rynt.

9 years agoImplement another largeish chunk of sed. Untested, unfinished, do not use yet.
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.

9 years agoFirst cleanup pass on hwclock.
Rob Landley [Mon, 10 Nov 2014 23:14:11 +0000 (17:14 -0600)]
First cleanup pass on hwclock.

9 years agohwclock: get and set the hwclock
Ashwini Sharma [Mon, 10 Nov 2014 21:26:08 +0000 (15:26 -0600)]
hwclock: get and set the hwclock

9 years agoipcrm : remove msg que, sem or shared memory
Ashwini Sharma [Mon, 10 Nov 2014 21:25:35 +0000 (15:25 -0600)]
ipcrm : remove msg que, sem or shared memory

9 years agoYet more sed tests.
Rob Landley [Sun, 9 Nov 2014 20:16:33 +0000 (14:16 -0600)]
Yet more sed tests.

10 years agoImplement a few sed commands. Not done, and not tested yet.
Rob Landley [Sat, 8 Nov 2014 07:51:59 +0000 (01:51 -0600)]
Implement a few sed commands. Not done, and not tested yet.

10 years agoMore sed tests.
Rob Landley [Thu, 6 Nov 2014 22:26:59 +0000 (16:26 -0600)]
More sed tests.

10 years agoNext round of sed infrastructure, parses most commands now, doesn't implement them...
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.

10 years agoAttached are new toys TR and CRONTAB.
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.

10 years agoTest for ls -d from Isaac Dunham, and he pointed out -F also disables symlink following.
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.

10 years agoBug report from Isaac Dunham: ls -d shouldn't follow command line symlinks without...
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).

10 years agoFirst batch of sed tests.
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.

10 years agoNext drop of sed infrastructure, mostly argument parsing, doesn't do anything interes...
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.

10 years agoFill out rest of help text for sed.
Rob Landley [Wed, 29 Oct 2014 04:43:58 +0000 (23:43 -0500)]
Fill out rest of help text for sed.

10 years agoFix use after free error spotted by ?ukasz Szpakowski.
Rob Landley [Tue, 28 Oct 2014 00:20:31 +0000 (19:20 -0500)]
Fix use after free error spotted by ?ukasz Szpakowski.

10 years agoO_CLOEXEC was confusing the O_RDONLY test in loopfiles(), resulting in attempts to...
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.

10 years agoxexec() recursion limiter has to go after rebound or toy_init() zeroes it.
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.

10 years agoCosmetic tweak: no trailing spaces when ./toybox lists command names.
Rob Landley [Sun, 26 Oct 2014 17:56:41 +0000 (12:56 -0500)]
Cosmetic tweak: no trailing spaces when ./toybox lists command names.

10 years agoBasic sed range support, enough for "sed -n 9,11p README" to work.
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.

10 years agoTeach ln -f to leave original target alone if link creation fails.
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.

10 years agoRandom in-progress snapshot of sed, not finished yet.
Rob Landley [Tue, 21 Oct 2014 02:07:16 +0000 (21:07 -0500)]
Random in-progress snapshot of sed, not finished yet.

10 years agoMore static analysis fixes from Ashwini Sharma.
Rob Landley [Tue, 21 Oct 2014 00:56:05 +0000 (19:56 -0500)]
More static analysis fixes from Ashwini Sharma.

10 years agoAdd TOYBOX_NORECURSE so xexec() won't make internal function calls.
Rob Landley [Tue, 21 Oct 2014 00:52:29 +0000 (19:52 -0500)]
Add TOYBOX_NORECURSE so xexec() won't make internal function calls.

10 years agonsenter: A tool to use setns(2)
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).

10 years agounshare: Fix help and option parsing
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).

10 years agoFactor out printf-style escape parsing logic from echo.c.
Rob Landley [Sat, 18 Oct 2014 22:14:12 +0000 (17:14 -0500)]
Factor out printf-style escape parsing logic from echo.c.

10 years agoEven bigger ip.c, from Ashwini Sharma.
Rob Landley [Thu, 16 Oct 2014 10:58:35 +0000 (05:58 -0500)]
Even bigger ip.c, from Ashwini Sharma.

10 years agoUse O_CLOEXEC instead of O_RDONLY to signal loopfiles_rw() to close filehandles.
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.

10 years agoFix last night's mv commit (use dest, not source).
Rob Landley [Tue, 14 Oct 2014 16:40:03 +0000 (11:40 -0500)]
Fix last night's mv commit (use dest, not source).

10 years agoImplement mv -f and -i.
Rob Landley [Tue, 14 Oct 2014 05:01:22 +0000 (00:01 -0500)]
Implement mv -f and -i.

10 years agoStarted over on sed (by reading the posix spec).
Rob Landley [Mon, 13 Oct 2014 15:49:24 +0000 (10:49 -0500)]
Started over on sed (by reading the posix spec).

10 years agoacpi: implement -ctV, fix recursion, plug a small leak
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.

10 years agoVarious bugfixes (mostly resource leaks) from Ashwini Sharma's static analysis, plus...
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.

10 years agoFix use-after-free spotted by Ashwini Sharma's static analysis.
Rob Landley [Thu, 9 Oct 2014 17:17:36 +0000 (12:17 -0500)]
Fix use-after-free spotted by Ashwini Sharma's static analysis.

We xstrdup() an optargs string to avoid modifying our environment space
(because it can change what "ps" shows to other processes), and then parse
out colon delimited strings and save them in globals that can later be used
in the -v codepath and so on. But those globals _aren't_ strdup (no point)
which means we can't free the string while we're still using pointers into
the middle of it. So move the free to the end.

(I hardly ever test with CFG_TOYBOX_FREE switched on because even nommu
doesn't need it.)

10 years agoUpdate status lists. (Once the pending-not-in-pending files go away (see toys/pending...
Rob Landley [Wed, 8 Oct 2014 18:59:16 +0000 (13:59 -0500)]
Update status lists. (Once the pending-not-in-pending files go away (see toys/pending/README), this can be probed from the source.)

10 years agoBasic update of the roadmap and status pages. (Both need a good scrub and polish...
Rob Landley [Tue, 7 Oct 2014 19:11:54 +0000 (14:11 -0500)]
Basic update of the roadmap and status pages. (Both need a good scrub and polish beyond this.)

10 years agoRelease notes for 0.5.0.
Rob Landley [Thu, 2 Oct 2014 12:53:27 +0000 (07:53 -0500)]
Release notes for 0.5.0.

10 years agoAdded tag 0.5.0 for changeset 7afd32673a5c
Rob Landley [Thu, 2 Oct 2014 12:47:08 +0000 (07:47 -0500)]
Added tag 0.5.0 for changeset 7afd32673a5c

10 years agoWorkaround for musl's faccessat bug (the rm -r "error: is a directory" thing).
Rob Landley [Thu, 2 Oct 2014 12:24:38 +0000 (07:24 -0500)]
Workaround for musl's faccessat bug (the rm -r "error: is a directory" thing).

The Linux man page says I can use AT_SYMLINK_NOFOLLOW. It works in glibc,
uclibc, and klibc, but musl returns -EINVAL any time you pass in that flag
and the maintainer says that's not a bug and insists the man page and those
other libraries all change to match musl's behavior.

Toybox uses it to avoid scheduling unnecessary metadata writes for things we're
about to delete (have to chmod unreadable directories so we can descend into
them to delete their contents, the chmod happens before we descend so the
disk I/O has plenty of time to be scheduled) because the extra writes wear out
SSD faster. It's just an optimization and I don't really care if it works
_well_ (the fchmodat call _also_ takes AT_SYMLINK_NOFOLLOW so that's covered),
but musl's behavior uniquely makes the check always error and thus breaks normal
"rm -r".

Yes this workaround is checking #ifdef __MUSL__ which the library does not
supply (because its code is perfect and will thus never need to be worked
around). You can CFLAGS=-D__MUSL__ if you don't echo "#define __MUSL__" >>
include/features.h when installing the library.

10 years agoBugfix from Ashwini Sharma: Z timezone required by posix for touch but not for libc...
Rob Landley [Thu, 2 Oct 2014 00:57:34 +0000 (19:57 -0500)]
Bugfix from Ashwini Sharma: Z timezone required by posix for touch but not for libc, so we have to implement it here.

10 years agoUpdated version, having complete support for ip _link_, _addr_, _rule_, _route_ and...
Ashwini Sharma [Mon, 29 Sep 2014 00:34:53 +0000 (19:34 -0500)]
Updated version, having complete support for ip _link_, _addr_, _rule_, _route_ and _tunnel_ options.

10 years agoFix two mount bugs: 1) Don't skip a filesystem type when setting up loopback mount...
Rob Landley [Sun, 28 Sep 2014 23:22:34 +0000 (18:22 -0500)]
Fix two mount bugs: 1) Don't skip a filesystem type when setting up loopback mount, 2) Don't stop checking filesystem types due to EBUSY, it may mean already mounted by another filesystem type you haven't tried yet.

10 years agomount: terminate list so unknown user mount attempts don't endlessly loop, add better...
Rob Landley [Sun, 28 Sep 2014 18:15:41 +0000 (13:15 -0500)]
mount: terminate list so unknown user mount attempts don't endlessly loop, add better error reporting.

10 years agoBrown paper bag time: comma_scan() didn't work for anything but the last entry.
Rob Landley [Sun, 28 Sep 2014 18:11:20 +0000 (13:11 -0500)]
Brown paper bag time: comma_scan() didn't work for anything but the last entry.

10 years agoMulti-build single.sh should exit with an error when build breaks.
Rob Landley [Sun, 28 Sep 2014 02:07:00 +0000 (21:07 -0500)]
Multi-build single.sh should exit with an error when build breaks.

10 years agoCleanup pass on groupdel.
Rob Landley [Sun, 28 Sep 2014 02:04:47 +0000 (21:04 -0500)]
Cleanup pass on groupdel.

10 years agoAllow single.sh to build more than one command per invocation.
Rob Landley [Sun, 28 Sep 2014 01:31:16 +0000 (20:31 -0500)]
Allow single.sh to build more than one command per invocation.

10 years agoUntangle id/groups/logname so single.sh can build each one standalone.
Rob Landley [Sun, 28 Sep 2014 01:28:33 +0000 (20:28 -0500)]
Untangle id/groups/logname so single.sh can build each one standalone.

10 years agoHave OLDTOY emit (redundant) function prototype so single.sh can build OLDTOY standal...
Rob Landley [Sun, 28 Sep 2014 00:59:28 +0000 (19:59 -0500)]
Have OLDTOY emit (redundant) function prototype so single.sh can build OLDTOY standalone (if it has its own config symbol).

10 years agoDon't segfault for --help of single.sh build of OLDTOY commands that use another...
Rob Landley [Sun, 28 Sep 2014 00:58:18 +0000 (19:58 -0500)]
Don't segfault for --help of single.sh build of OLDTOY commands that use another command's help.

10 years agoThe only illegal characters in a username are ":" (field separator), "\n" (line separ...
Rob Landley [Fri, 26 Sep 2014 23:49:44 +0000 (18:49 -0500)]
The only illegal characters in a username are ":" (field separator), "\n" (line separator), and "/" (filename separator).

Restricting usernames to the legacy posix character allowed set (for filenames,
so the $HOME directory is creatable on VFAT and similar) means you can't have
UTF-8 usernames. Linux allows any character but / and NUL in filenames.
Since root is creating these entries, we assume root knows what it's doing.

10 years agoSeparate more commands so single.sh can build them standalone.
Rob Landley [Fri, 26 Sep 2014 23:42:23 +0000 (18:42 -0500)]
Separate more commands so single.sh can build them standalone.

10 years agoWhen killall was invoked without arguments, there appeared segmentation fault
?ukasz Szpakowski [Mon, 22 Sep 2014 13:32:21 +0000 (08:32 -0500)]
When killall was invoked without arguments, there appeared segmentation fault

10 years agoFix du test: du symlink -> "0\tsymlink"
Felix Janda [Mon, 22 Sep 2014 13:22:12 +0000 (08:22 -0500)]
Fix du test: du symlink -> "0\tsymlink"

10 years agoRespond to two static analysis issues in dirtree_path() reported by Ashwini Sharma.
Rob Landley [Mon, 22 Sep 2014 12:52:15 +0000 (07:52 -0500)]
Respond to two static analysis issues in dirtree_path() reported by Ashwini Sharma.

dirtree->name is an array, not a pointer, so can't be zero. Remove the test.

We dereference plen without checking it for null but calling dirtree_path(0, 0)
is pilot error: only the _first_ call can have plen = 0. Add a comment.

10 years agoStart on ping.c.
Rob Landley [Mon, 22 Sep 2014 03:44:20 +0000 (22:44 -0500)]
Start on ping.c.

10 years agoTweak portability.h for uClibc version in buildroot defconfig.
Rob Landley [Sat, 20 Sep 2014 23:46:47 +0000 (18:46 -0500)]
Tweak portability.h for uClibc version in buildroot defconfig.

I've been locally patching uClibc to not violate posix-2008 (you don't need
to define a GNU macro to get a posix function), but uClibc is obsolete and
moribund (development peaked in 2006, last bugfix release was over 2 years
ago), and the largest remaining user (buildroot) doesn't bother to apply such
a patch. Since even buildroot is slowly migrating to musl-libc, just do the
portability tweak for what the last release of the old thing actually did.

10 years agoAlways call setlocale if I18N is enabled, so nested toy_exec() can switch it back...
Rob Landley [Sat, 20 Sep 2014 22:51:23 +0000 (17:51 -0500)]
Always call setlocale if I18N is enabled, so nested toy_exec() can switch it back off if necessary.

10 years agoDelete generated/README.txt (the contents are in code.html now) so clean can just...
Rob Landley [Sat, 20 Sep 2014 19:20:28 +0000 (14:20 -0500)]
Delete generated/README.txt (the contents are in code.html now) so clean can just remove the "generated" directory entirely.

10 years agoCapitalize "toybox" more consistently on the about page.
Rob Landley [Sat, 20 Sep 2014 19:12:55 +0000 (14:12 -0500)]
Capitalize "toybox" more consistently on the about page.

10 years agoFluff out the documentation some more.
Rob Landley [Sat, 20 Sep 2014 19:11:59 +0000 (14:11 -0500)]
Fluff out the documentation some more.

10 years agoRemove debug echo checked in by mistake.
Rob Landley [Sat, 20 Sep 2014 18:22:24 +0000 (13:22 -0500)]
Remove debug echo checked in by mistake.

10 years agoForgot to check in the updated makefile when I moved the testsuite.
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...)

10 years agoTypo from the dawn of time: toybox is not capitalized the way BusyBox was.
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.

10 years agoThe ancient GPL (copied from the 2.6.12 kernel) build infrastructure is actually...
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.)

10 years agoMove testsuite out of scripts/test into its own top level tests directory, and make...
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.

10 years agoGive library probe a progress indicator, and use 150% of detected CPUs to try to...
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).

10 years agoReorder functions to get rid of unnecessary prototypes, and move a global into GLOBALS.
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.

10 years agorm -rf needs to chmod directories to u+rwx, because directories need +x to search.
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).

10 years agoA few fixes for issues reported in static analysis.
Ashwini Sharma [Thu, 18 Sep 2014 16:47:42 +0000 (11:47 -0500)]
A few fixes for issues reported in static analysis.

10 years agoCleanup pass on README.
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.

10 years agoUpdate README for pending directory, include list of code outside of pending (grandfa...
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.

10 years agoMinor cleanup pass on touch.
Rob Landley [Wed, 17 Sep 2014 23:24:10 +0000 (18:24 -0500)]
Minor cleanup pass on touch.

10 years agoCleanup pass on cut, more to do.
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.

10 years agoCleanup pass on useradd.
Rob Landley [Tue, 16 Sep 2014 12:21:56 +0000 (07:21 -0500)]
Cleanup pass on useradd.

10 years agoAdd cpio -p
Rob Landley [Mon, 15 Sep 2014 02:24:50 +0000 (21:24 -0500)]
Add cpio -p

10 years agofind -xdev should return mount points, just not contents.
Rob Landley [Mon, 15 Sep 2014 01:37:23 +0000 (20:37 -0500)]
find -xdev should return mount points, just not contents.

10 years agoSecond attempt at one way xpopen().
Rob Landley [Mon, 15 Sep 2014 00:54:19 +0000 (19:54 -0500)]
Second attempt at one way xpopen().

10 years agoSplit xpopen() into xpopen_both(), xpopen(), and xrun() depending on whether we want...
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.

10 years agoBug report from luckboy: rm -f on a broken symlink didn't work because our "does...
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. :)

10 years agoCreate a generated/build.sh with a single compiler command line to rebuild the toybox...
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.)

10 years agoOops, unbreak make.sh.
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.)