Rob Landley [Mon, 24 Mar 2014 11:26:49 +0000 (06:26 -0500)]
Fix mkdir -p with absolute paths.
Stripping leading / is not the right thing to do there.
Broken when the code moved to lib and was genericized for use elsewhere.
Ashwini Sharma [Wed, 19 Mar 2014 18:57:06 +0000 (13:57 -0500)]
There are cases when the long options are of the format abc-def. In current implementation FLAG_xxx macros are generated for long options too. with __-__ sign in the macro, it will generate errors.
I am of the opinion that __-__ be converted to '_' for generating the FLAG_xxx macros and be used in the command.
This will enable the user to 'abc-def', but be handled like 'abc_def' in code.
Rob Landley [Sun, 16 Mar 2014 21:27:38 +0000 (16:27 -0500)]
Clarify an unclear comment pointed out by Steve Long.
Rob Landley [Sat, 15 Mar 2014 20:41:09 +0000 (15:41 -0500)]
Next round of cpio cleanup.
Rob Landley [Fri, 14 Mar 2014 00:55:59 +0000 (19:55 -0500)]
Cleanup cpio: use getline() instead of fgets(), have getline() allocate its own memory (instead of using toybuf), use perror_msg() instead of lower level verror_msg() (which is really an internal function needed to implement perror_msg()), don't set execute bits on created archive.
Rob Landley [Fri, 14 Mar 2014 00:42:42 +0000 (19:42 -0500)]
Cleanup cpio: fiddle with help text, make option parsing require/exclude -iot combinations, move loopfiles_stdin() down after write_cpio_member() so we can hardwire it instead of using a function pointer that only ever has one value.
Rob Landley [Wed, 12 Mar 2014 02:10:45 +0000 (21:10 -0500)]
Patch from Isaac Dunham to add cpio -d, with a few tweaks by me.
Rob Landley [Wed, 12 Mar 2014 01:44:55 +0000 (20:44 -0500)]
Move mkpathat to lib, remove redundant function used by patch.
Rob Landley [Tue, 11 Mar 2014 23:11:12 +0000 (18:11 -0500)]
Add "volatile" annotation to peek/poke to stop potential optimizer overreach.
Rob Landley [Tue, 11 Mar 2014 22:50:17 +0000 (17:50 -0500)]
Factor out mkpathat.
Rob Landley [Sun, 9 Mar 2014 19:42:28 +0000 (14:42 -0500)]
Promote freeramdisk from pending to other, default y.
Rob Landley [Sun, 9 Mar 2014 19:38:51 +0000 (14:38 -0500)]
Cleanup freeramdisk: tabs to 2 spaces, square brackets for option name, do optional cleanup under if (CFG_TOYBOX_FREE) guard.
Vivek Bhagat [Sun, 9 Mar 2014 19:27:11 +0000 (14:27 -0500)]
Please find the patches attached herewith for adding 3 new commands -
1. freeramdisk - If we unmount or detach the RAM disk based file system the Linux Kernel
will not free the allocated memory associated with the RAM device. This can be useful if
one wants to mount this device again: All data will be preserved.
If we need to free the memory back to the Kernel, one can use the command: "toybox freeramdisk <RAM device>".
2. openvt - Successfully opens a new virtual terminal as mentioned with -c option
otherwise search and open next available VT.
with -s option it switches to new VT
with -s -w option, it switch back successfully to originating VT.
3. deallocvt - Deallocate specified virtual teminal.
if no virtual terminal is specified, it deallocates all unused VT.
Rob Landley [Sun, 9 Mar 2014 01:26:33 +0000 (19:26 -0600)]
Broken URL that's been pointed out to me a couple times when I'm not at a machine I can fix it from, keep forgetting...
Rob Landley [Sat, 1 Mar 2014 05:10:03 +0000 (23:10 -0600)]
Fix another bug reported by Ashwini Sharma.
Rob Landley [Sat, 1 Mar 2014 05:04:57 +0000 (23:04 -0600)]
Fix two bugs reported by Ashwini Sharma.
Rob Landley [Sat, 1 Mar 2014 02:46:16 +0000 (20:46 -0600)]
Fix header file generation to not be confused by empty (but non-NULL) option string.
You shouldn't use "" as an option string because a NULL allows toy_init()
to avoid calling the option parsing logic entirely, which lets it drop out
when nothing's using it (ala scripts/single.sh builds). That said, init.c
is currently using a "" option string and a USE_ macro taking advantage
of string concatenation may require a "" option config, so...
Rob Landley [Tue, 25 Feb 2014 05:34:43 +0000 (23:34 -0600)]
Put all FOR_xxx blocks after all CLEANUP_xxx in generated/flags.h so the usages don't have to be in alphabetical order.
Rob Landley [Mon, 24 Feb 2014 02:11:06 +0000 (20:11 -0600)]
CLEANUP transitions require all the generated/flags.h stanzas always be present (even for commands disabled in the config) to avoid undefined symbol errors referencing FLAG_ macros.
Rob Landley [Sat, 22 Feb 2014 14:02:09 +0000 (08:02 -0600)]
Add -H option to cksum (hex output), fix to use FLAG macros.
Rob Landley [Sat, 22 Feb 2014 14:01:11 +0000 (08:01 -0600)]
Add crc code: zcat now works.
Rob Landley [Sat, 22 Feb 2014 04:24:02 +0000 (22:24 -0600)]
Update status page.
Rob Landley [Sat, 22 Feb 2014 04:21:59 +0000 (22:21 -0600)]
Update inflate code: fixed tables, bugfixes, zcat alias.
Rob Landley [Sun, 16 Feb 2014 23:31:33 +0000 (17:31 -0600)]
Make CLEANUP transitions work, so multiple NEWTOY() can exist in the same file.
Don't #undefine TT in the CLEANUP blocks of generated/flags.h, and #ifdef
around the other TT definition. That way you can put a union at the start
of your GLOBALS() with the arguments filled out by option parsing, and then
have multiple main() functions with different argumetns and different
FLAG_x macros, while sharing infrastructure that's not under lib.
Rob Landley [Sun, 16 Feb 2014 17:09:23 +0000 (11:09 -0600)]
Various cleanups found by Tom Sparrow's static analysis.
Rob Landley [Thu, 13 Feb 2014 12:45:35 +0000 (06:45 -0600)]
Ok, _maybe_ I'm rewriting deflate from scratch rather than cleaning up the existing one, but you can't prove it. I plead the fifth, third, twelvefth, twentieth, twenty-first, twenth-fith, and twenty-seventh.
Rob Landley [Mon, 10 Feb 2014 14:30:05 +0000 (08:30 -0600)]
Not buying it, eh?
Rob Landley [Sat, 8 Feb 2014 19:37:57 +0000 (13:37 -0600)]
Nothing to see here, move along.
Rob Landley [Sat, 8 Feb 2014 16:53:26 +0000 (10:53 -0600)]
Fix segfault with single build of a command with bare longopts.
Rob Landley [Fri, 7 Feb 2014 13:56:46 +0000 (07:56 -0600)]
Move bunzip2 logic from lib into bzcat.
Rob Landley [Tue, 4 Feb 2014 12:20:14 +0000 (06:20 -0600)]
Tweak help text.
Rob Landley [Tue, 4 Feb 2014 12:16:44 +0000 (06:16 -0600)]
More cleanup.html documentation, still way behind...
Rob Landley [Tue, 4 Feb 2014 12:14:30 +0000 (06:14 -0600)]
Use right config for single builds.
Rob Landley [Tue, 4 Feb 2014 12:13:13 +0000 (06:13 -0600)]
Add /prefix netmask support to ifconfig, ala "ifconfig eth0 192.168.1.42/28"
Rob Landley [Sun, 2 Feb 2014 21:02:15 +0000 (15:02 -0600)]
gzip: alphebetize help entries and remove trailing literal \n, check for command line option groups, move len/dist tables to GLOBALS and calculate instead of including literal tables, collate enum and typedef, convert main to toybox option parsing.
Rob Landley [Sat, 1 Feb 2014 21:03:49 +0000 (15:03 -0600)]
More gzip whitespace tweaks, and the occasional curly bracket. No actual code changes.
Rob Landley [Fri, 31 Jan 2014 12:22:32 +0000 (06:22 -0600)]
Convert leading tabs to spaces for gzip.
Rob Landley [Fri, 31 Jan 2014 12:01:30 +0000 (06:01 -0600)]
Add Szabolcs Nagy's deflate/inflate code from git://git.suckless.org/flate
Confirmed with him on IRC it's ok to use under toybox license, glued the files
together and hammered square peg into round hole, no other changes yet.
Rob Landley [Thu, 30 Jan 2014 05:47:53 +0000 (23:47 -0600)]
More elaborate help text collating logic.
Isaac Dunham [Tue, 28 Jan 2014 23:46:14 +0000 (17:46 -0600)]
init: don't use VT_OPENQRY.
The original codepath checks if there is a VT available,
and if there isn't sets TERM to vt102 (unless TERM is set to something
other than "linux").
Otherwise, TERM is set to "linux" if it is not already set.
However, we can rely on getty/... to set TERM if "linux" is not suitable.
This has the benefit of dropping a slightly messy section.
Isaac Dunham [Tue, 28 Jan 2014 16:10:25 +0000 (10:10 -0600)]
Two changes to shut up GCC:
* __GLIBC__ was checked unconditionally;
this made for a very messy build on musl.
* int fd in chvt is always initialized; GCC 3.4 does not recognize this.
Isaac Dunham [Thu, 23 Jan 2014 05:29:50 +0000 (23:29 -0600)]
-Eradicate (char*) casts for strings.
-Don't panic on failure to write messages.
-Don't panic on failure to fork; sleep an extra second instead.
-s/defualt/default/g
-Inline a couple functions called once.
(Don't inline inittab_parsing because it is too large).
Rob Landley [Mon, 20 Jan 2014 23:26:50 +0000 (17:26 -0600)]
Collate usage: lines in help text.
Rob Landley [Thu, 16 Jan 2014 15:26:50 +0000 (09:26 -0600)]
Rename xmsprintf() to just xmprintf().
Partly because there's no supplied target string ala sprintf, and partly
because I can never remember what order the m and s go in.
Rob Landley [Wed, 15 Jan 2014 15:38:31 +0000 (09:38 -0600)]
Help text, collate usage blocks (badly).
Rob Landley [Sun, 5 Jan 2014 20:43:27 +0000 (14:43 -0600)]
Whitespace changes, and collate a couple declarations/first assignment.
Rob Landley [Sat, 4 Jan 2014 19:09:42 +0000 (13:09 -0600)]
Change header and pages so each page has its own title.
Rob Landley [Sat, 4 Jan 2014 00:23:09 +0000 (18:23 -0600)]
Replace python help converter with C implementation.
Rob Landley [Wed, 1 Jan 2014 21:00:44 +0000 (15:00 -0600)]
More work on the cleanup page, partway through describing ifconfig.
Rob Landley [Wed, 1 Jan 2014 20:55:53 +0000 (14:55 -0600)]
Add new paragraphs on trading off different _kinds_ of simplicity (easy for machine to run vs easy for humans to follow), and why comments aren't a substitute for good code.
Rob Landley [Wed, 1 Jan 2014 19:24:03 +0000 (13:24 -0600)]
The README trailed off into unfinished confusion at the end, fix up the obvious parts.
Rob Landley [Tue, 31 Dec 2013 15:01:32 +0000 (09:01 -0600)]
A few more commands in request section of roadmap.
Rob Landley [Tue, 31 Dec 2013 15:01:01 +0000 (09:01 -0600)]
Link to a couple more things from nav bar.
Rob Landley [Sun, 29 Dec 2013 17:07:23 +0000 (11:07 -0600)]
Add -zZ support to grep (NUL delimited input/output).
Rob Landley [Sat, 28 Dec 2013 23:06:55 +0000 (17:06 -0600)]
Cosmetic tweak.
Rob Landley [Sat, 28 Dec 2013 03:14:57 +0000 (21:14 -0600)]
Cleanup vmstat. Procs, memory, and cpu are reading right, the others not so much.
Rob Landley [Sat, 28 Dec 2013 00:45:01 +0000 (18:45 -0600)]
Pass through all the readfile() arguments from xreadfile().
Isaac Dunham [Fri, 27 Dec 2013 14:36:03 +0000 (08:36 -0600)]
Noticed a few differences from standard help messages, plus a small
problem with the port number handling: when no port was specified, it failed.
The solution ended up dropping a couple lines.
Ashwini Sharma [Fri, 27 Dec 2013 14:30:32 +0000 (08:30 -0600)]
Attached is an implementation for ftpget/put commands.
Rob Landley [Fri, 27 Dec 2013 12:53:15 +0000 (06:53 -0600)]
New section on #including header files.
Ashwini Sharma [Thu, 26 Dec 2013 15:37:03 +0000 (09:37 -0600)]
An implementation for brctl (ethernet bridge control).
Ashwini Sharma [Thu, 26 Dec 2013 15:34:58 +0000 (09:34 -0600)]
arping command is implemented.
Isaac Dunham [Tue, 24 Dec 2013 02:58:24 +0000 (20:58 -0600)]
The recent switch from get_int_value to to atolx_range left route
broken. So here's a patch to switch it to atolx_range as well.
Rob Landley [Mon, 23 Dec 2013 15:36:14 +0000 (09:36 -0600)]
Two more commands (last and more) submitted by Ashwini Sharma.
Rob Landley [Mon, 23 Dec 2013 15:33:48 +0000 (09:33 -0600)]
telnet and telnetd from Ashwini Sharma's guys.
Rob Landley [Mon, 23 Dec 2013 13:37:36 +0000 (07:37 -0600)]
Clean up half-finished blkid.test.
Ashwini Sharma [Mon, 23 Dec 2013 13:26:22 +0000 (07:26 -0600)]
Updating the email id in Copyright.
Ashwini Sharma [Mon, 23 Dec 2013 13:23:28 +0000 (07:23 -0600)]
Attached is an implementation for groupdel.
This is aliased to delgroup, for a requirement at my end.
Also lib/password.c is modified to along with.
Rob Landley [Mon, 23 Dec 2013 13:19:07 +0000 (07:19 -0600)]
Pending commands default n.
Ashwini Sharma [Mon, 23 Dec 2013 13:15:13 +0000 (07:15 -0600)]
IPv6 support is added into traceroute command.
traceroute6 is made as an old toy of traceroute.
Rob Landley [Mon, 23 Dec 2013 12:49:38 +0000 (06:49 -0600)]
Fix some issues raised (albeit indirectly) by Isaac Dunham.
POLL_IN defined as a constant by some libc.
Factor out login.c's change_identity() to xwrap.c as xsetuser().
Replace xsetuid() with xsetuser()
Put a space between argument globals and non-argument globals.
TT starts zeroed, don't need to re-zero entries in it.
STDIN_FILENO has been 0 since 1969, even DOS copied that. Just say 0.
Added an xchroot() using xchdir() to lib/xwrap.c.
Remove endgrent() call until somebody can explain why it was there.
Rob Landley [Mon, 23 Dec 2013 02:15:54 +0000 (20:15 -0600)]
Ashwini sharma pointed out that show_help() doesn't exit so "ifconfig eth0 netmask" would segfault. Replace it with an error_exit(), see list for aesthetic issue this raises re: help text.
Rob Landley [Mon, 23 Dec 2013 01:39:12 +0000 (19:39 -0600)]
Add -s option, allow zero optargs for -l. (Suggested by Ashwini Sharma.)
Rob Landley [Sun, 22 Dec 2013 21:48:44 +0000 (15:48 -0600)]
Promote su from pending to lsb.
Rob Landley [Sun, 22 Dec 2013 21:47:48 +0000 (15:47 -0600)]
Cleanup su.
Rob Landley [Fri, 20 Dec 2013 04:20:08 +0000 (22:20 -0600)]
killall: fix return code, improve error reporting, avoid buffer overflow.
Rob Landley [Fri, 20 Dec 2013 03:38:12 +0000 (21:38 -0600)]
Don't permute toys.optargs, cleanup code (xexec()) can free it.
Rob Landley [Thu, 19 Dec 2013 21:14:33 +0000 (15:14 -0600)]
Older python spit --version to stdout, 2.7 does it to stderr. Of course.
Rob Landley [Thu, 19 Dec 2013 21:11:45 +0000 (15:11 -0600)]
Only define MNT_DETACH for old glibc, portability.h included _before_ sys/mount.h...
Rob Landley [Thu, 19 Dec 2013 21:07:28 +0000 (15:07 -0600)]
toynet.h went away, missed a file...
Rob Landley [Thu, 19 Dec 2013 21:02:18 +0000 (15:02 -0600)]
Regression test against Ancient Build Environment (Ubuntu 8.04), fixup bit-rot.
Rob Landley [Thu, 19 Dec 2013 15:32:30 +0000 (09:32 -0600)]
Move names_to_pid from pending to lib.
Rob Landley [Wed, 18 Dec 2013 16:25:02 +0000 (10:25 -0600)]
ln -v support from Ashwini Sharma (comment tweak from me)
Rob Landley [Wed, 18 Dec 2013 16:20:16 +0000 (10:20 -0600)]
Ashwini Sharma added -v, I tweaked it a bit and added a couple test suite entries.
Rob Landley [Mon, 16 Dec 2013 23:41:25 +0000 (17:41 -0600)]
Fix pidof -o bug aborting output, reported by Ashwini Sharma.
Rob Landley [Sun, 8 Dec 2013 19:26:05 +0000 (13:26 -0600)]
Doing math on void pointers isn't portable, reported by Nathan McSween.
Rob Landley [Sun, 8 Dec 2013 19:21:14 +0000 (13:21 -0600)]
Forgot to set new pending entry to default n.
Rob Landley [Sun, 8 Dec 2013 19:19:01 +0000 (13:19 -0600)]
Can't test <0 on an unsigned, reported by Nathan McSween.
Rob Landley [Sat, 7 Dec 2013 22:19:17 +0000 (16:19 -0600)]
Ashwini Sharma submitted tcpsvd/udpsvd.
Rob Landley [Thu, 5 Dec 2013 04:58:42 +0000 (22:58 -0600)]
When building for 32-bit, the compiler can't figure out that a constant too big to fit in a long isn't trying to unless you explicitly postfix the constant with the type of the varable it's being assigned into.
Rob Landley [Tue, 3 Dec 2013 21:11:52 +0000 (15:11 -0600)]
Redo od whitespace with multiple output types so the columns align.
Factor out single output type into od_out_t(), call it in a loop for each type
finding largest output (and if output consumes more than one byte of input
average rounding up), pad each output to the largest output times number of
bytes input consumed.
Rob Landley [Sun, 1 Dec 2013 20:34:05 +0000 (14:34 -0600)]
Minor drive-by cleanups to cpio. Whitespace, curly brackets, replace %4 with &3, turn a switch/case into if/else.
Rob Landley [Sat, 30 Nov 2013 06:57:26 +0000 (00:57 -0600)]
Fix cut.
Some commands went in before "pending", and thus need cleanup but are enabled
in defconfig. The fact cut used a function out of lib/pending.c is a hint
it might be in this category...
Rob Landley [Sat, 30 Nov 2013 06:16:28 +0000 (00:16 -0600)]
Cleanup help text, remove dead fields unused by linux kernel.
Rob Landley [Fri, 29 Nov 2013 04:13:04 +0000 (22:13 -0600)]
Promote ifconfig from pending to other.
Rob Landley [Fri, 29 Nov 2013 03:11:34 +0000 (21:11 -0600)]
Oops, cleaned up ifconfig uses atolx_range() instead of get_int_list(). Check that in.
Rob Landley [Fri, 29 Nov 2013 03:06:15 +0000 (21:06 -0600)]
Add xgetpwnam() to lib/xwrap.c.
Rob Landley [Fri, 29 Nov 2013 02:18:04 +0000 (20:18 -0600)]
Move xgetpwuid() and xgetgrgid() into xwrap.c
Rob Landley [Wed, 27 Nov 2013 01:35:22 +0000 (19:35 -0600)]
Ifconfig cleanup.
Rob Landley [Sun, 24 Nov 2013 02:02:10 +0000 (20:02 -0600)]
The return of ifconfig cleanup.